/** A wrapper around the C functions from <rtl/uri.h>.
*/ class Uri
{ public: /** A wrapper around rtl_uriEncode() from <rtl/uri.h> (see there), using anarrayof128booleansascharclass.
*/ staticinline rtl::OUString encode(rtl::OUString const & rText,
sal_Bool const * pCharClass,
rtl_UriEncodeMechanism eMechanism,
rtl_TextEncoding eCharset);
/** A wrapper around rtl_uriEncode() from <rtl/uri.h> (see there), using apredefinedrtl_UriCharClassenumerationmember.
*/ staticinline rtl::OUString encode(rtl::OUString const & rText,
rtl_UriCharClass eCharClass,
rtl_UriEncodeMechanism eMechanism,
rtl_TextEncoding eCharset);
/** A wrapper around rtl_uriDecode() from <rtl/uri.h> (see there).
*/ staticinline rtl::OUString decode(rtl::OUString const & rText,
rtl_UriDecodeMechanism eMechanism,
rtl_TextEncoding eCharset);
/** A wrapper around rtl_uriConvertRelToAbs() from <rtl/uri.h> (see there).
// Create a char class (for use with rtl_uriEncode and rtl::Uri::encode), represented as a // compile-time std::array, from an UTF-8 string literal. // // The given `unencoded` lists each ASCII character once that shall not be encoded. (It uses an // UTF-8 string type to emphasize that its characters' values are always interpreted as ASCII // values.) #if HAVE_CPP_CONSTEVAL
consteval #else
constexpr #endif auto createUriCharClass(std::u8string_view unencoded)
{
std::array<sal_Bool, UriCharClassSize> a = {}; for (auto c: unencoded) {
assert(!a[c]); // would presumably indicate a typo in the `unencoded` argument
a[c] = true;
} return a;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.