GRU - Generic Reusable Utilities
|
Typedefs | |
typedef enum conversion_stat_t_ | conversion_stat_t |
Enumerations | |
enum | conversion_stat_t_ { VAR_ERROR = 0 , VAR_SUCCESS = 1 , VAR_OUT_OF_RANGE = 2 , VAR_NOT_CONVERSIBLE = 4 } |
Functions | |
bool | gru_variant_set_string (gru_variant_t *variant, const char *str) |
Set the variant value to a string. More... | |
void | gru_variant_set_integer (gru_variant_t *variant, uint64_t number) |
Set the variant value to an integer. More... | |
void | gru_variant_clean (gru_variant_t *variant) |
Release the memory used by a variant (if any used at all). More... | |
gru_variant_t | gru_variant_parse (const char *str) |
Parses a string and sets it to the most appropriate type. More... | |
bool | gru_variant_equals_str (gru_variant_t *variant, const char *str) |
Simple equality check to test if the variant value matches a given string. More... | |
typedef enum conversion_stat_t_ conversion_stat_t |
enum conversion_stat_t_ |
void gru_variant_clean | ( | gru_variant_t * | variant | ) |
Release the memory used by a variant (if any used at all).
It's safe to pass any variant even if no memory is used at all
variant | the variant to release |
bool gru_variant_equals_str | ( | gru_variant_t * | variant, |
const char * | str | ||
) |
Simple equality check to test if the variant value matches a given string.
variant | the variant to compare with |
str | the string to check |
gru_variant_t gru_variant_parse | ( | const char * | str | ) |
Parses a string and sets it to the most appropriate type.
str | the string to parse |
void gru_variant_set_integer | ( | gru_variant_t * | variant, |
uint64_t | number | ||
) |
Set the variant value to an integer.
variant | the variant to hold the data |
number | the number to set |
bool gru_variant_set_string | ( | gru_variant_t * | variant, |
const char * | str | ||
) |
Set the variant value to a string.
variant | the variant hold the data |
str | the string to set |