Stride Reference Manual  - generated for commit 9643b11
stride::util::CSVRow Class Reference

Row in CSV file. More...

#include <CSVRow.h>

Collaboration diagram for stride::util::CSVRow:
Collaboration graph

Public Member Functions

 CSVRow (const CSV *parent, const std::vector< std::string > &values)
 CSVRow initialized with values. Should no be called by user code. CSV has convenience functions. More...
 
 CSVRow (const CSVRow &)=default
 
CSVRowoperator= (const CSVRow &)=default
 
template<typename T = std::string>
GetValue (size_t index) const
 Get value at index. When T is specified, StringUtils are used to try to convert the value to type T. More...
 
template<typename T = std::string>
GetValue (const std::string &label) const
 Get value based on label. Note this is slower than using the index. More...
 
bool operator== (const CSVRow &other) const
 Compare operator. More...
 
template<>
std::string GetValue (size_t index) const
 Declaration of specialization. More...
 
template<>
std::string GetValue (const std::string &label) const
 Declaration of specialization. More...
 

Protected Attributes

const CSVm_parent
 
std::vector< std::string > m_values
 

Friends

std::ostream & operator<< (std::ostream &os, const CSVRow &row)
 Print to stream. More...
 

Detailed Description

Row in CSV file.

Definition at line 36 of file CSVRow.h.

Constructor & Destructor Documentation

stride::util::CSVRow::CSVRow ( const CSV parent,
const std::vector< std::string > &  values 
)

CSVRow initialized with values. Should no be called by user code. CSV has convenience functions.

Definition at line 41 of file CSVRow.cpp.

References stride::util::CSV::GetColumnCount(), m_values, stride::util::ToString(), and stride::util::Trim().

Here is the call graph for this function:

stride::util::CSVRow::CSVRow ( const CSVRow )
default

Member Function Documentation

CSVRow& stride::util::CSVRow::operator= ( const CSVRow )
default
template<typename T >
T stride::util::CSVRow::GetValue ( size_t  index) const
inline

Get value at index. When T is specified, StringUtils are used to try to convert the value to type T.

Definition at line 105 of file CSVRow.h.

References stride::util::safe_cast().

Referenced by stride::util::CSVRow::GetValue< std::string >().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
T stride::util::CSVRow::GetValue ( const std::string &  label) const
inline

Get value based on label. Note this is slower than using the index.

Definition at line 112 of file CSVRow.h.

References stride::util::safe_cast().

Here is the call graph for this function:

bool stride::util::CSVRow::operator== ( const CSVRow other) const

Compare operator.

Definition at line 70 of file CSVRow.cpp.

References m_values.

template<>
std::string stride::util::CSVRow::GetValue ( size_t  index) const

Declaration of specialization.

template<>
std::string stride::util::CSVRow::GetValue ( const std::string &  label) const

Declaration of specialization.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CSVRow row 
)
friend

Print to stream.

Definition at line 72 of file CSVRow.cpp.

Member Data Documentation

const CSV* stride::util::CSVRow::m_parent
protected

Definition at line 61 of file CSVRow.h.

Referenced by stride::util::CSVRow::GetValue< std::string >().

std::vector<std::string> stride::util::CSVRow::m_values
protected

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