glibmm: Gio::SettingsSchema Class Reference

Introspecting and controlling the loading of GSettings schemas. More...

#include <giomm/settingsschema.h>

Public Member Functions

void reference () const
Increment the reference count for this object. More...

void unreference () const
Decrement the reference count for this object. More...

GSettingsSchema* gobj ()
Provides access to the underlying C instance. More...

const GSettingsSchema* gobj () const
Provides access to the underlying C instance. More...

GSettingsSchema* gobj_copy () const
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...

SettingsSchema ()=delete
SettingsSchema (const SettingsSchema &)=delete
SettingsSchema & operator= (const SettingsSchema &)=delete
Glib::ustring get_id () const
Get the ID of schema . More...

Glib::ustring get_path () const
Gets the path associated with schema , or nullptr . More...

Glib::RefPtr < SettingsSchemaKey > get_key (const Glib::ustring & name)
Gets the key named name from schema . More...

Glib::RefPtr < const SettingsSchemaKey > get_key (const Glib::ustring & name) const
Gets the key named name from schema . More...

bool has_key (const Glib::ustring & name) const
Checks if schema has a key named name . More...

std::vector < Glib::ustring > list_keys () const
Introspects the list of keys on schema . More...

std::vector < Glib::ustring > list_children () const
Gets the list of children in schema . More...

Protected Member Functions

void operator delete (void*, std::size_t)

Related Functions

(Note that these are not member functions.)

Glib::RefPtr < Gio::SettingsSchema > wrap (GSettingsSchema* object, bool take_copy=false)
A Glib::wrap() method for this object. More...

Detailed Description

Introspecting and controlling the loading of GSettings schemas.

The SettingsSchemaSource and SettingsSchema APIs provide a mechanism for advanced control over the loading of schemas and a mechanism for introspecting their content.

Plugin loading systems that wish to provide plugins a way to access settings face the problem of how to make the schemas for these settings visible to GSettings. Typically, a plugin will want to ship the schema along with itself and it won't be installed into the standard system directories for schemas.

SettingsSchemaSource provides a mechanism for dealing with this by allowing the creation of a new 'schema source' from which schemas can be acquired. This schema source can then become part of the metadata associated with the plugin and queried whenever the plugin requires access to some settings.

Since glibmm 2.32:

Constructor & Destructor Documentation

Gio::SettingsSchema::SettingsSchema ( )
delete
Gio::SettingsSchema::SettingsSchema ( const SettingsSchema & )
delete

Member Function Documentation

Glib::ustring Gio::SettingsSchema::get_id ( ) const

Get the ID of schema .

Returns
The ID.
Glib::RefPtr < SettingsSchemaKey > Gio::SettingsSchema::get_key ( const Glib::ustring & name )

Gets the key named name from schema .

It is a programmer error to request a key that does not exist. See g_settings_schema_list_keys().

Since glibmm 2.40:
Parameters
name The name of a key.
Returns
The SettingsSchemaKey for name .
Glib::RefPtr <const SettingsSchemaKey > Gio::SettingsSchema::get_key ( const Glib::ustring & name ) const

Gets the key named name from schema .

It is a programmer error to request a key that does not exist. See g_settings_schema_list_keys().

Since glibmm 2.40:
Parameters
name The name of a key.
Returns
The SettingsSchemaKey for name .
Glib::ustring Gio::SettingsSchema::get_path ( ) const

Gets the path associated with schema , or nullptr .

Schemas may be single-instance or relocatable. Single-instance schemas correspond to exactly one set of keys in the backend database: those located at the path returned by this function.

Relocatable schemas can be referenced by other schemas and can threfore describe multiple sets of keys at different locations. For relocatable schemas, this function will return nullptr .

Since glibmm 2.32:
Returns
The path of the schema, or nullptr .
GSettingsSchema* Gio::SettingsSchema::gobj ( )

Provides access to the underlying C instance.

const GSettingsSchema* Gio::SettingsSchema::gobj ( ) const

Provides access to the underlying C instance.

GSettingsSchema* Gio::SettingsSchema::gobj_copy ( ) const

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

bool Gio::SettingsSchema::has_key ( const Glib::ustring & name ) const

Checks if schema has a key named name .

Since glibmm 2.40:
Parameters
name The name of a key.
Returns
true if such a key exists.
std::vector < Glib::ustring > Gio::SettingsSchema::list_children ( ) const

Gets the list of children in schema .

You should free the return value with Glib::strfreev() when you are done with it.

Since glibmm 2.44:
Returns
A list of the children on settings .
std::vector < Glib::ustring > Gio::SettingsSchema::list_keys ( ) const

Introspects the list of keys on schema .

You should probably not be calling this function from "normal" code (since you should already know what keys are in your schema). This function is intended for introspection reasons.

Since glibmm 2.46:
Returns
A list of the keys on schema .
void Gio::SettingsSchema::operator delete ( void * ,
std::size_t
)
protected
SettingsSchema & Gio::SettingsSchema::operator= ( const SettingsSchema & )
delete
void Gio::SettingsSchema::reference ( ) const

Increment the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

void Gio::SettingsSchema::unreference ( ) const

Decrement the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

Friends And Related Function Documentation

Glib::RefPtr < Gio::SettingsSchema > wrap ( GSettingsSchema * object ,
bool take_copy = false
)
related

A Glib::wrap() method for this object.

Parameters
object The C instance.
take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.