![]() |
![]() |
![]() |
Reference Manual for CouchDB GLib Bindings | ![]() |
---|---|---|---|---|
Top | Description |
#define COUCHDB_TYPE_STRUCT_FIELD GType couchdb_struct_field_get_type (void
); CouchdbStructField * couchdb_struct_field_new (void
); CouchdbStructField * couchdb_struct_field_new_from_string (const char *str
); CouchdbStructField * couchdb_struct_field_ref (CouchdbStructField *sf
); void couchdb_struct_field_unref (CouchdbStructField *sf
); gboolean couchdb_struct_field_has_field (CouchdbStructField *sf
,const char *field
); void couchdb_struct_field_remove_field (CouchdbStructField *sf
,const char *field
); gboolean couchdb_struct_field_get_boolean_field (CouchdbStructField *sf
,const char *field
); void couchdb_struct_field_set_boolean_field (CouchdbStructField *sf
,const char *field
,gboolean value
); gdouble couchdb_struct_field_get_double_field (CouchdbStructField *sf
,const char *field
); void couchdb_struct_field_set_double_field (CouchdbStructField *sf
,const char *field
,gdouble value
); gint couchdb_struct_field_get_int_field (CouchdbStructField *sf
,const char *field
); void couchdb_struct_field_set_int_field (CouchdbStructField *sf
,const char *field
,gint value
); const char * couchdb_struct_field_get_string_field (CouchdbStructField *sf
,const char *field
); void couchdb_struct_field_set_string_field (CouchdbStructField *sf
,const char *field
,const char *value
); CouchdbStructField * couchdb_struct_field_get_struct_field (CouchdbStructField *sf
,const char *field
); void couchdb_struct_field_set_struct_field (CouchdbStructField *sf
,const char *field
,CouchdbStructField *value
); const char * couchdb_struct_field_get_uuid (CouchdbStructField *sf
); void couchdb_struct_field_set_uuid (CouchdbStructField *sf
,const char *uuid
); char * couchdb_struct_field_to_string (CouchdbStructField *sf
);
CouchdbStructField * couchdb_struct_field_new (void
);
Create a new struct field object, to be added to a CouchdbDocument or to another CouchdbStructField.
Returns : |
A newly-created CouchdbStructField object. |
CouchdbStructField * couchdb_struct_field_new_from_string
(const char *str
);
Create a new struct field object, filling it with values taken from a string representing a JSON object.
|
A JSON string |
Returns : |
A newly-created CouchdbStructField object. |
CouchdbStructField * couchdb_struct_field_ref (CouchdbStructField *sf
);
Increments reference count of a CouchdbStructField object.
|
A CouchdbStructField object |
Returns : |
A pointer to the referenced object. |
void couchdb_struct_field_unref (CouchdbStructField *sf
);
Decrements reference count of a CouchdbStructField object. When the reference count is equal to 0, the object will be destroyed and the memory it uses freed.
|
A CouchdbStructField object |
gboolean couchdb_struct_field_has_field (CouchdbStructField *sf
,const char *field
);
Check whether a given field exists in the given CouchdbStructField object.
|
A CouchdbStructField object |
|
Name of the field to check |
Returns : |
TRUE if the field exists, FALSE if not. |
void couchdb_struct_field_remove_field (CouchdbStructField *sf
,const char *field
);
Remove a field from the given CouchdbStructField object.
|
A CouchdbStructField object |
|
Name of the field to remove |
gboolean couchdb_struct_field_get_boolean_field (CouchdbStructField *sf
,const char *field
);
Retrieve the value of a boolean field from the given struct field.
|
A CouchdbStructField object |
|
Name of the field |
Returns : |
The value of the given field. |
void couchdb_struct_field_set_boolean_field (CouchdbStructField *sf
,const char *field
,gboolean value
);
Set the value of a boolean field in the given struct field.
|
A CouchdbStructField object |
|
Name of the field |
|
gdouble couchdb_struct_field_get_double_field (CouchdbStructField *sf
,const char *field
);
Retrieve the value of a decimal number field from the given struct field.
|
A CouchdbStructField object |
|
Name of the field |
Returns : |
The value of the given field. |
void couchdb_struct_field_set_double_field (CouchdbStructField *sf
,const char *field
,gdouble value
);
Set the value of a decimal number field in the given struct field.
|
A CouchdbStructField object |
|
Name of the field |
|
gint couchdb_struct_field_get_int_field (CouchdbStructField *sf
,const char *field
);
Retrieve the value of an integer field from the given struct field.
|
A CouchdbStructField object |
|
Name of the field |
Returns : |
The value of the given field. |
void couchdb_struct_field_set_int_field (CouchdbStructField *sf
,const char *field
,gint value
);
Set the value of an integer field in the given struct field.
|
A CouchdbStructField object |
|
Name of the field |
|
const char * couchdb_struct_field_get_string_field (CouchdbStructField *sf
,const char *field
);
Retrieve the value of a string field from the given struct field.
|
A CouchdbStructField object |
|
Name of the field |
Returns : |
The value of the given field. |
void couchdb_struct_field_set_string_field (CouchdbStructField *sf
,const char *field
,const char *value
);
Set the value of a string field in the given struct field.
|
A CouchdbStructField object |
|
Name of the field |
|
CouchdbStructField * couchdb_struct_field_get_struct_field (CouchdbStructField *sf
,const char *field
);
Retrieve the value of a struct field from the given struct field.
|
A CouchdbStructField object |
|
Name of the field |
Returns : |
The value of the given field. |
void couchdb_struct_field_set_struct_field (CouchdbStructField *sf
,const char *field
,CouchdbStructField *value
);
Set the value of a string field in the given struct field.
|
A CouchdbStructField object |
|
Name of the field |
|
const char * couchdb_struct_field_get_uuid (CouchdbStructField *sf
);
Retrieve the unique ID of the given struct field. Note that this is a convenience function to allow documents with a format similar to:
"list": { "unique-id-1": { "field": "value" }, "unique-id-2": { "field": "value" } }
So, not all CouchdbStructField objects would have a value for this, unless explicitly used by the applications storing the documents on the CouchDB database.
|
A CouchdbStructField object |
Returns : |
The unique ID of the given struct field. |
void couchdb_struct_field_set_uuid (CouchdbStructField *sf
,const char *uuid
);
Set the unique ID for the given struct field. See the explanation for couchdb_struct_field_get_uuid for knowing when to use this function.
|
A CouchdbStructField object |
|
Unique ID |