14using Tsv = vector<string>;
16using TsvParser = function<bool(
const Tsv& row,
string* key,
string* value)>;
19 function<bool(
const string& key,
const string& value,
Tsv* row)>;
51template <
class SinkType>
56template <
class SinkType>
61template <
class SourceType>
63 return writer(&source);
66template <
class SourceType>
68 return writer(&source);
vector< string > Tsv
Definition tsv.h:14
std::ostream & operator<<(std::ostream &stream, const Reference &reference)
Definition config_compiler.cc:12
function< bool(const string &key, const string &value, Tsv *row)> TsvFormatter
Definition tsv.h:18
int operator>>(TsvReader &reader, SinkType &sink)
Definition tsv.h:57
function< bool(const Tsv &row, string *key, string *value)> TsvParser
Definition tsv.h:16
TsvParser parser_
Definition tsv.h:33
TsvReader(const path &file_path, TsvParser parser)
Definition tsv.h:26
path file_path_
Definition tsv.h:32
int operator()(Sink *sink)
Definition tsv.cc:15
TsvWriter(const path &file_path, TsvFormatter formatter)
Definition tsv.h:38
path file_path_
Definition tsv.h:44
TsvFormatter formatter_
Definition tsv.h:45
string file_description
Definition tsv.h:48
int operator()(Source *source)
Definition tsv.cc:59