![]() |
![]() |
![]() |
Libosinfo Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#define OSINFO_ENTITY_PROP_ID struct OsinfoEntity; struct OsinfoEntityClass; void osinfo_entity_add_param (OsinfoEntity *entity
,const gchar *key
,const gchar *value
); void osinfo_entity_clear_param (OsinfoEntity *entity
,const gchar *key
); const gchar * osinfo_entity_get_id (OsinfoEntity *entity
); GList * osinfo_entity_get_param_keys (OsinfoEntity *entity
); const gchar * osinfo_entity_get_param_value (OsinfoEntity *entity
,const gchar *key
); GList * osinfo_entity_get_param_value_list (OsinfoEntity *entity
,const gchar *key
); void osinfo_entity_set_param (OsinfoEntity *entity
,const gchar *key
,const gchar *value
);
GObject +----OsinfoEntity +----OsinfoDeployment +----OsinfoDevice +----OsinfoDeviceLink +----OsinfoMedia +----OsinfoProduct +----OsinfoResources +----OsinfoTree
OsinfoEntity is an abstract base class for all objects against which metadata needs to be recorded. Every object has a unique identifier, which is recommended to be in URI format. Named, multi-valued data parameters can be associated with each entity. When filtering lists of entities, the parameter values can be used for matching.
struct OsinfoEntityClass { GObjectClass parent_class; /* class members */ };
void osinfo_entity_add_param (OsinfoEntity *entity
,const gchar *key
,const gchar *value
);
Adds a new parameter against the entity. A key can have multiple values associated. Thus repeated calls with the same key will build up a list of possible values.
|
OsinfoEntity containing the parameters |
|
the name of the key |
|
the data to associated with that key |
void osinfo_entity_clear_param (OsinfoEntity *entity
,const gchar *key
);
Remove all values associated with a key
|
OsinfoEntity containing the parameters |
|
the name of the key |
const gchar * osinfo_entity_get_id (OsinfoEntity *entity
);
Retrieves the unique key for the entity. The format of identifiers is undefined, but the recommended practice is to use a URI.
|
a OsinfoEntity |
Returns : |
the unique key for the entity. [transfer none] |
GList * osinfo_entity_get_param_keys (OsinfoEntity *entity
);
Retrieve all the known parameter keys associated with the entity
|
OsinfoEntity containing the parameters |
Returns : |
The list of string parameters. [transfer container][element-type utf8] |
const gchar * osinfo_entity_get_param_value (OsinfoEntity *entity
,const gchar *key
);
Retrieve the parameter value associated with a named key. If multiple values are stored against the key, only the first value is returned. If no value is associated, NULL is returned
|
OsinfoEntity containing the parameters |
|
the name of the key |
Returns : |
the value associated with the key, or NULL. [transfer none] |
GList * osinfo_entity_get_param_value_list (OsinfoEntity *entity
,const gchar *key
);
Retrieve all the parameter values associated with a named key. If no values are associated, NULL is returned
|
OsinfoEntity containing the parameters |
|
the name of the key |
Returns : |
the values associated with the key. [transfer container][element-type utf8] |
void osinfo_entity_set_param (OsinfoEntity *entity
,const gchar *key
,const gchar *value
);
Sets a new parameter against the entity. If the key already has a value associated with it, the existing value will be cleared.
|
OsinfoEntity containing the parameters |
|
the name of the key |
|
the data to associated with that key |