UI::Util::URLConverter Class Reference

Converter for URL-Encoding. More...

`#include <Recoder.hpp>`

Inheritance diagram for UI::Util::URLConverter:
Collaboration diagram for UI::Util::URLConverter:

## 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.
Public Member Functions inherited from UI::Util::Converter
| 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

Public Types inherited from UI::Util::Converter
enum | ErrorCode { EncUnknown_ , ConversionErr_ , UnknownErr_ }
| Error codes for exceptions.
typedef CodeException< ErrorCode > | Exception
| Exceptions for this class.
Protected Attributes inherited from UI::Util::Converter
std::string const | inEnc_
std::string const | outEnc_
bool const | sloppy_

## Detailed Description

Converter for URL-Encoding.

## Member Function Documentation

## 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

  url | the URL to encode

Returns
  the encoded URL

Referenced by make(), and URLConverter().

## make()

Conversion const * UI::Util::URLConverter::make | ( | char const *const | buf,
|  | size_t const | bufSize ) const

virtual

Convert from byte buffer.

Implements UI::Util::Converter.

References decode(), and encode().

The documentation for this class was generated from the following files:

- Recoder.hpp
- Recoder.cpp