WvStreams
Main Page
Modules
Classes
Files
File List
File Members
utils
wvstringlist.cc
1
/*
2
* Worldvisions Weaver Software:
3
* Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4
*
5
* Some helper functions for WvStringList.
6
*
7
* This is blatantly block-copied from WvStringTable, but I don't care! Hah!
8
* (I just know I'm going to regret this someday...)
9
*/
10
#include "wvstringlist.h"
11
#include "strutils.h"
12
13
14
WvString
WvStringList::join
(
const
char
*joinchars)
const
15
{
16
return ::strcoll_join
(*
this
, joinchars);
17
}
18
19
void
WvStringList::split
(
WvStringParm
s,
const
char
*splitchars,
20
int
limit)
21
{
22
return ::strcoll_split
(*
this
, s, splitchars, limit);
23
}
24
25
void
WvStringList::splitstrict
(
WvStringParm
s,
const
char
*splitchars,
26
int
limit)
27
{
28
return ::strcoll_splitstrict
(*
this
, s, splitchars, limit);
29
}
30
31
void
WvStringList::fill(
const
char
*
const
*array)
32
{
33
while
(array && *array)
34
{
35
append(
new
WvString
(*array),
true
);
36
array++;
37
}
38
}
39
40
41
void
WvStringList::append(
WvStringParm
str)
42
{
43
WvStringListBase::append(
new
WvString
(str),
true
);
44
}
45
46
47
void
WvStringList::append(
WvString
*strp,
bool
autofree,
char
*
id
)
48
{
49
WvStringListBase::append(strp, autofree,
id
);
50
}
51
52
53
// get the first string in the list, or an empty string if the list is empty.
54
// Removes the returned string from the list.
55
WvString
WvStringList::popstr
()
56
{
57
if
(isempty())
58
return
""
;
59
60
WvString
s = *first();
61
unlink_first();
62
return
s;
63
}
64
65
66
#ifndef _WIN32
67
void
WvStringList::split
(
WvStringParm
s,
const
WvRegex
®ex,
int
limit)
68
{
69
return ::strcoll_split
(*
this
, s, regex, limit);
70
}
71
#endif
Generated on Thu Jul 12 2012 23:23:56 for WvStreams by
1.8.1.1