summaryrefslogtreecommitdiff
path: root/library/VersionInfoFactory.cpp
diff options
context:
space:
mode:
authorPetr Mrázek2012-03-24 12:13:51 +0100
committerPetr Mrázek2012-03-24 12:13:51 +0100
commit8a847dbaba6f8b38a0fc170f72692470557f2e12 (patch)
tree8443203a4d32eb90f1801e9dc86677b94d6d2e26 /library/VersionInfoFactory.cpp
parent7fe5fc9a906710bc603bf93b3e282872990a3361 (diff)
downloaddfhack-8a847dbaba6f8b38a0fc170f72692470557f2e12.tar.gz
dfhack-8a847dbaba6f8b38a0fc170f72692470557f2e12.tar.bz2
dfhack-8a847dbaba6f8b38a0fc170f72692470557f2e12.tar.xz
Tweaks and cleanups
Removed t_virtual. Made lua use C++ compiler Removed many silly exception types from Error.h and renamed the rest. Removed Brush classes from tiletypes plugin.
Diffstat (limited to 'library/VersionInfoFactory.cpp')
-rw-r--r--library/VersionInfoFactory.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/library/VersionInfoFactory.cpp b/library/VersionInfoFactory.cpp
index 66cea00a..cf63e3b1 100644
--- a/library/VersionInfoFactory.cpp
+++ b/library/VersionInfoFactory.cpp
@@ -47,6 +47,7 @@ VersionInfoFactory::~VersionInfoFactory()
{
clear();
}
+
void VersionInfoFactory::clear()
{
// for each stored version, delete
@@ -83,11 +84,11 @@ void VersionInfoFactory::ParseVersion (TiXmlElement* entry, VersionInfo* mem)
TiXmlElement* pMemEntry;
const char *cstr_name = entry->Attribute("name");
if (!cstr_name)
- throw Error::MemoryXmlBadAttribute("name");
+ throw Error::SymbolsXmlBadAttribute("name");
const char *cstr_os = entry->Attribute("os-type");
if (!cstr_os)
- throw Error::MemoryXmlBadAttribute("os-type");
+ throw Error::SymbolsXmlBadAttribute("os-type");
string os = cstr_os;
mem->setVersion(cstr_name);
@@ -106,7 +107,7 @@ void VersionInfoFactory::ParseVersion (TiXmlElement* entry, VersionInfo* mem)
}
else
{
- throw Error::MemoryXmlBadAttribute("os-type");
+ throw Error::SymbolsXmlBadAttribute("os-type");
}
// process additional entries
@@ -121,7 +122,7 @@ void VersionInfoFactory::ParseVersion (TiXmlElement* entry, VersionInfo* mem)
{
const char *cstr_key = pMemEntry->Attribute("name");
if(!cstr_key)
- throw Error::MemoryXmlUnderspecifiedEntry(cstr_name);
+ throw Error::SymbolsXmlUnderspecifiedEntry(cstr_name);
const char *cstr_value = pMemEntry->Attribute("value");
if(!cstr_value)
{
@@ -134,14 +135,14 @@ void VersionInfoFactory::ParseVersion (TiXmlElement* entry, VersionInfo* mem)
{
const char *cstr_value = pMemEntry->Attribute("value");
if(!cstr_value)
- throw Error::MemoryXmlUnderspecifiedEntry(cstr_name);
+ throw Error::SymbolsXmlUnderspecifiedEntry(cstr_name);
mem->addMD5(cstr_value);
}
else if (type == "binary-timestamp")
{
const char *cstr_value = pMemEntry->Attribute("value");
if(!cstr_value)
- throw Error::MemoryXmlUnderspecifiedEntry(cstr_name);
+ throw Error::SymbolsXmlUnderspecifiedEntry(cstr_name);
mem->addPE(strtol(cstr_value, 0, 16));
}
} // for
@@ -157,7 +158,7 @@ bool VersionInfoFactory::loadFile(string path_to_xml)
{
error = true;
cerr << "failed!\n";
- throw Error::MemoryXmlParse(doc.ErrorDesc(), doc.ErrorId(), doc.ErrorRow(), doc.ErrorCol());
+ throw Error::SymbolsXmlParse(doc.ErrorDesc(), doc.ErrorId(), doc.ErrorRow(), doc.ErrorCol());
}
else
{
@@ -174,13 +175,13 @@ bool VersionInfoFactory::loadFile(string path_to_xml)
if (!pElem)
{
error = true;
- throw Error::MemoryXmlNoRoot();
+ throw Error::SymbolsXmlNoRoot();
}
string m_name=pElem->Value();
if(m_name != "data-definition")
{
error = true;
- throw Error::MemoryXmlNoRoot();
+ throw Error::SymbolsXmlNoRoot();
}
// save this for later
hRoot=TiXmlHandle(pElem);