| Home | Libraries | People | FAQ | More

#### format_context_base

(EXPERIMENTAL) Base class for concrete format contexts.

##### Synopsis

Defined in header `<boost/mysql/format_sql.hpp>`

    class format_context_base

##### Member Functions

Name | Description
--- | ---
add_error | Adds an error to the current error state.
append_raw | Adds raw SQL to the output string.
append_value | Formats a value and adds it to the output string.
error_state | Retrieves the current error state.
format_opts | Retrieves the format options.

##### Description

Conceptually, a format context contains:

- The result string. Output operations append characters to this output string. `format_context_base` is agnostic to the output string type.
- `format_options` required to format values.
- An error state (`error_state`) that is set by output operations when they fail. The error state is propagated to `basic_format_context::get`.

References to this class are useful when you need to manipulate a format context without knowing the type of the actual context that will be used, like when specializing `formatter`.

This class can't be instantiated directly - use `basic_format_context`, instead. Do not subclass it, either.

Convenience header `<boost/mysql.hpp>`