Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

logrecord.C File Reference

#include <string>
#include <ctype.h>
#include "logrecord.h"
#include "configuration.h"
#include "date.h"

Go to the source code of this file.

Functions

int hexdigit (char c)
void www_decode (string &s)


Function Documentation

int hexdigit ( char c ) [inline, static]
 

Definition at line 89 of file logrecord.C.

Referenced by www_decode().

00089                  { // assert(isxdigit(c))
00090 if (isdigit(c)) 
00091   return c - '0';
00092 else if (isupper(c))
00093   return c - 'A' + 10;
00094 else // must be lower case letter
00095   return c - 'a' +10;
00096 }

void www_decode ( string & s )
 

Definition at line 100 of file logrecord.C.

Referenced by LogRecord::parse_path().

00100                       {
00101 unsigned int i(0); // input index
00102 unsigned int j(0); // output index
00103 unsigned int len(s.size());
00104 for (i=0; (i<len); ++i,++j)
00105   switch (s[i]) {
00106     // case '+': s[j] = ' '; break; // Apparently not used in the log file.
00107     case '%': // the following 2 characters must be hex digits: 0-9,a-f
00108       if ((i+2<len) && isxdigit(s[i+1]) && isxdigit(s[i+2])) {
00109         s[j] = hexdigit(s[i+1])* 16 + hexdigit(s[i+2]);
00110         i += 2;
00111         }
00112       else
00113         s[j] = s[i];
00114       break;
00115     default: s[j] = s[i]; break;
00116     }
00117 s.resize(j);
00118 }


httpstats-stage04 [ 7 April, 2001]