9 static const char rcsid[] __attribute__((used)) =
"$Id: GZCSVPathWriter.cpp 1653 2016-02-28 19:54:59Z sella $";
11 #include "GZCSVPathWriter.h"
12 #include "GZCSVFileWriter.h"
17 using namespace sella::file;
36 sequence(::time(NULL) << 16)
39 DIR * directory = ::opendir(this->path.c_str());
41 if (directory == NULL) {
42 THROW(IOException,
"failed to open directory '%s' for writing", this->path.c_str());
44 ::closedir(directory);
47 while (*(this->path.rbegin()) ==
'/') {
48 this->path.erase(this->path.length() - 1, 1);
67 for (
auto iter = data.begin(); iter != data.end(); ++iter) {
70 writer.close(file[1]);
void write(const std::vector< std::vector< std::string >> &data) THROWS(IOException)
A GZIP compressed CSV writer.
GZCSVPathWriter(const std::string &path, char delimiter=DefaultDelimiter, char seperator=DefaultSeperator) THROWS(IOException)
static const char * FileSuffix
The file suffix for matching files in the directory for reading.