7#include "wvstringcache.h"
8#include "wvstringlist.h"
11int WvStringCache::refcount;
12size_t WvStringCache::clean_threshold;
14WvStringCache::WvStringCache()
19 t =
new WvStringTable;
25WvStringCache::~WvStringCache()
62 if (t->count() < clean_threshold)
71 WvStringTable::Iter i(*t);
72 for (i.rewind(); i.next(); )
77 l.append(i.ptr(),
false);
86 WvStringList::Iter i(l);
87 for (i.rewind(); i.next(); )
91 clean_threshold = t->count() + t->count()/10 + 1;
WvString get(WvStringParm s)
Get a shared string corresponding to 's'.
void clean()
Remove any now-unused strings from the cache.
This is a WvList of WvStrings, and is a really handy way to parse strings.
WvString is an implementation of a simple and efficient printable-string class.