00001
00002
00003
00004
00005
00006
00007
00008
00012 #ifndef ZYPP_URL_URLUTILS_H
00013 #define ZYPP_URL_URLUTILS_H
00014
00015 #include <zypp/url/UrlException.h>
00016
00017 #include <string>
00018 #include <vector>
00019 #include <map>
00020
00021
00023 namespace zypp
00024 {
00025
00027
00028 namespace url
00029 {
00030
00031
00032
00038 typedef std::vector < std::string > ParamVec;
00039
00040
00045 typedef std::map < std::string, std::string > ParamMap;
00046
00047
00050 typedef enum {
00051 E_ENCODED,
00052 E_DECODED
00053 } EEncoding;
00054
00055
00056
00082 std::string
00083 encode(const std::string &str, const std::string &safe = "",
00084 EEncoding eflag = E_DECODED);
00085
00086
00087
00103 std::string
00104 decode(const std::string &str, bool allowNUL = false);
00105
00106
00107
00117 std::string
00118 encode_octet(const unsigned char c);
00119
00120
00121
00140 int
00141 decode_octet(const char *hex);
00142
00143
00144
00158 void
00159 split(ParamVec &pvec,
00160 const std::string &pstr,
00161 const std::string &psep);
00162
00163
00164
00192 void
00193 split(ParamMap &pmap,
00194 const std::string &pstr,
00195 const std::string &psep,
00196 const std::string &vsep,
00197 EEncoding eflag = E_ENCODED);
00198
00199
00200
00214 std::string
00215 join(const ParamVec &pvec,
00216 const std::string &psep);
00217
00218
00219
00241 std::string
00242 join(const ParamMap &pmap,
00243 const std::string &psep,
00244 const std::string &vsep,
00245 const std::string &safe);
00246
00247
00249 }
00251
00253 }
00255
00256 #endif
00257
00258
00259