locale parsing done

This commit is contained in:
2026-04-04 10:11:46 -05:00
parent 9ec21f85a0
commit b5b29d7061
10 changed files with 743 additions and 54 deletions
@@ -9,10 +9,6 @@
#include "asset/asset.h"
#include "locale/localemanager.h"
typedef struct {
void *nothing;
} assetlocaleloaderparams_t;
/**
* Handler for locale assets.
*
@@ -31,4 +27,53 @@ errorret_t assetLocaleLoader(assetfile_t *file);
errorret_t assetLocaleLoad(
const char_t *path,
void *nothing
);
/**
* Skips blank lines and comment lines in the line reader.
*
* @param reader Line reader to read from.
* @param lineBuffer Buffer to use for reading lines.
* @return Any error that occurs during skipping.
*/
errorret_t assetLocaleLineSkipBlanks(
assetfilelinereader_t *reader,
uint8_t *lineBuffer
);
/**
* Unbuffers a potentially multi-line quoted string from the line reader.
*
* This will read lines until it finds a line that starts with a quote, then
* read until the closing quote.
*
* @param reader Line reader to read from.
* @param lineBuffer Buffer to use for reading lines.
* @param stringBuffer Buffer to write the unbuffered string to.
* @param stringBufferSize Size of the string buffer.
* @return Any error that occurs during unbuffering.
*/
errorret_t assetLocaleLineUnbuffer(
assetfilelinereader_t *reader,
uint8_t *lineBuffer,
uint8_t *stringBuffer,
const size_t stringBufferSize
);
/**
* Test function for locale asset loading.
*
* @param file Asset file to test loading from.
* @param messageId The message ID to retrieve.
* @param pluralIndex The plural index to retrieve.
* @param stringBuffer Buffer to write the retrieved string to.
* @param stringBufferSize Size of the string buffer.
* @return Any error that occurs during testing.
*/
errorret_t assetLocaleGetString(
assetfile_t *file,
const char_t *messageId,
const int32_t pluralIndex,
char_t *stringBuffer,
const size_t stringBufferSize
);