Ark Server API (ASA) - Wiki
|
#include <CsvParser.h>
Public Types | |
typedef TArray< TArray< const TCHAR * > > | FRows |
Public Member Functions | |
FCsvParser (FString InSourceString) | |
const FRows & | GetRows () const |
Private Types | |
enum struct | EParseResult { EndOfCell , EndOfRow , EndOfString } |
Private Member Functions | |
FCsvParser (const FCsvParser &) | |
FCsvParser & | operator= (const FCsvParser &) |
void | ParseRows () |
EParseResult | ParseRow () |
EParseResult | ParseCell () |
int8 | MeasureNewLine (const TCHAR *At) |
Private Attributes | |
FString | SourceString |
TCHAR * | BufferStart |
const TCHAR * | ReadAt |
FRows | Rows |
A simple, efficient csv parser
Definition at line 10 of file CsvParser.h.
typedef TArray<TArray<const TCHAR*> > FCsvParser::FRows |
Definition at line 12 of file CsvParser.h.
|
strongprivate |
Internal enum to control parsing progress
Enumerator | |
---|---|
EndOfCell | |
EndOfRow | |
EndOfString |
Definition at line 37 of file CsvParser.h.
FCsvParser::FCsvParser | ( | FString | InSourceString | ) |
Construct with a string. Takes a copy because the parser tramples over the file to create null-terminated cell strings Avoid a copy by passing overship of the source string with MoveTemp()
|
private |
Non copyable - has pointers to itself
Const access to the parsed rows Rows are stored as arrays of parsed, null-terminated cell-strings. Object (and contained strings) is valid for the lifetime of the parser.
Definition at line 26 of file CsvParser.h.
Helper to measure the size of a new line at the current read position
|
private |
|
private |
Parse a cell at the current read position
|
private |
Parse a single row at the current read position
|
private |
Parse all the rows in the source data
|
private |
Fixed pointer to the start of the buffer
Definition at line 54 of file CsvParser.h.
|
private |
Current parser read position
Definition at line 57 of file CsvParser.h.
|
private |
Array of cell string arrays
Definition at line 60 of file CsvParser.h.
|
private |
Raw csv buffer, sliced and diced by the parser
Definition at line 51 of file CsvParser.h.