gebr-validator

gebr-validator

Functions

Types and Values

Description

Functions

gebr_validator_new ()

GebrValidator *
gebr_validator_new (GebrGeoXmlDocument **flow,
                    GebrGeoXmlDocument **line,
                    GebrGeoXmlDocument **proj);

Parameters

flow

Reference to a flow

 

line

Reference to a line

 

proj

Reference to a project

 

Returns

A GebrValidator to validate type parameters and/or expressions.


gebr_validator_insert ()

gboolean
gebr_validator_insert (GebrValidator *self,
                       GebrGeoXmlParameter *param,
                       GList **affected,
                       GError **error);

gebr_validator_remove ()

gboolean
gebr_validator_remove (GebrValidator *self,
                       GebrGeoXmlParameter *param,
                       GList **affected,
                       GError **error);

Parameters

validator

A GebrValidator

 

param

The variable to be deleted

 

affected

A list containing the GebrGeoXmlParameter's affected

 

Returns

TRUE if the variable was removed, FALSE if variable is not defined


gebr_validator_rename ()

gboolean
gebr_validator_rename (GebrValidator *self,
                       GebrGeoXmlParameter *param,
                       const gchar *new_name,
                       GList **affected,
                       GError **error);

If the param has not been inserted in validator, returns FALSE

Parameters

validator

A GebrValidator

 

param

The variable to operate on

 

new_name

The new name for param

 

affected

The GebrGeoXmlParameter's affected by this operation

 

error

Return location for error, or NULL

 

Returns

TRUE if no error ocurred, FALSE otherwise


gebr_validator_change_value ()

gboolean
gebr_validator_change_value (GebrValidator *self,
                             GebrGeoXmlParameter *param,
                             const gchar *new_value,
                             GList **affected,
                             GError **error);

Find variable on the correct scope, and changes the param value to new_value .

Parameters

validator

A GebrValidator

 

param

The variable to operate on

 

new_value

The new value for param

 

affected

The GebrGeoXmlParameter's affected by this operation

 

error

Return location for error, or NULL

 

Returns

TRUE if no error ocurred, FALSE otherwise


gebr_validator_move ()

gboolean
gebr_validator_move (GebrValidator *self,
                     GebrGeoXmlParameter *source,
                     GebrGeoXmlParameter *pivot,
                     GebrGeoXmlDocumentType pivot_scope,
                     GebrGeoXmlParameter **copy,
                     GList **affected,
                     GError **error);

Parameters

validator

A GebrValidator

 

source

The variable to operate on

 

pivot

The pivot for the operation, or NULL to append

 

pivot_scope

The scope of the pivot

 

copy

The return location for the new parameter

 

affected

The GebrGeoXmlParameter's affected by this operation

 

error

Return location for error

 

Returns

TRUE if the move was successfull, FALSE otherwise.


gebr_validator_validate_param ()

gboolean
gebr_validator_validate_param (GebrValidator *validator,
                               GebrGeoXmlParameter *parameter,
                               gchar **validated,
                               GError **error);

Validates parameter 's values and returns the validated string. If parameter is not valid, then error is filled with the appropriate message and NULL is returned.

Parameters

validator

A GebrValidator

 

parameter

The GebrGeoXmlParameter to be validated

 

validated

Return location for the validated string, free with g_free()

 

error

Return location for the error, or NULL

 

Returns

TRUE if param is valid, FALSE otherwise.


gebr_validator_validate_expr_on_scope ()

gboolean
gebr_validator_validate_expr_on_scope (GebrValidator *self,
                                       const gchar *str,
                                       GebrGeoXmlParameterType type,
                                       GebrGeoXmlDocumentType scope,
                                       GError **err);

gebr_validator_validate_expr ()

gboolean
gebr_validator_validate_expr (GebrValidator *validator,
                              const gchar *expression,
                              GebrGeoXmlParameterType type,
                              GError **error);

Parameters

validator

A GebrValidator

 

expression

The expression to be validated

 

type

The type of the expression

 

