Fawkes API  Fawkes Development Version
fawkes::StringConversions Class Reference

Utility class that holds string methods. More...

#include <>>

Static Public Member Functions

static std::string to_upper (std::string str)
 Convert string to all-uppercase string. More...
 
static std::string to_lower (std::string str)
 Convert string to all-lowercase string. More...
 
static std::string to_string (unsigned int i)
 Convert unsigned int value to a string. More...
 
static std::string to_string (int i)
 Convert int value to a string. More...
 
static std::string to_string (long int i)
 Convert long int value to a string. More...
 
static std::string to_string (float f)
 Convert float value to a string. More...
 
static std::string to_string (double d)
 Convert double value to a string. More...
 
static std::string to_string (bool b)
 Convert bool value to a string. More...
 
static std::string to_string (std::string &s)
 No-op conversion of string. More...
 
static unsigned int to_uint (std::string s)
 Convert string to an unsigned int value. More...
 
static int to_int (std::string s)
 Convert string to an int value. More...
 
static long to_long (std::string s)
 Convert string to a long int value. More...
 
static float to_float (std::string s)
 Convert string to a float value. More...
 
static double to_double (std::string s)
 Convert string to a double value. More...
 
static bool to_bool (std::string s)
 Convert string to a bool value. More...
 
static void trim_inplace (std::string &s)
 Trim string. More...
 
static std::string trim (std::string &s)
 Trim spring. More...
 
static std::string resolve_path (std::string s)
 Resolves path-string with @...@ tags. More...
 
static std::vector< std::string > resolve_paths (std::vector< std::string > s)
 Resolves vector of path-string with @...@ tags. More...
 

Detailed Description

Utility class that holds string methods.

Author
Tim Niemueller

Definition at line 33 of file string_conversions.h.

Member Function Documentation

◆ resolve_path()

std::string fawkes::StringConversions::resolve_path ( std::string  s)
static

Resolves path-string with @...@ tags.

Parameters
sstring to resolve
Returns
path

Definition at line 284 of file string_conversions.cpp.

Referenced by resolve_paths(), and to_string().

◆ resolve_paths()

std::vector< std::string > fawkes::StringConversions::resolve_paths ( std::vector< std::string >  s)
static

Resolves vector of path-string with @...@ tags.

Parameters
sstrings to resolve
Returns
vector of resolved paths

Definition at line 309 of file string_conversions.cpp.

References resolve_path().

Referenced by to_string().

◆ to_bool()

bool fawkes::StringConversions::to_bool ( std::string  s)
static

Convert string to a bool value.

Parameters
sstring to convert
Returns
value as represented by string

Definition at line 240 of file string_conversions.cpp.

Referenced by fawkes::NavGraph::default_property_as_bool(), fawkes::NavGraphEdge::property_as_bool(), fawkes::NavGraphNode::property_as_bool(), and to_string().

◆ to_double()

double fawkes::StringConversions::to_double ( std::string  s)
static

Convert string to a double value.

Parameters
sstring to convert
Returns
value as represented by string

Definition at line 229 of file string_conversions.cpp.

Referenced by to_string().

◆ to_float()

float fawkes::StringConversions::to_float ( std::string  s)
static

Convert string to a float value.

Parameters
sstring to convert
Returns
value as represented by string

Definition at line 218 of file string_conversions.cpp.

Referenced by fawkes::NavGraph::default_property_as_float(), fawkes::NavGraphEdge::property_as_float(), fawkes::NavGraphNode::property_as_float(), and to_string().

◆ to_int()

int fawkes::StringConversions::to_int ( std::string  s)
static

Convert string to an int value.

Parameters
sstring to convert
Returns
value as represented by string

Definition at line 197 of file string_conversions.cpp.

Referenced by fawkes::NavGraph::default_property_as_int(), InterfaceParser::parse(), fawkes::NavGraphEdge::property_as_int(), fawkes::NavGraphNode::property_as_int(), and to_string().

◆ to_long()

long fawkes::StringConversions::to_long ( std::string  s)
static

Convert string to a long int value.

Parameters
sstring to convert
Returns
value as represented by string

Definition at line 207 of file string_conversions.cpp.

Referenced by ClipsWebRequestProcessor::process_request(), and to_string().

◆ to_lower()

std::string fawkes::StringConversions::to_lower ( std::string  str)
static

Convert string to all-lowercase string.

Parameters
strstring to convert
Returns
converted string

Definition at line 66 of file string_conversions.cpp.

◆ to_string() [1/7]

◆ to_string() [2/7]

std::string fawkes::StringConversions::to_string ( int  i)
static

Convert int value to a string.

Parameters
ivalue to convert
Returns
string representation of value.

Definition at line 98 of file string_conversions.cpp.

◆ to_string() [3/7]

std::string fawkes::StringConversions::to_string ( long int  i)
static

Convert long int value to a string.

Parameters
ivalue to convert
Returns
string representation of value.

Definition at line 116 of file string_conversions.cpp.

◆ to_string() [4/7]

std::string fawkes::StringConversions::to_string ( float  f)
static

Convert float value to a string.

Parameters
fvalue to convert
Returns
string representation of value.

Definition at line 134 of file string_conversions.cpp.

◆ to_string() [5/7]

std::string fawkes::StringConversions::to_string ( double  d)
static

Convert double value to a string.

Parameters
dvalue to convert
Returns
string representation of value.

Definition at line 152 of file string_conversions.cpp.

◆ to_string() [6/7]

std::string fawkes::StringConversions::to_string ( bool  b)
static

Convert bool value to a string.

Parameters
bvalue to convert
Returns
string representation of value.

Definition at line 170 of file string_conversions.cpp.

◆ to_string() [7/7]

static std::string fawkes::StringConversions::to_string ( std::string &  s)
inlinestatic

No-op conversion of string.

Parameters
svalue to convert
Returns
string the very same string

Definition at line 45 of file string_conversions.h.

References resolve_path(), resolve_paths(), to_bool(), to_double(), to_float(), to_int(), to_long(), to_uint(), trim(), and trim_inplace().

◆ to_uint()

unsigned int fawkes::StringConversions::to_uint ( std::string  s)
static

Convert string to an unsigned int value.

Parameters
sstring to convert
Returns
value as represented by string

Definition at line 185 of file string_conversions.cpp.

Referenced by to_string().

◆ to_upper()

std::string fawkes::StringConversions::to_upper ( std::string  str)
static

Convert string to all-uppercase string.

Parameters
strstring to convert
Returns
converted string

Definition at line 52 of file string_conversions.cpp.

Referenced by CppInterfaceGenerator::CppInterfaceGenerator(), and PluginGenerator::PluginGenerator().

◆ trim()

std::string fawkes::StringConversions::trim ( std::string &  s)
static

Trim spring.

Removes spaces at beginning and end of string.

Parameters
sstring to trim
Returns
trimmed string

Definition at line 271 of file string_conversions.cpp.

Referenced by to_string().

◆ trim_inplace()

void fawkes::StringConversions::trim_inplace ( std::string &  s)
static

Trim string.

Removes spaces at beginning and end of string.

Parameters
sstring to trim, upon return contains trimmed string

Definition at line 256 of file string_conversions.cpp.

Referenced by to_string().


The documentation for this class was generated from the following files: