All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Functions
as_geojson.h File Reference
#include <aerospike/as_std.h>
#include <aerospike/as_util.h>
#include <aerospike/as_val.h>
+ Include dependency graph for as_geojson.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as_geojson
 

Functions

static void as_geojson_destroy (as_geojson *string)
 
static as_geojsonas_geojson_fromval (const as_val *v)
 
static char * as_geojson_get (const as_geojson *string)
 
static char * as_geojson_getorelse (const as_geojson *string, char *fallback)
 
AS_EXTERN as_geojsonas_geojson_init (as_geojson *string, char *value, bool free)
 
AS_EXTERN as_geojsonas_geojson_init_wlen (as_geojson *string, char *value, size_t len, bool free)
 
AS_EXTERN size_t as_geojson_len (as_geojson *string)
 
AS_EXTERN as_geojsonas_geojson_new (char *value, bool free)
 
AS_EXTERN as_geojsonas_geojson_new_strdup (const char *value)
 
AS_EXTERN as_geojsonas_geojson_new_wlen (char *value, size_t len, bool free)
 
static as_valas_geojson_toval (const as_geojson *s)
 
AS_EXTERN void as_geojson_val_destroy (as_val *v)
 
AS_EXTERN uint32_t as_geojson_val_hashcode (const as_val *v)
 
AS_EXTERN char * as_geojson_val_tostring (const as_val *v)
 

Function Documentation

static void as_geojson_destroy ( as_geojson string)
inlinestatic

Destroy the as_geojson and associated resources.

Definition at line 209 of file as_geojson.h.

References as_val_destroy.

static as_geojson * as_geojson_fromval ( const as_val v)
inlinestatic

Convert from an as_val.

Definition at line 268 of file as_geojson.h.

References AS_GEOJSON, and as_util_fromval.

static char * as_geojson_get ( const as_geojson string)
inlinestatic

Get the string value.

Definition at line 244 of file as_geojson.h.

References as_geojson::as_geojson_getorelse().

static char * as_geojson_getorelse ( const as_geojson string,
char *  fallback 
)
inlinestatic

Get the string value. If string is NULL, then return the fallback value.

Definition at line 234 of file as_geojson.h.

AS_EXTERN as_geojson * as_geojson_init ( as_geojson string,
char *  value,
bool  free 
)

Initialize a stack allocated as_geojson.

If free is true, then the string value will be freed when the as_geojson is destroyed.

Parameters
stringThe stack allocated as_geojson to initialize
valueThe NULL terminated string of character.
freeIf true, then the value will be freed when as_geojson is destroyed.
Returns
On success, the initialized string. Otherwise NULL.
AS_EXTERN as_geojson * as_geojson_init_wlen ( as_geojson string,
char *  value,
size_t  len,
bool  free 
)

Initialize a stack allocated as_geojson and its length.

If free is true, then the string value will be freed when the as_geojson is destroyed.

Parameters
stringThe stack allocated as_geojson to initialize
valueThe NULL terminated string of character.
lenThe length of the string.
freeIf true, then the value will be freed when as_geojson is destroyed.
Returns
On success, the initialized string. Otherwise NULL.
AS_EXTERN size_t as_geojson_len ( as_geojson string)

The length of the string

Parameters
stringThe string to get the length of.
Returns
the length of the string in bytes.
AS_EXTERN as_geojson * as_geojson_new ( char *  value,
bool  free 
)

Create and initialize a new heap allocated as_geojson.

If free is true, then the string value will be freed when the as_geojson is destroyed.

Parameters
valueThe NULL terminated string of character.
freeIf true, then the value will be freed when as_geojson is destroyed.
Returns
On success, the new string. Otherwise NULL.
AS_EXTERN as_geojson* as_geojson_new_strdup ( const char *  value)

Create and initialize a new heap allocated as_geojson.

Value is cf_strdup()'d and will be freed when the as_geojson is destroyed.

Parameters
valueThe NULL terminated string of character.
Returns
On success, the new string. Otherwise NULL.
AS_EXTERN as_geojson * as_geojson_new_wlen ( char *  value,
size_t  len,
bool  free 
)

Create and initialize a new heap allocated as_geojson and its length.

If free is true, then the string value will be freed when the as_geojson is destroyed.

Parameters
valueThe NULL terminated string of character.
lenThe length of the string.
freeIf true, then the value will be freed when as_geojson is destroyed.
Returns
On success, the new string. Otherwise NULL.
static as_val * as_geojson_toval ( const as_geojson s)
inlinestatic

Convert to an as_val.

Definition at line 258 of file as_geojson.h.

AS_EXTERN void as_geojson_val_destroy ( as_val v)
private

Internal helper function for destroying an as_val.

AS_EXTERN uint32_t as_geojson_val_hashcode ( const as_val v)
private

Internal helper function for getting the hashcode of an as_val.

AS_EXTERN char* as_geojson_val_tostring ( const as_val v)
private

Internal helper function for getting the string representation of an as_val.