40 size_t write(
const uint8_t* data,
size_t size)
override {
63 if (data ==
nullptr || total_len == 0)
return false;
151 Str& attributes,
int start,
int len,
void* ref) {
166 for (
int i = 0; i < path.size(); ++i) {
167 r->
outPath->push_back(path[i]);
Print to a dynamic string.
Definition: StrPrint.h:13
const char * c_str()
Definition: StrPrint.h:39
size_t length()
Definition: StrPrint.h:41
size_t write(uint8_t ch) override
Definition: StrPrint.h:16
void reset()
Definition: StrPrint.h:43
void consume(int n)
Definition: StrPrint.h:45
void setExpandEncoded(bool flag)
Definition: StrPrint.h:47
Heap-backed string utility used throughout tiny_dlna.
Definition: Str.h:27
bool isEmpty() const
True if empty.
Definition: Str.h:54
void reset()
Clear contents (alias of clear)
Definition: Str.h:157
void clear()
Clear contents (size -> 0)
Definition: Str.h:93
Lightweight wrapper around std::vector with Arduino-friendly helpers and a pluggable allocator.
Definition: Vector.h:39
Helper class that implements a Print interface to accumulate XML data and then parse it using XMLPars...
Definition: XMLParserPrint.h:16
XMLParserPrint()
Constructor.
Definition: XMLParserPrint.h:21
struct tiny_dlna::XMLParserPrint::CBRef cbref
StrPrint buffer
Internal buffer for accumulating XML data.
Definition: XMLParserPrint.h:112
const char * c_str()
Returns the internal buffer as a C string.
Definition: XMLParserPrint.h:100
size_t write(uint8_t ch) override
Writes a single byte to the buffer (Print interface)
Definition: XMLParserPrint.h:32
void setExpandEncoded(bool flag)
Forwards expand-entities setting to the underlying XMLParser.
Definition: XMLParserPrint.h:48
static void wrapperCallback(Str &nodeName, Vector< Str > &path, Str &text, Str &attributes, int start, int len, void *ref)
Static wrapper used as XMLParser callback. Copies the first invocation's data into the CBRef and forw...
Definition: XMLParserPrint.h:150
void end()
Resets the internal buffer.
Definition: XMLParserPrint.h:87
size_t length()
Returns the length of the internal buffer.
Definition: XMLParserPrint.h:106
size_t write(const uint8_t *data, size_t size) override
Writes a block of data to the buffer (Print interface)
Definition: XMLParserPrint.h:40
XMLParser p
XMLParser instance used for parsing.
Definition: XMLParserPrint.h:117
bool parse(Str &outNodeName, Vector< Str > &outPath, Str &outText, Str &outAttributes)
Parses the accumulated XML data and returns results via output parameters.
Definition: XMLParserPrint.h:59
Lightweight streaming XML parser.
Definition: XMLParser.h:27
void setCallback(void(*cb)(Str &nodeName, Vector< Str > &path, Str &text, Str &attributes, int start, int len, void *ref))
Set the callback to be invoked for parsed fragments.
Definition: XMLParser.h:78
void setReportTextOnly(bool flag)
report only nodes with text
Definition: XMLParser.h:128
void setXml(const char *xmlStr)
Set the XML buffer to parse.
Definition: XMLParser.h:68
void setReference(void *ref)
Attach an opaque user pointer to the parser instance.
Definition: XMLParser.h:60
void end()
Fully reset parser state (parse position, path stack and content starts). Use this when the underlyin...
Definition: XMLParser.h:118
bool parseSingle()
Parse a single fragment (one callback invocation) from the previously set XML buffer.
Definition: XMLParser.h:104
int getParsePos()
Expose current parse position for incremental wrappers.
Definition: XMLParser.h:131
Definition: Allocator.h:13
Internal callback reference used to capture the callback data from XMLParser and forward it to the ca...
Definition: XMLParserPrint.h:123
int len
Length of parsed data.
Definition: XMLParserPrint.h:127
int start
Start position of parsed data.
Definition: XMLParserPrint.h:125
Str * outNode
Output node name pointer.
Definition: XMLParserPrint.h:129
Str * outText
Output text pointer.
Definition: XMLParserPrint.h:133
Str * outAttrs
Output attributes pointer.
Definition: XMLParserPrint.h:135
Vector< Str > * outPath
Output path vector pointer.
Definition: XMLParserPrint.h:131