GrlConfig

GrlConfig — Configuration data storage

Synopsis

#include <grilo.h>

#define             GRL_CONFIG_KEY_PLUGIN
#define             GRL_CONFIG_KEY_SOURCE
#define             GRL_CONFIG_KEY_APIKEY
#define             GRL_CONFIG_KEY_APITOKEN
#define             GRL_CONFIG_KEY_APISECRET
struct              GrlConfigClass;
void                grl_config_set_plugin               (GrlConfig *config,
                                                         const gchar *plugin);
void                grl_config_set_source               (GrlConfig *config,
                                                         const gchar *source);
void                grl_config_set_api_key              (GrlConfig *config,
                                                         const gchar *key);
void                grl_config_set_api_token            (GrlConfig *config,
                                                         const gchar *token);
void                grl_config_set_api_secret           (GrlConfig *config,
                                                         const gchar *secret);
gchar *             grl_config_get_plugin               (GrlConfig *config);
gchar *             grl_config_get_api_key              (GrlConfig *config);
gchar *             grl_config_get_api_token            (GrlConfig *config);
gchar *             grl_config_get_api_secret           (GrlConfig *config);
GrlConfig *         grl_config_new                      (const gchar *plugin,
                                                         const gchar *source);
void                grl_config_set                      (GrlConfig *config,
                                                         const gchar *param,
                                                         const GValue *value);
void                grl_config_set_string               (GrlConfig *config,
                                                         const gchar *param,
                                                         const gchar *value);
void                grl_config_set_int                  (GrlConfig *config,
                                                         const gchar *param,
                                                         gint value);
void                grl_config_set_float                (GrlConfig *config,
                                                         const gchar *param,
                                                         gfloat value);
gchar *             grl_config_get_string               (GrlConfig *config,
                                                         const gchar *param);
gint                grl_config_get_int                  (GrlConfig *config,
                                                         const gchar *param);
gfloat              grl_config_get_float                (GrlConfig *config,
                                                         const gchar *param);

Description

This class is used to store configuration settings used by plugins.

Details

GRL_CONFIG_KEY_PLUGIN

#define GRL_CONFIG_KEY_PLUGIN      "target-plugin"

GRL_CONFIG_KEY_SOURCE

#define GRL_CONFIG_KEY_SOURCE      "target-source"

GRL_CONFIG_KEY_APIKEY

#define GRL_CONFIG_KEY_APIKEY      "api-key"

GRL_CONFIG_KEY_APITOKEN

#define GRL_CONFIG_KEY_APITOKEN    "api-token"

GRL_CONFIG_KEY_APISECRET

#define GRL_CONFIG_KEY_APISECRET   "api-secret"

struct GrlConfigClass

struct GrlConfigClass {
  GObjectClass parent_class;
};

Grilo Config Class

GObjectClass parent_class;

the parent class structure

grl_config_set_plugin ()

void                grl_config_set_plugin               (GrlConfig *config,
                                                         const gchar *plugin);

Set the plugin key in the configuration

config :

the config instance

plugin :

the plugin id

Since 0.1.4


grl_config_set_source ()

void                grl_config_set_source               (GrlConfig *config,
                                                         const gchar *source);

Set the plugin key in the configuration

config :

the config instance

source :

the source id

Since 0.1.4


grl_config_set_api_key ()

void                grl_config_set_api_key              (GrlConfig *config,
                                                         const gchar *key);

Set the webservice API key in the configuration

config :

the config instance

key :

the API key

Since 0.1.4


grl_config_set_api_token ()

void                grl_config_set_api_token            (GrlConfig *config,
                                                         const gchar *token);

Set the webservice API token in the configuration

config :

the config instance

token :

the API token

Since 0.1.4


grl_config_set_api_secret ()

void                grl_config_set_api_secret           (GrlConfig *config,
                                                         const gchar *secret);

Set the webservice passphrase in the configuration

config :

the config instance

secret :

the webservice passphrase

Since 0.1.4


grl_config_get_plugin ()

gchar *             grl_config_get_plugin               (GrlConfig *config);

config :

the config instance

Returns :

the plugin id

Since 0.1.4


grl_config_get_api_key ()

gchar *             grl_config_get_api_key              (GrlConfig *config);

config :

the config instance

Returns :

the webservice API key

Since 0.1.4


grl_config_get_api_token ()

gchar *             grl_config_get_api_token            (GrlConfig *config);

config :

the config instance

Returns :

the webservice API token

Since 0.1.4


grl_config_get_api_secret ()

gchar *             grl_config_get_api_secret           (GrlConfig *config);

config :

the config instance

Returns :

the webservice API passphrase

Since 0.1.4


grl_config_new ()

GrlConfig *         grl_config_new                      (const gchar *plugin,
                                                         const gchar *source);

Creates a new data config object that will be associated with a plugin (if source is NULL), or a specific source spawned from a plugin (if source is not NULL). The latter may be useful for plugins spawning various sources, each one needing a different configuration.

plugin :

plugin id for this configuration

source :

source id for this configuration. [allow-none]

Returns :

a newly-allocated data config. The data config associated with the plugin should not be freed until the plugin has been unloaded. [transfer none]

Since 0.1.4


grl_config_set ()

void                grl_config_set                      (GrlConfig *config,
                                                         const gchar *param,
                                                         const GValue *value);

grl_config_set_string ()

void                grl_config_set_string               (GrlConfig *config,
                                                         const gchar *param,
                                                         const gchar *value);

grl_config_set_int ()

void                grl_config_set_int                  (GrlConfig *config,
                                                         const gchar *param,
                                                         gint value);

grl_config_set_float ()

void                grl_config_set_float                (GrlConfig *config,
                                                         const gchar *param,
                                                         gfloat value);

grl_config_get_string ()

gchar *             grl_config_get_string               (GrlConfig *config,
                                                         const gchar *param);

grl_config_get_int ()

gint                grl_config_get_int                  (GrlConfig *config,
                                                         const gchar *param);

grl_config_get_float ()

gfloat              grl_config_get_float                (GrlConfig *config,
                                                         const gchar *param);