16 size_t write(uint8_t ch)
override {
24 size_t write(
const uint8_t* buffer,
size_t size)
override {
26 for (
int j = 0; j < size; j++) {
27 result +=
write(buffer[j]);
49 size_t printf(
const char* fmt, ...) {
53 int n = vsnprintf(buf,
sizeof(buf), fmt, args);
56 write((
const uint8_t*)buf, n);
Print to a dynamic string.
Definition: StrPrint.h:13
const char * c_str()
Definition: StrPrint.h:39
StrPrint(int incSize=STR_PRINT_INC_SIZE)
Definition: StrPrint.h:15
size_t length()
Definition: StrPrint.h:41
size_t write(uint8_t ch) override
Definition: StrPrint.h:16
void reset()
Definition: StrPrint.h:43
size_t write(const uint8_t *buffer, size_t size) override
Definition: StrPrint.h:24
bool expand_encoded
Definition: StrPrint.h:65
void consume(int n)
Definition: StrPrint.h:45
void setExpandEncoded(bool flag)
Definition: StrPrint.h:47
int inc_size
Definition: StrPrint.h:64
size_t printf(const char *fmt,...)
Definition: StrPrint.h:49
Str str
Definition: StrPrint.h:63
Heap-backed string utility used throughout tiny_dlna.
Definition: Str.h:27
int length() const
Current length (int)
Definition: Str.h:57
int replaceAll(const char *toReplace, const char *replaced)
Replace all occurrences of toReplace with replaced; returns count.
Definition: Str.h:279
void reset()
Clear contents (alias of clear)
Definition: Str.h:157
void add(const char *append)
Append C-string (ignored if nullptr)
Definition: Str.h:96
void setCapacity(size_t newLen)
Reserve capacity.
Definition: Str.h:323
const char * c_str() const
C-string pointer to internal buffer.
Definition: Str.h:88
void remove(int n)
removes the first n characters
Definition: Str.h:226
size_t capacity() const
Current capacity.
Definition: Str.h:325
#define MAX_PRINTF_SIZE
Max printf buffer size.
Definition: dlna_config.h:50
#define STR_PRINT_INITIAL_SIZE
Define initial size for StrPrint.
Definition: dlna_config.h:30
#define STR_PRINT_INC_SIZE
Define increment size for StrPrint.
Definition: dlna_config.h:35
Definition: Allocator.h:13