~singpolyma/biboumi

cb718def0cb51aac4c2125e3864522740fcb2573 — Florent Le Coz 10 years ago fb01f78
Put utils::tolower definition in its own cpp file
3 files changed, 15 insertions(+), 8 deletions(-)

M CMakeLists.txt
A src/utils/tolower.cpp
M src/utils/tolower.hpp
M CMakeLists.txt => CMakeLists.txt +1 -0
@@ 34,6 34,7 @@ if((NOT ${POLLER} MATCHES "POLL") AND
    (NOT ${POLLER} MATCHES "EPOLL"))
  message(FATAL_ERROR "POLLER must be either POLL or EPOLL")
endif()

#
## utils
#

A src/utils/tolower.cpp => src/utils/tolower.cpp +13 -0
@@ 0,0 1,13 @@
#include <utils/tolower.hpp>

namespace utils
{
  std::string tolower(const std::string& original)
  {
    std::string res;
    res.reserve(original.size());
    for (const char c: original)
      res += static_cast<char>(std::tolower(c));
    return res;
  }
}

M src/utils/tolower.hpp => src/utils/tolower.hpp +1 -8
@@ 5,14 5,7 @@

namespace utils
{
  std::string tolower(const std::string& original)
  {
    std::string res;
    res.reserve(original.size());
    for (const char c: original)
      res += static_cast<char>(std::tolower(c));
    return res;
  }
  std::string tolower(const std::string& original);
}

#endif // SPLIT_INCLUDED