33
44Designed to work with JSON when using the [ simstr] ( https://github.com/orefkov/simstr ) library.
55
6- Version 1.2.2 .
6+ Version 1.2.3 .
77
88<span class =" obfuscator " ><a href =" readme_ru.md " >On Russian | По-русски</a ></span >
99
1010This library contains a simple implementation of a simple JsonValue object for working with JSON using string objects
1111of the * simstr* library, since other libraries mainly work with ` std::string ` or raw ` const char* ` .
1212The task was not to somehow compete in performance or optimality with other libraries, I mainly use it
13- for working with small config files - read, modify, write.
13+ for working with small config files - read, modify, write. However, it also copes quite well with large files.
1414
1515For json objects, ` std::unordered_map ` is used, in the form of ` hashStrMap<K, JsonValueTemp<K>> ` ,
1616for arrays - ` std::vector<JsonValueTemp<K>> ` , strings are stored in ` sstring<K> ` .
@@ -50,7 +50,7 @@ downloads automatically).
5050 // Simple json, equal to 1.
5151 JsonValue json = 1 ; // int64
5252 stringa text = json.store(); // "1"
53-
53+
5454 // Initialization of the object, ""_h - slightly optimizes the key, calculating the hash during compilation
5555 JsonValue obj = {
5656 {"Key1"_h, 1},
@@ -67,7 +67,7 @@ downloads automatically).
6767 // Saving keys, immediately several levels
6868 test["a"_h]["b"_h]["c"_h] = 10;
6969 text = json.store(); // {"a":{"b":{"c":10}}}
70-
70+
7171 // Converts a json object to an array
7272 test[0] = "value";
7373 test[-1] = true; // When using -1 - the value is added to the end of the array
@@ -114,9 +114,9 @@ void read_config_from_file(ssa folder, ssa file_name) {
114114 stringa config;
115115 if (is_file_exist(fullPath)) {
116116 config = get_file_content(fullPath);
117-
117+
118118 auto [readed, error, line, col] = JsonValue::parse(config);
119-
119+
120120 if (error != JsonParseResult::Success) {
121121 std::cerr << "Error in parse config file " << fullPath <<
122122 " at line " << line << ", col " << col << std::endl;
0 commit comments