Add documentation to JSON loading functions

This commit is contained in:
Alexander Bock
2024-02-10 10:23:20 +01:00
parent fa1847d235
commit 15e3cbbb68
2 changed files with 6 additions and 2 deletions

View File

@@ -76,7 +76,9 @@ std::string formatJson(T value);
void sortJson(nlohmann::json& json, const std::string& key);
/**
* Converts the provided JSON object into its corresponding Dictionary format.
* Converts the provided JSON object into its corresponding Dictionary format. Please note
* that if the JSON contains keys that array of an array type, they are converted into a
* Dictionary with numerical keys and the numerical keys start with 1.
*/
ghoul::Dictionary jsonToDictionary(const nlohmann::json& json);

View File

@@ -252,7 +252,9 @@ namespace {
}
/**
* Loads the provided JSON file and returns it back to the caller.
* Loads the provided JSON file and returns it back to the caller. Please note that if the
* JSON contains keys that array of an array type, they are converted into a Dictionary
* with numerical keys and the numerical keys start with 1.
*/
[[codegen::luawrap]] ghoul::Dictionary loadJson(std::filesystem::path path) {
if (!std::filesystem::exists(path)) {