Data Structures | |
| class | KaGetOpt |
| class | LineStream |
Typedefs | |
| typedef std::vector< std::string > | StringVector |
| typedef const std::string & | cstr |
Functions | |
| template<typename T> | |
| string | toString (const T &v) |
| template<> | |
| string | toString (const bool &v) |
| StringVector | tokenize (const std::string &s) |
| vector< string > | tokenize (const std::string &s, const std::string &delimiters) |
| void | consume_line (std::istream &is) |
| void | consumeWhitespace (std::istream &is) |
| std::string | readCommentLines (std::istream &is, char commentChar) |
| bool | startsWith (const std::string &s, const char *cs) |
| bool | endsWith (const std::string &s, const char *cs) |
| std::string | normalizeLibraryName (const std::string &l) |
| string | trim (const string &s, const char *charsToTrim) |
| string | readEntireFile (cstr file) |
| template<typename T> | |
| std::string | toString (T v) |
| template<class X> | |
| bool | parse (const std::string &s, X &x) |
| template<class X> | |
| std::string | quote (X &x) |
| std::string | normalizeLibraryName (cstr libraryName) |
| typedef const std::string& RDK2::TextUtils::cstr |
Definition at line 34 of file textutils.h.
| typedef std::vector<std::string> RDK2::TextUtils::StringVector |
Types definition
Definition at line 33 of file textutils.h.
| void RDK2::TextUtils::consume_line | ( | std::istream & | is | ) |
| void RDK2::TextUtils::consumeWhitespace | ( | std::istream & | is | ) |
Add your own utils here. Consumes whitespaces from the stream. Whitespaces are empty lines, isspace() and lines beginning with '#'
Definition at line 64 of file textutils.cpp.
References consume_line().
Referenced by RDK2::Geometry::PGMFile::load(), and RDK2::Geometry::loadPGM().

| bool RDK2::TextUtils::endsWith | ( | const std::string & | s, | |
| const char * | cs | |||
| ) |
Test whether s ands with cs.
Definition at line 108 of file textutils.cpp.
Referenced by normalizeLibraryName().
| std::string RDK2::TextUtils::normalizeLibraryName | ( | cstr | libraryName | ) |
| std::string RDK2::TextUtils::normalizeLibraryName | ( | const std::string & | l | ) |
Definition at line 113 of file textutils.cpp.
References endsWith(), startsWith(), and tokenize().
Referenced by RDK2::RAgent::Module::createFromLibrary().

| bool RDK2::TextUtils::parse | ( | const std::string & | s, | |
| X & | x | |||
| ) | [inline] |
The converse of .
Definition at line 77 of file textutils.h.
Referenced by RDK2::SensorData::LaserParser::parse(), and RDK2::Geometry::parsePoint().
| std::string RDK2::TextUtils::quote | ( | X & | x | ) | [inline] |
The converse of .
Definition at line 84 of file textutils.h.
References toString().
Referenced by RDK2::Filesystem::fsOpenOrException(), RDK2::Filesystem::fsRealpath(), RDK2::Geometry::PGMFile::load(), and RDK2::Filesystem::modificationTime().

| std::string RDK2::TextUtils::readCommentLines | ( | std::istream & | is, | |
| char | commentChar = '#' | |||
| ) |
Reads a comment of the form "# ... \n # ..." and strips the #
Definition at line 82 of file textutils.cpp.
Referenced by RDK2::Geometry::PGMFile::load().
| std::string RDK2::TextUtils::readEntireFile | ( | cstr | file | ) |
Reads the entire file into a string.
Definition at line 153 of file textutils.cpp.
| bool RDK2::TextUtils::startsWith | ( | const std::string & | s, | |
| const char * | cs | |||
| ) |
Test whether s starts with cs.
Definition at line 103 of file textutils.cpp.
Referenced by RDK2::RepositoryNS::Repository::getLocalPropertiesStartingWith(), RDK2::RepositoryNS::Session::getPropertyNamesStartingWith(), and normalizeLibraryName().
| std::vector< std::string > RDK2::TextUtils::tokenize | ( | const std::string & | s, | |
| const std::string & | delimiters | |||
| ) |
Tokenizes a string using as delimiters
Definition at line 41 of file textutils.cpp.
References RDK2::Statistics::r.
Referenced by RDK2::RepositoryNS::Url::contextualize(), RDK2::RepositoryNS::Session::getConnectionStatusWith(), RDK2::RepositoryNS::getOptionsFromTextConfig(), RDK2::RepositoryNS::Url::getRelativeUrl(), RDK2::SensorData::LaserParser::parse(), RDK2::RAgent::ModuleConfig::parseTextConfig(), and RDK2::RAgent::stripOptionsFromTextConfigValue().
| StringVector RDK2::TextUtils::tokenize | ( | const std::string & | ) |
Tokenizes a string
Definition at line 33 of file textutils.cpp.
Referenced by normalizeLibraryName(), and RDK2::TextUtils::LineStream::tokenize().
| std::string RDK2::TextUtils::toString | ( | T | v | ) | [inline] |
Useful template function for parsing using << and >>. Converts an object to string using its << operator
Definition at line 69 of file textutils.h.
Referenced by RDK2::Geometry::PGMFile::getViewport(), RDK2::Geometry::PGMFile::load(), RDK2::SensorData::LaserParser::parse(), RDK2::Geometry::parseMatrix(), RDK2::UnitTest::Serialization::EmptyVersion::read(), RDK2::UnitTest::Serialization::VersionTest::read(), and RDK2::Geometry::PGMFile::readResolution().
| string RDK2::TextUtils::toString | ( | const bool & | v | ) | [inline] |
Definition at line 16 of file kagetopt.h.
| string RDK2::TextUtils::toString | ( | const T & | v | ) | [inline] |
Definition at line 13 of file kagetopt.h.
Referenced by RDK2::Geometry::basic_w2b(), RDK2::TextUtils::KaGetOpt::optionBool(), RDK2::TextUtils::KaGetOpt::optionDouble(), RDK2::TextUtils::KaGetOpt::optionInt(), quote(), and RDK2::Geometry::Viewport::Viewport().
| std::string RDK2::TextUtils::trim | ( | const string & | s, | |
| const char * | charsToTrim | |||
| ) |
Definition at line 144 of file textutils.cpp.
Referenced by RDK2::RepositoryNS::getOptionsFromTextConfig(), RDK2::RAgent::ModuleConfig::parseTextConfig(), and RDK2::RAgent::stripOptionsFromTextConfigValue().
1.5.6