DCL 4.0
Loading...
Searching...
No Matches
URLDecoder Class Reference

#include <URI.h>

Static Public Member Functions

static ByteString decode (const char *_begin, const char *_end)
static ByteString decode (const ByteString &_str)
static String decode (const String &_str)

Detailed Description

Definition at line 18 of file URI.h.

Member Function Documentation

◆ decode() [1/3]

ByteString URLDecoder::decode ( const ByteString & _str)
static

Definition at line 69 of file URI.cpp.

70{
71 return URLDecoder::decode(_str, _str.data() + _str.length());
72}
static ByteString decode(const char *_begin, const char *_end)
Definition URI.cpp:46

◆ decode() [2/3]

ByteString URLDecoder::decode ( const char * _begin,
const char * _end )
static

Definition at line 46 of file URI.cpp.

47{
48 ByteStringBuilder r;
49 while (_begin < _end) {
50 if (*_begin == '+')
51 r += ' ';
52 else if (
53 *_begin == '%'
54 && (_begin + 2) < _end
55 && isxdigit(*(_begin +1))
56 && isxdigit(*(_begin + 2))
57 )
58 {
59 r += (char)hextoi(_begin + 1);
60 _begin += 2;
61 }
62 else
63 r += *_begin;
64 _begin++;
65 }
66 return r;
67}
ByteString r

◆ decode() [3/3]

String URLDecoder::decode ( const String & _str)
static

Definition at line 74 of file URI.cpp.

75{
76 return UTF8Decoder::decode(
78 UTF8Encoder::encode(_str)
79 )
80 );
81}

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