diff options
| author | admin (centauri.fritz.box) <puppet@mx.buetow.org> | 2014-07-01 20:17:01 +0200 |
|---|---|---|
| committer | admin (centauri.fritz.box) <puppet@mx.buetow.org> | 2014-07-01 20:17:01 +0200 |
| commit | 174529af9197d99d2c5e8f75798fb6d6d9247254 (patch) | |
| tree | 7bdb29f9391b5a3d3629bba3ebec1ca7832b3c9c /src/conf | |
| parent | 751eada68e49f9ffae9a0be743d88a3ce956883f (diff) | |
| parent | 6fde6b0fe90abde84011202edd40fe46eb06af44 (diff) | |
Diffstat (limited to 'src/conf')
| -rw-r--r-- | src/conf/conf.cpp | 17 | ||||
| -rw-r--r-- | src/conf/conf.h | 5 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/conf/conf.cpp b/src/conf/conf.cpp index a8b8410..dee678c 100644 --- a/src/conf/conf.cpp +++ b/src/conf/conf.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/conf/conf.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow @@ -201,4 +201,19 @@ conf::get_int(string s_key) return tool::string2int(get_elem(s_key)); } +vector<string> +conf::get_vector(string s_key) +{ + vector<string> vec_ret; + string s_val = get_elem(s_key); + + 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); + } + + vec_ret.push_back(s_val); + return vec_ret; +} #endif diff --git a/src/conf/conf.h b/src/conf/conf.h index 2353422..065fe65 100644 --- a/src/conf/conf.h +++ b/src/conf/conf.h @@ -1,7 +1,7 @@ /*:* *: File: ./src/conf/conf.h *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow @@ -47,7 +47,8 @@ public: ~conf(); string colored_error_msg(string s_key); //<< - int get_int(string s_key); + int get_int(string s_key); + vector<string> get_vector(string s_key); }; #endif |
