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

CSV stream reader. More...

#include <CSVReader.h>

Public Types

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

Public Member Functions

 CSVReader (InputStream *source, char split_char=',') noexcept
 
Row read () noexcept
 

Protected Attributes

char splitChar
 
InputStreamsource = nullptr
 

Detailed Description

CSV stream reader.

Member Typedef Documentation

◆ InputStream

Input stream supported by the utility.

◆ Row

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

Constructor & Destructor Documentation

◆ CSVReader()

sese::CSVReader::CSVReader ( InputStream * source,
char split_char = ',' )
explicitnoexcept

Constructor

Parameters
sourceThe input stream to read from
split_charThe delimiter character

Member Function Documentation

◆ read()

sese::CSVReader::Row sese::CSVReader::read ( )
noexcept

Reads a line from the stream

Returns
A vector container containing all elements in the line

References sese::text::AbstractStringBuffer::clear(), sese::text::AbstractStringBuffer::empty(), sese::io::InputStream::read(), source, splitChar, and sese::text::AbstractStringBuffer::toString().

Member Data Documentation

◆ source

InputStream* sese::CSVReader::source = nullptr
protected

Referenced by read().

◆ splitChar

char sese::CSVReader::splitChar
protected

Referenced by read().


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