Exemplo n.º 1
0
DB::DB(void)
{
	Configuration *config = Configuration::GetInstance();

	// Initialisation de mysql
	mysql = mysql_init(0);
	mysql_options(mysql, MYSQL_SET_CHARSET_NAME, "UTF8");

	// Connection à la base
	if(!mysql_real_connect(mysql,config->Get("mysql.host"),config->Get("mysql.user"),config->Get("mysql.password"),config->Get("mysql.database"),0,0,0))
		throw Exception("DB",mysql_error(mysql));

	res=0;
	is_copy = false;
}
Exemplo n.º 2
0
string CountryIdentifier::getCountry(string key) {
		Configuration   config;
		string name;
		config.Load("./CountriesMapping.cfg");
		World w;
		if (config.Get(key, name))
		{
			//Country c = w.CountrieList.at(name);
			return name;
		}
		else
		{
			return "";
		}
	
	return "";
}