class Renderer
Required header: <Eclog/Renderer.h>
The Renderer class represents an Eclog text renderer.
Name | Description |
---|---|
(constructor) | Constructor. |
beginRootObject | Begins rendering the root object. |
endRootObject | Ends rendering the root object. |
renderRootObject | Renders the root object directly with an object description. |
renderEmptyLines | Renders one or more empty lines. |
renderComment | Renders a comment. |
beginInline | Begins an inline-block. |
endInline | Ends an inline-block. |
close | Closes the renderer. |
operator RendererHandle | Returns a handle to this renderer. |
explicit Renderer(OutputStream& stream,
const RendererConfig& rendererConfig = RendererConfig());
Constructs a Renderer.
OutputStream&
stream The output stream to write to.
RendererConfig&
rendererConfig The renderer configuration.
void beginRootObject();
void beginRootObject(ErrorCode& ec);
Begins rendering the root object.
The key-value pairs of the root object must be rendered with a new object renderer (an ObjectRenderer instance) constructed from this renderer.
Call to this method must be paired with a call to endRootObject.
ErrorCode&
ec Set to indicate what error occurred, if any.
An InvalidOperation
fault occurs if the root object is being rendered or has been rendered.
void endRootObject();
void endRootObject(ErrorCode& ec);
Ends rendering the root object.
The object renderer of the root object, if there is one, is invalidated after this call.
ErrorCode&
ec Set to indicate what error occurred, if any.
An InvalidOperation
fault occurs if the root object is not currently being rendered.
An InvalidOperation
fault occurs if there is currently a deeply nested object or array that is being rendered.
void renderRootObject(const ObjectDesc& root);
void renderRootObject(const ObjectDesc& root, ErrorCode& ec);
Renders the root object directly with an object description.
const
ObjectDesc&
root The description of the root object.
ErrorCode&
ec Set to indicate what error occurred, if any.
An InvalidOperation
fault occurs if the root object is being rendered or has been rendered.
void renderEmptyLines(int count);
void renderEmptyLines(int count, ErrorCode& ec);
Renders one or more empty lines.
int
count Number of empty lines.
ErrorCode&
ec Set to indicate what error occurred, if any.
An InvalidOperation
fault occurs if the root object is currently being rendered.
void renderComment(cstring comment);
void renderComment(cstring comment, ErrorCode& ec);
Renders a comment.
cstring comment The comment.
ErrorCode&
ec Set to indicate what error occurred, if any.
An InvalidOperation
fault occurs if the root object is currently being rendered.
int beginInline();
Begins an inline-block.
int
The nesting level of the inline block.
An InvalidOperation
fault occurs if the root object is currently being rendered.
int endInline();
Ends an inline-block.
int
The nesting level of the inline block.
An InvalidOperation
fault occurs if the root object is currently being rendered.
void close();
void close(ErrorCode& ec);
Closes the renderer.
This renderer is invalidated after this operation.
ErrorCode&
ec Set to indicate what error occurred, if any.
An InvalidOperation
fault occurs if the root object is currently being rendered.
operator RendererHandle();
Returns a handle to this renderer.
RendererHandle
Handle to this renderer.