Diffusion C API  6.3.3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
diffusion-recordv2.h File Reference

Functions

bool diffusion_recordv2_as_model (const DIFFUSION_VALUE_T *value, const DIFFUSION_RECORDV2_SCHEMA_T *schema, DIFFUSION_RECORDV2_RECORD_MODEL_T **record_model, DIFFUSION_API_ERROR *error)
 Parses the value into a model based upon a specified schema. More...
 
bool diffusion_recordv2_as_validated_model (const DIFFUSION_VALUE_T *value, const DIFFUSION_RECORDV2_SCHEMA_T *schema, DIFFUSION_RECORDV2_RECORD_MODEL_T **record_model, DIFFUSION_API_ERROR *error)
 Parses the value into a model based upon a specified schema. More...
 
bool diffusion_recordv2_as_records (const DIFFUSION_VALUE_T *value, LIST_T **as_records, DIFFUSION_API_ERROR *error)
 Get a list of lists where each element represents a record within the RecordV2 diffusion value. More...
 
bool diffusion_recordv2_to_string (const DIFFUSION_VALUE_T *value, char **recordv2_as_string, DIFFUSION_API_ERROR *error)
 Get a stringified representation of the RecordV2 diffusion value. More...
 
bool write_diffusion_recordv2_value (const void *recordv2, const BUF_T *buf)
 Write a recordv2 value into a BUF_T for an update. More...
 

Function Documentation

bool diffusion_recordv2_as_model ( const DIFFUSION_VALUE_T value,
const DIFFUSION_RECORDV2_SCHEMA_T schema,
DIFFUSION_RECORDV2_RECORD_MODEL_T **  record_model,
DIFFUSION_API_ERROR error 
)

Parses the value into a model based upon a specified schema.

This assumes that data is compatible with the schema and does not do any validation. There is no need to validate the data if this has been done on entry or at the server. However, if the data is invalid then issues may occur when attempting to access it.

Parameters
valuethe diffusion value to be read
schemathe schema to retrieve the model from
record_modela pointer to a pointer which has its value populated with a DIFFUSION_RECORDV2_RECORD_MODEL_T. Must be freed.
errorpopulated if an error occurs. Can be NULL.
Returns
true if the value was successfully read and the record_model parameter was populated with a record_model. False, otherwise.
bool diffusion_recordv2_as_records ( const DIFFUSION_VALUE_T value,
LIST_T **  as_records,
DIFFUSION_API_ERROR error 
)

Get a list of lists where each element represents a record within the RecordV2 diffusion value.

Parameters
valuediffusion value to be read
as_recordspointer to a LIST_T to be populated
errorerror populated if an error occurs. Can be NULL.
Returns
true if the value was successfully read and as_records was populated with lists of all the records contained in the RecordV2 diffusion value. False otherwise.
bool diffusion_recordv2_as_validated_model ( const DIFFUSION_VALUE_T value,
const DIFFUSION_RECORDV2_SCHEMA_T schema,
DIFFUSION_RECORDV2_RECORD_MODEL_T **  record_model,
DIFFUSION_API_ERROR error 
)

Parses the value into a model based upon a specified schema.

Parameters
valuethe diffusion value to be read
schemathe schema to be validated against and retrieve the model from
record_modela pointer to a pointer which has its value populated with a DIFFUSION_RECORDV2_RECORD_MODEL_T. Must be freed.
errorpopulated if an error occurs. Can be NULL.
Returns
true if the value was successfully read and the record_model parameter was populated with a record_model. False, otherwise.
bool diffusion_recordv2_to_string ( const DIFFUSION_VALUE_T value,
char **  recordv2_as_string,
DIFFUSION_API_ERROR error 
)

Get a stringified representation of the RecordV2 diffusion value.

Parameters
valuediffusion value to be read.
recordv2_as_stringpointer to a pointer where the stringified RecordV2 data will be stored
errorpopulated if an error occurs. Can be NULL.
Returns
true if the value was sucessfully read and recordv2_as_string was set to a pointer. containing the stringified representation of the RecordV2 diffusion value. False otherwise.
bool write_diffusion_recordv2_value ( const void *  recordv2,
const BUF_T buf 
)

Write a recordv2 value into a BUF_T for an update.

Parameters
recordv2recordv2 bytes to be written into the BUF_T
bufBUFT_T to write the recordv2 value into
Returns
true if the value was successfully written into the BUF_T. False is returned if recordv2 or buf are NULL.