void Settings::LoadFromXml(xml_node& node) { settings = map<string, Setting>(); for (auto settingNode : node.children("setting")) { auto set = Setting(); set.LoadFromXml(settingNode); settings[set.name] = set; } }
bool CPdpManager::LoadOptionsFile(const std::string& projFile) { string opt = projFile; int fileEnd = projFile.rfind('.'); if (fileEnd != -1) opt = opt.substr(0, fileEnd); opt += ".opt"; return LoadFromXml(opt); }
bool TextAllTable::LoadFromXml(char* pszFileName) { WCHAR* pwszFileName = Ntl_MB2WC(pszFileName); if (NULL == pwszFileName) { return false; } bool bResult = LoadFromXml(pwszFileName); Ntl_CleanUpHeapStringW(pwszFileName); return bResult; }
void GuiManager::DoKeyDown(int key) { KeyDown[key] = 1; switch(key) { case 'g': SelectVisualMode(); break; case 'l': { m_LayerManager.RemoveAllLayers(); LoadFromXml(); } break; case '-': m_timer.TogglePause(); break; } }
bool CPdpManager::LoadFromFile(const string& fromFile ) { New(); if (fromFile.find(".hap") != fromFile.npos) { if (LoadFromXml(fromFile)) { SortGroups(); LoadOptionsFile(fromFile); StoreFileModTime(fromFile); StorePathFile(fromFile); return true; } return false; } fstream file( fromFile.c_str(), ios::in ); if( file.good() ) { StoreFileModTime(fromFile); StorePathFile(fromFile); string line = ""; do { char ch; file.read( &ch, 1 ); if( ch ) { if( ch == '\n' ) { if( !ProcessLine( line ) ) { return false; } line = ""; } else { line += ch; } } else { break; } } while( !file.eof() ); file.close(); } SortGroups(); return true; }