Table of Contents

Class CSVParser

Namespace
Core.Loaders
Assembly
Core.dll

High-performance CSV parser for Paradox files. Handles semicolon-delimited format with header detection.

[BurstCompile(OptimizeFor = OptimizeFor.Performance)]
public static class CSVParser
Inheritance
object
CSVParser

Methods

FindColumnIndex(NativeArray<uint>, uint)

Find column index by name hash

public static int FindColumnIndex(NativeArray<uint> headerHashes, uint columnNameHash)

Parameters

headerHashes NativeArray<uint>
columnNameHash uint

Returns

int

GetField(CSVRow, int)

Get field data as string slice

public static NativeSlice<byte> GetField(CSVParser.CSVRow row, int columnIndex)

Parameters

row CSVParser.CSVRow
columnIndex int

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

csvData NativeSlice<byte>
allocator Allocator
hasHeader bool

Returns

CSVParser.CSVParseResult

TryGetFloat(CSVRow, int, out float)

Try to parse field as float

public static bool TryGetFloat(CSVParser.CSVRow row, int columnIndex, out float value)

Parameters

row CSVParser.CSVRow
columnIndex int
value float

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

row CSVParser.CSVRow
columnIndex int
value int

Returns

bool