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

wvtclstring.h

Go to the documentation of this file.
00001 /* -*- Mode: C++ -*-
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  * 
00005  * FIXME:
00006  *   It would be possible to represent arbitrary binary blobs using this
00007  *   technique, but we'd have to avoid using null-terminated strings in a few
00008  *   places, particularly in the input to wvtcl_escape().
00009  * 
00010  *   We could even make encoded binary blobs printable (although that's not
00011  *   _strictly_ necessary in all cases) by encoding non-printable characters
00012  *   using \x## notation, if wvtcl_escape() or wvtcl_unescape() supported it.
00013  */
00034 #ifndef __WVTCLSTRING_H
00035 #define __WVTCLSTRING_H
00036 
00037 #include "wvbuf.h"
00038 
00039 // the default set of "nasties", ie. characters that need to be escaped if
00040 // they occur somewhere in a string.
00041 #define WVTCL_NASTIES    " \t\n\r"
00042 
00043 
00044 // {, }, \, and " are always considered "nasty."
00045 #define WVTCL_ALWAYS_NASTY "{}\\\""
00046 
00047 
00048 // the default set of split characters, ie. characters that separate elements
00049 // in a list.  If these characters appear unescaped and not between {} or ""
00050 // in a list, they signify the end of the current element.
00051 #define WVTCL_SPLITCHARS " \t\n\r"
00052 
00053 
00063 WvString wvtcl_escape(WvStringParm s, const char *nasties = WVTCL_NASTIES);
00064 
00065 
00072 WvString wvtcl_unescape(WvStringParm s);
00073 
00074 
00080 WvString wvtcl_encode(WvList<WvString> &l, const char *nasties = WVTCL_NASTIES,
00081                       const char *splitchars = WVTCL_SPLITCHARS);
00082 
00088 WvString wvtcl_getword(WvBuf &buf, const char *splitchars = WVTCL_SPLITCHARS,
00089     bool do_unescape = true);
00090 
00107 void wvtcl_decode(WvList<WvString> &l, WvStringParm _s,
00108                   const char *splitchars = WVTCL_SPLITCHARS,
00109                   bool do_unescape = true);
00110 
00111 #endif // __WVTCLSTRING_H

Generated on Sun Jul 10 15:30:56 2005 for WvStreams by  doxygen 1.4.0