FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
public void FB::URI::parse_query_data ( const std::string &  in_str)

Parses a urlencoded QueryString and stores the results in the URI.

FB::URI uri("http://www.firebreath.org");
uri.parse_query_data("user=taxilian&firebreath=awesome");
// uri.query_data["user"] == "taxilian"
// uri.query_data["firebreath"] == "awesome"
Parameters
in_strurlencoded querystring (minus the ?)
Returns
void
Since
1.4b1

Definition at line 219 of file URI.cpp.

References url_decode().

Referenced by URI().

219  {
220  std::vector<string> parts;
221  split(parts, in_str, is_any_of("&"));
222  for (std::vector<string>::iterator it = parts.begin(); it != parts.end(); ++it) {
223  std::vector<string> kvp;
224  split(kvp, *it, is_any_of("="));
225  if (kvp.empty()) continue;
226  else if (kvp.size() == 1) query_data[url_decode(kvp[0])] = string();
227  else query_data[url_decode(kvp[0])] = url_decode(kvp[1]);
228  }
229 }
static std::string url_decode(const std::string &in)
Decodes the given urlencoded URL.
Definition: URI.cpp:53

Here is the call graph for this function: