diff options
author | Florent Le Coz <louiz@louiz.org> | 2015-02-26 17:43:24 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2015-02-26 17:43:24 +0100 |
commit | 82256d40a32e1401c7884b1c9ff26ea77d775d3d (patch) | |
tree | 0661670f87c6cca2b43f2a35bc5c5d71ccfff78a /src/utils/empty_if_fixed_server.hpp | |
parent | c01befb054075ab414fd602859e5999a138aa5bf (diff) | |
parent | c307df85c8e7d9bcd4570269bf13c3e92c3f5954 (diff) | |
download | biboumi-82256d40a32e1401c7884b1c9ff26ea77d775d3d.tar.gz biboumi-82256d40a32e1401c7884b1c9ff26ea77d775d3d.tar.bz2 biboumi-82256d40a32e1401c7884b1c9ff26ea77d775d3d.tar.xz biboumi-82256d40a32e1401c7884b1c9ff26ea77d775d3d.zip |
Merge branch 'fixed_server'
Diffstat (limited to 'src/utils/empty_if_fixed_server.hpp')
-rw-r--r-- | src/utils/empty_if_fixed_server.hpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/utils/empty_if_fixed_server.hpp b/src/utils/empty_if_fixed_server.hpp new file mode 100644 index 0000000..8739fd9 --- /dev/null +++ b/src/utils/empty_if_fixed_server.hpp @@ -0,0 +1,26 @@ +#ifndef EMPTY_IF_FIXED_SERVER_HPP_INCLUDED +#define EMPTY_IF_FIXED_SERVER_HPP_INCLUDED + +#include <string> + +#include <config/config.hpp> + +namespace utils +{ + inline std::string empty_if_fixed_server(std::string&& str) + { + if (!Config::get("fixed_irc_server", "").empty()) + return {}; + return str; + } + + inline std::string empty_if_fixed_server(const std::string& str) + { + if (!Config::get("fixed_irc_server", "").empty()) + return {}; + return str; + } + +} + +#endif /* EMPTY_IF_FIXED_SERVER_HPP_INCLUDED */ |