Class CSVParser
High-performance CSV parser for Paradox files. Handles semicolon-delimited format with header detection.
[BurstCompile(OptimizeFor = OptimizeFor.Performance)]
public static class CSVParser
- Inheritance
-
objectCSVParser
Methods
FindColumnIndex(NativeArray<uint>, uint)
Find column index by name hash
public static int FindColumnIndex(NativeArray<uint> headerHashes, uint columnNameHash)
Parameters
headerHashesNativeArray<uint>columnNameHashuint
Returns
- int
GetField(CSVRow, int)
Get field data as string slice
public static NativeSlice<byte> GetField(CSVParser.CSVRow row, int columnIndex)
Parameters
Returns
- NativeSlice<byte>
Parse(NativeSlice<byte>, Allocator, bool)
Parse CSV data with automatic header detection. Assumes UTF-8 encoding (preprocess with Python if needed).
public static CSVParser.CSVParseResult Parse(NativeSlice<byte> csvData, Allocator allocator, bool hasHeader = true)
Parameters
csvDataNativeSlice<byte>allocatorAllocatorhasHeaderbool
Returns
TryGetFloat(CSVRow, int, out float)
Try to parse field as float
public static bool TryGetFloat(CSVParser.CSVRow row, int columnIndex, out float value)
Parameters
Returns
- bool
TryGetInt(CSVRow, int, out int)
Try to parse field as integer
public static bool TryGetInt(CSVParser.CSVRow row, int columnIndex, out int value)
Parameters
Returns
- bool