Skip to content

Latest commit

 

History

History
243 lines (142 loc) · 5.2 KB

ArrayRenderer.md

File metadata and controls

243 lines (142 loc) · 5.2 KB

ArrayRenderer

class ArrayRenderer

Required header: <Eclog/ArrayRenderer.h>

The ArrayRenderer class represents an array renderer.

Member functions

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 value.
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.

(constructor)

explicit ArrayRenderer(RendererHandle parent);
explicit ArrayRenderer(ArrayRenderer& parent);

Constructs an ArrayRenderer.

Parameters

RendererHandle parent Handle to the parent renderer.

ArrayRenderer& parent Reference to the parent renderer.


beginObject

void beginObject();
void beginObject(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.

Parameters

ErrorCode& ec Set to indicate what error occurred, if any.

Errors

An InvalidOperation fault occurs if there is currently a nested object or array being rendered.


endObject

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.

Parameters

ErrorCode& ec Set to indicate what error occurred, if any.

Errors

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.


beginArray

void beginArray();
void beginArray(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.

Parameters

ErrorCode& ec Set to indicate what error occurred, if any.

Errors

An InvalidOperation fault occurs if there is currently a nested object or array being rendered.


endArray

Ends rendering the current array.

The array renderer of the current array, if there is one, is invalidated after this call.

Parameters

ErrorCode& ec Set to indicate what error occurred, if any.

Errors

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.


renderMember

void renderMember(const ValueDesc& value);
void renderMember(const ValueDesc& value, ErrorCode& ec);

Renders a value.

Parameters

const ValueDesc& value The description of the value.

ErrorCode& ec Set to indicate what error occurred, if any.

Errors

An InvalidOperation fault occurs if there is currently a nested object or array being rendered.


renderEmptyLines

void renderEmptyLines(int count);
void renderEmptyLines(int count, ErrorCode& ec);

Renders one or more empty lines.

Parameters

int count Number of empty lines.

ErrorCode& ec Set to indicate what error occurred, if any.

Errors

An InvalidOperation fault occurs if there is currently a nested object or array being rendered.


renderComment

void renderComment(cstring comment);
void renderComment(cstring comment, ErrorCode& ec);

Renders a comment.

Parameters

cstring comment The comment.

ErrorCode& ec Set to indicate what error occurred, if any.

Errors

An InvalidOperation fault occurs if there is currently a nested object or array being rendered.


beginInline

int beginInline();

Begins an inline-block.

Return value

int The nesting level of the inline block.

Errors

An InvalidOperation fault occurs if there is currently a nested object or array being rendered.


endInline

int endInline();

Ends an inline-block.

Return value

int The nesting level of the inline block.

Errors

An InvalidOperation fault occurs if there is currently a nested object or array being rendered.


operator RendererHandle

operator RendererHandle();

Returns a handle to this renderer.

Return value

RendererHandle Handle to this renderer.