00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _CGIUTILS_H_
00025 #define _CGIUTILS_H_ 1
00026
00027 #ifdef __GNUG__
00028 # pragma interface
00029 #endif
00030
00038 #include <new>
00039 #include <string>
00040 #include <fstream>
00041
00042 #include "cgicc/CgiDefs.h"
00043
00044
00045 namespace cgicc {
00046
00055 CGICC_API bool
00056 stringsAreEqual(const std::string& s1,
00057 const std::string& s2);
00058
00068 CGICC_API bool
00069 stringsAreEqual(const std::string& ss1,
00070 const std::string& ss2,
00071 size_t n);
00072
00083 CGICC_API std::string
00084 form_urldecode(const std::string& src);
00085
00093 CGICC_API std::string
00094 form_urlencode(const std::string& src);
00095
00096
00110 CGICC_API std::string
00111 charToHex(char c);
00112
00127 CGICC_API char
00128 hexToChar(char first,
00129 char second);
00130
00146 std::string
00147 extractBetween(const std::string& data,
00148 const std::string& separator1,
00149 const std::string& separator2);
00150
00159 inline std::string
00160 extractBetween(const std::string& datas,
00161 const std::string& separators)
00162 { return extractBetween(datas, separators, separators); }
00163
00171 void
00172 writeString(std::ostream& out,
00173 const std::string& s);
00174
00182 void
00183 writeLong(std::ostream& out,
00184 unsigned long l);
00185
00193 std::string
00194 readString(std::istream& in);
00195
00203 unsigned long
00204 readLong(std::istream& in);
00205
00206 }
00207
00208 #endif