2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
5 * Some helper functions for WvStringList.
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...)
10 #include "wvstringlist.h"
14 WvString
WvStringList::join(const char *joinchars
) const
16 return ::strcoll_join(*this, joinchars
);
19 void WvStringList::split(WvStringParm s
, const char *splitchars
,
22 return ::strcoll_split(*this, s
, splitchars
, limit
);
25 void WvStringList::splitstrict(WvStringParm s
, const char *splitchars
,
28 return ::strcoll_splitstrict(*this, s
, splitchars
, limit
);
31 void WvStringList::fill(const char * const *array
)
33 while (array
&& *array
)
35 append(new WvString(*array
), true);
41 void WvStringList::append(WvStringParm str
)
43 WvStringListBase::append(new WvString(str
), true);
47 void WvStringList::append(WvString
*strp
, bool autofree
, char *id
)
49 WvStringListBase::append(strp
, autofree
, id
);
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()
60 WvString s
= *first();
67 void WvStringList::split(WvStringParm s
, const WvRegex
®ex
, int limit
)
69 return ::strcoll_split(*this, s
, regex
, limit
);