AnjutaPluginDescription

AnjutaPluginDescription — Plugin description from .plugin file

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libanjuta/anjuta-plugin-description.h>

void                (*AnjutaPluginDescriptionSectionFunc)
                                                        (AnjutaPluginDescription *df,
                                                         const gchar *name,
                                                         gpointer user_data);
void                (*AnjutaPluginDescriptionLineFunc)  (AnjutaPluginDescription *df,
                                                         const gchar *key,
                                                         const gchar *locale,
                                                         const gchar *value,
                                                         gpointer data);
enum                AnjutaPluginDescriptionParseError;
#define             ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR
GQuark              anjuta_plugin_description_parse_error_quark
                                                        (void);
AnjutaPluginDescription * anjuta_plugin_description_new (const gchar *filename,
                                                         GError **error);
AnjutaPluginDescription * anjuta_plugin_description_new_from_string
                                                        (gchar *data,
                                                         GError **error);
gchar *             anjuta_plugin_description_to_string (AnjutaPluginDescription *df);
void                anjuta_plugin_description_free      (AnjutaPluginDescription *df);
AnjutaPluginDescription * anjuta_plugin_description_copy
                                                        (AnjutaPluginDescription *df);
void                anjuta_plugin_description_foreach_section
                                                        (AnjutaPluginDescription *df,
                                                         AnjutaPluginDescriptionSectionFunc func,
                                                         gpointer user_data);
void                anjuta_plugin_description_foreach_key
                                                        (AnjutaPluginDescription *df,
                                                         const gchar *section_name,
                                                         gboolean include_localized,
                                                         AnjutaPluginDescriptionLineFunc func,
                                                         gpointer user_data);
gboolean            anjuta_plugin_description_get_raw   (AnjutaPluginDescription *df,
                                                         const gchar *section_name,
                                                         const gchar *keyname,
                                                         const gchar *locale,
                                                         gchar **val);
gboolean            anjuta_plugin_description_get_integer
                                                        (AnjutaPluginDescription *df,
                                                         const gchar *section,
                                                         const gchar *keyname,
                                                         gint *val);
gboolean            anjuta_plugin_description_get_boolean
                                                        (AnjutaPluginDescription *df,
                                                         const gchar *section,
                                                         const gchar *keyname,
                                                         gboolean *val);
gboolean            anjuta_plugin_description_get_string
                                                        (AnjutaPluginDescription *df,
                                                         const gchar *section,
                                                         const gchar *keyname,
                                                         gchar **val);
gboolean            anjuta_plugin_description_get_locale_string
                                                        (AnjutaPluginDescription *df,
                                                         const gchar *section,
                                                         const gchar *keyname,
                                                         gchar **val);
gboolean            anjuta_plugin_description_override  (AnjutaPluginDescription *df,
                                                         const gchar *section_name,
                                                         const gchar *keyname,
                                                         const gchar *val);
gboolean            anjuta_plugin_description_remove    (AnjutaPluginDescription *df,
                                                         const gchar *section_name,
                                                         const gchar *keyname);
                    AnjutaPluginDescription;

Object Hierarchy

  GBoxed
   +----AnjutaPluginDescription

Description

Details

AnjutaPluginDescriptionSectionFunc ()

void                (*AnjutaPluginDescriptionSectionFunc)
                                                        (AnjutaPluginDescription *df,
                                                         const gchar *name,
                                                         gpointer user_data);


AnjutaPluginDescriptionLineFunc ()

void                (*AnjutaPluginDescriptionLineFunc)  (AnjutaPluginDescription *df,
                                                         const gchar *key,
                                                         const gchar *locale,
                                                         const gchar *value,
                                                         gpointer data);


enum AnjutaPluginDescriptionParseError

typedef enum {
  ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_SYNTAX,
  ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_ESCAPES,
  ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_CHARS
} AnjutaPluginDescriptionParseError;

Possible errors when parsing a plugin file

ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_SYNTAX

Syntax of plugin file is invalid

ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_ESCAPES

Invalid escape sequence

ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR_INVALID_CHARS

Invalid characters

ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR

#define             ANJUTA_PLUGIN_DESCRIPTION_PARSE_ERROR


anjuta_plugin_description_parse_error_quark ()

GQuark              anjuta_plugin_description_parse_error_quark
                                                        (void);


anjuta_plugin_description_new ()

AnjutaPluginDescription * anjuta_plugin_description_new (const gchar *filename,
                                                         GError **error);


anjuta_plugin_description_new_from_string ()

AnjutaPluginDescription * anjuta_plugin_description_new_from_string
                                                        (gchar *data,
                                                         GError **error);

