CouchdbQuery

CouchdbQuery

Synopsis

                    CouchdbQuery;
                    CouchdbQueryClass;
CouchdbQuery *      couchdb_query_new                   (void);
CouchdbQuery *      couchdb_query_new_for_path          (const char *path);
CouchdbQuery *      couchdb_query_new_for_view          (const char *design_doc,
                                                         const char *view_name);
const char *        couchdb_query_get_path              (CouchdbQuery *self);
void                couchdb_query_set_path              (CouchdbQuery *self,
                                                         const char *path);
const char *        couchdb_query_get_method            (CouchdbQuery *self);
void                couchdb_query_set_method            (CouchdbQuery *self,
                                                         const char *method);
const char *        couchdb_query_get_option            (CouchdbQuery *self,
                                                         const char *name);
void                couchdb_query_set_option            (CouchdbQuery *self,
                                                         const char *name,
                                                         const char *value);
const char *        couchdb_query_get_query_options_string
                                                        (CouchdbQuery *self);
JsonObject *        couchdb_query_get_json_object       (CouchdbQuery *self);
void                couchdb_query_set_json_object       (CouchdbQuery *self,
                                                         JsonObject *object);
                    CouchdbQueryPrivate;

Description

Details

CouchdbQuery

typedef struct {
	GObject parent;
	CouchdbQueryPrivate *priv;
} CouchdbQuery;


CouchdbQueryClass

typedef struct {
	GObjectClass parent_class;
} CouchdbQueryClass;


couchdb_query_new ()

CouchdbQuery *      couchdb_query_new                   (void);

Creates and returns a new CouchdbQuery object

Returns :

A new CouchdbQuery object, to be unreferenced when no longer needed.

couchdb_query_new_for_path ()

CouchdbQuery *      couchdb_query_new_for_path          (const char *path);

Creates and returns a new CouchdbQuery object for a give design document and view. It's a shortcut for this code: [[[ const gchar *design_doc, *view_name; CouchdbQuery *query;

design_doc = "document"; view_name = "view"; path = g_str_concat ("_design/", design_doc, "_view", view_name); query = couchdb_query_new(); couchdb_query_set_path (query, path); g_free (path); ]]]

Returns :

A new CouchdbQuery object, to be unreferenced when no longer needed.

couchdb_query_new_for_view ()

CouchdbQuery *      couchdb_query_new_for_view          (const char *design_doc,
                                                         const char *view_name);


couchdb_query_get_path ()

const char *        couchdb_query_get_path              (CouchdbQuery *self);

Returns path set for the query.

self :

A CouchdbQuery object

Returns :

string containing path set for the query.

couchdb_query_set_path ()

void                couchdb_query_set_path              (CouchdbQuery *self,
                                                         const char *path);

Sets path for the Query.

self :

A CouchdbQuery object

couchdb_query_get_method ()

const char *        couchdb_query_get_method            (CouchdbQuery *self);

Returns method set for the query.

self :

A CouchdbQuery object

Returns :

string containing method set for the query.

couchdb_query_set_method ()

void                couchdb_query_set_method            (CouchdbQuery *self,
                                                         const char *method);

Sets method for the Query.

self :

A CouchdbQuery object

method :

A method for query.

couchdb_query_get_option ()

const char *        couchdb_query_get_option            (CouchdbQuery *self,
                                                         const char *name);

Returns the value of the given key, or NULL if it wasn't set

Returns :

the value of the given key, or NULL if it hasn't been set. [transfer none][allow-none]

couchdb_query_set_option ()

void                couchdb_query_set_option            (CouchdbQuery *self,
                                                         const char *name,
                                                         const char *value);

Set's the value of the given key, overwriting the current one if it's already set


couchdb_query_get_query_options_string ()

const char *        couchdb_query_get_query_options_string
                                                        (CouchdbQuery *self);

Returns options as a query string that can be used to create a complete uri for querying server.

self :

A CouchdbQuery object

Returns :

A string containing all query options.

couchdb_query_get_json_object ()

JsonObject *        couchdb_query_get_json_object       (CouchdbQuery *self);

Sets the given Json object as a body of the query that is going to be send to the CouchDB server. It doesn't change the query's method so it has to be set to either PUT or POST by calling couchdb_query_set_method.

Returns :

A JsonObject to be set as a Query's body. [transfer full]

couchdb_query_set_json_object ()

void                couchdb_query_set_json_object       (CouchdbQuery *self,
                                                         JsonObject *object);


CouchdbQueryPrivate

typedef struct _CouchdbQueryPrivate CouchdbQueryPrivate;