1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00
vcmi/lib/json
Alexander Wilms 1ca8e9b3ae JsonParser::parse(): Print JSON if there were errors while parsing
In cases where the file name was not specified, the warning messages were not very useful.

Example:

```json
File <unknown> is not a valid JSON file!
At line 33, position 1 warning: Comma expected!

{
        "name" : "New Old Heroes",
        "description" : "New heroes based on old 3DO artwork and other game appearances. Requires Horn of the Abyss.",
        "modType" : "Heroes",
        "version" : "1.2.0",
        "author" : "Aphra",
        "contact" : "",

        "heroes" :
        [
                "config/gwenneth.json",
                "config/balindar.json",
                "config/nicolas.json",
                "config/kastore.json",
                "config/kydoimos.json",
                "config/athe.json",
                "config/miseria.json",
                "config/areshrak.json",
                "config/pactal.json",
                "config/zog.json"
        ],

        "changelog" :
    {
        "1.0.0"   : ["Initial release"],
        "1.1.0"   : ["Added Nicolas Gryphonheart and Kastore"],
        "1.1.1"   : ["Bug fixes"],
        "1.2.0"   : ["Added some HotA portrait-only campaign heroes"]
    },

        "depends" :
                [ "hota.neutralCreatures" ]
        "keepDisabled" : true
}
```
2024-07-17 13:17:43 +02:00
..
JsonBonus.cpp Re-enable code that was not restored after terrain rework 2024-06-07 12:24:36 +00:00
JsonBonus.h Replace bonus string description with metastring that can properly 2024-04-09 16:13:30 +03:00
JsonFormatException.h Converted json validator into a class 2024-02-26 12:55:49 +02:00
JsonNode.cpp Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
JsonNode.h Add additional constructor to JsonNode from const char * 2024-02-29 17:33:00 +02:00
JsonParser.cpp JsonParser::parse(): Print JSON if there were errors while parsing 2024-07-17 13:17:43 +02:00
JsonParser.h Cleanup 2024-02-26 12:55:49 +02:00
JsonRandom.cpp Cleanup 2024-02-26 12:55:49 +02:00
JsonRandom.h Unify formatting 2024-02-26 12:55:49 +02:00
JsonUtils.cpp Avoid crash if configs file is missing, e.g. broken version of mod 2024-05-11 13:19:07 +00:00
JsonUtils.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
JsonValidator.cpp Merge remote-tracking branch 'vcmi/master' into develop 2024-07-11 17:43:44 +00:00
JsonValidator.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
JsonWriter.cpp Cleanup 2024-02-26 12:55:49 +02:00
JsonWriter.h Unify formatting 2024-02-26 12:55:49 +02:00