10 #ifndef CTRL_UTILS_STRING_H_
11 #define CTRL_UTILS_STRING_H_
22 inline std::string ToString(
const T& value) {
32 inline std::string ToString(
const std::string& value) {
40 inline void ToString(std::string& str,
const T& value) {
41 str = ToString(value);
48 inline void FromString(
const std::string& str, T& value) {
49 std::stringstream ss(str);
67 inline void FromString(
const std::string& str, std::string& value) {
71 #if __cplusplus >= 201703L
74 #include <string_view>
79 inline T
FromString(
const std::string_view& str) {
86 inline void FromString(
const std::string& str, std::string_view& value) {
92 inline std::ostream& bold(std::ostream& os) {
return os <<
"\e[1m"; }
93 inline std::ostream& underline(std::ostream& os) {
return os <<
"\e[4m"; }
94 inline std::ostream& bold_underline(std::ostream& os) {
return os <<
"\e[1;4m"; }
95 inline std::ostream& normal(std::ostream& os) {
return os <<
"\e[0m"; }
Definition: ctrl_utils.cc:18
nlohmann::json FromString(const std::string &str)
Definition: json.h:27