JULEA
Data Structures | Macros | Typedefs | Enumerations | Functions
URI

Data Structures

struct  JURI
 

Macros

#define J_URI_ERROR   j_uri_error_quark()
 

Typedefs

typedef struct JURI JURI
 

Enumerations

enum  JURIError {
  J_URI_ERROR_STORE_NOT_FOUND , J_URI_ERROR_COLLECTION_NOT_FOUND , J_URI_ERROR_ITEM_NOT_FOUND , J_URI_ERROR_STORE_EXISTS ,
  J_URI_ERROR_COLLECTION_EXISTS , J_URI_ERROR_ITEM_EXISTS
}
 

Functions

G_END_DECLS G_BEGIN_DECLS GQuark j_uri_error_quark (void)
 
JURIj_uri_new (gchar const *uri_)
 
void j_uri_free (JURI *uri)
 
gchar const * j_uri_get_collection_name (JURI *uri)
 
gchar const * j_uri_get_item_name (JURI *uri)
 
gboolean j_uri_get (JURI *uri, GError **error)
 
gboolean j_uri_create (JURI *uri, gboolean with_parents, GError **error)
 
gboolean j_uri_delete (JURI *uri, GError **error)
 
JCollectionj_uri_get_collection (JURI *uri)
 
JItemj_uri_get_item (JURI *uri)
 

Detailed Description

Macro Definition Documentation

◆ J_URI_ERROR

#define J_URI_ERROR   j_uri_error_quark()

A URI error domain.

Typedef Documentation

◆ JURI

typedef struct JURI JURI

A URI.

Enumeration Type Documentation

◆ JURIError

enum JURIError

A URI error code.

Enumerator
J_URI_ERROR_STORE_NOT_FOUND 
J_URI_ERROR_COLLECTION_NOT_FOUND 
J_URI_ERROR_ITEM_NOT_FOUND 
J_URI_ERROR_STORE_EXISTS 
J_URI_ERROR_COLLECTION_EXISTS 
J_URI_ERROR_ITEM_EXISTS 

Function Documentation

◆ j_uri_create()

gboolean j_uri_create ( JURI uri,
gboolean  with_parents,
GError **  error 
)

Creates the collection and item.

JURI* uri;
GError* error = NULL;
...
j_uri_create(uri, FALSE, &error);
Definition: juri.c:46
Parameters
uriA URI.
with_parentsWhether to create the parent objects, too.
errorAn error.
Returns
TRUE on success, FALSE if an error occurred.

◆ j_uri_delete()

gboolean j_uri_delete ( JURI uri,
GError **  error 
)

Deletes the collection and item.

JURI* uri;
GError* error = NULL;
...
j_uri_delete(uri, FALSE, &error);
Parameters
uriA URI.
errorAn error.
Returns
TRUE on success, FALSE if an error occurred.

◆ j_uri_error_quark()

GQuark j_uri_error_quark ( void  )

Returns the URI error quark.

Returns
The URI error quark.

◆ j_uri_free()

void j_uri_free ( JURI uri)

Frees the memory allocated by a URI.

JURI* uri;
...
j_uri_free(uri);
Parameters
uriA URI.

◆ j_uri_get()

gboolean j_uri_get ( JURI uri,
GError **  error 
)

Gets the collection and item.

JURI* uri;
GError* error = NULL;
...
j_uri_get(uri, &error);
Parameters
uriA URI.
errorAn error.
Returns
TRUE on success, FALSE if an error occurred.

◆ j_uri_get_collection()

JCollection * j_uri_get_collection ( JURI uri)

Returns the collection.

JCollection* collection;
JURI* uri;
...
JCollection * j_uri_get_collection(JURI *uri)
Definition: juri.c:380
Definition: jcollection.c:48
JCollection * collection
Definition: juri.c:60
Parameters
uriA URI.
Returns
The collection.

◆ j_uri_get_collection_name()

gchar const * j_uri_get_collection_name ( JURI uri)

Returns the collection name.

JURI* uri;
...
g_print("%s\n", j_uri_get_collection_name(uri));
gchar const * j_uri_get_collection_name(JURI *uri)
Definition: juri.c:207
Parameters
uriA URI.
Returns
The collection name.

◆ j_uri_get_item()

JItem * j_uri_get_item ( JURI uri)

Returns the item.

JItem* item;
JURI* uri;
...
JItem * j_uri_get_item(JURI *uri)
Definition: juri.c:388
Definition: jitem.c:59
JItem * item
Definition: juri.c:65
Parameters
uriA URI.
Returns
The item.

◆ j_uri_get_item_name()

gchar const * j_uri_get_item_name ( JURI uri)

Returns the item name.

JURI* uri;
...
g_print("%s\n", j_uri_get_item_name(uri));
gchar const * j_uri_get_item_name(JURI *uri)
Definition: juri.c:215
Parameters
uriA URI.
Returns
The item name.

◆ j_uri_new()

JURI * j_uri_new ( gchar const *  uri_)

Creates a new URI.

JURI* uri;
uri = j_uri_new("julea://foo/bar");
JURI * j_uri_new(gchar const *uri_)
Definition: juri.c:163
Parameters
uri_A URI string.
Returns
A new URI. Should be freed with j_uri_free().