Skip to end of metadata
Go to start of metadata

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_str urlencoded querystring (minus the ?)
Returns:
void
Since:
1.4b1

Definition at line 219 of file URI.cpp.

References url_decode().

Referenced by URI().

00219                                                   {
00220     std::vector<string> parts;
00221     split(parts, in_str, is_any_of("&"));
00222     for (std::vector<string>::iterator it = parts.begin(); it != parts.end(); ++it) {
00223         std::vector<string> kvp;
00224         split(kvp, *it, is_any_of("="));
00225         if (kvp.empty()) continue;
00226         else if (kvp.size() == 1) query_data[url_decode(kvp[0])] = string();
00227         else query_data[url_decode(kvp[0])] = url_decode(kvp[1]);
00228     }
00229 }

Here is the call graph for this function:


Generated on 25 May 2013 for FireBreath by  doxygen 1.6.1
Labels
  • None