///////////////////////////////////////////////////////////////////////////////
// CGISetup Class                                                            //
///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Author:  Hexar William Anderson                                           //
// Date:    10/25/2000                                                       //
// Desc:    This class does all of the work for you when it comes to         //
//          separating CGI input into name/value pairs.  Then, you can access//
//          these values by name or by number.                               //
///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// COPYRIGHT NOTICE                                                          //
// Copyright (c) 2000 Hexar W. Anderson                                      //
//                                                                           //
// CGISetup may be used and modified free of charge by anyone so long as this//
// copyright notice remains intact.  By using this code you agree to         //
// indemnify Hexar Anderson from any liability that might arise from its use.//
//                                                                           //
// Attempting to sell the source code for this program without prior written //
// consent is expressly forbidden.  Obtain permission before redistributing  //
// this software over the Internet or any other medium.                      //
///////////////////////////////////////////////////////////////////////////////
 
class CGISetup
  {
   private:
   
   // Variables
   
    int num;
    char **names;
    char **values;
   
   // Private Functions
   
    static int CountChars(char, const char*);
    static int CountStrings(const char*, const char*);
    static int CountValues(const char*);
    static int ConvHex(char);
    static void ReplaceChar(char*, char, char);
        
    void MethodGet(char*) const;
    void MethodPost(char*) const;
    void ParseString(const char*);
    
   public:
   
   // Public Functions
   
    CGISetup(); 
    ~CGISetup();
    
    int   GetNum() const;
    char* GetName(int) const;
    char* GetValue(int) const;
    char* GetValue(const char*) const;
        
   // Miscellaneous but Useful Static Functions
 
    static void DecodeURL(char*);
    static void CopyFile(const char*, const char*);
    static void MoveFile(const char*, const char*);
    static void StrLwr(char*);
    static void ViewFile(const char*);
  };

All material Copyright (c) 2001-2010 Hexar
Please direct all inquiries, love letters, and hate mail to .

Home •  Blog •  Photos •  Code •  Features •  Resume •  WinTetris