diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2021-04-22 14:54:23 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-22 14:54:23 -0400 |
| commit | b0d98ff1bbda9fa25515a28bcf0c36314156c66c (patch) | |
| tree | fb72d1baab60c2e16dae5399be023debeba4a3a4 /ZAPD/Main.cpp | |
| parent | e06757c87e317e6bb102bd39fbe4cdcfed277fa9 (diff) | |
Add a few errors checks (#119)
* Check for repeated names, outnames and offsets
Signed-off-by: angie <angheloalf95@gmail.com>
* Check for File inside File
Signed-off-by: angie <angheloalf95@gmail.com>
* Error if a ZResource node has a child
Signed-off-by: angie <angheloalf95@gmail.com>
* Error if an invalid ZResource name is included in the XML
Signed-off-by: angie <angheloalf95@gmail.com>
* error when a ZResource is not in a ZFile
Signed-off-by: angie <angheloalf95@gmail.com>
* ups
Signed-off-by: angie <angheloalf95@gmail.com>
* Add error if unknown element is found and other fixes
* Run format
Diffstat (limited to 'ZAPD/Main.cpp')
| -rw-r--r-- | ZAPD/Main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ZAPD/Main.cpp b/ZAPD/Main.cpp index 98d11f0..4a58909 100644 --- a/ZAPD/Main.cpp +++ b/ZAPD/Main.cpp @@ -319,6 +319,13 @@ bool Parse(const std::string& xmlFilePath, const std::string& basePath, const st ZFile* file = new ZFile(fileMode, child, basePath, outPath, "", xmlFilePath, false); Globals::Instance->files.push_back(file); } + else + { + throw std::runtime_error( + StringHelper::Sprintf("Parse: Fatal error in '%s'.\n\t Found a resource outside of " + "a File element: '%s'\n", + xmlFilePath.c_str(), child->Name())); + } } for (ZFile* file : Globals::Instance->files) |
