static gboolean ReadXMLFile(char *fname, GTree* tree)
{
	xmlDocPtr doc;

	if( (doc = xmlParseFile(fname)) == NULL )
		return FALSE;

#if 0
	if( doc->root == NULL
	 || doc->root->name == NULL
	 || g_ascii_strncasecmp(doc->root->name, "KeyTextList", 11) != 0)
	{
		xmlFreeDoc(doc);
		return FALSE;
	}
#endif
	if( doc->xmlRootNode == NULL
	 || doc->xmlRootNode->name == NULL
	 || g_ascii_strncasecmp((const gchar *)doc->xmlRootNode->name, "KeyTextList", 11) != 0)
	{
		xmlFreeDoc(doc);
		return FALSE;
	}

	ParseXMLDoc(doc, tree);
	xmlFreeDoc(doc);

	return TRUE;
}
Exemple #2
0
void GameCore::Load(UString CoreXMLFilename)
{
	assert(Loaded == false);
	ParseXMLDoc(CoreXMLFilename);
	DebugModeEnabled = false;

	MouseCursor = new ApocCursor(fw().gamecore->GetPalette("xcom3/tacdata/TACTICAL.PAL"));

	Loaded = true;
}
Exemple #3
0
void GameCore::ParseGameXML(tinyxml2::XMLElement *Source)
{
	tinyxml2::XMLElement *node;
	UString nodename;

	for (node = Source->FirstChildElement(); node != nullptr; node = node->NextSiblingElement())
	{
		nodename = node->Name();
		if (nodename == "title")
		{
			fw().Display_SetTitle(node->GetText());
		}
		if (nodename == "include")
		{
			ParseXMLDoc(node->GetText());
		}
	}
}
static short ReadXMLFile(char *fname, STRINGLISTCOMP* tree)
{
	short result = -1;
	xmlDocPtr doc;

	if( (doc = xmlParseFile(fname)) == NULL ) goto Err;

	if( doc->xmlRootNode == NULL
	 || doc->xmlRootNode->name == NULL )
	 //|| g_strcasecmp((const gchar *)doc->xmlRootNode->name, "KeyTextList") != 0)
	{
		xmlFreeDoc(doc);
		goto Err;
	}

	ParseXMLDoc(doc, tree);
	xmlFreeDoc(doc);


	result = 0;
Err:
	return result;
}