Template.Template.expand

### Method

# Template Templateexpand

#### Declaration

    gboolean
    tmpl_template_expand (
      TmplTemplate* self,
      GOutputStream* stream,
      TmplScope* scope,
      GCancellable* cancellable,
      GError** error
    )

#### Description

Expands a template into `stream` using the `scope` provided.

`scope` should have all of the variables set that are required to expand the template, or you will get a symbol reference error and `FALSE` will be returned.

To set a symbol value, get the symbol with `tmpl_scope_get()` and assign a value using `tmpl_scope_assign_value()` or similar methods.

#### Parameters

`stream`

  Type: `GOutputStream`

  A `GOutputStream` to write the results to.

  The data is owned by the caller of the method.

`scope`

  Type: `TmplScope`

  A `TmplScope` containing state for the template, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`cancellable`

  Type: `GCancellable`

  An optional cancellable for the operation.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `gboolean`

`TRUE` if successful, otherwise `FALSE` and `error` is set.