error

Returns location for the error, or NULL

 

Returns

TRUE if expression is valid, FALSE otherwise.


gebr_validator_get_documents ()

void
gebr_validator_get_documents (GebrValidator *validator,
                              GebrGeoXmlDocument **flow,
                              GebrGeoXmlDocument **line,
                              GebrGeoXmlDocument **proj);

Parameters

validator

A GebrValidator

 

flow

Return location for the flow

 

line

Return location for the line

 

proj

Return location for the proj

 

gebr_validator_update ()

void
gebr_validator_update (GebrValidator *validator);

Updates of all variables of the changed documents.

Parameters

validator

The GebrValidator to be updated

 

gebr_validator_force_update ()

void
gebr_validator_force_update (GebrValidator *validator);

Forces update of all variables, ignoring document cache.


gebr_validator_free ()

void
gebr_validator_free (GebrValidator *validator);

Parameters

validator

The GebrValidator to be freed

 

gebr_validator_evaluate_interval ()

gboolean
gebr_validator_evaluate_interval (GebrValidator *self,
                                  const gchar *expr,
                                  GebrGeoXmlParameterType type,
                                  GebrGeoXmlDocumentType scope,
                                  gboolean show_interval,
                                  gchar **value,
                                  GError **error);

gebr_validator_evaluate ()

gboolean
gebr_validator_evaluate (GebrValidator *self,
                         const gchar *expr,
                         GebrGeoXmlParameterType type,
                         GebrGeoXmlDocumentType scope,
                         gchar **value,
                         GError **error);

gebr_validator_evaluate_param ()

gboolean
gebr_validator_evaluate_param (GebrValidator *self,
                               GebrGeoXmlParameter *myparam,
                               gchar **value,
                               GError **error);

Calculate the value of expr and return it at value .

Parameters

validator

The GebrValidator to be used

 

myparam

The parameter to evaluate

 

value

Returns the value of the expression.

 

error

Returns the error, if any.

 

Returns

TRUE if expr could be evaluated. FALSE otherwise.


gebr_validator_is_var_in_scope ()

gboolean
gebr_validator_is_var_in_scope (GebrValidator *self,
                                const gchar *name,
                                GebrGeoXmlDocumentType scope);

Returns

TRUE if name exists in scope , FALSE otherwise


gebr_validator_set_document ()

void
gebr_validator_set_document (GebrValidator *self,
                             GebrGeoXmlDocument **doc,
                             GebrGeoXmlDocumentType type,
                             gboolean force);

gebr_validator_set_document is deprecated and should not be used in newly-written code.

Use gebr_validator_push_document() and gebr_validator_pop_document() instead.

Set on validator, a new doc .


gebr_validator_push_document ()

void
gebr_validator_push_document (GebrValidator *self,
                              GebrGeoXmlDocument **doc,
                              GebrGeoXmlDocumentType type);

Pushes doc into this validator, saving a copy of the last document in a queue. This effectivelly changes the whole validation, using doc 's variables instead of the original one. To return to the last state, see gebr_validator_pop_document().

Notice that there is a queue for each type of document.


gebr_validator_pop_document ()

GebrGeoXmlDocument **
gebr_validator_pop_document (GebrValidator *self,
                             GebrGeoXmlDocumentType type);

Pops the current document and return the validator to the last saved state. See gebr_validator_push_document().


gebr_validator_use_iter ()

gboolean
gebr_validator_use_iter (GebrValidator *self,
                         const gchar *expr,
                         GebrGeoXmlParameterType type,
                         GebrGeoXmlDocumentType scope);

Returns


gebr_validator_validate_control_parameter ()

gboolean
gebr_validator_validate_control_parameter
                               (GebrValidator *self,
                                const gchar *name,
                                const gchar *expression,
                                GError **error);

Return FALSE if parameter have error, FALSE otherwise

Parameters

self

GebrValidator to validate parameter

 

error

GError to set if has error

 

Types and Values

GebrValidator

typedef struct _GebrValidator GebrValidator;