diff options
author | qrort <qrort@yandex-team.com> | 2022-12-02 11:31:25 +0300 |
---|---|---|
committer | qrort <qrort@yandex-team.com> | 2022-12-02 11:31:25 +0300 |
commit | b1f4ffc9c8abff3ba58dc1ec9a9f92d2f0de6806 (patch) | |
tree | 2a23209faf0fea5586a6d4b9cee60d1b318d29fe /library/cpp/deprecated/datafile/datafile.cpp | |
parent | 559174a9144de40d6bb3997ea4073c82289b4974 (diff) | |
download | ydb-b1f4ffc9c8abff3ba58dc1ec9a9f92d2f0de6806.tar.gz |
remove kikimr/driver DEPENDS
Diffstat (limited to 'library/cpp/deprecated/datafile/datafile.cpp')
-rw-r--r-- | library/cpp/deprecated/datafile/datafile.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/library/cpp/deprecated/datafile/datafile.cpp b/library/cpp/deprecated/datafile/datafile.cpp deleted file mode 100644 index ff93f11c6b7..00000000000 --- a/library/cpp/deprecated/datafile/datafile.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "datafile.h" - -void TDataFileBase::DoLoad(const char* fname, int loadMode) { - Destroy(); - TFile f(fname, RdOnly); - DoLoad(f, loadMode, nullptr, 0); -} - -void TDataFileBase::DoLoad(TFile& f, int loadMode, void* hdrPtr, size_t hdrSize) { - if (hdrPtr) { - if (loadMode & DLM_EXACT_SIZE && f.GetLength() != (i64)Length) - throw yexception() << f.GetName() << " size does not match its header value"; - } else { - Length = f.GetLength(); - hdrSize = 0; - } - if ((loadMode & DLM_LD_TYPE_MASK) == DLM_READ) { - MemData = TVector<char>(Length); - memcpy(MemData.begin(), hdrPtr, hdrSize); - f.Load(MemData.begin() + hdrSize, Length - hdrSize); - Start = MemData.begin(); - } else { - FileData.init(f); - if (FileData.getSize() < Length) - throw yexception() << f.GetName() << " is smaller than what its header value says"; - if ((loadMode & DLM_LD_TYPE_MASK) == DLM_MMAP_PRC) - FileData.precharge(); - Start = (const char*)FileData.getData(); - } -} - -void TDataFileBase::Destroy() { - TVector<char>().swap(MemData); - FileData.term(); - Start = nullptr; - Length = 0; -} - -void TDataFileBase::Precharge() const { - if (Length && Start == (char*)FileData.getData()) - FileData.precharge(); -} |