Arduino DLNA Server
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
tiny_dlna::XMLProtocolInfoParser Class Reference

Streaming parser for ConnectionManager::GetProtocolInfo results. More...

#include <XMLProtocolInfoParser.h>

Static Public Member Functions

static bool parse (Stream &in, std::function< void(const char *entry, ProtocolRole role)> cb)
 

Detailed Description

Streaming parser for ConnectionManager::GetProtocolInfo results.

This small utility parses the SOAP/XML reply of the GetProtocolInfo action and extracts the comma-separated entries found inside the <Source>...</Source> and <Sink>...</Sink> elements. It's designed for low-memory environments and works in a streaming fashion without buffering the full response. Two entry points are provided:

The callback receives each protocol-info entry as a C-string and a ProtocolRole indicating whether it came from Source or Sink.

Member Function Documentation

◆ parse()

static bool tiny_dlna::XMLProtocolInfoParser::parse ( Stream &  in,
std::function< void(const char *entry, ProtocolRole role)>  cb 
)
inlinestatic

Parse a streamed GetProtocolInfo XML result from a connected Client. The parser searches for <Source>...</Source> and <Sink>...</Sink> and invokes cb(entry, role) for each CSV entry found. This is low-memory and does not buffer the full response.

Parameters
cliconnected Client to read from
cbcallback invoked for each parsed CSV entry
Returns
true if parsing completed or at least one entry was parsed, false on error (e.g., cli == nullptr)

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