68 lines
1.5 KiB
C++
68 lines
1.5 KiB
C++
//
|
|
// URI Parser
|
|
// Neal Probert
|
|
//
|
|
|
|
/* prevent multiple inclusions */
|
|
#ifndef __QueryString__
|
|
#define __QueryString__
|
|
|
|
/* includes *****************************************************************/
|
|
|
|
#include <string.h>
|
|
|
|
#include <string>
|
|
|
|
/* defines ******************************************************************/
|
|
|
|
/* macros *******************************************************************/
|
|
|
|
/* structs & typedefs *******************************************************/
|
|
|
|
/* c class definitions ******************************************************/
|
|
|
|
//
|
|
// Chop up the URI into it's component parts
|
|
//
|
|
class QueryString {
|
|
// public data
|
|
public:
|
|
std::string Name;
|
|
std::string Value;
|
|
|
|
// private data
|
|
private:
|
|
|
|
// static data
|
|
|
|
// public methods
|
|
public:
|
|
// constructors
|
|
QueryString();
|
|
QueryString(const QueryString ©);
|
|
|
|
// destructor
|
|
virtual ~QueryString();
|
|
|
|
// operators
|
|
QueryString &operator=(const QueryString &rhs);
|
|
|
|
// access methods
|
|
void setName( const char *s );
|
|
void setValue( const char *s );
|
|
void setValue( int v );
|
|
void Set( const char *name, const char *value=NULL );
|
|
|
|
const char *getName(void) { return Name.c_str(); };
|
|
int getLength(void) { return Value.length(); };
|
|
const char *getValue(void) { return Value.c_str(); };
|
|
const char *Get(void) { return Value.c_str(); };
|
|
|
|
// static methods
|
|
|
|
// private methods
|
|
private:
|
|
};
|
|
|
|
#endif
|