00001 00007 /* 00008 Copyright (C) 1999 Anders Hedstrom 00009 00010 This program is free software; you can redistribute it and/or 00011 modify it under the terms of the GNU General Public License 00012 as published by the Free Software Foundation; either version 2 00013 of the License, or (at your option) any later version. 00014 00015 This program is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the Free Software 00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00023 */ 00024 00025 #ifndef _CGI_PARSE_H 00026 #define _CGI_PARSE_H 00027 00028 #include <string> 00029 00030 00031 /***************************************************/ 00032 /* interface of class Parse */ 00033 00035 namespace Cgi 00036 { 00037 00038 class Parse 00039 { 00040 public: 00041 Parse(); 00042 Parse(const char *); 00043 Parse(const char *,const char *); 00044 Parse(const char *,const char *,short); 00045 ~Parse(); 00046 short issplit(char); 00047 void getsplit(); 00048 void getsplit(char *); 00049 std::string getword(); 00050 void getword(char *); 00051 void getword(char *,int); 00052 void getword(char *,char *,int); 00053 void getrest(char *); 00054 long getvalue(); 00055 void setbreak(char); 00056 int getwordlen(); 00057 int getrestlen(); 00058 void enablebreak(char); 00059 void disablebreak(char); 00060 void getline(); 00061 void getline(char *); 00062 void getline(char *,int); 00063 int getptr(); 00064 void EnableQuote(bool b); 00065 00066 private: 00067 Parse(const Parse& ); 00068 Parse& operator=(const Parse& ); 00069 char *pa_the_str; 00070 char *pa_splits; 00071 char *pa_ord; 00072 int pa_the_ptr; 00073 char pa_breakchar; 00074 char pa_enable; 00075 char pa_disable; 00076 short pa_nospace; 00077 bool pa_quote; 00078 }; 00079 00080 } // namespace Cgi 00081 00082 #endif // _CGI_PARSE_H