Parses the given plugin description data (usally read from the plugin description file and creates an instance of AnjutaPluginDescription. The format of the content string is similar to .ini format.

data :

The data to parse. The format of the data is .ini style.

Returns :

a new AnjutaPluginDescription object

anjuta_plugin_description_to_string ()

gchar *             anjuta_plugin_description_to_string (AnjutaPluginDescription *df);

Converts the description detains into string format, usually for saving it in a file.

df :

an AnjutaPluginDescription object.

Returns :

The string representation of the description. The returned values must be freed after use. [transfer full][allow-none]

anjuta_plugin_description_free ()

void                anjuta_plugin_description_free      (AnjutaPluginDescription *df);

Frees the AnjutaPluginDescription instance.

df :

an AnjutaPluginDescription object

anjuta_plugin_description_copy ()

AnjutaPluginDescription * anjuta_plugin_description_copy
                                                        (AnjutaPluginDescription *df);


anjuta_plugin_description_foreach_section ()

void                anjuta_plugin_description_foreach_section
                                                        (AnjutaPluginDescription *df,
                                                         AnjutaPluginDescriptionSectionFunc func,
                                                         gpointer user_data);

Calls func for each of the sections in the description.

df :

an AnjutaPluginDescription object.

func :

Callback function.

user_data :

User data to pass to func.

anjuta_plugin_description_foreach_key ()

void                anjuta_plugin_description_foreach_key
                                                        (AnjutaPluginDescription *df,
                                                         const gchar *section_name,
                                                         gboolean include_localized,
                                                         AnjutaPluginDescriptionLineFunc func,
                                                         gpointer user_data);

Calls func for each of the keys in the given section. include_localized, if set to TRUE will make it call func for the localized keys also, otherwise only one call is made for the key in current locale.

df :

an AnjutaPluginDescription object.

section_name :

Name of the section.

include_localized :

Whether each localized key should be called separately.

func :

The callback function.

user_data :

User data to pass to func.

anjuta_plugin_description_get_raw ()

gboolean            anjuta_plugin_description_get_raw   (AnjutaPluginDescription *df,
                                                         const gchar *section_name,
                                                         const gchar *keyname,
                                                         const gchar *locale,
                                                         gchar **val);

Retrieves the value of a key (in the given section) for the given locale. The value returned in val must be freed after use.

df :

an AnjutaPluginDescription object.

section_name :

Name of the section.

keyname :

Name of the key.

locale :

The locale for which the value is to be retrieved.

val :

Pointer to the variable to store the string value. [out][transfer full][allow-none]

Returns :

TRUE if sucessful, otherwise FALSE.

anjuta_plugin_description_get_integer ()

gboolean            anjuta_plugin_description_get_integer
                                                        (AnjutaPluginDescription *df,
                                                         const gchar *section,
                                                         const gchar *keyname,
                                                         gint *val);

Returns the value of key as integer in the given section.

df :

an AnjutaPluginDescription object.

section :

Section name.

keyname :

Key name.

val :

Pointer to value to store retured value.

Returns :

TRUE if sucessful, otherwise FALSE.

anjuta_plugin_description_get_boolean ()

gboolean            anjuta_plugin_description_get_boolean
                                                        (AnjutaPluginDescription *df,
                                                         const gchar *section,
                                                         const gchar *keyname,
                                                         gboolean *val);

Returns the value of key as boolean in the given section.

df :

an AnjutaPluginDescription object.

section :

Section name.

keyname :

Key name.

val :

Pointer to value to store retured value.

Returns :

TRUE if sucessful, otherwise FALSE.

anjuta_plugin_description_get_string ()

gboolean            anjuta_plugin_description_get_string
                                                        (AnjutaPluginDescription *df,
                                                         const gchar *section,
                                                         const gchar *keyname,
                                                         gchar **val);

Returns the value of key in the given section.

df :

an AnjutaPluginDescription object.

section :

Section name.

keyname :

Key name.

val :

Pointer to value to store retured value.

Returns :

TRUE if sucessful, otherwise FALSE.

anjuta_plugin_description_get_locale_string ()

gboolean            anjuta_plugin_description_get_locale_string
                                                        (AnjutaPluginDescription *df,
                                                         const gchar *section,
                                                         const gchar *keyname,
                                                         gchar **val);

Returns the value of key in the given section in current locale.

df :

an AnjutaPluginDescription object.

section :

Section name.

keyname :

Key name.

val :

Pointer to value to store retured value.

Returns :

TRUE if sucessful, otherwise FALSE.

anjuta_plugin_description_override ()

gboolean            anjuta_plugin_description_override  (AnjutaPluginDescription *df,
                                                         const gchar *section_name,
                                                         const gchar *keyname,
                                                         const gchar *val);

Override the value of a key in the description. This can be removed using the function anjuta_plugin_description_remove().

df :

an AnjutaPluginDescription object.

section_name :

Section name.

keyname :

Key name.

val :

Pointer to value to store retured value.

Returns :

TRUE if sucessful, otherwise FALSE.

anjuta_plugin_description_remove ()

gboolean            anjuta_plugin_description_remove    (AnjutaPluginDescription *df,
                                                         const gchar *section_name,
                                                         const gchar *keyname);

Remove a key from the description.

df :

an AnjutaPluginDescription object.

section_name :

Section name.

keyname :

Key name.

Returns :

TRUE if sucessful, otherwise FALSE.

AnjutaPluginDescription

typedef struct _AnjutaPluginDescription AnjutaPluginDescription;

See Also

AnjutaPlugin, AnjutaPluginHandle