org::xmlBlaster::util::StringStripper Class Reference

Class StringStripper is used to strip a std::string with separators into a std::vector of (separated) std::strings. More...

List of all members.

Public Member Functions

 StringStripper (const std::string &separator)
std::vector< std::string > strip (std::string line)
 strip strips the std::string into a std::vector of std::strings.


Detailed Description

Class StringStripper is used to strip a std::string with separators into a std::vector of (separated) std::strings.

It is mostly used to strip a name to be used in a name server. An example could be to strip the following name:

 std::string name = "motor.electric.stepper.motor1";
 std::vector<std::string> vec = StringStripper(".").strip(name);
 

Definition at line 31 of file StringStripper.h.


Constructor & Destructor Documentation

org::xmlBlaster::util::StringStripper::StringStripper ( const std::string &  separator  ) 

Definition at line 38 of file StringStripper.h.


Member Function Documentation

std::vector<std::string> org::xmlBlaster::util::StringStripper::strip ( std::string  line  ) 

strip strips the std::string into a std::vector of std::strings.

If the input std::string terminates with a separator, then the last std::string in the std::vector will be empty. No separator appears in the return std::strings.

Definition at line 48 of file StringStripper.h.


The documentation for this class was generated from the following file: