Make FileDataView private.

GitOrigin-RevId: e3e53f5b97152aab99573d84296ef7094981d544
This commit is contained in:
levlam 2020-01-03 04:16:05 +03:00
parent c8bf8fa5f7
commit 45bb48bfa7
2 changed files with 13 additions and 13 deletions

View File

@ -10,6 +10,7 @@
#include "td/utils/format.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
#include "td/utils/port/FileFd.h"
#include "td/utils/Random.h"
#include "td/utils/SharedSlice.h"
@ -88,6 +89,18 @@ BufferSlice gen_random_prefix(int64 data_size) {
return buff;
}
class FileDataView : public DataView {
public:
FileDataView(FileFd &fd, int64 size);
int64 size() const override;
Result<BufferSlice> pread(int64 offset, int64 size) const override;
private:
FileFd &fd_;
int64 size_;
};
FileDataView::FileDataView(FileFd &fd, int64 size) : fd_(fd), size_(size) {
}

View File

@ -9,7 +9,6 @@
#include "td/utils/buffer.h"
#include "td/utils/common.h"
#include "td/utils/crypto.h"
#include "td/utils/port/FileFd.h"
#include "td/utils/Slice.h"
#include "td/utils/Status.h"
#include "td/utils/UInt.h"
@ -75,18 +74,6 @@ class DataView {
virtual ~DataView() = default;
};
class FileDataView : public DataView {
public:
FileDataView(FileFd &fd, int64 size);
int64 size() const override;
Result<BufferSlice> pread(int64 offset, int64 size) const override;
private:
FileFd &fd_;
int64 size_;
};
class BufferSliceDataView : public DataView {
public:
explicit BufferSliceDataView(BufferSlice buffer_slice);