URL provides URL parsing The URL class provides an interface to work on the data of an URL like "http://www.crosswire.org/index.jsp?page=test&user=nobody"
Definition at line 34 of file url.h.
Parse Parse the URL into protocol, hostname, path, page and paramters
Parse the URL. Parse the URL into the protocol, the hostname, the path and the paramters with their values
Definition at line 117 of file url.cpp.
132 const char *end = strchr( urlPtr,
':' );
138 for (; (*urlPtr ==
':') || (*urlPtr ==
'/'); urlPtr++);
142 bool checkPath =
true;
143 bool checkParams =
true;
144 bool checkAnchor =
true;
146 end = strchr(urlPtr,
'/');
149 end = strchr(urlPtr,
'?');
153 end = strchr(urlPtr,
'#');
157 end = urlPtr+strlen(urlPtr);
162 urlPtr = end + ((*end)? 1 : 0);
165 end = strchr(urlPtr,
'?');
168 end = strchr(urlPtr,
'#');
172 end = urlPtr+strlen(urlPtr);
177 urlPtr = end + ((*end)? 1 : 0);
185 if (checkAnchor) checkAnchor =
false;
200 const char *valueStart = strchr(end,
'=');
202 const char* valueEnd = strstr(valueStart,
"&") ? strstr(valueStart,
"&") : strstr(valueStart,
"&");
205 paramName.
append(end, valueStart-end);
206 paramValue.
append(valueStart+1, valueEnd-(valueStart+1));
209 paramName.
append(end, valueStart-end);
210 paramValue.
append(valueStart+1);
215 paramValue =
decode(paramValue.c_str());
224 const char *start = end+1;
225 end = strstr(start,
"&") ? strstr(start,
"&")+5 : (strstr(start,
"&") ? strstr(start,
"&")+1 : 0);
unsigned long length() const
const char * c_str() const
SWBuf & append(const char *str, long max=-1)
ParameterMap parameterMap
static const SWBuf decode(const char *encodedText)