fastdo  0.5.12
winux::CsvReader类 参考

CSV文件读取器 更多...

#include <archives.hpp>

Public 成员函数

 CsvReader (IFile *inputFile, bool hasColumnHeaders=false)
 
 CsvReader (String const &content, bool hasColumnHeaders=false)
 
Mixed const & operator[] (int iRow) const
 获取一行记录,再次[]可获得某一列 更多...
 
Mixed const & operator() (int iRow, String const &name) const
 如果从CSV中读取了列标头,那可以通过列标头名获取一行记录中的某一列 更多...
 
int getCount () const
 获取读取到的记录数 更多...
 
MixedgetRecords ()
 获取所有记录的引用,可直接操作 更多...
 
MixedgetColumnHeaders ()
 获取所有列标头 更多...
 
void read (String const &content, bool hasColumnHeaders=false)
 解析CSV数据,hasColumnHeaders表示CSV中第一行是否为列标头行 更多...
 

详细描述

CSV文件读取器

在文件 archives.hpp79 行定义.

构造及析构函数说明

winux::CsvReader::CsvReader ( IFile inputFile,
bool  hasColumnHeaders = false 
)
winux::CsvReader::CsvReader ( String const &  content,
bool  hasColumnHeaders = false 
)

成员函数说明

Mixed& winux::CsvReader::getColumnHeaders ( )
inline

获取所有列标头

在文件 archives.hpp95 行定义.

int winux::CsvReader::getCount ( ) const
inline

获取读取到的记录数

在文件 archives.hpp90 行定义.

Mixed& winux::CsvReader::getRecords ( )
inline

获取所有记录的引用,可直接操作

在文件 archives.hpp93 行定义.

Mixed const& winux::CsvReader::operator() ( int  iRow,
String const &  name 
) const
inline

如果从CSV中读取了列标头,那可以通过列标头名获取一行记录中的某一列

在文件 archives.hpp88 行定义.

Mixed const& winux::CsvReader::operator[] ( int  iRow) const
inline

获取一行记录,再次[]可获得某一列

在文件 archives.hpp86 行定义.

void winux::CsvReader::read ( String const &  content,
bool  hasColumnHeaders = false 
)

解析CSV数据,hasColumnHeaders表示CSV中第一行是否为列标头行


该类的文档由以下文件生成: