Top |
XbSilo * | xb_silo_new () |
XbSilo * | xb_silo_new_from_xml () |
GBytes * | xb_silo_get_bytes () |
gboolean | xb_silo_load_from_bytes () |
gboolean | xb_silo_load_from_file () |
gboolean | xb_silo_save_to_file () |
gchar * | xb_silo_to_string () |
guint | xb_silo_get_size () |
const gchar * | xb_silo_get_guid () |
XbNode * | xb_silo_get_root () |
void | xb_silo_invalidate () |
gboolean | xb_silo_is_valid () |
gboolean | xb_silo_watch_file () |
void | xb_silo_set_profile_flags () |
const gchar * | xb_silo_get_profile_string () |
gboolean | xb_silo_get_enable_node_cache () |
void | xb_silo_set_enable_node_cache () |
XbQuery * | xb_silo_lookup_query () |
#define | XB_TYPE_SILO |
struct | XbSiloClass |
enum | XbSiloLoadFlags |
enum | XbSiloProfileFlags |
XbSilo |
XbSilo provides read-only access and querying of a previously parsed blob of XML data.
All signal emissions from XbSilo (currently only “notify” emissions) will happen in the GMainContext which is the thread default when the XbSilo is constructed.
This GMainContext must be iterated for file monitoring using
xb_silo_watch_file()
to function correctly.
XbSilo * xb_silo_new_from_xml (const gchar *xml
,GError **error
);
Creates a new silo from an XML string.
Since: 0.1.0
GBytes *
xb_silo_get_bytes (XbSilo *self
);
Gets the backing object that created the blob.
You should never *ever* modify this data.
Since: 0.1.0
gboolean xb_silo_load_from_bytes (XbSilo *self
,GBytes *blob
,XbSiloLoadFlags flags
,GError **error
);
Loads a silo from memory location.
Since: 0.1.0
gboolean xb_silo_load_from_file (XbSilo *self
,GFile *file
,XbSiloLoadFlags flags
,GCancellable *cancellable
,GError **error
);
Loads a silo from file.
self |
a XbSilo |
|
file |
a GFile |
|
flags |
||
cancellable |
a GCancellable, or |
|
error |
the GError, or |
Since: 0.1.0
gboolean xb_silo_save_to_file (XbSilo *self
,GFile *file
,GCancellable *cancellable
,GError **error
);
Saves a silo to a file.
Since: 0.1.0
gchar * xb_silo_to_string (XbSilo *self
,GError **error
);
Converts the silo to an internal string representation. This is only really useful for debugging XbSilo itself.
Since: 0.1.0
guint
xb_silo_get_size (XbSilo *self
);
Gets the number of nodes in the silo.
Since: 0.1.0
const gchar *
xb_silo_get_guid (XbSilo *self
);
Gets the GUID used to identify this silo.
Since: 0.1.0
XbNode *
xb_silo_get_root (XbSilo *self
);
Gets the root node for the silo. (MIGHT BE MORE).
Since: 0.1.0
void
xb_silo_invalidate (XbSilo *self
);
Invalidates a silo. Future calls xb_silo_is_valid()
will return FALSE
.
Since: 0.1.1
gboolean
xb_silo_is_valid (XbSilo *self
);
Checks is the silo is valid. The usual reason the silo is invalidated is when the backing mmapped file has changed, or one of the imported files have been modified.
Since: 0.1.0
gboolean xb_silo_watch_file (XbSilo *self
,GFile *file
,GCancellable *cancellable
,GError **error
);
Adds a file monitor to the silo. If the file or directory for file
changes
then the silo will be invalidated.
The monitor will internally use the GMainContext which was the thread default when the XbSilo was created, so that GMainContext must be iterated for monitoring to work.
Since: 0.1.0
void xb_silo_set_profile_flags (XbSilo *self
,XbSiloProfileFlags profile_flags
);
Enables or disables the collection of profiling data.
Since: 0.1.1
const gchar *
xb_silo_get_profile_string (XbSilo *self
);
Returns the profiling data. This will only return profiling text if
xb_silo_set_profile_flags()
was used with XB_SILO_PROFILE_FLAG_APPEND
.
Since: 0.1.1
gboolean
xb_silo_get_enable_node_cache (XbSilo *self
);
Get “enable-node-cache”.
Since: 0.2.0
void xb_silo_set_enable_node_cache (XbSilo *self
,gboolean enable_node_cache
);
Set “enable-node-cache”.
This is not thread-safe, and can only be called before the XbSilo is passed between threads.
Since: 0.2.0
XbQuery * xb_silo_lookup_query (XbSilo *self
,const gchar *xpath
);
Create an XbQuery from the given xpath
XPath string, or return it from the
query cache in the XbSilo.
xpath
must be valid: it is a programmer error if creating the query fails
(i.e. if xb_query_new()
returns an error).
This function is thread-safe.
Since: 0.3.0