Data Structures | |
struct | yaml_emitter_t |
The emitter structure. More... | |
Typedefs | |
typedef int | yaml_write_handler_t (void *data, unsigned char *buffer, size_t size) |
The prototype of a write handler. | |
Enumerations | |
enum | yaml_emitter_state_t { YAML_EMIT_STREAM_START_STATE, YAML_EMIT_FIRST_DOCUMENT_START_STATE, YAML_EMIT_DOCUMENT_START_STATE, YAML_EMIT_DOCUMENT_CONTENT_STATE, YAML_EMIT_DOCUMENT_END_STATE, YAML_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE, YAML_EMIT_FLOW_SEQUENCE_ITEM_STATE, YAML_EMIT_FLOW_MAPPING_FIRST_KEY_STATE, YAML_EMIT_FLOW_MAPPING_KEY_STATE, YAML_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE, YAML_EMIT_FLOW_MAPPING_VALUE_STATE, YAML_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE, YAML_EMIT_BLOCK_SEQUENCE_ITEM_STATE, YAML_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE, YAML_EMIT_BLOCK_MAPPING_KEY_STATE, YAML_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE, YAML_EMIT_BLOCK_MAPPING_VALUE_STATE, YAML_EMIT_END_STATE } |
The emitter states. | |
Functions | |
int | yaml_emitter_initialize (yaml_emitter_t *emitter) |
Initialize an emitter. | |
void | yaml_emitter_delete (yaml_emitter_t *emitter) |
Destroy an emitter. | |
void | yaml_emitter_set_output_string (yaml_emitter_t *emitter, unsigned char *output, size_t size, size_t *size_written) |
Set a string output. | |
void | yaml_emitter_set_output_file (yaml_emitter_t *emitter, FILE *file) |
Set a file output. | |
void | yaml_emitter_set_output (yaml_emitter_t *emitter, yaml_write_handler_t *handler, void *data) |
Set a generic output handler. | |
void | yaml_emitter_set_encoding (yaml_emitter_t *emitter, yaml_encoding_t encoding) |
Set the output encoding. | |
void | yaml_emitter_set_canonical (yaml_emitter_t *emitter, int canonical) |
Set if the output should be in the "canonical" format as in the YAML specification. | |
void | yaml_emitter_set_indent (yaml_emitter_t *emitter, int indent) |
Set the intendation increment. | |
void | yaml_emitter_set_width (yaml_emitter_t *emitter, int width) |
Set the preferred line width. | |
void | yaml_emitter_set_unicode (yaml_emitter_t *emitter, int unicode) |
Set if unescaped non-ASCII characters are allowed. | |
void | yaml_emitter_set_break (yaml_emitter_t *emitter, yaml_break_t line_break) |
Set the preferred line break. | |
int | yaml_emitter_emit (yaml_emitter_t *emitter, yaml_event_t *event) |
Emit an event. | |
int | yaml_emitter_flush (yaml_emitter_t *emitter) |
Flush the accumulated characters to the output. |
|
The prototype of a write handler. The write handler is called when the emitter needs to flush the accumulated characters to the output. The handler should write size bytes of the buffer to the output.
|
|
Initialize an emitter. This function creates a new emitter object. An application is responsible for destroying the object using the yaml_emitter_delete() function.
|
|
Destroy an emitter.
|
|
Set a string output. The emitter will write the output characters to the output buffer of the size size. The emitter will set size_written to the number of written bytes. If the buffer is smaller than required, the emitter produces the YAML_WRITE_ERROR error.
|
|
Set a file output. file should be a file object open for writing. The application is responsible for closing the file.
|
|
Set a generic output handler.
|
|
Set the output encoding.
|
|
Set if the output should be in the "canonical" format as in the YAML specification.
|
|
Set the intendation increment.
|
|
Set the preferred line width.
|
|
Set if unescaped non-ASCII characters are allowed.
|
|
Set the preferred line break.
|
|
Emit an event. The event object may be generated using the yaml_parser_parse() function. The emitter takes the responsibility for the event object and destroys its content after it is emitted. The event object is destroyed even if the function fails.
|
|
Flush the accumulated characters to the output.
|