summaryrefslogtreecommitdiffabout
path: root/include/kingate/util.h
Side-by-side diff
Diffstat (limited to 'include/kingate/util.h') (more/less context) (ignore whitespace changes)
-rw-r--r--include/kingate/util.h35
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
@@ -5,2 +5,10 @@
+#ifndef __deprecated
+#if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3
+#define __deprecated __attribute__((deprecated))
+#else
+#define __deprecated
+#endif
+#endif
+
namespace kingate {
@@ -9,7 +17,7 @@ namespace kingate {
/**
- * 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);
/**
@@ -17,5 +25,20 @@ namespace kingate {
* @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
+ */
+ inline string __deprecated url_escape(const string& str) {
+ return url_encode(str);
+ }
+ /**
+ * deprecated alias to url_decode.
+ * @see url_decode
*/
- string url_unescape(const string& str);
+ inline string __deprecated url_unescape(const string& str) {
+ return url_decode(str);
+ }
}