From 6fde6b0fe90abde84011202edd40fe46eb06af44 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 21 Nov 2010 16:20:55 +0000 Subject: --- src/conf/conf.cpp | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'src/conf/conf.cpp') diff --git a/src/conf/conf.cpp b/src/conf/conf.cpp index 824bf9c..14268d1 100644 --- a/src/conf/conf.cpp +++ b/src/conf/conf.cpp @@ -1,12 +1,11 @@ /*:* *: File: ./src/conf/conf.cpp *: - *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow *: Copyright (C) 2005 EXA Digital Solutions GbR - *: Copyright (C) 2006, 2007 Paul C. Buetow *: *: This program is free software; you can redistribute it and/or *: modify it under the terms of the GNU General Public License @@ -33,14 +32,12 @@ using namespace std; conf::conf( string s_conf, map* p_main_loop_params ) : name::name( s_conf ) { - string s_check[] = - { - get_name(), - string(getenv("HOME"))+string("/.ychat/") + get_name(), - string("./etc/") + get_name(), - string("/etc/") + get_name(), - string(PREFIX+string("etc/")+get_name()) - }; + string s_check[] = { + get_name(), + string(getenv("HOME"))+string("/.ychat/") + get_name(), + string("./etc/") + get_name(), + string("/etc/") + get_name(), + string(PREFIX+string("etc/")+get_name()) }; string s_config; @@ -48,7 +45,7 @@ conf::conf( string s_conf, map* p_main_loop_params ) : name::name { cout << "Checking for " << s_check[i]; ifstream if_check( s_check[i].c_str() ); - if ( if_check ) + if( if_check ) { s_config = s_check[i]; if_check.close(); @@ -204,19 +201,13 @@ conf::get_int(string s_key) return tool::string2int(get_elem(s_key)); } -bool -conf::get_bool(string s_key) -{ - return get_elem(s_key).compare("true") == 0; -} - vector conf::get_vector(string s_key) { vector vec_ret; string s_val = get_elem(s_key); - for (size_type i_pos = s_val.find(" "); i_pos != string::npos; i_pos = s_val.find(" ")) + for (unsigned i_pos = s_val.find(" "); i_pos != string::npos; i_pos = s_val.find(" ")) { vec_ret.push_back(s_val.substr(0, i_pos)); s_val = s_val.substr(i_pos+1); -- cgit v1.2.3