Polishing the CSV and Language Parser(s).

This commit is contained in:
2021-08-09 08:34:49 -07:00
parent 1f3f23a76e
commit 68986fd108
12 changed files with 382 additions and 149 deletions

View File

@ -7,16 +7,23 @@
#pragma once
#include "../libs.h"
#include "../file/asset.h"
#include "../file/csv.h"
/** Maximum number of strings a language can hold. */
#define LANGUAGE_STRING_MAX 128
/** Definition for a Language */
typedef struct {
/** The buffer to read the asset from. */
assetbuffer_t *asset;
/** CSV Row for the header */
csvrow_t header;
/** The index in the header row that the key column is in. */
int32_t headerIndexKey;
/** The index in the header row that the value column is in. */
int32_t headerIndexValue;
} language_t;
typedef struct {
language_t *language;
csvrow_t *row;
char *key;
char *text;
} languagestring_t;
typedef struct {
languagestring_t strings[LANGUAGE_STRING_MAX];
int32_t stringCount;
} language_t;
} languagecsvget_t;