29 maxlen = initialAllocatedLength;
39 if (
chars !=
nullptr) {
99 if (this->
chars !=
nullptr) {
101 this->len = copy_len;
103 memmove(this->
chars, source, copy_len);
104 this->
chars[copy_len] = 0;
111 if (this->
chars !=
nullptr) {
112 for (
int j = 0; j <
len; j++) {
126 for (
size_t i = 0; i <
len; i++) {
128 new_size += strlen(temp);
131 char result[new_size + 1];
132 memset(result,0, new_size+1);
133 for (
size_t i = 0; i <
len; i++) {
135 strcat(result, temp);
139 strcpy(
chars, result);
140 this->len = strlen(result);
147 size_t result_idx = 0;
149 if (
chars[i] ==
'%' && i + 2 <
len) {
150 szTemp[0] =
chars[i + 1];
151 szTemp[1] =
chars[i + 2];
154 }
else if (
chars[i] ==
'+') {
155 chars[result_idx] =
' ';
163 chars[result_idx] = 0;
164 this->
len = result_idx;
201 bool grow(
int newMaxLen)
override {
203 assert(newMaxLen < 1024 * 10);
204 if (newMaxLen < 0)
return false;
207 LOGD(
"grow(%d)", newMaxLen);
221 snprintf(result, maxLen,
"%c", c);
222 }
else if (isspace(c)) {
223 snprintf(result, maxLen,
"%s",
"+");
225 snprintf(result, maxLen,
"%%%X%X", c >> 4, c % 16);
230 if (ch >=
'0' && ch <=
'9') {
231 return (
char)(ch -
'0');
233 if (ch >=
'a' && ch <=
'f') {
234 return (
char)(ch -
'a' + 10);
236 if (ch >=
'A' && ch <=
'F') {
237 return (
char)(ch -
'A' + 10);
247 ch = (szBuffer[0] << 4) | szBuffer[1];
#define LOGD(...)
Definition AudioLoggerIDF.h:27
#define assert(T)
Definition avr.h:10