char out[max_string_length] -> string out; out.reserve(max_string_length)
string TemplateDictionary::UrlQueryEscape::operator()(const string& in)
const {
// Everything not matching [0-9a-zA-Z.,_:*/~!()-] is escaped.
static unsigned long _unsafe_characters[8] = {
0xffffffffL, 0xf80008fdL, 0x78000001L, 0xb8000001L,
0xffffffffL, 0xffffffffL, 0xffffffffL, 0xffffffffL
};
int max_string_length = in.size() * 3 + 1;
string out;
out.reserve(max_string_length);
for (int i = 0; i < in.size(); i++) {
unsigned char c = in[i];
if (c == ' ') {
out += '+';
} else if (!(_unsafe_characters[(c)>>5] & (1 << ((c) & 31)))) {
out += c;
} else {
out += '%';
out += ((c>>4) < 10 ? ((c>>4) + '0') : (((c>>4) - 10) + 'A'));
out += ((c&0xf) < 10 ? ((c&0xf) + '0') : (((c&0xf) - 10) + 'A'));
}
}
return out;
}
Nobody/Anonymous
None
None
Public
|
Date: 2007-01-25 23:59
|
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2007-01-25 23:59 | csilvers |
| resolution_id | None | 2007-01-25 23:59 | csilvers |
| close_date | - | 2007-01-25 23:59 | csilvers |
Copyright © 2010 Geeknet, Inc. All rights reserved. Terms of Use