Commit 45291557 authored by Nafi3's avatar Nafi3
Browse files

offset definition

parent bf510c59
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ private:
    bool append_flag_;

    int fd_;
    off_t pos_;
    FILE* tmp_file_;

public:
@@ -30,6 +31,10 @@ public:

    void fd(int fd_);

    off_t pos() const;

    void pos(off_t pos_);

    bool append_flag() const;

    void append_flag(bool append_flag);
+9 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ OpenFile::OpenFile(const string& path, const bool append_flag) : path_(path), ap
        exit(1);
    }
    fd_ = fileno(tmp_file_); // get a valid file descriptor from the kernel
    off_t pos_ = 0;
}

string OpenFile::path() const {
@@ -30,6 +31,14 @@ void OpenFile::fd(int fd_) {
    OpenFile::fd_ = fd_;
}

off_t OpenFile::pos() const {
    return pos_;
}

void OpenFile::pos(off_t pos_) {
    OpenFile::pos_=pos_;
}

OpenFileMap::OpenFileMap() {}

OpenFile::~OpenFile() {