Vince's CSV Parser
|
Class for writing delimiter separated values files. More...
#include <csv_writer.hpp>
Public Member Functions | |
DelimWriter (OutputStream &_out, bool _quote_minimal=true) | |
Construct a DelimWriter over the specified output stream. More... | |
DelimWriter (const std::string &filename) | |
Construct a DelimWriter over the file. More... | |
~DelimWriter () | |
Destructor will flush remaining data. | |
template<typename T , size_t Size> | |
DelimWriter & | operator<< (const std::array< T, Size > &record) |
Format a sequence of strings and write to CSV according to RFC 4180. More... | |
template<typename... T> | |
DelimWriter & | operator<< (const std::tuple< T... > &record) |
Format a sequence of strings and write to CSV according to RFC 4180. More... | |
template<typename T , typename Alloc , template< typename, typename > class Container, csv::enable_if_t< std::is_class< Alloc >::value, int > = 0> | |
DelimWriter & | operator<< (const Container< T, Alloc > &record) |
Format a sequence of strings and write to CSV according to RFC 4180. More... | |
void | flush () |
Flushes the written data. | |
Class for writing delimiter separated values files.
To write formatted strings, one should
OutputStream | The output stream, e.g. std::ofstream , std::stringstream |
Delim | The delimiter character |
Quote | The quote character |
Flush | True: flush after every writing function, false: you need to flush explicitly if needed. In both cases the destructor will flush. |
Definition at line 193 of file csv_writer.hpp.
|
inline |
Construct a DelimWriter over the specified output stream.
_out | Stream to write to |
_quote_minimal | Limit field quoting to only when necessary |
Definition at line 201 of file csv_writer.hpp.
|
inline |
Construct a DelimWriter over the file.
[out] | filename | File to write to |
Definition at line 208 of file csv_writer.hpp.
|
inline |
Format a sequence of strings and write to CSV according to RFC 4180.
T | A container such as std::vector, std::deque, or std::list |
[in] | record | Sequence of strings to be formatted |
Definition at line 254 of file csv_writer.hpp.
|
inline |
Format a sequence of strings and write to CSV according to RFC 4180.
[in] | record | Sequence of strings to be formatted |
Definition at line 226 of file csv_writer.hpp.
|
inline |
Format a sequence of strings and write to CSV according to RFC 4180.
[in] | record | Sequence of strings to be formatted |
Definition at line 238 of file csv_writer.hpp.