예제 #1
0
	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;
		}
	}
예제 #2
0
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);
}
예제 #3
0
bool TextAllTable::LoadFromXml(char* pszFileName)
{
	WCHAR* pwszFileName = Ntl_MB2WC(pszFileName);
	if (NULL == pwszFileName)
	{
		return false;
	}

	bool bResult = LoadFromXml(pwszFileName);

	Ntl_CleanUpHeapStringW(pwszFileName);

	return bResult;
}
예제 #4
0
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;
	}
}
예제 #5
0
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;

}