| 31 | } |
| 32 | |
| 33 | std::string unescapeForFileName(const std::string & s) |
| 34 | { |
| 35 | std::string res; |
| 36 | const char * pos = s.data(); |
| 37 | const char * end = pos + s.size(); |
| 38 | |
| 39 | while (pos != end) |
| 40 | { |
| 41 | if (!(*pos == '%' && pos + 2 < end)) |
| 42 | { |
| 43 | res += *pos; |
| 44 | ++pos; |
| 45 | } |
| 46 | else |
| 47 | { |
| 48 | ++pos; |
| 49 | res += unhex2(pos); |
| 50 | pos += 2; |
| 51 | } |
| 52 | } |
| 53 | return res; |
| 54 | } |
| 55 | |
| 56 | } |