MVault 1.0.0
Simple c++ database
Loading...
Searching...
No Matches
Public Member Functions | List of all members
mvlt::CsvParser Class Reference

A class for parsing csv files that provides data in a form similar to generators. More...

#include <CsvParser.h>

Public Member Functions

 CsvParser () noexcept
 Default constructor.
 
 CsvParser (const CsvParser &other) noexcept=delete
 Deleted copy constructor.
 
 CsvParser (CsvParser &&other) noexcept=delete
 Deleted move constructor.
 
CsvParseroperator= (const CsvParser &other) noexcept=delete
 Deleted assignment operator.
 
CsvParseroperator= (CsvParser &&other) noexcept=delete
 Deleted move assignment operator.
 
bool OpenFile (const std::string &fileName) noexcept
 The method for opening the file.
 
bool GetNextVector (std::vector< std::string > &vectorWithNext, const char &separator) noexcept
 The method for getting the next record in the file. It works by analogy with generators in Python.
 
 ~CsvParser () noexcept=default
 Default destructor.
 

Detailed Description

A class for parsing csv files that provides data in a form similar to generators.

Constructor & Destructor Documentation

◆ CsvParser() [1/3]

mvlt::CsvParser::CsvParser ( )
noexcept

Default constructor.

Todo:
Wait new lcc version to make it default

◆ CsvParser() [2/3]

mvlt::CsvParser::CsvParser ( const CsvParser other)
deletenoexcept

Deleted copy constructor.

Parameters
[in]otherobject to copy

◆ CsvParser() [3/3]

mvlt::CsvParser::CsvParser ( CsvParser &&  other)
deletenoexcept

Deleted move constructor.

Parameters
[in]otherobject to move

Member Function Documentation

◆ GetNextVector()

bool mvlt::CsvParser::GetNextVector ( std::vector< std::string > &  vectorWithNext,
const char separator 
)
noexcept

The method for getting the next record in the file. It works by analogy with generators in Python.

Parameters
[out]vectorWithNextvector with all fields in the record
[in]separatorthe symbol used to separate the records in the file
Returns
it will return the true if it was possible to open the file otherwise it will return a false

◆ OpenFile()

bool mvlt::CsvParser::OpenFile ( const std::string &  fileName)
noexcept

The method for opening the file.

Parameters
[in]fileNameThe name of the file to open
Returns
it will return the true if it was possible to open the file otherwise it will return a false

◆ operator=() [1/2]

CsvParser & mvlt::CsvParser::operator= ( const CsvParser other)
deletenoexcept

Deleted assignment operator.

Parameters
[in]otherobject to copy
Returns
returns a new object, with data from other

◆ operator=() [2/2]

CsvParser & mvlt::CsvParser::operator= ( CsvParser &&  other)
deletenoexcept

Deleted move assignment operator.

Parameters
[in]otherobject to move
Returns
returns a new object, with data from other

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