Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::CSVWriter Class Reference

CSV stream writer. More...

#include <CSVWriter.h>

Public Types

using OutputStream = io::OutputStream
 Output stream supported by the utility.
 
using Row = std::vector<std::string>
 

Public Member Functions

 CSVWriter (OutputStream *dest, char split_char=',', bool crlf=true) noexcept
 
void write (const Row &row) noexcept
 

Static Public Attributes

static const char * crlf = "\r\n"
 
static const char * lf = "\n"
 

Protected Attributes

char splitChar
 
bool isCRLF
 
OutputStreamdest = nullptr
 

Detailed Description

CSV stream writer.

Member Typedef Documentation

◆ OutputStream

Output stream supported by the utility.

◆ Row

using sese::CSVWriter::Row = std::vector<std::string>

Constructor & Destructor Documentation

◆ CSVWriter()

sese::CSVWriter::CSVWriter ( OutputStream * dest,
char split_char = ',',
bool crlf = true )
explicitnoexcept

Constructor

Parameters
destThe destination stream
split_charThe delimiter character
crlfWhether to use CRLF as the line separator

Member Function Documentation

◆ write()

void sese::CSVWriter::write ( const Row & row)
noexcept

Write to the stream

Parameters
rowThe row to be written

Member Data Documentation

◆ crlf

const char * sese::CSVWriter::crlf = "\r\n"
static

◆ dest

OutputStream* sese::CSVWriter::dest = nullptr
protected

◆ isCRLF

bool sese::CSVWriter::isCRLF
protected

◆ lf

const char * sese::CSVWriter::lf = "\n"
static

◆ splitChar

char sese::CSVWriter::splitChar
protected

The documentation for this class was generated from the following files: