~singpolyma/biboumi

ref: 2df0ebf2dfed1dcbf80c92bff8361e2a04581bec biboumi/src/utils/empty_if_fixed_server.hpp -rw-r--r-- 526 bytes
2df0ebf2 — Florent Le Coz Add support for a fixed_irc_server configuration 7 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 */