WvStreams
wvstringlist.h
1/* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4 *
5 * WvStrings are used a lot more often than WvStringLists, so the List need
6 * not be defined most of the time. Include this file if you need it.
7 *
8 */
9#ifndef __WVSTRINGLIST_H
10#define __WVSTRINGLIST_H
11
12#include "wvstring.h"
13#include "wvlinklist.h"
14
15class WvRegex;
16
17DeclareWvList2(WvStringListBase, WvString);
18
27class WvStringList : public WvStringListBase
28{
29 // copy constructor: not defined anywhere!
30 WvStringList(const WvStringList &l);
31public:
36
40 WvString join(const char *joinchars = " ") const;
41
51 void split(WvStringParm s, const char *splitchars = " \t\r\n",
52 int limit = 0);
66 void splitstrict(WvStringParm s, const char *splitchars = " \t\r\n",
67 int limit = 0);
68
69#ifndef _WIN32
75 void split(WvStringParm s, const WvRegex &regex, int limit = 0);
76#endif
77
78 /*
79 * populate the list from an array of strings
80 */
81 void fill(const char * const *array);
82
83 void append(WvStringParm str);
84 void append(WVSTRING_FORMAT_DECL)
85 { append(WvString(WVSTRING_FORMAT_CALL)); }
86 void append(WvString *strp, bool autofree, char *id = NULL);
87
93};
94
95#endif // __WVSTRINGLIST_H
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
Definition: wvstring.h:94
WvRegex – Unified support for regular expressions.
Definition: wvregex.h:48
This is a WvList of WvStrings, and is a really handy way to parse strings.
Definition: wvstringlist.h:28
WvString join(const char *joinchars=" ") const
concatenates all elements of the list seperating on joinchars
Definition: wvstringlist.cc:14
WvStringList()
Instatiate a new WvStringList()
Definition: wvstringlist.h:35
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 ...
Definition: wvstringlist.cc:25
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.
Definition: wvstringlist.cc:19
WvString popstr()
get the first string in the list, or an empty string if the list is empty.
Definition: wvstringlist.cc:55
WvString is an implementation of a simple and efficient printable-string class.
Definition: wvstring.h:330