author | Michael Krelin <hacker@klever.net> | 2005-03-31 22:06:45 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2005-03-31 22:06:45 (UTC) |
commit | 0942697ed6ee058809db963f9cc3126f93139de2 (patch) (side-by-side diff) | |
tree | 2a5cdf5d200e302a6d6394e4a0193929dcb11bb0 /include/kingate/util.h | |
parent | 5b50415afdb7b708874293ac7047b9b70de78e59 (diff) | |
download | kingate-0942697ed6ee058809db963f9cc3126f93139de2.zip kingate-0942697ed6ee058809db963f9cc3126f93139de2.tar.gz kingate-0942697ed6ee058809db963f9cc3126f93139de2.tar.bz2 |
1. renamed url_escape/unescape to encode/decode
2. introduced a number of wrappers for accessing meta-variables mentioned in RFC3875
3. bumped library version info
-rw-r--r-- | include/kingate/util.h | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/include/kingate/util.h b/include/kingate/util.h index 4b0dca8..6024ccf 100644 --- a/include/kingate/util.h +++ b/include/kingate/util.h @@ -4,19 +4,42 @@ #include <string> +#ifndef __deprecated +#if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3 +#define __deprecated __attribute__((deprecated)) +#else +#define __deprecated +#endif +#endif + namespace kingate { using namespace std; /** - * Escape string for passing via URL. - * @param str string unescaped. - * @return the escaped string. + * Encode string for passing via URL. + * @param str string unencoded. + * @return the encoded string. */ - string url_escape(const string& str); + string url_encode(const string& str); /** * Remove URL-encoding from the string. * @param str the URL-encoded string. - * @return the unescaped string. + * @return the decoded string. + */ + string url_decode(const string& str); + + /** + * deprecated alias to url_encode. + * @see url_encode */ - string url_unescape(const string& str); + inline string __deprecated url_escape(const string& str) { + return url_encode(str); + } + /** + * deprecated alias to url_decode. + * @see url_decode + */ + inline string __deprecated url_unescape(const string& str) { + return url_decode(str); + } } |