home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 8
/
amigaformatcd08.iso
/
in_the_mag
/
html_tutorial
/
o_parse.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-09-03
|
1KB
|
46 lines
//
// 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