libmoost
|
Namespaces | |
namespace | scope_exit |
Classes | |
class | benchmark |
class | fixed_interval_timer |
A fixed interval timer. More... | |
class | histogram |
class | relops |
Sub-class this to implement relops in your class. More... | |
class | singleton_default |
class | stopwatch |
class | scoped_stopwatch |
class | YesNo |
Functions | |
void | assert_absolute_path (const boost::filesystem::path &path, const std::string &what="", bool accept_empty_path=true) |
template<typename unsigned_intT > | |
unsigned_intT | next_power_of_two (unsigned_intT num) |
template<typename unsigned_intT > | |
bool | is_power_of_two (unsigned_intT num) |
template<typename unsigned_intT > | |
signed char | msb_set (unsigned_intT num) |
std::string | demangle_name (char const *name) |
std::string | short_function_name (char const *name) |
template<class T > | |
std::string | stringify (const T &val, size_t truncate=0) |
template<class T > | |
void | streamstringify (std::ostream &os, const T &val, size_t=0) |
template<class T1 , class T2 > | |
void | streamstringify (std::ostream &os, const std::pair< T1, T2 > &val, size_t truncate=0) |
template<class T > | |
void | streamstringify (std::ostream &os, const std::set< T > &val, size_t truncate=0) |
template<class T > | |
void | streamstringify (std::ostream &os, const std::vector< T > &val, size_t truncate=0) |
template<class T1 , class T2 > | |
void | streamstringify (std::ostream &os, const std::map< T1, T2 > &val, size_t truncate=0) |
void moost::utils::assert_absolute_path | ( | const boost::filesystem::path & | path, |
const std::string & | what = "" , |
||
bool | accept_empty_path = true |
||
) |
std::string moost::utils::demangle_name | ( | char const * | name | ) | [inline] |
Definition at line 57 of file demangler.hpp.
bool moost::utils::is_power_of_two | ( | unsigned_intT | num | ) |
signed char moost::utils::msb_set | ( | unsigned_intT | num | ) |
unsigned_intT moost::utils::next_power_of_two | ( | unsigned_intT | num | ) |
std::string moost::utils::short_function_name | ( | char const * | name | ) | [inline] |
Definition at line 98 of file demangler.hpp.
void moost::utils::streamstringify | ( | std::ostream & | os, |
const T & | val, | ||
size_t | = 0 |
||
) |
void moost::utils::streamstringify | ( | std::ostream & | os, |
const std::pair< T1, T2 > & | val, | ||
size_t | truncate = 0 |
||
) |
void moost::utils::streamstringify | ( | std::ostream & | os, |
const std::set< T > & | val, | ||
size_t | truncate = 0 |
||
) |
void moost::utils::streamstringify | ( | std::ostream & | os, |
const std::vector< T > & | val, | ||
size_t | truncate = 0 |
||
) |
void moost::utils::streamstringify | ( | std::ostream & | os, |
const std::map< T1, T2 > & | val, | ||
size_t | truncate = 0 |
||
) |
std::string moost::utils::stringify | ( | const T & | val, |
size_t | truncate | ||
) |
Turn complex data structures into plain strings.
Usage is pretty simple: just call stringify with an arbitrarily nested data structure argument and it will turn its contents into a string representation. It's a bit like Perl's Data::Dumper for C++.
You can add support for your own types by overloading the template.
Definition at line 73 of file stringify.hpp.