jspace/jspace/strutil.hpp File Reference

Author:
Roland Philippsen (roland DOT philippsen AT gmx DOT net)
More...

#include <string>
#include <sstream>

Include dependency graph for strutil.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  wbcnet
namespace  sfl

Functions

template<typename displayable_t, typename prefix_t>
std::string wbcnet::displayString (displayable_t const &displayable, prefix_t const &prefix)
template<typename Foo>
std::string sfl::to_string (const Foo &foo)
 convert "anything" to a string by using its output operator
template<>
std::string sfl::to_string< bool > (const bool &flag)
 booleans are better represented by "true" and "false" than by 1 and 0.
template<typename Foo>
bool sfl::string_to (const std::string &str, Foo &foo)
 convert a string to "something" based on its input operator
template<>
bool sfl::string_to< bool > (const std::string &str, bool &foo)
 booleans are converted by string matching: "true", "True", "TRUE", "on", "On", or "ON" yield a true boolean, whereas "false", "False", "FALSE", "off", "Off", or "OFF" yield a false boolean.
template<typename Foo>
bool sfl::string_to_bool (const std::string &str, Foo &foo)
 very useful for booleans that are encoded as char, int, short, or other integer formats.
bool sfl::splitstring (std::string const &input, char separator, std::string &head, std::string &tail)
 Split a string at the first occurrence of a separator, and store the two portions in head and tail.
template<typename tokenlist_t>
size_t sfl::tokenize (std::string const &input, char separator, tokenlist_t &output)
 For any tokenlist_t that accepts push_back(string const &) and can return its size().
template<typename tokenlist_t, typename value_t>
bool sfl::token_to (tokenlist_t const &tokenlist, size_t index, value_t &value)
 For any tokenlist_t whose operator[]() returns a string const & and which can return its size().


Detailed Description

Author:
Roland Philippsen (roland DOT philippsen AT gmx DOT net)

Definition in file strutil.hpp.


Generated on Fri Aug 26 01:31:33 2011 for Stanford Whole-Body Control Framework by  doxygen 1.5.4