void LibreOfficeInspector::_readLanguage()
{
	XmlParser parser;
	wstring lang_found, file;	

	_getPreferencesFile(file);

	if (parser.Load(file))
	{
		parser.Parse(_readNodeCallback, &lang_found);

		if (m_version.size() > 0 && lang_found.size() == 0)
		{
			wstring locale;

			_readLocale(locale);
			lang_found = L"locale:" + locale;
		}

		g_log.Log(L"LibreOfficeInspector::_readLanguage. Preferences file '%s', language '%s'", (wchar_t *)file.c_str(), 
			(wchar_t *) lang_found.c_str());		
	}
	else
	{
		g_log.Log(L"LibreOfficeInspector::_readLanguage. Could not open '%s'", (wchar_t *) file.c_str());
	}

	m_KeyValues.push_back(InspectorKeyValue(L"lang",lang_found));
}
void ConfigurationRemoteXmlParser::Parse()
{
	XmlParser parser;	
	
	if (parser.Load(m_file) == false)
	{
		g_log.Log(L"ConfigurationXmlParser::Parse. Could not open / error parsing '%s'", (wchar_t *) m_file.c_str());
		return;
	}

	m_configurationBlock = ConfigurationBlockNone;
	parser.Parse(_readNodeCallback, this);
}
Esempio n. 3
0
bool SkypeProfile::_readDefaultAccount(wstring& account)
{
	XmlParser parser;
	wstring file;	

	_getSharedFile(file);

	if (parser.Load(file) == false)
	{
		g_log.Log(L"SkypeProfile::_readDefaultAccount. Could not open '%s'", (wchar_t *) file.c_str());
		return false;
	}
	parser.Parse(_readDefaultAccountNodeCallback, &account);
	return account.size() > 0;
}
Esempio n. 4
0
bool SkypeProfile::_readDefaultAccountLanguage(wstring& language)
{
	XmlParser parser;
	wstring file, account;

	if (_readDefaultAccount(account) == false)
		return false;
	
	_getConfigFile(file, account);
	if (parser.Load(file) == false)
	{
		g_log.Log(L"SkypeProfile::_readDefaultAccountLanguage. Could not open '%s'", (wchar_t *) file.c_str());
		return false;
	}

	parser.Parse(_readDefaultAccountLanguageNodeCallback, &language);
	return language.size() >0;
}
bool OpenOfficeAction::_isDefaultLanguage()
{
	XmlParser parser;
	wstring lang_found, file;
	bool bRslt;

	_getPreferencesFile(file);

	if (parser.Load(file) == false)
	{
		g_log.Log(L"OpenOfficeAction::_isDefaultLanguage. Could not open '%s'", (wchar_t *) file.c_str());
		return false;
	}
	parser.Parse(_readNodeCallback, &lang_found);
	// TODO: We should look for != "ca" but right now we can only add Catalan if no language is present
	bRslt = lang_found.size() != 0;
	g_log.Log(L"OpenOfficeAction::_isDefaultLanguage. Preferences file '%s', isdefault %u", (wchar_t *)file.c_str(), (wchar_t *) bRslt);
	return bRslt;
}
Esempio n. 6
0
void ColladaParser::Parse(const char* colladaFileData)
{
	XmlParser p;
	p.Parse(colladaFileData);

	if (p.root.tagName != "COLLADA")
		throw "expected COLLADA as root element";

	if (!p.root.HasAttribute("xmlns", "http://www.collada.org/2005/11/COLLADASchema") || !p.root.HasAttribute("version", "1.4.1"))
		throw "expected COLLADA as root element";

	XmlElement* root = &p.root;

	{
		auto v = root->Child("library_geometries")->Childs("geometry");

		for (int ia = 0; ia < v.size(); ia++)
			ReadGeometry(v[ia]);
	}

	if (root->HasChild("library_animations"))
	{
		auto v = root->Child("library_animations")->Childs("animation");

		for (int ia = 0; ia < v.size(); ia++)
			ReadAnimations(v[ia]);
	}

	{
		auto v = root->Child("library_visual_scenes")->Childs("visual_scene");

		for (int ia = 0; ia < v.size(); ia++)
		{
			ReadScene(v[ia]);
		}
	}

	auto sceneId = ReadId(root->Child("scene")->Child("instance_visual_scene")->Attribute("url"));
	currentScene = &scenes[sceneId];
	int x = 2;
}