00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __sella__file__GZCSVPathReader_H__
00010 #define __sella__file__GZCSVPathReader_H__
00011
00012 #include "../util/CommonMacro.h"
00013 #include "IOException.h"
00014
00015 #include <sys/types.h>
00016 #include <stdint.h>
00017 #include <zlib.h>
00018 #include <fcntl.h>
00019 #include <dirent.h>
00020
00021 #include <string>
00022 #include <vector>
00023 #include <memory>
00024
00025 namespace sella {
00026 namespace file {
00027 class GZCSVPathReader;
00028 }
00029 }
00030
00034 class sella::file::GZCSVPathReader {
00035 public:
00036
00037 STANDARD_TYPEDEF(sella::file::GZCSVPathReader);
00038
00039 static const char * FileSuffix;
00040
00041 static const char DefaultDelimiter = 0x1e;
00042 static const char DefaultSeperator = 0x1d;
00043
00044
00045 GZCSVPathReader(const std::string & path, char delimiter = DefaultDelimiter, char seperator = DefaultSeperator) THROWS(IOException);
00046
00047
00048 void read(std::vector<std::vector<std::string>> & data) THROWS(IOException);
00049
00050 protected:
00051 static int filter(const struct dirent * file) NO_EXCEPTIONS;
00052
00053 private:
00054 std::string path;
00055
00056 char delimiter;
00057 char seperator;
00058 };
00059
00060 #endif
00061
00062
00063
00064