Ejemplo n.º 1
0
void ScriptTestSetup(ScriptInterface& ifc)
{
	ifc.RegisterFunction<void, std::wstring, script_TS_FAIL>("TS_FAIL");

	// Load the TS_* function definitions
	// (We don't use VFS because tests might not have the normal VFS paths loaded)
	OsPath path = DataDir()/"tests"/"test_setup.js";
	std::ifstream ifs(OsString(path).c_str());
	ENSURE(ifs.good());
	std::string content((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
	std::wstring wcontent(content.begin(), content.end());
	bool ok = ifc.LoadScript(L"test_setup.js", wcontent);
	ENSURE(ok);
}
Ejemplo n.º 2
0
bool XMLParser::getProperties(_xmlAttr * properties, map<wstring, wstring> & attrMap)
{
	for(_xmlAttr * childprop = properties;
		childprop;
		childprop = childprop->next)
	{
		
		for(xmlNode * child = childprop->children;
			child;
			child = child->next)
		{
			string name = (char*)childprop->name;
			string content = (char*)childprop->children->content;
			wstring wname(name.begin(), name.end());
			wstring wcontent(content.begin(), content.end());
			attrMap[wname] = wcontent;
		}
	}
	return true;
}