diff --git a/src/core/game_list.cpp b/src/core/game_list.cpp index 96004fa1c..3fd995459 100644 --- a/src/core/game_list.cpp +++ b/src/core/game_list.cpp @@ -1149,3 +1149,19 @@ bool GameList::SaveCompatibilityDatabaseForEntry(const GameListCompatibilityEntr Log_InfoPrintf("Updated compatibility list '%s'", m_compatibility_list_filename.c_str()); return true; } + +std::string GameList::ExportCompatibilityEntry(const GameListCompatibilityEntry* entry) +{ + tinyxml2::XMLDocument doc; + tinyxml2::XMLElement* root_elem = doc.NewElement("compatibility-list"); + doc.InsertEndChild(root_elem); + + tinyxml2::XMLElement* entry_elem = doc.NewElement("entry"); + root_elem->InsertEndChild(entry_elem); + InitElementForCompatibilityEntry(&doc, entry_elem, entry); + + tinyxml2::XMLPrinter printer; + //doc.Print(&printer); + entry_elem->Accept(&printer); + return std::string(printer.CStr(), printer.CStrSize()); +} diff --git a/src/core/game_list.h b/src/core/game_list.h index 9ac07f653..d98e9713d 100644 --- a/src/core/game_list.h +++ b/src/core/game_list.h @@ -110,6 +110,8 @@ public: void UpdateCompatibilityEntry(GameListCompatibilityEntry new_entry, bool save_to_list = true); + static std::string ExportCompatibilityEntry(const GameListCompatibilityEntry* entry); + private: enum : u32 {