ost::XMLStream(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’– ost::XMLStream(3) πŸ’–

okay bestie, gather round, because this is the manual page for ost::XMLStream from GNU CommonC++, and it's genuinely giving parser royalty energy. πŸ‘‘


✨ NAME ✨

ost::XMLStream β€” this class implements a basic XML stream parser that you can use to examine an XML resource thru virtual I/O methods. 🌈


🌸 SYNOPSIS 🌸

#include <xml.h>

Inherited by ost::XMLRPC.

πŸŽ€ Public Member Functions πŸŽ€

  • virtual bool open (const char *resource) β€” may perform an open operation on behalf of a parsed resource.
  • virtual void close (void) β€” may perform a close operation of an i/o source when the parser has completed operation.
  • virtual Slog::Level getLogging (void) β€” get error logging level.
  • virtual void comment (const unsigned char *text, size_t len) β€” virtual to receive embedded comments in an XML document being parsed.
  • virtual int read (unsigned char *buffer, size_t len)=0 β€” read method to aquire data for the parser.
  • virtual void characters (const unsigned char *text, size_t len)=0 β€” virtual to receive character text extracted from the document in the current element.
  • virtual void startDocument (void) β€” identify start of document event.
  • virtual void endDocument (void) β€” identify end of document event.
  • virtual void startElement (const unsigned char *name, const unsigned char **attr)=0 β€” identify start of an element in the document.
  • virtual void endElement (const unsigned char *name)=0 β€” identify end of an element in the document.
  • bool parse (const char *resource=NULL) β€” parse a resource as a stream thru the virtual read method.

πŸ¦‹ Protected Member Functions πŸ¦‹

  • virtual ~XMLStream ()

🌟 Detailed Description 🌟

This class implements a basic XML stream parser that can be used to examine an XML resource thru virtual I/O methods. no cap, that's the whole vibe. ✨

Here's the thing though, bestie: this class must be derived into one that can implement the physical I/O required to parse actual data. You can't just raw-dog it as-is, you gotta subclass it. A mixer class using XMLStream and URLStream would seem a likely combination for this purpose β€” like, that's the collab we'd want. πŸ’…

🫢 Author 🫢

  • David Sugar dyfet@ostel.com

⭐ XML Stream Parser (SAX) ⭐

πŸ’œ Examples πŸ’œ

  • xmlfetch.cpp.

😭 Constructor & Destructor Documentation 😭

virtual ost::XMLStream::~XMLStream () [protected], [virtual]

yep. that's the destructor. protected. virtual. iconic behaviour honestly. πŸŽ€


πŸ”₯ Member Function Documentation πŸ”₯

virtual void ost::XMLStream::characters (const unsigned char * text, size_t len) [pure virtual]

Virtual to receive character text extracted from the document in the current element.

Parameters

  • text received.
  • len length of text received.

virtual void ost::XMLStream::close (void) [virtual]

May perform a close operation of an i/o source when the parser has completed operation.


virtual void ost::XMLStream::comment (const unsigned char * text, size_t len) [virtual]

Virtual to receive embedded comments in an XML document being parsed.

Parameters

  • text text comment extracted.
  • len length of comment.

virtual void ost::XMLStream::endDocument (void) [virtual]

Identify end of document event.


virtual void ost::XMLStream::endElement (const unsigned char * name) [pure virtual]

Identify end of an element in the document.

Parameters

  • name of element found.

virtual Slog::Level ost::XMLStream::getLogging (void) [virtual]

Get error logging level.

Returns

  • error logging level.

virtual bool ost::XMLStream::open (const char * resource) [virtual]

May perform an open operation on behalf of a parsed resource. In some cases, the parser may be merged with a class that already has performed some kind of open, and this method can then be ignored. (yes bestie, ignoring it is valid here, we love a flexible API πŸ’…)

Returns

  • true if open is successful.

Parameters

  • resource passed to Parse methods.

bool ost::XMLStream::parse (const char * resource = NULL)

Parse a resource as a stream thru the virtual read method.

Returns

  • true if well formed document has been fully parsed.

Parameters

  • resource optional name of resource.

virtual int ost::XMLStream::read (unsigned char * buffer, size_t len) [pure virtual]

Read method to aquire data for the parser.

Returns

  • number of bytes actually read.

Parameters

  • buffer to read data into.
  • len number of bytes to read.

virtual void ost::XMLStream::startDocument (void) [virtual]

Identify start of document event.


virtual void ost::XMLStream::startElement (const unsigned char * name, const unsigned char ** attr) [pure virtual]

Identify start of an element in the document.

Parameters

  • name of element found.
  • attr list of attributes extracted.

🌈 Author 🌈

Generated automatically by Doxygen for GNU CommonC++ from the source code.


okay so that's literally it bestie, go forth and parse πŸ¦‹βœ¨

this page is from the GNU CommonC++ manual, dated Sun Dec 27 2020, and it's the ost::XMLStream(3) page β€” so if you're searching for it later, that's the whole address. πŸ’–
πŸ“¦ where this page comes from