Encodes the given URL for transmission. std::string encoded = FB::URI::url_encode("http://www.firebreath.org/display/documentation/Mac Video Tutorial")
Definition at line 37 of file URI.cpp. Referenced by toString(). 00037 { 00038 std::stringstream res; 00039 for (size_t i = 0; i < in.size(); ++i) { 00040 char c = in[i]; 00041 if (c > 0 && (isalnum(c) || c == '+' || 00042 c == '$' || c == '-' || c == '_' || c == '.' || c == '!' || 00043 c == '*' || c == '\''|| c == '(' || c == ')' || c == ',' || c == '/')) res << c; 00044 else { 00045 char buf[4]; 00046 sprintf(buf, "%%%.2x", c & 0xff); 00047 res << buf; 00048 } 00049 } 00050 return res.str(); 00051 } |
Generated on 25 May 2013 for FireBreath by
1.6.1
Labels
