Converter for URL-Encoding.
More...
#include <Recoder.hpp>
|
| URLConverter (bool const encode=true) |
| Constructor; inEnc and outEnc are fixed by the encode flag.
|
|
Conversion const * | make (char const *const buf, size_t const bufSize) const |
| Convert from byte buffer. More...
|
|
| Converter (std::string const &inEnc, std::string const &outEnc, bool const &sloppy=false) |
| Converter base constructor.
|
|
virtual Conversion const * | make (char const *const buf, size_t const bufSize) const =0 |
| Convert from byte buffer. More...
|
|
Conversion const * | make (char const *const cStr) const |
| Convert from C-String.
|
|
Conversion const * | make (std::string const &str) const |
| Convert from std::string.
|
|
std::string | getID () const |
| Get id (informational).
|
|
|
static std::string | encode (std::string const &url) |
| Encode an URL string. More...
|
|
static std::string | decode (std::string const &url) |
| Decode an URL encoded string. More...
|
|
|
enum | ErrorCode { EncUnknown_
, ConversionErr_
, UnknownErr_
} |
| Error codes for exceptions.
|
|
typedef CodeException< ErrorCode > | Exception |
| Exceptions for this class.
|
|
std::string const | inEnc_ |
|
std::string const | outEnc_ |
|
bool const | sloppy_ |
|
Converter for URL-Encoding.
◆ decode()
std::string UI::Util::URLConverter::decode |
( |
std::string const & |
url | ) |
|
|
static |
Decode an URL encoded string.
The following rules are applied in the conversion: The alphanumeric characters "a" through "z", "A" through "Z" and "0" through "9" remain the same. The special characters ".", "-", "*", and "_" remain the same. The plus sign "+" is converted into a space character " ". A sequence of the form "%xy" will be treated as representing a byte where xy is the two-digit hexadecimal representation of the 8 bits.
- Parameters
-
url | the encoded URL string |
- Returns
- the decoded URL
Referenced by make().
◆ encode()
std::string UI::Util::URLConverter::encode |
( |
std::string const & |
url | ) |
|
|
static |
Encode an URL string.
The following rules are applied in the conversion: The alphanumeric characters "a" through "z", "A" through "Z" and "0" through "9" remain the same. The special characters ".", "-", "*", and "_" remain the same. The space character " " is converted into a plus sign "+". The other special characters will be converted in a sequence of the form "%xy" which epresenting a byte where xy is the two-digit hexadecimal representation of the 8 bits.
- Parameters
-
- Returns
- the encoded URL
Referenced by make().
◆ make()
Conversion const * UI::Util::URLConverter::make |
( |
char const *const |
buf, |
|
|
size_t const |
bufSize |
|
) |
| const |
|
virtual |
The documentation for this class was generated from the following files: