diff options
Diffstat (limited to 'Swiften/JID/JID.h')
-rw-r--r-- | Swiften/JID/JID.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Swiften/JID/JID.h b/Swiften/JID/JID.h index 63e063d..98b42da 100644 --- a/Swiften/JID/JID.h +++ b/Swiften/JID/JID.h @@ -7,7 +7,7 @@ #pragma once #include <string> -#include <ostream> +#include <iosfwd> namespace Swift { class JID { @@ -38,6 +38,18 @@ namespace Swift { return !hasResource_; } + /** + * Returns the given node, escaped according to XEP-0106. + * The resulting node is a valid node for a JID, whereas the input value can contain characters + * that are not allowed. + */ + static std::string getEscapedNode(const std::string& node); + + /** + * Returns the node of the current JID, unescaped according to XEP-0106. + */ + std::string getUnescapedNode() const; + JID toBare() const { JID result(*this); result.hasResource_ = false; |