Functions
utl::String Namespace Reference

Functions

template<typename T >
std::string AsBinary (const T &number, const int maxBits=8 *sizeof(T), const char separator= ' ', const int stride=4)
 converts integer-type numbers into a string of binary representation More...
 
template<typename T >
std::pair< double, char > AsHumanReadable (const T &x, const int thousand=1000)
 
template<class T >
std::vector< T > AsVectorOf (const std::string &str)
 
template<typename Geo , typename CS >
std::string Make (const Geo &g, const CS &cs, const double unit=1, const std::string &sep=" ")
 
string OfAlreadySortedIds (const vector< int > &ids)
 
template<typename Map >
std::string OfMapKeys (const Map &m, const std::string &quote="'", const std::string &separator=", ")
 
string OfSortedIds (vector< int > ids)
 
string OfSortedIds (const set< int > &ids)
 
std::string OfSortedIds (std::vector< int > ids)
 
std::string OfSortedIds (const std::set< int > &ids)
 
template<typename T , typename = typename std::enable_if<std::is_integral<T>::value, T>::type>
const char * Plural (const T n)
 
template<class Container , typename T = typename Container::value_type>
const char * Plural (const Container &c)
 
vector< string > Split (const string &str, const char *const separators)
 
std::vector< std::string > Split (const std::string &str, const char *const separators=" ")
 
std::string Strip (std::string str)
 

Function Documentation

template<typename T >
std::string utl::String::AsBinary ( const T &  number,
const int  maxBits = 8*sizeof(T),
const char  separator = ' ',
const int  stride = 4 
)
template<typename T >
std::pair<double, char> utl::String::AsHumanReadable ( const T &  x,
const int  thousand = 1000 
)

Definition at line 156 of file String.h.

References utl::m.

template<class T >
std::vector<T> utl::String::AsVectorOf ( const std::string &  str)
inline

Definition at line 78 of file String.h.

template<typename Geo , typename CS >
std::string utl::String::Make ( const Geo &  g,
const CS &  cs,
const double  unit = 1,
const std::string &  sep = " " 
)
inline
string utl::String::OfAlreadySortedIds ( const vector< int > &  ids)

Function returns string of sorted sequence of integers. Consecutive incresing numbers are displayed in short notation using range ".." symbol. Useful for outputs of ids.

Author
Darko Veberic
Date
14 Jul 2006

Definition at line 33 of file String.cc.

Referenced by OfSortedIds().

template<typename Map >
std::string utl::String::OfMapKeys ( const Map &  m,
const std::string &  quote = "'",
const std::string &  separator = ", " 
)
inline

Definition at line 116 of file String.h.

Referenced by det::ManagerRegister::InterpretXML().

string utl::String::OfSortedIds ( vector< int >  ids)
string utl::String::OfSortedIds ( const set< int > &  ids)

Definition at line 73 of file String.cc.

References OfAlreadySortedIds().

std::string utl::String::OfSortedIds ( std::vector< int >  ids)
std::string utl::String::OfSortedIds ( const std::set< int > &  ids)
template<typename T , typename = typename std::enable_if<std::is_integral<T>::value, T>::type>
const char* utl::String::Plural ( const T  n)
inline
template<class Container , typename T = typename Container::value_type>
const char* utl::String::Plural ( const Container &  c)
inline

Definition at line 109 of file String.h.

vector<string> utl::String::Split ( const string &  str,
const char *const  separators 
)

Definition at line 13 of file String.cc.

Referenced by io::CorsikaShowerFile::ReadProfile().

std::vector<std::string> utl::String::Split ( const std::string &  str,
const char *const  separators = " " 
)

Definition at line 13 of file String.cc.

Referenced by io::CorsikaShowerFile::ReadProfile().

std::string utl::String::Strip ( std::string  str)
inline

Definition at line 87 of file String.h.


, generated on Tue Sep 26 2023.