string XLIFFFile::ToString() const { XMLNode* xml = ToXMLNode(); string s = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; s += xml->ToString(XLIFF_NAMESPACES); delete xml; s += '\n'; return s; }
/**\brief Save an XML file for this player * \details The filename is by default the player's name. */ void Player::Save( string simulation ) { xmlDocPtr xmlPtr; LogMsg( INFO, "Creation of %s", GetFileName().c_str() ); // Create new XML Document xmlPtr = xmlNewDoc( BAD_CAST "1.0" ); xmlNodePtr root_node = ToXMLNode("player"); xmlDocSetRootElement(xmlPtr, root_node); xmlSaveFormatFileEnc( GetFileName().c_str(), xmlPtr, "ISO-8859-1", 1); // Update and Save this player's info in the master players list. Players::Instance()->GetPlayerInfo( GetName() )->Update( this, simulation ); Players::Instance()->Save(); }
/**\brief Save an XML file for this player * \details The filename is by default the player's name. */ void Player::Save( string scenario ) { xmlDocPtr xmlPtr; LogMsg( INFO, "Creation of %s", GetFileName().c_str() ); // Create new XML Document xmlPtr = xmlNewDoc( BAD_CAST "1.0" ); xmlNodePtr root_node = ToXMLNode("player"); xmlDocSetRootElement(xmlPtr, root_node); xmlSaveFormatFileEnc( (std::string(PHYSFS_getWriteDir()) + std::string(PHYSFS_getDirSeparator()) + GetFileName()).c_str(), xmlPtr, "ISO-8859-1", 1); // Update and Save this player's info in the master players list. PlayerList::Instance()->GetPlayerInfo( GetName() )->Update( this, scenario ); PlayerList::Instance()->Save(); }