/////////////////////////////////////////////////////////////////////////// // 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 three 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. / // 21 October 1995 / // / // / // S p e c i f i c a t i o n / /////////////////////////////////////////////////////////////////////////// #ifndef CLASS_PARSE #define CLASS_PARSE #define NO_MAP // Define for no ~user processing #include "t99_type.h" class Parse { public: Parse( char [] ); ~Parse(); void set( char [] ); char *get_item( char [], int pos=1, bool=false ); char *get_item_n( char [], int pos=1, 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