Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

wvstringlist.cc

Go to the documentation of this file.
00001 /*
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  *
00005  * Some helper functions for WvStringList.
00006  * 
00007  * This is blatantly block-copied from WvStringTable, but I don't care!  Hah!
00008  * (I just know I'm going to regret this someday...)
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 
00020 void WvStringList::split(WvStringParm s, const char *splitchars,
00021     int limit)
00022 {
00023     return ::strcoll_split(*this, s, splitchars, limit);
00024 }
00025 
00026 void WvStringList::splitstrict(WvStringParm s, const char *splitchars,
00027     int limit)
00028 {
00029     return ::strcoll_splitstrict(*this, s, splitchars, limit);
00030 }
00031 
00032 void WvStringList::fill(const char * const *array)
00033 {
00034     while (array && *array)
00035     {
00036         append(new WvString(*array), true);
00037         array++;
00038     }
00039 }
00040 
00041 
00042 // get the first string in the list, or an empty string if the list is empty.
00043 // Removes the returned string from the list.
00044 WvString WvStringList::popstr()
00045 {
00046     if (isempty())
00047         return "";
00048     
00049     WvString s = *first();
00050     unlink_first();
00051     return s;
00052 }

Generated on Wed Dec 15 15:08:11 2004 for WvStreams by  doxygen 1.3.9.1