Class that manage CSV files. More...
Public Member Functions | |
GO2SCsvFile (String fileName, GO2SEnum::GO2SFileOpen mode=GO2SEnum::GO2SFileOpen::read_only, QChar sep=';', Boolean header=true) | |
Create new or open an existing csv file. | |
GO2SEnum::GO2SError | AppendRecord (Array< String > record) |
GO2SEnum::GO2SError | EditField (Number line, Number column, String newElem) |
GO2SEnum::GO2SError | EditRecord (Number index, Array< String > newRecord) |
Number | GetFieldCount () |
Array< String > | GetLabels () |
Number | GetRecordCount () |
Array< Array< String > > | ReadCsv () |
String | ReadField (Number line, Number index) |
String | ReadFieldByName (Number line, String name) |
Array< String > | ReadRecord (Number line) |
Public Member Functions inherited from GO2SAsciiFile | |
GO2SAsciiFile (String fileName, GO2SEnum::GO2SFileOpen mode=GO2SEnum::GO2SFileOpen::read_only) | |
GO2SEnum::GO2SError | Append (Number pos, String line) |
GO2SEnum::GO2SError | AppendLast (String line) |
GO2SEnum::GO2SError | DeleteLine (Number no) |
GO2SEnum::GO2SError | EditLine (Number no, String newLine) |
Number | GetLineCount () |
Array< String > | ReadAll () |
String | ReadLine (Number no) |
Public Member Functions inherited from GO2SFile | |
void | Close () |
Close the file. | |
String | GetFilePath () |
Get the full path (directory + name) of the file. | |
Boolean | IsOpen () |
Get if the file is open. | |
void | Save ()=0 |
Class that manage CSV files.
GO2SCsvFile::GO2SCsvFile | ( | String | fileName, |
GO2SEnum::GO2SFileOpen | mode = GO2SEnum::GO2SFileOpen::read_only, | ||
QChar | sep = ';', | ||
Boolean | header = true ) |
Create new or open an existing csv file.
[in] | fileName | full path of the file (directory + name) |
[in] | mode | opening mode |
[in] | sep | column separator |
[in] | header | should we consider first line as header ? it true, 1st line should contains data name, if false 1st line contains data. This parameter is unused when starting from an empty file |
GO2SEnum::GO2SError GO2SCsvFile::AppendRecord | ( | Array< String > | record | ) |
Add a record at the end of the file
[in] | record | new record/line that will be added at the end of the file |
GO2SEnum::GO2SError GO2SCsvFile::EditField | ( | Number | line, |
Number | column, | ||
String | newElem ) |
Edit a field in the file
[in] | line | line number of the record to edit |
[in] | column | column number of the field to edit |
[in] | newElem | new value |
GO2SEnum::GO2SError GO2SCsvFile::EditRecord | ( | Number | index, |
Array< String > | newRecord ) |
Replace a record
[in] | index | line number of the record to edit |
[in] | newRecord | new record |
|
inline |
|
inline |
|
inline |
Array< Array< String > > GO2SCsvFile::ReadCsv | ( | ) |
String GO2SCsvFile::ReadField | ( | Number | line, |
Number | index ) |
Read the field at a given line, given column (starting at 0)
[in] | line | line number of the record to read |
[in] | index | column number of the field to read |
String GO2SCsvFile::ReadFieldByName | ( | Number | line, |
String | name ) |
Read the field with the given name, on the record at a given line
[in] | line | line number of the record to read |
[in] | name | column name the field to read |
|
inline |
Read a record at a given line (starting at 0)
[in] | line | line number of the record to read |