HiPipe
0.7.0
C++17 data pipeline with Python bindings.
|
Classes | |
class | hipipe::csv_istream_range |
Parse and iterate over CSV formatted rows from an istream. More... | |
Functions | |
dataframe | hipipe::read_csv (std::istream &in, int drop=0, bool has_header=true, char separator=',', char quote='"', char escape = '\\') |
Parse csv file from an std::istream. More... | |
dataframe | hipipe::read_csv (const std::experimental::filesystem::path &file, int drop=0, bool header=true, char separator=',', char quote='"', char escape = '\\') |
Same as read_csv() but read directly from a file. More... | |
std::ostream & | hipipe::write_csv_row (std::ostream &out, const std::vector< std::string > &row, char separator=',', char quote='"', char escape = '\\') |
Write a single csv row to an std::ostream. More... | |
std::ostream & | hipipe::write_csv (std::ostream &out, const dataframe &df, char separator=',', char quote='"', char escape = '\\') |
Write a dataframe to an std::ostream. More... | |
void | hipipe::write_csv (const std::experimental::filesystem::path &file, const dataframe &df, char separator=',', char quote='"', char escape = '\\') |
Same as write_csv(std::ostream...), but write directly to a file. More... | |
dataframe hipipe::read_csv | ( | const std::experimental::filesystem::path & | file, |
int | drop = 0 , |
||
bool | header = true , |
||
char | separator = ',' , |
||
char | quote = '"' , |
||
char | escape = '\\' |
||
) |
Same as read_csv() but read directly from a file.
std::ios_base::failure | If the specified file cannot be opened. |
dataframe hipipe::read_csv | ( | std::istream & | in, |
int | drop = 0 , |
||
bool | has_header = true , |
||
char | separator = ',' , |
||
char | quote = '"' , |
||
char | escape = '\\' |
||
) |
Parse csv file from an std::istream.
Parsing has the same rules as for csv_istream_range.
in | The input stream. |
drop | How many lines should be ignored at the very beginning of the stream. |
has_header | Whether a header row should be parsed (after drop). |
separator | Field separator. |
quote | Quote character. |
escape | Character used to escape a quote inside quotes. |
void hipipe::write_csv | ( | const std::experimental::filesystem::path & | file, |
const dataframe & | df, | ||
char | separator = ',' , |
||
char | quote = '"' , |
||
char | escape = '\\' |
||
) |
Same as write_csv(std::ostream...), but write directly to a file.
std::ios_base::failure | If the specified file cannot be opened. |
std::ostream& hipipe::write_csv | ( | std::ostream & | out, |
const dataframe & | df, | ||
char | separator = ',' , |
||
char | quote = '"' , |
||
char | escape = '\\' |
||
) |
Write a dataframe to an std::ostream.
Fields containing a quote, a newline, or a separator are quoted automatically.
std::ios_base::failure | if badbit is triggered. |
std::ostream& hipipe::write_csv_row | ( | std::ostream & | out, |
const std::vector< std::string > & | row, | ||
char | separator = ',' , |
||
char | quote = '"' , |
||
char | escape = '\\' |
||
) |
Write a single csv row to an std::ostream.
Fields containing a quote, a newline, or a separator are quoted automatically.
std::ios_base::failure | if badbit is triggered. |