struct CCL::ISgmlWriter

Overview

#include <itextwriter.h>

struct ISgmlWriter: public CCL::IMarkupWriter
{
    // methods

    virtual tresult CCL_API writeDocType (
        StringRef name,
        StringRef pubid,
        StringRef sysid,
        StringRef subset
    ) = 0;

    virtual void CCL_API setShouldIndent (tbool state) = 0;

    virtual tresult CCL_API startElement (
        StringRef name,
        const IStringDictionary* attributes = nullptr
    ) = 0;

    virtual tresult CCL_API endElement (StringRef name) = 0;
    virtual tresult CCL_API writeElement (StringRef name, StringRef value) = 0;

    virtual tresult CCL_API writeElement (
        StringRef name,
        const IStringDictionary* attributes = nullptr,
        StringRef value = nullptr
    ) = 0;

    virtual tresult CCL_API writeValue (StringRef value) = 0;
    virtual tresult CCL_API writeComment (StringRef text) = 0;
    virtual int CCL_API getCurrentDepth () const = 0;
};

Inherited Members

public:
    // methods

    virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0;
    virtual unsigned int CCL_API retain () = 0;
    virtual unsigned int CCL_API release () = 0;
    virtual void CCL_API setDocumentLineFormat (TextLineFormat lineFormat) = 0;

    virtual tresult CCL_API beginDocument (
        IStream& stream,
        TextEncoding encoding = Text::kUnknownEncoding
    ) = 0;

    virtual tresult CCL_API endDocument () = 0;
    virtual tresult CCL_API writeLine (StringRef text) = 0;

    virtual tresult CCL_API writeMarkup (
        StringRef markup,
        tbool appendNewline = false
    ) = 0;

    virtual tresult CCL_API encode (String& result, StringRef text) = 0;
    virtual tresult CCL_API encode (MutableCString& result, StringRef text) = 0;
    virtual tresult CCL_API decode (String& result, StringRef text) = 0;

Detailed Documentation

Methods

virtual tresult CCL_API writeDocType (
    StringRef name,
    StringRef pubid,
    StringRef sysid,
    StringRef subset
) = 0

Write DOCTYPE declaration.

virtual void CCL_API setShouldIndent (tbool state) = 0

Set whether to indent elements (default is on).

virtual tresult CCL_API startElement (
    StringRef name,
    const IStringDictionary* attributes = nullptr
) = 0

Start element.

Attributes are optional.

virtual tresult CCL_API endElement (StringRef name) = 0

End element.

virtual tresult CCL_API writeElement (StringRef name, StringRef value) = 0

Write simple element with text and no attributes.

virtual tresult CCL_API writeElement (
    StringRef name,
    const IStringDictionary* attributes = nullptr,
    StringRef value = nullptr
) = 0

Write simple element with optional attributes and text.

virtual tresult CCL_API writeValue (StringRef value) = 0

Write value inside an element.

virtual tresult CCL_API writeComment (StringRef text) = 0

Write comment.

virtual int CCL_API getCurrentDepth () const = 0

Get current depth of nested elements.