author | Michael Krelin <hacker@klever.net> | 2008-03-02 23:52:14 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-03-02 23:52:14 (UTC) |
commit | 5fd5ecad8c2bd1e8846c11fa9b281f0f4ab8a4a7 (patch) (unidiff) | |
tree | 76ba24c589d0ce7de6cab113787cf7a70572f994 /include | |
parent | f6482fb9003e4953f838ba4ef2c110190355622f (diff) | |
download | libopkele-5fd5ecad8c2bd1e8846c11fa9b281f0f4ab8a4a7.zip libopkele-5fd5ecad8c2bd1e8846c11fa9b281f0f4ab8a4a7.tar.gz libopkele-5fd5ecad8c2bd1e8846c11fa9b281f0f4ab8a4a7.tar.bz2 |
aded util::url_decode()
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | include/opkele/util.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/opkele/util.h b/include/opkele/util.h index fd974a1..0130bff 100644 --- a/include/opkele/util.h +++ b/include/opkele/util.h | |||
@@ -10,56 +10,64 @@ namespace opkele { | |||
10 | using std::string; | 10 | using std::string; |
11 | using std::vector; | 11 | using std::vector; |
12 | 12 | ||
13 | /** | 13 | /** |
14 | * @brief opkele utils namespace | 14 | * @brief opkele utils namespace |
15 | */ | 15 | */ |
16 | namespace util { | 16 | namespace util { |
17 | 17 | ||
18 | /** | 18 | /** |
19 | * Convert internal time representation to w3c format | 19 | * Convert internal time representation to w3c format |
20 | * @param t internal representation | 20 | * @param t internal representation |
21 | * @return w3c time | 21 | * @return w3c time |
22 | * @throw failed_conversion in case of error | 22 | * @throw failed_conversion in case of error |
23 | */ | 23 | */ |
24 | string time_to_w3c(time_t t); | 24 | string time_to_w3c(time_t t); |
25 | /** | 25 | /** |
26 | * Convert W3C time representation to internal time_t | 26 | * Convert W3C time representation to internal time_t |
27 | * @param w w3c representation | 27 | * @param w w3c representation |
28 | * @return converted time | 28 | * @return converted time |
29 | * @throw failed_conversion in case of error | 29 | * @throw failed_conversion in case of error |
30 | */ | 30 | */ |
31 | time_t w3c_to_time(const string& w); | 31 | time_t w3c_to_time(const string& w); |
32 | 32 | ||
33 | /** | 33 | /** |
34 | * Encode string to the representation suitable for using in URL. | 34 | * Encode string to the representation suitable for using in URL |
35 | * @param str string to encode | 35 | * @param str string to encode |
36 | * @return encoded string | 36 | * @return encoded string |
37 | * @throw failed_conversion in case of failure | 37 | * @throw failed_conversion in case of failure |
38 | */ | 38 | */ |
39 | string url_encode(const string& str); | 39 | string url_encode(const string& str); |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Decode url-encoded string back to normal | ||
43 | * @param str url-encoded string | ||
44 | * @return decoded string | ||
45 | * @throw failed_conversion in case of failure | ||
46 | */ | ||
47 | string url_decode(const string& str); | ||
48 | |||
49 | /** | ||
42 | * Make string suitable for using as x(ht)ml attribute. | 50 | * Make string suitable for using as x(ht)ml attribute. |
43 | * @param str string to escape | 51 | * @param str string to escape |
44 | * @return escaped string | 52 | * @return escaped string |
45 | */ | 53 | */ |
46 | string attr_escape(const string& str); | 54 | string attr_escape(const string& str); |
47 | 55 | ||
48 | /** | 56 | /** |
49 | * Convert number to string | 57 | * Convert number to string |
50 | * @param l number | 58 | * @param l number |
51 | * @return string representation | 59 | * @return string representation |
52 | * @throw failed_conversion in case of failure | 60 | * @throw failed_conversion in case of failure |
53 | */ | 61 | */ |
54 | string long_to_string(long l); | 62 | string long_to_string(long l); |
55 | /** | 63 | /** |
56 | * Convert string to number | 64 | * Convert string to number |
57 | * @param s string, containing the number | 65 | * @param s string, containing the number |
58 | * @return the number | 66 | * @return the number |
59 | * @throw failed_conversion in case of failure | 67 | * @throw failed_conversion in case of failure |
60 | */ | 68 | */ |
61 | long string_to_long(const string& s); | 69 | long string_to_long(const string& s); |
62 | 70 | ||
63 | /** | 71 | /** |
64 | * Encode binary data using base64. | 72 | * Encode binary data using base64. |
65 | * @param data pointer to binary data | 73 | * @param data pointer to binary data |