5 #ifndef CVMFS_UTIL_FILE_BACKED_BUFFER_H_
6 #define CVMFS_UTIL_FILE_BACKED_BUFFER_H_
12 #include "gtest/gtest_prod.h"
38 FRIEND_TEST(T_FileBackedBuffer, SimpleWriteAndRead);
39 FRIEND_TEST(T_FileBackedBuffer, EmptyBuffer);
40 FRIEND_TEST(T_FileBackedBuffer, EmptyWrite);
41 FRIEND_TEST(T_FileBackedBuffer, StraightToFile);
42 FRIEND_TEST(T_FileBackedBuffer, OnlyInMemory);
46 const std::string &tmp_dir =
"/tmp/");
49 void Append(
const void *source, uint64_t len);
51 int64_t Data(
void** ptr, int64_t len, uint64_t pos);
52 int64_t
Read(
void* ptr, int64_t len);
53 int64_t ReadP(
void* ptr, int64_t len, uint64_t pos);
56 uint64_t GetSize()
const;
88 #endif // CVMFS_UTIL_FILE_BACKED_BUFFER_H_
static Publisher * Create(const SettingsPublisher &settings)
const uint64_t in_memory_threshold_
static void Read(void *buf, size_t nbyte)
MemoryMappedFile * mmapped_
const std::string tmp_dir_