| Top |
TmplTemplate *
tmpl_template_new (TmplTemplateLocator *locator);
Creates a new TmplTemplate.
If locator
is specified, locator
will be used to resolve include
directives when parsing the template.
TmplTemplateLocator *
tmpl_template_get_locator (TmplTemplate *self);
Gets the template locator used when resolving template includes.
void tmpl_template_set_locator (TmplTemplate *self,TmplTemplateLocator *locator);
gboolean tmpl_template_parse_file (TmplTemplate *self,GFile *file,GCancellable *cancellable,GError **error);
gboolean tmpl_template_parse_resource (TmplTemplate *self,const gchar *path,GCancellable *cancellable,GError **error);
gboolean tmpl_template_parse_path (TmplTemplate *self,const gchar *path,GCancellable *cancellable,GError **error);
gboolean tmpl_template_parse_string (TmplTemplate *self,const gchar *input,GError **error);
gboolean tmpl_template_parse (TmplTemplate *self,GInputStream *stream,GCancellable *cancellable,GError **error);
gboolean tmpl_template_expand (TmplTemplate *self,GOutputStream *stream,TmplScope *scope,GCancellable *cancellable,GError **error);
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.
self |
A TmplTemplate. |
|
stream |
a GOutputStream to write the results to |
|
scope |
[nullable] | |
cancellable |
An optional cancellable for the operation. |
[nullable] |
error |
gchar * tmpl_template_expand_string (TmplTemplate *self,TmplScope *scope,GError **error);
Expands the template and returns the result as a string.
“locator” property“locator” TmplTemplateLocator *
The locator used for resolving includes.
Flags: Read / Write / Construct