45 lines
1.1 KiB
C
45 lines
1.1 KiB
C
/**
|
|
* Copyright (c) 2026 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#pragma once
|
|
#include "asset/asset.h"
|
|
#include "yyjson.h"
|
|
|
|
#define ASSET_JSON_FILE_SIZE_MAX 1024*256
|
|
|
|
typedef struct {
|
|
void *nothing;
|
|
} assetjsonloaderparams_t;
|
|
|
|
/**
|
|
* Loads a JSON document from the specified asset file.
|
|
*
|
|
* @param file Asset file to load the JSON document from.
|
|
* @param outDoc Pointer to store the loaded JSON document.
|
|
* @return Any error that occurs during loading.
|
|
*/
|
|
errorret_t assetJsonLoadFileToDoc(assetfile_t *file, yyjson_doc **outDoc);
|
|
|
|
/**
|
|
* Handler for locale assets.
|
|
*
|
|
* @param file Asset file to load the locale from.
|
|
* @return Any error that occurs during loading.
|
|
*/
|
|
errorret_t assetJsonLoader(assetfile_t *file);
|
|
|
|
/**
|
|
* Loads a locale from the specified path.
|
|
*
|
|
* @param path Path to the locale asset.
|
|
* @param outDoc Pointer to store the loaded JSON document.
|
|
* @return Any error that occurs during loading.
|
|
*/
|
|
errorret_t assetJsonLoad(
|
|
const char_t *path,
|
|
yyjson_doc **outDoc
|
|
); |