Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

WvStringList Class Reference

#include <wvstringlist.h>

List of all members.


Detailed Description

This is a WvList of WvStrings, and is a really handy way to parse strings.

If you ever find yourself using strtok(3) or strpbrk(3), or find yourself needing to parse a line of input, WvStringList, WvStringList::split(), and WvStringList::popstr() are probably what you want, and avoid all sorts of nasty security bugs caused by doing it any other way.


Public Member Functions

 WvStringList ()
 Instatiate a new WvStringList().
WvString join (const char *joinchars=" ") const
 concatenates all elements of the list seperating on joinchars
void split (WvStringParm s, const char *splitchars=" \t\r\n", int limit=0)
 split s and form a list ignoring splitchars (except at beginning and end) ie.
void splitstrict (WvStringParm s, const char *splitchars=" \t\r\n", int limit=0)
 split s and form a list creating null entries when there are multiple splitchars ie " happy birthday to you" split on " " will populate the list with "" "happy" "birthday" "" "to" "" "you"
void fill (const char *const *array)
void append (WvStringParm str)
void append (WvString *strp, bool autofree, char *id=NULL)
WvString popstr ()
 get the first string in the list, or an empty string if the list is empty.


Member Function Documentation

void WvStringList::split WvStringParm  s,
const char *  splitchars = " \t\r\n",
int  limit = 0
 

split s and form a list ignoring splitchars (except at beginning and end) ie.

" happy birthday to you" split on " " will populate the list with "" "happy" "birthday" "to" "you"

WvString WvStringList::popstr  ) 
 

get the first string in the list, or an empty string if the list is empty.

Removes the returned string from the list.


The documentation for this class was generated from the following files:
Generated on Tue Jul 12 03:00:12 2005 for WvStreams by  doxygen 1.4.0