class ObjectRenderer
Required header: <Eclog/ObjectRenderer.h>
The ObjectRenderer class represents an object renderer.
Name | Description |
---|---|
(constructor) | Constructor. |
beginObject | Begins rendering an object. |
endObject | Ends rendering the current object. |
beginArray | Begins rendering an array. |
endArray | Ends rendering the current array. |
renderMember | Renders a key-value pair. |
renderEmptyLines | Renders one or more empty lines. |
renderComment | Renders a comment. |
beginInline | Begins an inline-block. |
endInline | Ends an inline-block. |
operator RendererHandle | Returns a handle to this renderer. |
explicit ObjectRenderer(RendererHandle parent);
explicit ObjectRenderer(ObjectRenderer& parent);
Constructs an ObjectRenderer.
RendererHandle
parent Handle to the parent renderer.
ObjectRenderer&
parent Reference to the parent renderer.
void beginObject(const KeyDesc& key);
void beginObject(const KeyDesc& key, ErrorCode& ec);
Begins rendering an object.
The key-value pairs of the object must be rendered with a new object renderer (an ObjectRenderer instance) constructed from this renderer.
Each call to this method must be paired with a call to endObject.
const
KeyDesc&
key The description of the key of the nested object.
ErrorCode&
ec Set to indicate what error occurred, if any.
An InvalidOperation
fault occurs if there is currently a nested object or array being rendered.
void endObject();
void endObject(ErrorCode& ec);
Ends rendering the current object.
The object renderer of the current 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 there is currently no nested object that is being rendered.
An InvalidOperation
fault occurs if there is currently a deeply nested object or array that is being rendered.
void beginArray(const KeyDesc& key);
void beginArray(const KeyDesc& key, ErrorCode& ec);
Begins rendering an array.
The values of the array must be rendered with a new array renderer (an ArrayRenderer instance) constructed from this renderer.
Each call to this method must be paired with a call to endArray.
const
KeyDesc&
key The description of the key of the nested array.
ErrorCode&
ec Set to indicate what error occurred, if any.
An InvalidOperation
fault occurs if there is currently a nested object or array being rendered.
Ends rendering the current array.
The array renderer of the current array, if there is one, is invalidated after this call.
ErrorCode&
ec Set to indicate what error occurred, if any.
An InvalidOperation
fault occurs if there is currently no nested array that is being rendered.
An InvalidOperation
fault occurs if there is currently a deeply nested object or array that is being rendered.
void renderMember(const KeyDesc& key, const ValueDesc& value);
void renderMember(const KeyDesc& key, const ValueDesc& value, ErrorCode& ec);
Renders a key-value pair.
const
KeyDesc&
key The description of the key.
const
ValueDesc&
value The description of the value.
ErrorCode&
ec Set to indicate what error occurred, if any.
An InvalidOperation
fault occurs if there is currently a nested object or array being 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 there is currently a nested object or array 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 there is currently a nested object or array being rendered.
int beginInline();
Begins an inline-block.
int
The nesting level of the inline block.
An InvalidOperation
fault occurs if there is currently a nested object or array being rendered.
int endInline();
Ends an inline-block.
int
The nesting level of the inline block.
An InvalidOperation
fault occurs if there is currently a nested object or array being rendered.
operator RendererHandle();
Returns a handle to this renderer.
RendererHandle
Handle to this renderer.