Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

log4cpp::StringUtil Class Reference

#include <StringUtil.hh>

List of all members.

Static Public Methods

std::string trim (const std::string &s)
 Returns a string identical to the given string but without leading or trailing HTABs or spaces. More...

void split (std::vector< std::string > &v, const std::string &s, char delimiter, unsigned int maxSegments=INT_MAX)
 splits a string into a vector of string segments based on the given delimiter. More...

template<typename T> unsigned int split (T &output, const std::string &s, char delimiter, unsigned int maxSegments=INT_MAX)
 splits a string into string segments based on the given delimiter and assigns the segments through an output_iterator. More...


Member Function Documentation

template<typename T>
unsigned int log4cpp::StringUtil::split T &    output,
const std::string &    s,
char    delimiter,
unsigned int    maxSegments = INT_MAX
[inline, static]
 

splits a string into string segments based on the given delimiter and assigns the segments through an output_iterator.

Parameters:
out  The output_iterator through which to assign the string segments. Typically this will be a back_insertion_iterator.
s  The string to split into segments.
delimiter  The delimiter character
maxSegments  The maximum number of segments.
Returns:
The actual number of segments (limited by maxSegments).

void log4cpp::StringUtil::split std::vector< std::string > &    v,
const std::string &    s,
char    delimiter,
unsigned int    maxSegments = INT_MAX
[static]
 

splits a string into a vector of string segments based on the given delimiter.

Parameters:
v  The vector in which the segments will be stored. The vector will be emptied before storing the segments
s  The string to split into segments.
delimiter  The delimiter character
maxSegments  the maximum number of segments. Upon return v.size() <= maxSegments. The string is scanned from left to right so v[maxSegments - 1] may contain a string containing the delimiter character.

std::string log4cpp::StringUtil::trim const std::string &    s [static]
 

Returns a string identical to the given string but without leading or trailing HTABs or spaces.


The documentation for this class was generated from the following files:
Generated on Thu Aug 15 00:00:51 2002 for log4cpp by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002