summaryrefslogtreecommitdiffstats
path: root/pokemod/Author.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-05-11 01:33:42 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-05-11 01:33:42 +0000
commitfafbdab97afb5ec6498ea0ab66b693b9e335f6f1 (patch)
tree2f8ad1e735f3b15b123ea2353fedec8affd22790 /pokemod/Author.cpp
parent0d2d8121cbb6a45180d88021fe2e5ac86b3532e3 (diff)
Starting INI migration
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@9 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Author.cpp')
-rw-r--r--pokemod/Author.cpp42
1 files changed, 15 insertions, 27 deletions
diff --git a/pokemod/Author.cpp b/pokemod/Author.cpp
index cd033ccf..c67f25bb 100644
--- a/pokemod/Author.cpp
+++ b/pokemod/Author.cpp
@@ -32,10 +32,10 @@ PokeGen::PokeMod::Author::Author(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::Author::Author(XmlElement &xml, unsigned _id)
+PokeGen::PokeMod::Author::Author(Ini &ini, unsigned _id)
{
- LogCtorXml("Author", id);
- ImportXml(xml, _id);
+ LogCtorIni("Author", id);
+ ImportIni(ini, _id);
// Big problems
if (id == UINT_MAX)
LogIdError("Author");
@@ -104,47 +104,35 @@ void PokeGen::PokeMod::Author::Validate(wxListBox &output)
}
#endif
-void PokeGen::PokeMod::Author::ImportXml(XmlElement &xml, unsigned _id)
+void PokeGen::PokeMod::Author::ImportIni(Ini &ini, unsigned _id)
{
LogImportStart("Author");
String curName;
if (_id == UINT_MAX)
{
- xml.GetValue(id);
+ ini.GetValue("id", id, UINT_MAX);
if (id == UINT_MAX)
LogIdNotFound("Author");
}
else
id = _id;
- name = "";
- email = "";
- role = "";
- xml.ClearCounter();
- for (XmlElement *child = xml.NextElement(); child; child = xml.NextElement())
- {
- curName = child->GetName();
- if (curName == "name")
- child->GetValue(name);
- else if (curName == "email")
- child->GetValue(email);
- else if (curName == "role")
- child->GetValue(role);
- else
- LogUnknownXml("Author", curName);
- }
+ ini.GetValue("name", name, "");
+ ini.GetValue("email", email, "");
+ ini.GetValue("role", role, "");
LogImportOver("Author", id, name);
}
-PokeGen::PokeMod::XmlElement PokeGen::PokeMod::Author::ExportXml()
+void PokeGen::PokeMod::Author::ExportIni(const std::ofstream &fout)
{
LogExportStart("Author", id, name);
// Declare the elements
- XmlElement exAuthor("author", id, true);
- exAuthor.AddElement("name", name);
- exAuthor.AddElement("email", email);
- exAuthor.AddElement("role", role);
+ Ini exAuthor("author");
+ exAuthor.AddField("id", id);
+ exAuthor.AddField("name", name);
+ exAuthor.AddField("email", email);
+ exAuthor.AddField("role", role);
+ exAuthor.Export(fout);
LogExportOver("Author", id, name);
- return exAuthor;
}
void PokeGen::PokeMod::Author::SetName(const String &n)