home *** CD-ROM | disk | FTP | other *** search
-
- //
- // Split the components of a CGI result string into
- // individual sub strings
- //
- // For example the string
- // name=Your+name&action=%2B10%25&log=~mas/log
- //
- // is composed of two named elements:
- //
- // Element String associated with element
- // name Your name
- // action +10%
- // log /usr/staff/mas/log
- //
- // (C) M.A.Smith University of Brighton
- // Permission is granted to use this code
- // provided this declaration and copyright notice remains intact.
- // 26 August 1995
- //
- //
- // S p e c i f i c a t i o n
-
- #ifndef CLASS_PARSE
- #define CLASS_PARSE
-
- class Parse
- {
- public:
- Parse( char [] );
- ~Parse();
- void set( char [] );
- char *get_item( char [], bool=false );
- char *get_item_n( char [], bool=false );
- protected:
- void remove_escape(char []); // Strip escape characters
- int hex( char ); // Return hex value
- char *map_uname( char [] ); // process ~uname -> home path
- private:
- enum { SEP = '&' }; // Seperator for fields
- char *the_str; // String parsed
- int the_length; // Length of the string
- };
-
- #endif
-