Groonga
Loading...
Searching...
No Matches
cast.h File Reference
#include <groonga/option.h>
Include dependency graph for cast.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  grn_caster
 

Functions

GRN_API grn_rc grn_caster_cast (grn_ctx *ctx, grn_caster *caster)
 
GRN_API grn_rc grn_obj_cast (grn_ctx *ctx, grn_obj *src, grn_obj *dest, bool add_record_if_not_exist)
 Cast and append a value from the source bulk/vector to the destination bulk/vector.
 

Function Documentation

◆ grn_caster_cast()

GRN_API grn_rc grn_caster_cast ( grn_ctx ctx,
grn_caster caster 
)

◆ grn_obj_cast()

GRN_API grn_rc grn_obj_cast ( grn_ctx ctx,
grn_obj src,
grn_obj dest,
bool  add_record_if_not_exist 
)

Cast and append a value from the source bulk/vector to the destination bulk/vector.

If dest is a reference type bulk/vector, add_record_if_not_exist is used. Reference type bulk/vector means that type of dest is a table. If src value doesn't exist in the table that is a type of dest. The src value is added to the table.

Parameters
ctxThe context object.
srcThe bulk object containing the value to be casted.
destThe bulk/vector object specifying the target type and where the casted value will be stored.
add_record_if_not_existIf dest is a reference type bulk/vector and the src value doesn't exist in the target table, setting this to true will add the src value to the table.
Returns
GRN_SUCCESS on success, the appropriate grn_rc on error.