ui-utilcpp 1.10.3
|
Converter for URL-Encoding. More...
#include <Recoder.hpp>
Public Member Functions | |
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. | |
![]() | |
Converter (std::string const &inEnc, std::string const &outEnc, bool const &sloppy=false) | |
Converter base constructor. | |
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 Public Member Functions | |
static std::string | encode (std::string const &url) |
Encode an URL string. | |
static std::string | decode (std::string const &url) |
Decode an URL encoded string. | |
Additional Inherited Members | |
![]() | |
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.
|
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.
url | the encoded URL string |
Referenced by make().
|
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.
url | the URL to encode |
Referenced by make().