Static Public Member Functions
log4cpp::StringUtil Class Reference

#include <StringUtil.hh>

List of all members.

Static Public Member Functions

static unsigned int split (std::vector< std::string > &v, const std::string &s, char delimiter, unsigned int maxSegments=INT_MAX)
template<typename T >
static unsigned int split (T &output, const std::string &s, char delimiter, unsigned int maxSegments=INT_MAX)
static std::string trim (const std::string &s)
static std::string vform (const char *format, va_list args)

Detailed Description

Definition at line 20 of file StringUtil.hh.


Member Function Documentation

unsigned int 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:
vThe vector in which the segments will be stored. The vector will be emptied before storing the segments
sThe string to split into segments.
delimiterThe delimiter character
maxSegmentsthe 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.
Returns:
The actual number of segments (limited by maxSegments).

Definition at line 80 of file StringUtil.cpp.

template<typename T >
static 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:
outputThe output_iterator through which to assign the string segments. Typically this will be a back_insertion_iterator.
sThe string to split into segments.
delimiterThe delimiter character
maxSegmentsThe maximum number of segments.
Returns:
The actual number of segments (limited by maxSegments).

Definition at line 63 of file StringUtil.hh.

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.

Definition at line 61 of file StringUtil.cpp.

std::string log4cpp::StringUtil::vform ( const char *  format,
va_list  args 
) [static]

Returns a string contructed from the a format specifier and a va_list of arguments, analogously to vprintf(3).

Parameters:
formatthe format specifier.
argsthe va_list of arguments.

Definition at line 37 of file StringUtil.cpp.


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


log4cpp
Author(s): Stephen Roderick
autogenerated on Mon Oct 6 2014 03:13:15