|
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. | |
| template<typename T = OutputStream, csv::enable_if_t< std::is_same< T, std::ofstream >::value, int > = 0> | |
| DelimWriter (const std::string &filename, bool _quote_minimal=true) | |
| Construct a DelimWriter over the file. | |
| ~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. | |
| template<typename... T> | |
| DelimWriter & | operator<< (const std::tuple< T... > &record) |
| Format a sequence of strings and write to CSV according to RFC 4180. | |
| 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) |
| 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 195 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 203 of file csv_writer.hpp.
|
inline |
Construct a DelimWriter over the file.
| [out] | filename | File to write to |
Definition at line 212 of file csv_writer.hpp.
|
inline |
Destructor will flush remaining data.
Definition at line 223 of file csv_writer.hpp.
|
inline |
Flushes the written data.
Definition at line 280 of file csv_writer.hpp.
|
inline |
| T | A container such as std::vector, std::deque, or std::list |
Format a sequence of strings and write to CSV according to RFC 4180.
| [in] | record | Sequence of strings to be formatted |
Definition at line 264 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 236 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 248 of file csv_writer.hpp.