本文整理汇总了C++中TiXmlComment::SetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ TiXmlComment::SetValue方法的具体用法?C++ TiXmlComment::SetValue怎么用?C++ TiXmlComment::SetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TiXmlComment
的用法示例。
在下文中一共展示了TiXmlComment::SetValue方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveXml
bool cSubMenu::SaveXml(char *fname )
{
if (_fname)
{
TiXmlDocument xml = TiXmlDocument(fname );
TiXmlComment comment;
comment.SetValue(
" Mini-VDR cSetupConfiguration File\n"
" (c) Ralf Dotzert\n"
"\n\n"
" for Example see vdr-menu.xml.example\n\n"
);
TiXmlElement root("menus");
root.SetAttribute("suffix", _menuSuffix);
for (cSubMenuNode *node = _menuTree.First(); node; node = _menuTree.Next(node))
node->SaveXml(&root);
if (xml.InsertEndChild(comment) != NULL &&
xml.InsertEndChild(root) != NULL)
{
return xml.SaveFile(fname);
}
}
else
{
return false;
}
return true;
}
示例2: TiXmlDeclaration
void kore::ProjectLoader::saveProject(const std::string& path) const {
ResourceManager* ResMgr = ResourceManager::getInstance();
TiXmlDocument doc;
TiXmlDeclaration* decl = new TiXmlDeclaration("1.0", "", "yes");
doc.LinkEndChild(decl);
TiXmlComment * comment = new TiXmlComment();
time_t rawtime;
time(&rawtime);
comment->SetValue(ctime(&rawtime));
doc.LinkEndChild(comment);
// Resources
TiXmlElement* resources = new TiXmlElement("Resources");
doc.LinkEndChild(resources);
// Textures
TiXmlElement* texture;
std::map<std::string, TexturePtr>::iterator texIt;
for(texIt = ResMgr->_textures.begin();
texIt != ResMgr->_textures.end();
texIt++) {
texture = new TiXmlElement("Texture");
STextureProperties prop = texIt->second->getProperties();
texture->SetAttribute("name", texIt->second->getName().c_str());
texture->SetAttribute("width", prop.width);
texture->SetAttribute("height", prop.height);
resources->LinkEndChild(texture);
}
// TODO(dospelt) the rest
TiXmlElement* scene = new TiXmlElement("Scene");
doc.LinkEndChild(scene);
kore::SceneNodePtr root = kore::SceneManager::getInstance()->getRootNode();
//saveSceneNode(scene, root);
// finally, save to file
if(doc.SaveFile(path.c_str())) {
kore::Log::getInstance()->write("[DEBUG] writing file '%s'\n",
path.c_str());
} else {
kore::Log::getInstance()->write("[ERROR] could not write file '%s'\n",
path.c_str());
}
// TODO(dospelt) runtime error when deleting created pointers.
// it seems they get automatically deleted when saving File -> tinyxmlDoku?
// delete resources;
// delete comment;
}
示例3: save_xml
/* Method save_xml */
void ClusterSettings::save_xml (const Glib::ustring& filename)
{
/* Create xml document */
TiXmlDocument doc;
/* XML Declaration */
TiXmlDeclaration *decl = new TiXmlDeclaration ("0.0", "", "");
doc.LinkEndChild (decl);
/* Root element */
TiXmlElement *root = new TiXmlElement ("SensorsClusterSettings");
doc.LinkEndChild (root);
/* Comment */
Glib::ustring message;
message.assign (" File created by ComLibSim at [");
message.append (filename);
message.append ("] ");
TiXmlComment *comment = new TiXmlComment ();
comment->SetValue (message.c_str ());
root->LinkEndChild (comment);
/* Cluster element */
TiXmlElement *cluster = new TiXmlElement ("Cluster");
root->LinkEndChild (cluster);
/* Set cluster attribute */
cluster->SetAttribute ("name", m_Name.c_str ());
/* Sensors element */
TiXmlElement *sensorsNode = new TiXmlElement ("Sensors");
root->LinkEndChild (sensorsNode);
/* Set sensor element and attributes */
std::list<SensorSettings>::iterator iter;
for (iter=m_Sensors.begin (); iter != m_Sensors.end (); iter++)
{
const SensorSettings& sensor_iter = *iter;
/* Sensor element */
TiXmlElement *sensor = new TiXmlElement ("Sensor");
sensorsNode->LinkEndChild (sensor);
/* Set sensor attributes */
sensor->SetAttribute ("tag", iter->get_tag ().c_str ());
sensor->SetAttribute ("online", iter->get_online ());
sensor->SetDoubleAttribute ("x", iter->get_x_coord ());
sensor->SetDoubleAttribute ("y", iter->get_y_coord ());
sensor->SetAttribute ("adata", iter->get_amount_data ());
sensor->SetAttribute ("type", iter->get_type ().c_str ());
}
/* Save xml to file */
doc.SaveFile (filename.c_str ());
}
示例4: save
BOOL __stdcall DefaultLaserPen::save(LPCTSTR lpszFileName)
{
assert( lpszFileName);
FILE* stream = _tfopen(lpszFileName, _T("wb"));
if (NULL == stream)
return FALSE;
//tinyxml lib
TiXmlDocument doc;
TiXmlDeclaration* pDecl = new TiXmlDeclaration("1.0", "euc-kr", "");
doc.LinkEndChild(pDecl);
TiXmlElement* pRoot = new TiXmlElement("laserpen");
pRoot->SetAttribute("version", DA0LIB_VERSION);
pRoot->SetAttribute("count", this->size() );
doc.LinkEndChild(pRoot);
TiXmlComment * pComment = new TiXmlComment();
pComment->SetValue("2014 copyright to KOSES. all rights reserved. created by da0lib." );
pRoot->LinkEndChild( pComment );
CONTAINER_IT it = _pPimpl->container.begin();
for (; it != _pPimpl->container.end(); it++)
{
LASERPEN* pPen = it->second;
assert(pPen);
TiXmlElement* p = new TiXmlElement("pen");
p->SetAttribute("id", pPen->penid);
p->SetAttribute("frequency", pPen->frequency);
p->SetDoubleAttribute("pulsewidth", pPen->pulsewidth);
p->SetDoubleAttribute("output", pPen->output);
p->SetDoubleAttribute("speedmark" , pPen->speedmark);
p->SetDoubleAttribute("speedjump" , pPen->speedjump);
p->SetDoubleAttribute("delayoff" , pPen->delayoff);
p->SetDoubleAttribute("delayon" , pPen->delayon);
p->SetDoubleAttribute("delayjump" , pPen->delayjump);
p->SetDoubleAttribute("delaymark" , pPen->delaymark);
p->SetDoubleAttribute("delaypolygon" , pPen->delaypolygon);
p->SetAttribute("wobbelfrequency" , pPen->wobbelfrequency);
p->SetDoubleAttribute("wobbelamplitude" , pPen->wobbelamplitude);
pRoot->LinkEndChild(p);
}
doc.SaveFile(stream);
fclose( stream );
return TRUE;
}
示例5: generateConfig
/*
* Generates setting placeholders for any missing sections
* ** Plugins should verify that their settings exist and
* ** create new placeholders if they do not exist!
*/
void Configuration::generateConfig()
{
TiXmlDeclaration* decl = new TiXmlDeclaration("1.0", "", "");
configs.LinkEndChild(decl);
TiXmlElement* root = new TiXmlElement("osdb");
configs.LinkEndChild(root);
TiXmlComment* comment = new TiXmlComment();
comment->SetValue(" Settings for OSDB ");
root->LinkEndChild(comment);
setConfigSetting("main", "logFilePath", "osdb.log");
setConfigSetting("main", "useStdOut", "true");
}
示例6: addComment
void SimXMLDocument::addComment(const char* comment)
{
TiXmlComment cComment;
cComment.SetValue(comment);
if(m_paNode.empty())
{
Con::warnf("Cannot add comment without any elements: '%s'", comment);
return;
}
const int iFinalElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iFinalElement];
if(!pNode)
{
return;
}
pNode->InsertEndChild( cComment );
}
示例7: WriteXMLData
void COptions::WriteXMLData()
{
// Create document
TiXmlDocument newConfig;
TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "UTF-8", "" );
newConfig.LinkEndChild( decl );
// Root node
TiXmlElement * root = new TiXmlElement( "Bombermaaan" );
newConfig.LinkEndChild( root );
// Comment
TiXmlComment * comment = new TiXmlComment();
comment->SetValue(" Configuration settings for the Bombermaaan game (http://bombermaaan.sf.net/) " );
root->LinkEndChild( comment );
// Configuration tree node - all options have this node as parent
TiXmlElement * config = new TiXmlElement( "Configuration" );
root->LinkEndChild( config );
//! The revision number is currently 1
TiXmlElement* configRev = new TiXmlElement( "ConfigRevision" );
configRev->SetAttribute( "value", 1 );
config->LinkEndChild( configRev );
// TimeUp (when will arena close begin)
TiXmlElement* configTimeUp = new TiXmlElement( "TimeUp" );
configTimeUp->SetAttribute( "minutes", m_TimeUpMinutes );
configTimeUp->SetAttribute( "seconds", m_TimeUpSeconds );
config->LinkEndChild( configTimeUp );
// TimeStart (the duration of a match)
TiXmlElement* configTimeStart = new TiXmlElement( "TimeStart" );
configTimeStart->SetAttribute( "minutes", m_TimeStartMinutes );
configTimeStart->SetAttribute( "seconds", m_TimeStartSeconds );
config->LinkEndChild( configTimeStart );
// BattleMode
TiXmlElement* configBattleMode = new TiXmlElement("BattleMode");
configBattleMode->SetAttribute("value", m_BattleMode);
config->LinkEndChild(configBattleMode);
// BattleCount
TiXmlElement* configBattleCount = new TiXmlElement( "BattleCount" );
configBattleCount->SetAttribute( "value", m_BattleCount );
config->LinkEndChild( configBattleCount );
// LevelFileNumber
TiXmlElement* configLevel = new TiXmlElement( "LevelFileNumber" );
configLevel->SetAttribute( "value", m_Level );
config->LinkEndChild( configLevel );
// DisplayMode
TiXmlElement* configDisplayMode = new TiXmlElement( "DisplayMode" );
configDisplayMode->SetAttribute( "value", (int) m_DisplayMode );
config->LinkEndChild( configDisplayMode );
int i;
// BomberTypes
TiXmlElement* configBomberTypes = new TiXmlElement( "BomberTypes" );
for ( i = 0; i < MAX_PLAYERS; i++ ) {
std::ostringstream oss;
oss << "bomber" << i;
std::string attributeName = oss.str();
configBomberTypes->SetAttribute( attributeName, (int) m_BomberType[i] );
}
config->LinkEndChild( configBomberTypes );
// BomberTeams
TiXmlElement* configBomberTeams = new TiXmlElement("BomberTeams");
for (i = 0; i < MAX_PLAYERS; i++) {
std::ostringstream oss;
oss << "bomber" << i;
std::string attributeName = oss.str();
configBomberTeams->SetAttribute(attributeName, (int)m_BomberTeam[i]);
}
config->LinkEndChild(configBomberTeams);
// PlayerInputs
TiXmlElement* configPlayerInputs = new TiXmlElement( "PlayerInputs" );
for ( i = 0; i < MAX_PLAYERS; i++ ) {
std::ostringstream oss;
oss << "bomber" << i;
std::string attributeName = oss.str();
configPlayerInputs->SetAttribute( attributeName, (int) m_PlayerInput[i] );
}
config->LinkEndChild( configPlayerInputs );
// ControlList
TiXmlElement* configControlList = new TiXmlElement( "ControlList" );
for ( unsigned int j = 0; j < MAX_PLAYER_INPUT; j++ )
{
TiXmlElement* configControl = new TiXmlElement( "Control" );
configControl->SetAttribute( "id", j );
for ( unsigned int ctrl = 0; ctrl < NUM_CONTROLS; ctrl++ )
{
std::ostringstream oss;
oss << "control" << ctrl;
std::string attributeName = oss.str();
//.........这里部分代码省略.........
示例8: SwitchTo
void CfgMgrBldr::SwitchTo(const wxString& fileName)
{
doc = new TiXmlDocument();
if (!TinyXML::LoadDocument(fileName, doc))
{
doc->InsertEndChild(TiXmlDeclaration("1.0", "UTF-8", "yes"));
doc->InsertEndChild(TiXmlElement("CodeBlocksConfig"));
doc->FirstChildElement("CodeBlocksConfig")->SetAttribute("version", CfgMgrConsts::version);
}
if (doc->ErrorId())
cbThrow(wxString::Format(_T("TinyXML error: %s\nIn file: %s\nAt row %d, column: %d."), cbC2U(doc->ErrorDesc()).c_str(), fileName.c_str(), doc->ErrorRow(), doc->ErrorCol()));
TiXmlElement* docroot = doc->FirstChildElement("CodeBlocksConfig");
if (doc->ErrorId())
cbThrow(wxString::Format(_T("TinyXML error: %s\nIn file: %s\nAt row %d, column: %d."), cbC2U(doc->ErrorDesc()).c_str(), fileName.c_str(), doc->ErrorRow(), doc->ErrorCol()));
const char *vers = docroot->Attribute("version");
if (!vers || atoi(vers) != 1)
cbMessageBox(_("ConfigManager encountered an unknown config file version. Continuing happily."), _("Warning"), wxICON_WARNING);
doc->ClearError();
wxString info;
#ifndef __GNUC__
info.Printf(_T( " application info:\n"
"\t svn_revision:\t%u\n"
"\t build_date:\t%s, %s "), ConfigManager::GetRevisionNumber(), wxT(__DATE__), wxT(__TIME__));
#else
info.Printf(_T( " application info:\n"
"\t svn_revision:\t%u\n"
"\t build_date:\t%s, %s\n"
"\t gcc_version:\t%d.%d.%d "), ConfigManager::GetRevisionNumber(), wxT(__DATE__), wxT(__TIME__),
__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
#endif
if (platform::windows)
info.append(_T("\n\t Windows "));
if (platform::linux)
info.append(_T("\n\t Linux "));
if (platform::macosx)
info.append(_T("\n\t Mac OS X "));
if (platform::unix)
info.append(_T("\n\t Unix "));
info.append(platform::unicode ? _T("Unicode ") : _T("ANSI "));
TiXmlComment c;
c.SetValue((const char*) info.mb_str());
TiXmlNode *firstchild = docroot->FirstChild();
if (firstchild && firstchild->ToComment())
{
docroot->RemoveChild(firstchild);
firstchild = docroot->FirstChild();
}
if (firstchild)
docroot->InsertBeforeChild(firstchild, c);
else
docroot->InsertEndChild(c);
}
示例9: SaveWorld
// save world information into file
void MapInfoXmlWriter::SaveWorld(const std::string Filename, const WorldInfo & wi)
{
TiXmlDocument doc;
TiXmlComment * comment;
std::string s;
TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" );
doc.LinkEndChild( decl );
TiXmlElement * root = new TiXmlElement("World");
doc.LinkEndChild( root );
root->SetAttribute("name", wi.Name);
root->SetAttribute("firstmap", wi.FirstMap);
root->SetAttribute("firstsparea", wi.FirstSpawning);
TiXmlElement * desc = new TiXmlElement( "description" );
root->LinkEndChild(desc);
desc->LinkEndChild(new TiXmlText(wi.Description));
// block: teleport
{
comment = new TiXmlComment();
s="Define the place it is possible to teleport to, the first place is the place where we arrive in the world";
comment->SetValue(s.c_str());
root->LinkEndChild( comment );
TiXmlElement * tps = new TiXmlElement( "teleports" );
root->LinkEndChild(tps);
std::map<std::string, TPInfo>::const_iterator it = wi.Teleports.begin();
std::map<std::string, TPInfo>::const_iterator end = wi.Teleports.end();
for(; it != end; ++it)
{
TiXmlElement * tp = new TiXmlElement( "teleport" );
tps->LinkEndChild(tp);
tp->SetAttribute("name", it->second.Name);
tp->SetAttribute("map", it->second.NewMap);
tp->SetAttribute("sparea", it->second.Spawning);
}
}
// file info block
{
TiXmlElement * files = new TiXmlElement( "files" );
root->LinkEndChild(files);
std::map<std::string, std::string>::const_iterator it2 = wi.Files.begin();
std::map<std::string, std::string>::const_iterator end2 = wi.Files.end();
for(; it2 != end2; ++it2)
{
TiXmlElement * file = new TiXmlElement( "file" );
files->LinkEndChild(file);
file->SetAttribute("name", it2->first);
file->SetAttribute("path", it2->second);
}
}
TiXmlElement * maps = new TiXmlElement( "maps" );
root->LinkEndChild(maps);
std::map<std::string, MapInfo>::const_iterator it = wi.Maps.begin();
std::map<std::string, MapInfo>::const_iterator end = wi.Maps.end();
for(; it != end; ++it)
{
comment = new TiXmlComment();
s="Map of "+it->second.Description;
comment->SetValue(s.c_str());
maps->LinkEndChild( comment );
TiXmlElement * map = new TiXmlElement( "Map" );
maps->LinkEndChild(map);
map->SetAttribute("name", it->first);
map->SetAttribute("type", it->second.Type);
map->SetAttribute("music", it->second.Music);
map->SetAttribute("repeatmusic", it->second.MusicLoop);
TiXmlElement * descm = new TiXmlElement( "description" );
map->LinkEndChild(descm);
descm->LinkEndChild(new TiXmlText(it->second.Description));
// file info block
{
comment = new TiXmlComment();
s="Give the path of the files containing the island information to be loaded";
comment->SetValue(s.c_str());
map->LinkEndChild( comment );
TiXmlElement * files = new TiXmlElement( "files" );
map->LinkEndChild(files);
//.........这里部分代码省略.........
示例10: saveKeys
void input::saveKeys()
{
// printf("saving control file\n");
TiXmlDocument doc;
TiXmlElement* msg;
TiXmlDeclaration * decl = new TiXmlDeclaration("1.0", "", "");
doc.LinkEndChild(decl );
TiXmlElement * root = new TiXmlElement("controls");
doc.LinkEndChild(root );
TiXmlComment * comment = new TiXmlComment();
comment->SetValue("Keyboard mappings");
root->LinkEndChild(comment );
TiXmlElement * msgs = new TiXmlElement("keys");
root->LinkEndChild(msgs );
msg = new TiXmlElement("accept");
msg->SetAttribute("value", input::keys[KEY_ACCEPT]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("accept_d1");
msg->SetAttribute("value", input::keys[KEY_DBG_ACCEPT1]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("accept_d2");
msg->SetAttribute("value", input::keys[KEY_DBG_ACCEPT2]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("cancel");
msg->SetAttribute("value", input::keys[KEY_CANCEL]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("up");
msg->SetAttribute("value", input::keys[KEY_UP]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("up_d");
msg->SetAttribute("value", input::keys[KEY_DBG_UP]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("down");
msg->SetAttribute("value", input::keys[KEY_DOWN]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("down_d");
msg->SetAttribute("value", input::keys[KEY_DBG_DOWN]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("left");
msg->SetAttribute("value", input::keys[KEY_LEFT]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("left_d");
msg->SetAttribute("value", input::keys[KEY_DBG_LEFT]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("right");
msg->SetAttribute("value", input::keys[KEY_RIGHT]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("right_d");
msg->SetAttribute("value", input::keys[KEY_DBG_RIGHT]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("upleft");
msg->SetAttribute("value", input::keys[KEY_UPLEFT]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("upright");
msg->SetAttribute("value", input::keys[KEY_UPRIGHT]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("downleft");
msg->SetAttribute("value", input::keys[KEY_DOWNLEFT]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("downright");
msg->SetAttribute("value", input::keys[KEY_DOWNRIGHT]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("attack");
msg->SetAttribute("value", input::keys[KEY_ATTACK]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("spells");
msg->SetAttribute("value", input::keys[KEY_SPELLS]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("inventory");
msg->SetAttribute("value", input::keys[KEY_INVENTORY]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("interact");
msg->SetAttribute("value", input::keys[KEY_INTERACT]->binding);
msgs->LinkEndChild(msg);
msg = new TiXmlElement("search");
//.........这里部分代码省略.........
示例11: write_SettingsXML
void CSettingsManager::write_SettingsXML()
{
try
{
if(m_Settings.size() > 0)
{
TiXmlDocument doc;
// ToDo: check all TiXml* generations!
TiXmlDeclaration *declaration = new TiXmlDeclaration("1.0", "", "");
doc.LinkEndChild(declaration);
TiXmlComment *autoGenComment = new TiXmlComment();
autoGenComment->SetValue(" THIS IS A AUTO GENERTATED FILE. DO NOT EDIT! ");
doc.LinkEndChild(autoGenComment);
for(SettingsMap::iterator mapIter = m_Settings.begin(); mapIter != m_Settings.end(); mapIter++)
{
vector<string> tokens;
strTokenizer(mapIter->first, SETTINGS_SEPERATOR_STR, tokens);
if(tokens.size() != 3)
{
doc.Clear();
KODI->Log(LOG_ERROR, "Line: %i func: %s, Saving XML-File failed! Wrong SettingsMap string! Please call contact Addon author!\n", __LINE__, __func__, m_XMLFilename.c_str());
return;
}
TiXmlElement *mainCategory = NULL;
// check if this main category is already available
for(TiXmlNode *element = doc.FirstChild(); element && !mainCategory; element = element->NextSiblingElement())
{
if(element->Value() == tokens[0])
{
mainCategory = static_cast<TiXmlElement*>(element);
}
}
if(!mainCategory)
{ // create new main category
mainCategory = new TiXmlElement(tokens[0]);
doc.LinkEndChild(mainCategory);
}
TiXmlElement *settingsGroup = new TiXmlElement("settings_group");
settingsGroup->SetAttribute("sub_category", tokens[1].c_str());
settingsGroup->SetAttribute("group_name", tokens[2].c_str());
mainCategory->LinkEndChild(settingsGroup);
for(CSettingsList::iterator setIter=mapIter->second.begin(); setIter != mapIter->second.end(); setIter++)
{
if(!*setIter)
{
KODI->Log(LOG_ERROR, "Line: %i func: %s, invalid settings element! Please call contact Addon author!\n", __LINE__, __func__);
return;
}
TiXmlElement *setting = new TiXmlElement("setting");
setting->SetAttribute("key", (*setIter)->get_Key().c_str());
switch((*setIter)->get_Type())
{
case ISettingsElement::STRING_SETTING:
setting->SetAttribute("string", STRING_SETTINGS(*setIter)->get_Setting().c_str());
break;
case ISettingsElement::UNSIGNED_INT_SETTING:
setting->SetAttribute("unsigned_int", toString(UNSIGNED_INT_SETTINGS(*setIter)->get_Setting()).c_str());
break;
case ISettingsElement::INT_SETTING:
setting->SetAttribute("int", INT_SETTINGS(*setIter)->get_Setting());
break;
case ISettingsElement::FLOAT_SETTING:
setting->SetDoubleAttribute("float", (double)FLOAT_SETTINGS(*setIter)->get_Setting());
break;
case ISettingsElement::DOUBLE_SETTING:
setting->SetDoubleAttribute("double", DOUBLE_SETTINGS(*setIter)->get_Setting());
break;
case ISettingsElement::BOOL_SETTING:
if(BOOL_SETTINGS(*setIter)->get_Setting())
{
setting->SetAttribute("bool", "true");
}
else
{
setting->SetAttribute("bool", "false");
}
break;
default:
KODI->Log(LOG_ERROR, "Line: %i func: %s, invalid settings type! Please call contact Addon author!\n", __LINE__, __func__);
return;
break;
}
settingsGroup->LinkEndChild(setting);
}
}
if(!doc.SaveFile(m_XMLFilename.c_str()))
//.........这里部分代码省略.........