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

Go to the source code of this file.

Data Structures

struct  as_string
 

Functions

void as_string_destroy (as_string *string)
 
as_stringas_string_fromval (const as_val *v)
 
char * as_string_get (const as_string *string)
 
char * as_string_getorelse (const as_string *string, char *fallback)
 
as_stringas_string_init (as_string *string, char *value, bool free)
 
size_t as_string_len (as_string *string)
 
as_stringas_string_new (char *value, bool free)
 
char * as_string_tostring (const as_string *string)
 
as_valas_string_toval (const as_string *s)
 
void as_string_val_destroy (as_val *v)
 
uint32_t as_string_val_hashcode (const as_val *v)
 
char * as_string_val_tostring (const as_val *v)
 

Function Documentation

void as_string_destroy ( as_string string)
inline

Destroy the as_string and associated resources.

Definition at line 173 of file as_string.h.

References as_val_destroy.

as_string * as_string_fromval ( const as_val v)
inline

Convert from an as_val.

Definition at line 243 of file as_string.h.

References AS_STRING, and as_util_fromval.

char * as_string_get ( const as_string string)
inline

Get the string value.

Definition at line 208 of file as_string.h.

References as_string::as_string_getorelse().

char * as_string_getorelse ( const as_string string,
char *  fallback 
)
inline

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

Definition at line 198 of file as_string.h.

as_string * as_string_init ( as_string string,
char *  value,
bool  free 
)

Initialize a stack allocated as_string.

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

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

The length of the string

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

Create and initialize a new heap allocated as_string.

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

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

Get the string value.

Definition at line 219 of file as_string.h.

References as_string::as_string_getorelse().

as_val * as_string_toval ( const as_string s)
inline

Convert to an as_val.

Definition at line 233 of file as_string.h.

void as_string_val_destroy ( as_val v)
private

Internal helper function for destroying an as_val.

uint32_t as_string_val_hashcode ( const as_val v)
private

Internal helper function for getting the hashcode of an as_val.

char* as_string_val_tostring ( const as_val v)
private

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