make otml simpler and easier to use, improve error handling/exceptions

This commit is contained in:
Eduardo Bart
2011-08-19 15:53:23 -03:00
parent f9e7d52ac0
commit 033f14780d
32 changed files with 646 additions and 622 deletions

View File

@@ -15,7 +15,7 @@ OTMLDocumentPtr OTMLDocument::parse(const std::string& fileName)
{
std::stringstream fin;
g_resources.loadFile(fileName, fin);
return parse(fin, fileName);
return parse(fin, g_resources.resolvePath(fileName));
}
OTMLDocumentPtr OTMLDocument::parse(std::istream& in, const std::string& source)
@@ -34,8 +34,7 @@ std::string OTMLDocument::emit()
bool OTMLDocument::save(const std::string& fileName)
{
setSource(fileName);
m_source = fileName;
return g_resources.saveFile(fileName, emit());
}