DCL 3.7.4
Loading...
Searching...
No Matches
URLEncoder Class Reference

#include <URI.h>

Static Public Member Functions

static ByteString encode (const ByteString &_str)
static String encode (const String &_str)

Detailed Description

Definition at line 26 of file URI.h.

Member Function Documentation

◆ encode() [1/2]

ByteString URLEncoder::encode ( const ByteString & _str)
static

Definition at line 82 of file URI.cpp.

83{
84 static unsigned char hexchars[] = "0123456789ABCDEF";
85
86 ByteStringBuilder r;
87
88 const char* psz = _str.data();
89 for (; *psz; psz++) {
90 unsigned char c = (unsigned char)*psz;
91 if (c == ' ')
92 r += '+';
93 else if ((c < '0' && c != '-' && c != '.')
94 || (c < 'A' && c > '9')
95 || (c > 'Z' && c < 'a' && c != '_')
96 || (c > 'z')
97 ) {
98 r += '%';
99 r += (char)hexchars[c >> 4];
100 r += (char)hexchars[c & 15];
101 }
102 else
103 r += (char)c;
104 }
105 return r;
106}
IOException *size_t r
Definition MediaInfo.cpp:82

◆ encode() [2/2]

String URLEncoder::encode ( const String & _str)
static

Definition at line 108 of file URI.cpp.

109{
112 UTF8Encoder::encode(_str)
113 )
114 );
115}
static String decode(const char *_mbs, size_t _mbslen=(size_t) -1)
static ByteString encode(const ByteString &_str)
Definition URI.cpp:82

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