A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
a11::percent Namespace Reference

Functions

int HexDigit (char one)
 The value 0-15 of a hex digit, either case, or -1 if one is not one.
 
std::string Decode (std::string_view value, bool plus_is_space=false)
 Percent-decodes value, leaving anything malformed as it stands.
 
absl::StatusOr< std::string > DecodeStrict (std::string_view value, std::string_view what)
 Percent-decodes value, or says why it cannot be decoded.
 
std::string Encode (std::string_view value)
 Percent-encodes everything outside RFC 3986's unreserved set.
 

Function Documentation

◆ Decode()

std::string a11::percent::Decode ( std::string_view  value,
bool  plus_is_space = false 
)
inline

Percent-decodes value, leaving anything malformed as it stands.

Malformed percent escapes remain unchanged.

Parameters
valueText to decode.
plus_is_spaceMap + to a space, as application/x-www-form-urlencoded does. Off for a URL path or a baggage value, where + is literal.

◆ DecodeStrict()

absl::StatusOr< std::string > a11::percent::DecodeStrict ( std::string_view  value,
std::string_view  what 
)
inline

Percent-decodes value, or says why it cannot be decoded.

Returns an error for malformed escapes, including in credential URLs.

Parameters
valueText to decode.
whatNames the input in the error, e.g. "Redis URL".

◆ Encode()

std::string a11::percent::Encode ( std::string_view  value)
inline

Percent-encodes everything outside RFC 3986's unreserved set.

◆ HexDigit()

int a11::percent::HexDigit ( char  one)
inline

The value 0-15 of a hex digit, either case, or -1 if one is not one.