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 
15 class WvRegex;
16 
17 DeclareWvList2(WvStringListBase, WvString);
18 
27 class WvStringList : public WvStringListBase
28 {
29  // copy constructor: not defined anywhere!
30  WvStringList(const WvStringList &l);
31 public:
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
70 
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 
92  WvString popstr();
93 };
94 
95 #endif // __WVSTRINGLIST_H
WvStringList::popstr
WvString popstr()
get the first string in the list, or an empty string if the list is empty.
Definition: wvstringlist.cc:55
WvStringList::splitstrict
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
WvString
WvString is an implementation of a simple and efficient printable-string class.
Definition: wvstring.h:329
WvStringList::join
WvString join(const char *joinchars=" ") const
concatenates all elements of the list seperating on joinchars
Definition: wvstringlist.cc:14
WvRegex
WvRegex – Unified support for regular expressions.
Definition: wvregex.h:47
WvStringList::WvStringList
WvStringList()
Instatiate a new WvStringList()
Definition: wvstringlist.h:35
WvStringList
This is a WvList of WvStrings, and is a really handy way to parse strings.
Definition: wvstringlist.h:27
WvStringList::split
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