mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-25 12:46:53 +01:00
* Updated tinyXML to tinyXML2 v4.0.1 (GreyWolf)
This commit is contained in:
parent
3a62520601
commit
6a2d30beb3
@ -2,8 +2,8 @@
|
|||||||
<app version="1">
|
<app version="1">
|
||||||
<name> USB Loader GX</name>
|
<name> USB Loader GX</name>
|
||||||
<coder>USB Loader GX Team</coder>
|
<coder>USB Loader GX Team</coder>
|
||||||
<version>3.0 r1262</version>
|
<version>3.0 r1263</version>
|
||||||
<release_date>20161019124305</release_date>
|
<release_date>20161106144602</release_date>
|
||||||
<!-- // remove this line to enable arguments
|
<!-- // remove this line to enable arguments
|
||||||
<arguments>
|
<arguments>
|
||||||
<arg>--ios=250</arg>
|
<arg>--ios=250</arg>
|
||||||
|
@ -7,11 +7,13 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "FileOperations/fileops.h"
|
#include "FileOperations/fileops.h"
|
||||||
#include "xml/tinyxml.h"
|
#include "xml/tinyxml2.h"
|
||||||
#include "gecko.h"
|
#include "gecko.h"
|
||||||
|
|
||||||
#include "HomebrewXML.h"
|
#include "HomebrewXML.h"
|
||||||
|
|
||||||
|
using namespace tinyxml2;
|
||||||
|
|
||||||
#define ENTRIE_SIZE 8192
|
#define ENTRIE_SIZE 8192
|
||||||
|
|
||||||
/* qparam filename Filepath of the XML file */
|
/* qparam filename Filepath of the XML file */
|
||||||
@ -24,15 +26,15 @@ int HomebrewXML::LoadHomebrewXMLData(const char* filename)
|
|||||||
LongDescription.clear();
|
LongDescription.clear();
|
||||||
Releasedate.clear();
|
Releasedate.clear();
|
||||||
|
|
||||||
TiXmlDocument xmlDoc(filename);
|
XMLDocument xmlDoc;
|
||||||
if(!xmlDoc.LoadFile())
|
if(xmlDoc.LoadFile(filename) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TiXmlElement *appNode = xmlDoc.FirstChildElement("app");
|
XMLElement *appNode = xmlDoc.FirstChildElement("app");
|
||||||
if(!appNode)
|
if(!appNode)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TiXmlElement *node = NULL;
|
XMLElement *node = NULL;
|
||||||
|
|
||||||
node = appNode->FirstChildElement("name");
|
node = appNode->FirstChildElement("name");
|
||||||
if(node && node->FirstChild() && node->FirstChild()->Value())
|
if(node && node->FirstChild() && node->FirstChild()->Value())
|
||||||
@ -75,7 +77,7 @@ int HomebrewXML::LoadHomebrewXMLData(const char* filename)
|
|||||||
if(!node)
|
if(!node)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
TiXmlElement *argNode = node->FirstChildElement("arg");
|
XMLElement *argNode = node->FirstChildElement("arg");
|
||||||
|
|
||||||
while(argNode)
|
while(argNode)
|
||||||
{
|
{
|
||||||
|
@ -26,9 +26,11 @@
|
|||||||
#include "settings/CSettings.h"
|
#include "settings/CSettings.h"
|
||||||
#include "network/networkops.h"
|
#include "network/networkops.h"
|
||||||
#include "utils/StringTools.h"
|
#include "utils/StringTools.h"
|
||||||
#include "xml/tinyxml.h"
|
#include "xml/tinyxml2.h"
|
||||||
#include "gecko.h"
|
#include "gecko.h"
|
||||||
|
|
||||||
|
using namespace tinyxml2;
|
||||||
|
|
||||||
Wiinnertag::Wiinnertag(const string &filepath)
|
Wiinnertag::Wiinnertag(const string &filepath)
|
||||||
{
|
{
|
||||||
ReadXML(filepath);
|
ReadXML(filepath);
|
||||||
@ -36,11 +38,11 @@ Wiinnertag::Wiinnertag(const string &filepath)
|
|||||||
|
|
||||||
bool Wiinnertag::ReadXML(const string &filepath)
|
bool Wiinnertag::ReadXML(const string &filepath)
|
||||||
{
|
{
|
||||||
TiXmlDocument xmlDoc(filepath.c_str());
|
XMLDocument xmlDoc;
|
||||||
if(!xmlDoc.LoadFile())
|
if(xmlDoc.LoadFile(filepath.c_str()) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TiXmlElement * node = xmlDoc.FirstChildElement("Tag");
|
XMLElement * node = xmlDoc.FirstChildElement("Tag");
|
||||||
|
|
||||||
while(node != NULL)
|
while(node != NULL)
|
||||||
{
|
{
|
||||||
@ -108,17 +110,17 @@ bool Wiinnertag::CreateExample(const string &filepath)
|
|||||||
fullpath += '/';
|
fullpath += '/';
|
||||||
fullpath += "Wiinnertag.xml";
|
fullpath += "Wiinnertag.xml";
|
||||||
|
|
||||||
TiXmlDocument xmlDoc;
|
XMLDocument xmlDoc;
|
||||||
|
|
||||||
TiXmlDeclaration declaration("1.0", "UTF-8", "");
|
XMLDeclaration * declaration = xmlDoc.NewDeclaration();
|
||||||
xmlDoc.InsertEndChild(declaration);
|
xmlDoc.InsertEndChild(declaration);
|
||||||
|
|
||||||
TiXmlElement Tag("Tag");
|
XMLElement *Tag = xmlDoc.NewElement("Tag");
|
||||||
Tag.SetAttribute("URL", "http://www.wiinnertag.com/wiinnertag_scripts/update_sign.php?key={KEY}&game_id={ID6}");
|
Tag->SetAttribute("URL", "http://www.wiinnertag.com/wiinnertag_scripts/update_sign.php?key={KEY}&game_id={ID6}");
|
||||||
Tag.SetAttribute("Key", "1234567890");
|
Tag->SetAttribute("Key", "1234567890");
|
||||||
xmlDoc.InsertEndChild(Tag);
|
xmlDoc.InsertEndChild(Tag);
|
||||||
|
|
||||||
xmlDoc.SaveFile(fullpath);
|
xmlDoc.SaveFile(fullpath.c_str());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,8 @@
|
|||||||
#include "utils/StringTools.h"
|
#include "utils/StringTools.h"
|
||||||
#include "svnrev.h"
|
#include "svnrev.h"
|
||||||
|
|
||||||
|
using namespace tinyxml2;
|
||||||
|
|
||||||
#define VALID_CONFIG_REV 1084
|
#define VALID_CONFIG_REV 1084
|
||||||
|
|
||||||
CGameCategories GameCategories;
|
CGameCategories GameCategories;
|
||||||
@ -70,14 +72,14 @@ bool CGameCategories::Load(string filepath)
|
|||||||
|
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
TiXmlDocument xmlDoc(filepath.c_str());
|
XMLDocument xmlDoc;
|
||||||
if(!xmlDoc.LoadFile())
|
if(xmlDoc.LoadFile(filepath.c_str()) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(!ValidVersion(xmlDoc.FirstChildElement("Revision")))
|
if(!ValidVersion(xmlDoc.FirstChildElement("Revision")))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TiXmlElement * node = xmlDoc.FirstChildElement("Categories");
|
XMLElement * node = xmlDoc.FirstChildElement("Categories");
|
||||||
if(!node)
|
if(!node)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -104,7 +106,7 @@ bool CGameCategories::Load(string filepath)
|
|||||||
{
|
{
|
||||||
const char * gameID = node->Attribute("ID");
|
const char * gameID = node->Attribute("ID");
|
||||||
|
|
||||||
TiXmlElement * category = node->FirstChildElement("Category");
|
XMLElement * category = node->FirstChildElement("Category");
|
||||||
|
|
||||||
while(category != NULL)
|
while(category != NULL)
|
||||||
{
|
{
|
||||||
@ -135,13 +137,13 @@ bool CGameCategories::Save()
|
|||||||
CreateSubfolder(filepath);
|
CreateSubfolder(filepath);
|
||||||
|
|
||||||
StartProgress(tr("Generating GXGameCategories.xml"), tr("Please wait..."), 0, false, true);
|
StartProgress(tr("Generating GXGameCategories.xml"), tr("Please wait..."), 0, false, true);
|
||||||
TiXmlDocument xmlDoc;
|
XMLDocument xmlDoc;
|
||||||
|
|
||||||
TiXmlDeclaration declaration("1.0", "UTF-8", "");
|
XMLDeclaration *declaration = xmlDoc.NewDeclaration();
|
||||||
xmlDoc.InsertEndChild(declaration);
|
xmlDoc.InsertEndChild(declaration);
|
||||||
TiXmlElement Revision("Revision");
|
XMLElement *Revision = xmlDoc.NewElement("Revision");
|
||||||
TiXmlText revText(GetRev());
|
XMLText *revText = xmlDoc.NewText(GetRev());
|
||||||
Revision.InsertEndChild(revText);
|
Revision->InsertEndChild(revText);
|
||||||
xmlDoc.InsertEndChild(Revision);
|
xmlDoc.InsertEndChild(Revision);
|
||||||
|
|
||||||
int progressSize = CategoryList.size() + List.size();
|
int progressSize = CategoryList.size() + List.size();
|
||||||
@ -151,14 +153,14 @@ bool CGameCategories::Save()
|
|||||||
{
|
{
|
||||||
//! On LinkEndChild TinyXML owns and deletes the elements allocated here.
|
//! On LinkEndChild TinyXML owns and deletes the elements allocated here.
|
||||||
//! This is more memory efficient than making another copy of the elements.
|
//! This is more memory efficient than making another copy of the elements.
|
||||||
TiXmlElement *Categories = new TiXmlElement("Categories");
|
XMLElement *Categories = xmlDoc.NewElement("Categories");
|
||||||
|
|
||||||
CategoryList.goToFirst();
|
CategoryList.goToFirst();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
ShowProgress(progress, progressSize);
|
ShowProgress(progress, progressSize);
|
||||||
|
|
||||||
TiXmlElement *Category = new TiXmlElement("Category");
|
XMLElement *Category = xmlDoc.NewElement("Category");
|
||||||
Category->SetAttribute("ID", fmt("%02i", CategoryList.getCurrentID()));
|
Category->SetAttribute("ID", fmt("%02i", CategoryList.getCurrentID()));
|
||||||
Category->SetAttribute("Name", CategoryList.getCurrentName().c_str());
|
Category->SetAttribute("Name", CategoryList.getCurrentName().c_str());
|
||||||
|
|
||||||
@ -175,13 +177,13 @@ bool CGameCategories::Save()
|
|||||||
{
|
{
|
||||||
//! On LinkEndChild TinyXML owns and deletes the elements allocated here.
|
//! On LinkEndChild TinyXML owns and deletes the elements allocated here.
|
||||||
//! This is more memory efficient than making another copy of the elements.
|
//! This is more memory efficient than making another copy of the elements.
|
||||||
TiXmlElement *GameCategories = new TiXmlElement("GameCategories");
|
XMLElement *GameCategories = xmlDoc.NewElement("GameCategories");
|
||||||
|
|
||||||
for(map<string, vector<unsigned int> >::iterator itr = List.begin(); itr != List.end(); itr++)
|
for(map<string, vector<unsigned int> >::iterator itr = List.begin(); itr != List.end(); itr++)
|
||||||
{
|
{
|
||||||
ShowProgress(progress, progressSize);
|
ShowProgress(progress, progressSize);
|
||||||
|
|
||||||
TiXmlElement *Game = new TiXmlElement("Game");
|
XMLElement *Game = xmlDoc.NewElement("Game");
|
||||||
Game->SetAttribute("ID", itr->first.c_str());
|
Game->SetAttribute("ID", itr->first.c_str());
|
||||||
Game->SetAttribute("Title", GameTitles.GetTitle(itr->first.c_str()));
|
Game->SetAttribute("Title", GameTitles.GetTitle(itr->first.c_str()));
|
||||||
|
|
||||||
@ -191,7 +193,7 @@ bool CGameCategories::Save()
|
|||||||
if(!CatName)
|
if(!CatName)
|
||||||
CatName = "";
|
CatName = "";
|
||||||
|
|
||||||
TiXmlElement *Category = new TiXmlElement("Category");
|
XMLElement *Category = xmlDoc.NewElement("Category");
|
||||||
Category->SetAttribute("ID", fmt("%02i", itr->second[i]));
|
Category->SetAttribute("ID", fmt("%02i", itr->second[i]));
|
||||||
Category->SetAttribute("Name", CatName);
|
Category->SetAttribute("Name", CatName);
|
||||||
|
|
||||||
@ -207,13 +209,13 @@ bool CGameCategories::Save()
|
|||||||
|
|
||||||
ShowProgress(tr("Writing GXGameCategories.xml"), tr("Please wait..."), 0, progressSize, progressSize, false, true);
|
ShowProgress(tr("Writing GXGameCategories.xml"), tr("Please wait..."), 0, progressSize, progressSize, false, true);
|
||||||
|
|
||||||
xmlDoc.SaveFile(configPath);
|
xmlDoc.SaveFile(configPath.c_str());
|
||||||
ProgressStop();
|
ProgressStop();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CGameCategories::ValidVersion(TiXmlElement *revisionNode)
|
bool CGameCategories::ValidVersion(XMLElement *revisionNode)
|
||||||
{
|
{
|
||||||
if(!revisionNode) return false;
|
if(!revisionNode) return false;
|
||||||
|
|
||||||
|
@ -28,9 +28,11 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "xml/tinyxml.h"
|
#include "xml/tinyxml2.h"
|
||||||
#include "CCategoryList.hpp"
|
#include "CCategoryList.hpp"
|
||||||
|
|
||||||
|
using namespace tinyxml2;
|
||||||
|
|
||||||
class CGameCategories
|
class CGameCategories
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -56,7 +58,7 @@ class CGameCategories
|
|||||||
|
|
||||||
CCategoryList CategoryList;
|
CCategoryList CategoryList;
|
||||||
protected:
|
protected:
|
||||||
bool ValidVersion(TiXmlElement *xmlfile);
|
bool ValidVersion(XMLElement *xmlfile);
|
||||||
|
|
||||||
string configPath;
|
string configPath;
|
||||||
const vector<unsigned int> defaultCategory;
|
const vector<unsigned int> defaultCategory;
|
||||||
|
@ -31,7 +31,9 @@
|
|||||||
|
|
||||||
#include "network/networkops.h"
|
#include "network/networkops.h"
|
||||||
#include "Theme_List.h"
|
#include "Theme_List.h"
|
||||||
#include "xml/tinyxml.h"
|
#include "xml/tinyxml2.h"
|
||||||
|
|
||||||
|
using namespace tinyxml2;
|
||||||
|
|
||||||
Theme_List::Theme_List(const char * url)
|
Theme_List::Theme_List(const char * url)
|
||||||
{
|
{
|
||||||
@ -64,23 +66,23 @@ Theme_List::~Theme_List()
|
|||||||
|
|
||||||
bool Theme_List::ParseXML(const char * xmlfile)
|
bool Theme_List::ParseXML(const char * xmlfile)
|
||||||
{
|
{
|
||||||
TiXmlDocument xmlDoc;
|
XMLDocument xmlDoc;
|
||||||
|
|
||||||
if(!xmlDoc.Parse(xmlfile))
|
if(!xmlDoc.Parse(xmlfile))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TiXmlElement *themesNode = xmlDoc.FirstChildElement("themes");
|
XMLElement *themesNode = xmlDoc.FirstChildElement("themes");
|
||||||
if (!themesNode)
|
if (!themesNode)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TiXmlElement *theme = themesNode->FirstChildElement("theme");
|
XMLElement *theme = themesNode->FirstChildElement("theme");
|
||||||
|
|
||||||
while(theme)
|
while(theme)
|
||||||
{
|
{
|
||||||
int i = ThemesList.size();
|
int i = ThemesList.size();
|
||||||
ThemesList.resize(i+1);
|
ThemesList.resize(i+1);
|
||||||
|
|
||||||
TiXmlElement *node = NULL;
|
XMLElement *node = NULL;
|
||||||
|
|
||||||
node = theme->FirstChildElement("name");
|
node = theme->FirstChildElement("name");
|
||||||
if(node && node->FirstChild() && node->FirstChild()->Value())
|
if(node && node->FirstChild() && node->FirstChild()->Value())
|
||||||
|
File diff suppressed because it is too large
Load Diff
1807
source/xml/tinyxml.h
1807
source/xml/tinyxml.h
File diff suppressed because it is too large
Load Diff
2536
source/xml/tinyxml2.cpp
Normal file
2536
source/xml/tinyxml2.cpp
Normal file
File diff suppressed because it is too large
Load Diff
2170
source/xml/tinyxml2.h
Normal file
2170
source/xml/tinyxml2.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
www.sourceforge.net/projects/tinyxml
|
|
||||||
Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any
|
|
||||||
damages arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any
|
|
||||||
purpose, including commercial applications, and to alter it and
|
|
||||||
redistribute it freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must
|
|
||||||
not claim that you wrote the original software. If you use this
|
|
||||||
software in a product, an acknowledgment in the product documentation
|
|
||||||
would be appreciated but is not required.
|
|
||||||
|
|
||||||
2. Altered source versions must be plainly marked as such, and
|
|
||||||
must not be misrepresented as being the original software.
|
|
||||||
|
|
||||||
3. This notice may not be removed or altered from any source
|
|
||||||
distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "tinyxml.h"
|
|
||||||
|
|
||||||
// The goal of the seperate error file is to make the first
|
|
||||||
// step towards localization. tinyxml (currently) only supports
|
|
||||||
// english error messages, but the could now be translated.
|
|
||||||
//
|
|
||||||
// It also cleans up the code a bit.
|
|
||||||
//
|
|
||||||
|
|
||||||
const char* TiXmlBase::errorString[ TiXmlBase::TIXML_ERROR_STRING_COUNT ] =
|
|
||||||
{
|
|
||||||
"No error",
|
|
||||||
"Error",
|
|
||||||
"Failed to open file",
|
|
||||||
"Error parsing Element.",
|
|
||||||
"Failed to read Element name",
|
|
||||||
"Error reading Element value.",
|
|
||||||
"Error reading Attributes.",
|
|
||||||
"Error: empty tag.",
|
|
||||||
"Error reading end tag.",
|
|
||||||
"Error parsing Unknown.",
|
|
||||||
"Error parsing Comment.",
|
|
||||||
"Error parsing Declaration.",
|
|
||||||
"Error document empty.",
|
|
||||||
"Error null (0) or unexpected EOF found in input stream.",
|
|
||||||
"Error parsing CDATA.",
|
|
||||||
"Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.",
|
|
||||||
};
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user