00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "wvstringlist.h"
00011 #include "strutils.h"
00012
00013
00014 WvString WvStringList::join(const char *joinchars) const
00015 {
00016 return ::strcoll_join(*this, joinchars);
00017 }
00018
00019 void WvStringList::split(WvStringParm s, const char *splitchars,
00020 int limit)
00021 {
00022 return ::strcoll_split(*this, s, splitchars, limit);
00023 }
00024
00025 void WvStringList::splitstrict(WvStringParm s, const char *splitchars,
00026 int limit)
00027 {
00028 return ::strcoll_splitstrict(*this, s, splitchars, limit);
00029 }
00030
00031 void WvStringList::fill(const char * const *array)
00032 {
00033 while (array && *array)
00034 {
00035 append(new WvString(*array), true);
00036 array++;
00037 }
00038 }
00039
00040
00041 void WvStringList::append(WvStringParm str)
00042 {
00043 WvStringListBase::append(new WvString(str), true);
00044 }
00045
00046
00047 void WvStringList::append(WvString *strp, bool autofree, char *id)
00048 {
00049 WvStringListBase::append(strp, autofree, id);
00050 }
00051
00052
00053
00054
00055 WvString WvStringList::popstr()
00056 {
00057 if (isempty())
00058 return "";
00059
00060 WvString s = *first();
00061 unlink_first();
00062 return s;
00063 }
00064
00065
00066 #ifndef _WIN32
00067 void WvStringList::split(WvStringParm s, const WvRegex ®ex, int limit)
00068 {
00069 return ::strcoll_split(*this, s, regex, limit);
00070 }
00071 #endif