LiConfigData

LiConfigData

Functions

Types and Values

Object Hierarchy

    GObject
    ╰── LiConfigData

Description

Functions

LI_TYPE_CONFIG_DATA

#define LI_TYPE_CONFIG_DATA (li_config_data_get_type ())


li_config_data_new ()

LiConfigData *
li_config_data_new (void);

Creates a new LiConfigData.

Returns

a LiConfigData.

[transfer full]


li_config_data_load_file ()

void
li_config_data_load_file (LiConfigData *cdata,
                          GFile *file,
                          GError **error);

li_config_data_load_data ()

void
li_config_data_load_data (LiConfigData *cdata,
                          const gchar *data);

li_config_data_open_block ()

gboolean
li_config_data_open_block (LiConfigData *cdata,
                           const gchar *field,
                           const gchar *value,
                           gboolean reset_index);

Open a block in the config file.

Parameters

cdata

A valid LiConfigData instance

 

field

A field indentifier

 

value

The value of the field, or NULL if not important.

[allow-none][default NULL]

reset_index

TRUE if the block should be searched from the beginning, or from the current position.

 

li_config_data_new_block ()

void
li_config_data_new_block (LiConfigData *cdata);

Create a new block at the end of the file and open it.


li_config_data_get_value ()

gchar *
li_config_data_get_value (LiConfigData *cdata,
                          const gchar *field);

li_config_data_set_value ()

gboolean
li_config_data_set_value (LiConfigData *cdata,
                          const gchar *field,
                          const gchar *value);

Change the value of a field in the currently opened block. If the field does not exist, it will be created.

Parameters

field

The field which should be changed

 

value

The new value for the specified field

 

Returns

TRUE if value was sucessfully changed.


li_config_data_get_data ()

gchar *
li_config_data_get_data (LiConfigData *cdata);

li_config_data_save_to_file ()

gboolean
li_config_data_save_to_file (LiConfigData *cdata,
                             const gchar *filename,
                             GError **error);

li_config_data_reset ()

void
li_config_data_reset (LiConfigData *cdata);

Reset current block index and jup to the beginning.


li_config_data_next ()

gboolean
li_config_data_next (LiConfigData *cdata);

Jump to the next block.

Parameters

cdata

A valid LiConfigData instance

 

Returns

TRUE if successful, FALSE if there is no new block to be found.

Types and Values

struct LiConfigDataClass

struct LiConfigDataClass {
	GObjectClass		parent_class;
};


LiConfigData

typedef struct _LiConfigData LiConfigData;