Loading...
Searching...
No Matches
template.h File Reference
`#include <glib-object.h>`
`#include "macros.h"`
`#include "types.h"`
Include dependency graph for template.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | GiraraTemplate
struct | GiraraTemplateClass

## Macros

#define | GIRARA_TYPE_TEMPLATE (girara_template_get_type())
#define | GIRARA_TEMPLATE(obj)
#define | GIRARA_TEMPLATE_CLASS(obj)
#define | GIRARA_IS_TEMPLATE(obj)
#define | GIRARA_IS_TEMPLATE_CLASS(obj)
#define | GIRARA_TEMPLATE_GET_CLASS(obj)

## Functions

GType | girara_template_get_type (void) G_GNUC_CONST GIRARA_VISIBLE
GiraraTemplate * | girara_template_new (const char *base) GIRARA_VISIBLE
void | girara_template_set_base (GiraraTemplate *object, const char *base) GIRARA_VISIBLE
const char * | girara_template_get_base (GiraraTemplate *object) GIRARA_VISIBLE
girara_list_t * | girara_template_referenced_variables (GiraraTemplate *object) GIRARA_VISIBLE
bool | girara_template_add_variable (GiraraTemplate *object, const char *name) GIRARA_VISIBLE
void | girara_template_set_variable_value (GiraraTemplate *object, const char *name, const char *value) GIRARA_VISIBLE
char * | girara_template_evaluate (GiraraTemplate *object) GIRARA_VISIBLE

## Macro Definition Documentation

## GIRARA_IS_TEMPLATE

#define GIRARA_IS_TEMPLATE | ( |  | obj | ) |

Value:
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GIRARA_TYPE_TEMPLATE))
GIRARA_TYPE_TEMPLATE
#define GIRARA_TYPE_TEMPLATE
Definition template.h:25

Definition at line 28 of file template.h.

## GIRARA_IS_TEMPLATE_CLASS

#define GIRARA_IS_TEMPLATE_CLASS | ( |  | obj | ) |

Value:
(G_TYPE_CHECK_CLASS_TYPE((obj), GIRARA_TYPE_TEMPLATE))

Definition at line 29 of file template.h.

## GIRARA_TEMPLATE

#define GIRARA_TEMPLATE | ( |  | obj | ) |

Value:
(G_TYPE_CHECK_INSTANCE_CAST((obj), GIRARA_TYPE_TEMPLATE, GiraraTemplate))

Definition at line 26 of file template.h.

## GIRARA_TEMPLATE_CLASS

#define GIRARA_TEMPLATE_CLASS | ( |  | obj | ) |

Value:
(G_TYPE_CHECK_CLASS_CAST((obj), GIRARA_TYPE_TEMPLATE, GiraraTemplateClass))

Definition at line 27 of file template.h.

## GIRARA_TEMPLATE_GET_CLASS

#define GIRARA_TEMPLATE_GET_CLASS | ( |  | obj | ) |

Value:
(G_TYPE_INSTANCE_GET_CLASS((obj), GIRARA_TYPE_TEMPLATE, GiraraTemplateClass))

Definition at line 30 of file template.h.

## GIRARA_TYPE_TEMPLATE

#define GIRARA_TYPE_TEMPLATE (girara_template_get_type())

Definition at line 25 of file template.h.

## Function Documentation

## girara_template_add_variable()

bool girara_template_add_variable | ( | GiraraTemplate * | object,
|  | const char * | name )

Register a variable.

Parameters

  object | GiraraTemplate object
  name | name of the variable

Returns
  true if the variable was added, false otherwise

## girara_template_evaluate()

char * girara_template_evaluate | ( | GiraraTemplate * | object | ) |

Replace all variables with their values in the template.

Parameters

  object | GiraraTemplate object

Returns
  evaluated template, needes to be deallocated with g_free

## girara_template_get_base()

const char * girara_template_get_base | ( | GiraraTemplate * | object | ) |

Get the base string of the template.

Parameters

  object | GiraraTemplate object

Returns
  string that is used as template

## girara_template_get_type()

GType girara_template_get_type | ( | void |  | ) |

Returns the type of the template.

Returns
  the type

## girara_template_new()

GiraraTemplate * girara_template_new | ( | const char * | base | ) |

Create new template object.

Parameters

  base | a string that is used as template

Returns
  a templot object

## girara_template_referenced_variables()

girara_list_t * girara_template_referenced_variables | ( | GiraraTemplate * | object | ) |

Get list of variable names referenced in the template.

Parameters

  object | GiraraTemplate object

Returns
  list of variables names referenced in the template

## girara_template_set_base()

void girara_template_set_base | ( | GiraraTemplate * | object,
|  | const char * | base )

Set the base string of the template.

Parameters

  object | GiraraTemplate object
  base | a string that is used as template

## girara_template_set_variable_value()

void girara_template_set_variable_value | ( | GiraraTemplate * | object,
|  | const char * | name,
|  | const char * | value )

Set value of a variable.

Parameters

  object | GiraraTemplate object
  name | name of the variable
  value | value of the variable