MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / AR_TOSTRING

Function AR_TOSTRING

src/arithmetic/string_funcs/string_funcs.c:488–498  ·  view source on GitHub ↗

converts an integer, float or boolean value to a string.

Source from the content-addressed store, hash-verified

486
487// converts an integer, float or boolean value to a string.
488SIValue AR_TOSTRING(SIValue *argv, int argc, void *private_data) {
489 if(SI_TYPE(argv[0]) & STRINGABLE) {
490 size_t len = SIValue_StringJoinLen(argv, 1, "");
491 char *str = rm_malloc(len * sizeof(char));
492 size_t bytesWritten = 0;
493 SIValue_ToString(argv[0], &str, &len, &bytesWritten);
494 return SI_TransferStringVal(str);
495 } else {
496 return SI_NullVal();
497 }
498}
499
500// Returns a JSON string representation of a map value.
501SIValue AR_TOJSON(SIValue *argv, int argc, void *private_data) {

Callers 1

AR_TOSTRINGLISTFunction · 0.85

Calls 5

SIValue_StringJoinLenFunction · 0.85
rm_mallocFunction · 0.85
SIValue_ToStringFunction · 0.85
SI_TransferStringValFunction · 0.85
SI_NullValFunction · 0.85

Tested by

no test coverage detected