Functions
oomph::StringConversion Namespace Reference

Functions

std::string to_lower (const std::string &input)
 Convert a string to lower case (outputs a copy). More...
 
std::string to_upper (const std::string &input)
 Convert a string to upper case (outputs a copy). More...
 
void split_string (const std::string &s, char delim, Vector< std::string > &elems)
 Split a string, s, into a vector of strings where ever there is an instance of delimiter (i.e. is delimiter is " " will give a list of words). Note that mutliple delimiters in a row will give empty strings. More...
 
Vector< std::string > split_string (const std::string &s, char delim)
 Split a string, s, into a vector of strings where ever there is an instance of delimiter (i.e. is delimiter is " " will give a list of words). Note that mutliple delimiters in a row will give empty strings. Return by value. More...
 
template<class T >
std::string to_string (T object, unsigned float_precision=8)
 Conversion function that should work for anything with operator<< defined (at least all basic types). More...
 

Detailed Description

Conversion functions for easily making strings (e.g. for filenames - to avoid stack smashing problems with cstrings and long filenames).

Function Documentation

void oomph::StringConversion::split_string ( const std::string &  s,
char  delim,
Vector< std::string > &  elems 
)

Split a string, s, into a vector of strings where ever there is an instance of delimiter (i.e. is delimiter is " " will give a list of words). Note that mutliple delimiters in a row will give empty strings.

Split a string, s, into a vector of strings where ever there is an instance of delimiter (i.e. is delimiter is " " will give a list of words). Note that multiple delimiters in a row will give empty strings.

Definition at line 598 of file oomph_utilities.cc.

References oomph::Global_string_for_annotation::string().

Referenced by split_string().

Vector< std::string > oomph::StringConversion::split_string ( const std::string &  s,
char  delim 
)

Split a string, s, into a vector of strings where ever there is an instance of delimiter (i.e. is delimiter is " " will give a list of words). Note that mutliple delimiters in a row will give empty strings. Return by value.

Split a string, s, into a vector of strings where ever there is an instance of delimiter (i.e. is delimiter is " " will give a list of words). Note that multiple delimiters in a row will give empty strings. Return by value.

Definition at line 613 of file oomph_utilities.cc.

References split_string().

std::string oomph::StringConversion::to_lower ( const std::string &  input)

Convert a string to lower case (outputs a copy).

Definition at line 574 of file oomph_utilities.cc.

References oomph::output(), and oomph::Global_string_for_annotation::string().

template<class T >
std::string oomph::StringConversion::to_string ( object,
unsigned  float_precision = 8 
)
std::string oomph::StringConversion::to_upper ( const std::string &  input)

Convert a string to upper case (outputs a copy).

Definition at line 585 of file oomph_utilities.cc.

References oomph::output(), and oomph::Global_string_for_annotation::string().