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; }
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 ""; }