diff options
| author | louist103 <louist103@gmail.com> | 2022-07-18 23:32:51 -0400 |
|---|---|---|
| committer | louist103 <louist103@gmail.com> | 2022-07-18 23:32:51 -0400 |
| commit | a44c491a3aee6dd9f111edb648443d46a4fc2f76 (patch) | |
| tree | f1a61f05c9b94a147ff4983d9eea9982b44ef7bc /ZAPD/ZFile.cpp | |
| parent | e7bb31a1c74da39b10fb783550e1976ee45a1bb9 (diff) | |
Use file name for guard.
Diffstat (limited to 'ZAPD/ZFile.cpp')
| -rw-r--r-- | ZAPD/ZFile.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/ZAPD/ZFile.cpp b/ZAPD/ZFile.cpp index 34c57f5..adc0c0b 100644 --- a/ZAPD/ZFile.cpp +++ b/ZAPD/ZFile.cpp @@ -98,14 +98,6 @@ void ZFile::ParseXML(tinyxml2::XMLElement* reader, const std::string& filename) if (outNameXml != nullptr) outName = outNameXml; - const char* customHeaderGuard = reader->Attribute("CustomGuard"); - - if (customHeaderGuard != nullptr) - { - useCustomHeaderGuard = true; - customGuard = customHeaderGuard; - } - // TODO: This should be a variable on the ZFile, but it is a large change in order to force all // ZResource types to have a parent ZFile. const char* gameStr = reader->Attribute("Game"); @@ -784,15 +776,10 @@ void ZFile::GenerateSourceHeaderFiles() { OutputFormatter formatter; - std::string objectNameUpper = StringHelper::ToUpper(GetName()); - - if (!useCustomHeaderGuard) - formatter.Write(StringHelper::Sprintf("#ifndef %s_H\n#define %s_H 1\n\n", - objectNameUpper.c_str(), objectNameUpper.c_str())); - else - formatter.Write(StringHelper::Sprintf("#ifndef %s_H\n#define %s_H 1\n\n", - customGuard.c_str(), customGuard.c_str())); + std::string guard = StringHelper::ToUpper(outName.stem().string()); + formatter.Write( + StringHelper::Sprintf("#ifndef %s_H\n#define %s_H 1\n\n", guard.c_str(), guard.c_str())); for (ZResource* res : resources) { |
