crossroads

Git mirror of https://crossroads.e-tunity.com/
git clone git://git.finwo.net/app/crossroads
Log | Files | Refs | LICENSE

paramvalue.cc (519B)


      1 #include "httpbuffer"
      2 
      3 string Httpbuffer::paramvalue (string c) {
      4     PROFILE("Httpheader::paramvalue");
      5 
      6     string uri = requesturi();
      7     string match = c;
      8     if (match[match.size() - 1] != '=')
      9 	match += '=';
     10     string ret = "";
     11     size_t pos = uri.find(match);
     12     if (pos != string::npos) {
     13 	pos += match.size();
     14 	for (char ch = uri[pos];
     15 	     pos < uri.size() && ch != '&' && ch != '?';
     16 	     ch = uri[++pos])
     17 	    ret += ch;
     18     }
     19     msg("Param value '" << c << "' : '" << ret << "'\n");
     20     return ret;
     21 }