17 #ifndef ARCHIVE_POSIXFILEARCHIVE_H_
18 #define ARCHIVE_POSIXFILEARCHIVE_H_
34 if (!this->plain_text) {
35 this->plain_text = boost::filesystem::extension(
url_part(5)) ==
".csv" ||
36 boost::filesystem::extension(
url_part(5)) ==
".tsv" ||
37 boost::filesystem::extension(
url_part(5)) ==
".txt" ||
38 boost::filesystem::extension(
url_part(5)) ==
"";
41 if (this->plain_text) {
60 if (
nullptr == (
fp =
fopen(file_path.c_str(),
"r"))) {
61 throw std::runtime_error(std::string(
"fopen(") + file_path +
62 "): " + strerror(errno));
65 if (ARCHIVE_OK != archive_read_open_filename(
ar, file_path.c_str(), 1 << 16)) {
66 throw std::runtime_error(std::string(
"fopen(") + file_path +
67 "): " + strerror(errno));
virtual bool read_data_block(const void **buff, size_t *size, int64_t *offset)
~PosixFileArchive() override
PosixFileArchive(const std::string url, const bool plain_text)
bool read_next_header() override
::FILE * fopen(const char *filename, const char *mode)
bool read_data_block(const void **buff, size_t *size, int64_t *offset) override
size_t g_archive_read_buf_size
virtual int64_t get_position_compressed() const
const std::string url_part(const int i)
void init_for_read() override
virtual bool read_next_header()