// Sub-stream for writing quoted text, as opposed to markup. // Characters written to this stream are subject to quoting, // as '<' => "<", etc. class xmlTextStream : public outputStream { friendclass xmlStream; friendclass defaultStream; // tty private:
// Output stream for writing XML-structured logs. // To write markup, use special calls elem, head/tail, etc. // Use the xmlStream::text() stream to write unmarked text. // Text written that way will be quoted as necessary using '<', etc. // Characters written directly to an xmlStream via print_cr, etc., // are directly written to the encapsulated stream, xmlStream::out(). // This can be used to produce markup directly, character by character. // (Such writes are not checked for markup syntax errors.)
class xmlStream : public outputStream { friendclass defaultStream; // tty public: enum MarkupState { BODY, // after end_head() call, in text
HEAD, // after begin_head() call, in attrs
ELEM }; // after begin_elem() call, in attrs
protected:
outputStream* _out; // file stream by which it goes
julong _last_flush; // last position of flush
MarkupState _markup_state; // where in the elem/head/tail dance
outputStream* _text; // text stream
xmlTextStream _text_init;
// for subclasses
xmlStream() {} void initialize(outputStream* out);
// protect this from public use:
outputStream* out() { return _out; }
// helpers for writing XML elements void va_tag(bool push, constchar* format, va_list ap) ATTRIBUTE_PRINTF(3, 0); virtualvoid see_tag(constchar* tag, bool push) NOT_DEBUG({}); virtualvoid pop_tag(constchar* tag) NOT_DEBUG({});
#ifdef ASSERT // in debug mode, we verify matching of opening and closing tags int _element_depth; // number of unfinished elements char* _element_close_stack_high; // upper limit of down-growing stack char* _element_close_stack_low; // upper limit of down-growing stack char* _element_close_stack_ptr; // pointer of down-growing stack #endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.