g2o
|
Files | |
file | misc.h |
some general case utility functions | |
file | timeutil.h |
utility functions for handling time related stuff | |
Namespaces | |
g2o | |
Macros | |
#define | DO_EVERY_TS(secs, currentTime, code) |
#define | DO_EVERY(secs, code) DO_EVERY_TS(secs, g2o::get_time(), code) |
Executes code, only if secs are gone since last exec. More... | |
#define | MEASURE_TIME(text, code) |
#define | MEASURE_FUNCTION_TIME g2o::ScopeTime scopeTime(__PRETTY_FUNCTION__) |
Functions | |
std::string | g2o::trim (const std::string &s) |
std::string | g2o::trimLeft (const std::string &s) |
std::string | g2o::trimRight (const std::string &s) |
std::string | g2o::strToLower (const std::string &s) |
std::string | g2o::strToUpper (const std::string &s) |
template<typename OutputIterator > | |
OutputIterator | g2o::readInts (const char *str, OutputIterator out) |
template<typename OutputIterator > | |
OutputIterator | g2o::readFloats (const char *str, OutputIterator out) |
std::string | g2o::formatString (const char *fmt,...) |
int | g2o::strPrintf (std::string &str, const char *fmt,...) |
template<typename T > | |
bool | g2o::convertString (const std::string &s, T &x, bool failIfLeftoverChars=true) |
template<typename T > | |
T | g2o::stringToType (const std::string &s, bool failIfLeftoverChars=true) |
bool | g2o::strStartsWith (const std::string &s, const std::string &start) |
bool | g2o::strEndsWith (const std::string &s, const std::string &end) |
std::string | g2o::strExpandFilename (const std::string &filename) |
std::vector< std::string > | g2o::strSplit (const std::string &str, const std::string &delimiters) |
int | g2o::readLine (std::istream &is, std::stringstream ¤tLine) |
#define DO_EVERY | ( | secs, | |
code | |||
) | DO_EVERY_TS(secs, g2o::get_time(), code) |
Executes code, only if secs are gone since last exec.
Definition at line 66 of file timeutil.h.
#define DO_EVERY_TS | ( | secs, | |
currentTime, | |||
code | |||
) |
Executes code, only if secs are gone since last exec. extended version, in which the current time is given, e.g., timestamp of IPC message
Definition at line 50 of file timeutil.h.
#define MEASURE_FUNCTION_TIME g2o::ScopeTime scopeTime(__PRETTY_FUNCTION__) |
Definition at line 127 of file timeutil.h.
#define MEASURE_TIME | ( | text, | |
code | |||
) |
Definition at line 70 of file timeutil.h.
bool g2o::convertString | ( | const std::string & | s, |
T & | x, | ||
bool | failIfLeftoverChars = true |
||
) |
convert a string into an other type.
Definition at line 125 of file string_tools.h.
G2O_STUFF_API std::string g2o::formatString | ( | const char * | fmt, |
... | |||
) |
format a string and return a std::string. Format is just like printf, see man 3 printf
Definition at line 95 of file string_tools.cpp.
References __PRETTY_FUNCTION__.
Referenced by gnudump_edges(), gnudump_features(), and g2o::readFloats().
OutputIterator g2o::readFloats | ( | const char * | str, |
OutputIterator | out | ||
) |
read float values (seperated by spaces) from a string and store them in the given OutputIterator.
Definition at line 96 of file string_tools.h.
References g2o::formatString(), G2O_ATTRIBUTE_FORMAT12, G2O_ATTRIBUTE_FORMAT23, G2O_STUFF_API, and g2o::strPrintf().
OutputIterator g2o::readInts | ( | const char * | str, |
OutputIterator | out | ||
) |
read integer values (seperated by spaces) from a string and store them in the given OutputIterator.
Definition at line 77 of file string_tools.h.
G2O_STUFF_API int g2o::readLine | ( | std::istream & | is, |
std::stringstream & | currentLine | ||
) |
read a line from is into currentLine.
Definition at line 172 of file string_tools.cpp.
Referenced by main(), g2o::ParameterContainer::read(), g2o::Gm2dlIO::readGm2dl(), g2o::Gm2dlIO::readRobotLaser(), g2o::OptimizableGraph::setFixed(), and g2o::stringToType().
G2O_STUFF_API bool g2o::strEndsWith | ( | const std::string & | str, |
const std::string & | substr | ||
) |
return true, if str ends with substr
Definition at line 165 of file string_tools.cpp.
Referenced by str2solver(), and g2o::stringToType().
G2O_STUFF_API std::string g2o::strExpandFilename | ( | const std::string & | filename | ) |
expand the given filename like a posix shell, e.g., ~ $CARMEN_HOME and other will get expanded. Also command substitution, e.g. pwd
will give the current directory.
Definition at line 124 of file string_tools.cpp.
References __PRETTY_FUNCTION__.
Referenced by g2o::stringToType().
T g2o::stringToType | ( | const std::string & | s, |
bool | failIfLeftoverChars = true |
||
) |
convert a string into an other type. Return the converted value. Throw error if parsing is wrong.
Definition at line 139 of file string_tools.h.
References g2o::convertString(), G2O_STUFF_API, g2o::readLine(), g2o::strEndsWith(), g2o::strExpandFilename(), g2o::strSplit(), and g2o::strStartsWith().
G2O_STUFF_API int g2o::strPrintf | ( | std::string & | str, |
const char * | fmt, | ||
... | |||
) |
replacement function for sprintf which fills a std::string instead of a char*
Definition at line 112 of file string_tools.cpp.
Referenced by g2o::readFloats().
G2O_STUFF_API std::vector< std::string > g2o::strSplit | ( | const std::string & | s, |
const std::string & | delim | ||
) |
split a string into token based on the characters given in delim
Definition at line 143 of file string_tools.cpp.
Referenced by g2o::loadStandardSolver(), g2o::loadStandardTypes(), g2o::OptimizableGraph::setRenamedTypesFromString(), g2o::stringToType(), and g2o::PropertyMap::updateMapFromString().
G2O_STUFF_API bool g2o::strStartsWith | ( | const std::string & | str, |
const std::string & | substr | ||
) |
return true, if str starts with substr
Definition at line 158 of file string_tools.cpp.
Referenced by str2solver(), and g2o::stringToType().
G2O_STUFF_API std::string g2o::strToLower | ( | const std::string & | s | ) |
convert the string to lower case
Definition at line 81 of file string_tools.cpp.
References transform().
Referenced by str2method().
G2O_STUFF_API std::string g2o::strToUpper | ( | const std::string & | s | ) |
convert a string to upper case
Definition at line 88 of file string_tools.cpp.
References transform().
G2O_STUFF_API std::string g2o::trim | ( | const std::string & | s | ) |
remove whitespaces from the start/end of a string
Definition at line 48 of file string_tools.cpp.
Referenced by g2o::OptimizableGraph::setRenamedTypesFromString(), and g2o::PropertyMap::updateMapFromString().
G2O_STUFF_API std::string g2o::trimLeft | ( | const std::string & | s | ) |
remove whitespaces from the left side of the string
Definition at line 59 of file string_tools.cpp.
G2O_STUFF_API std::string g2o::trimRight | ( | const std::string & | s | ) |
remove whitespaced from the right side of the string
Definition at line 70 of file string_tools.cpp.