CppTools
Loading...
Searching...
No Matches
StrTools.hpp
Go to the documentation of this file.
1
11#ifndef CPP_TOOLS_STR_TOOLS_HPP
12#define CPP_TOOLS_STR_TOOLS_HPP
13
14#include <string>
15#include <sstream>
16#include <iomanip>
17
19namespace CppTools
20{
25 int utf8_strlen(const std::string& str);
31 std::string DtoStr(const double val, const int precision = 2);
38 std::string RemoveObsoletePrecision(std::string str);
45 std::string RemoveObsoletePrecision(const double value);
50 std::string BtoStr(const bool val);
51}
52
53#endif /* CPP_TOOLS_STR_TOOLS_HPP */
std::string BtoStr(const bool val)
Converts bool into std::string.
Definition StrTools.cpp:55
std::string RemoveObsoletePrecision(std::string str)
Removes every 0 until first non-zero value from right to left after the dot.
Definition StrTools.cpp:31
std::string DtoStr(const double val, const int precision=2)
Converts double to std::string with the given precision.
Definition StrTools.cpp:48
int utf8_strlen(const std::string &str)
Returns the length of the std::string type variable.
Definition StrTools.cpp:16