![]() |
Oyranos
git-devel
Oyranos is a full featured Color Management System
|
Tree data structure manipulation and I/O. More...
|
Data Structures | |
| struct | oyjl_val_s |
Macros | |
| #define | OYJL_NUMBER_DETECTION 0x1000 |
| try to parse values as number More... | |
| #define | OYJL_DECIMAL_SEPARATOR_COMMA 0x2000 |
| use comma ',' as decimal separator More... | |
| #define | OYJL_ALLOW_STATIC 0x10 |
| allow to read static format More... | |
| #define | OYJL_DELIMITER_COMMA 0x20 |
| ',' comma More... | |
| #define | OYJL_DELIMITER_SEMICOLON 0x40 |
| ';' semicolon More... | |
| #define | OYJL_JSON 0x01 |
| JSON format; default. More... | |
| #define | OYJL_YAML 0x04 |
| YAML format. More... | |
| #define | OYJL_XML 0x08 |
| XML format. More... | |
| #define | OYJL_CSV 0x20 |
| CSV format - needs 2D array. More... | |
| #define | OYJL_CSV_SEMICOLON 0x40 |
| CSV format - needs 2D array. More... | |
| #define | OYJL_HTML 0x100 |
| Formatting flag for markup on output. More... | |
| #define | OYJL_NO_MARKUP 0x10000 |
| expect plain text More... | |
| #define | OYJL_PATH 0x08 |
| flag to obtain only path More... | |
| #define | OYJL_KEY 0x10 |
| flat to obtain only keys More... | |
| #define | OYJL_NO_ALLOC 0x800 |
| avoid malloc for oyjlOBJECT_JSON More... | |
| #define | OYJL_CREATE_NEW 0x02 |
| flag to allocate a new tree node, in case it is not inside More... | |
| #define | OYJL_PATH_MATCH_LEN 0x20 |
| flag to test if the specified path match with the full length. More... | |
| #define | OYJL_PATH_MATCH_LAST_ITEMS 0x40 |
| flag to test only the last path segments, which are separated by slash '/'. More... | |
| #define | OYJL_OBSERVE 0x200000 |
| be verbose on change More... | |
Typedefs | |
| typedef struct oyjl_val_s * | oyjl_val |
| typedef struct oyjl_val_s | oyjl_val_s |
Enumerations | |
| enum | oyjl_type { oyjl_t_string = 1, oyjl_t_number = 2, oyjl_t_object = 3, oyjl_t_array = 4, oyjl_t_true = 5, oyjl_t_false = 6, oyjl_t_null = 7 } |
| enum | oyjlPARSE_STATE_e { oyjlPARSE_STATE_NONE, oyjlPARSE_STATE_NOT_COMPILED, oyjlPARSE_STATE_FORMAT_ERROR, oyjlPARSE_STATE_PARSER_ERROR, oyjlPARSE_STATE_RETURN_STATIC } |
Functions | |
| int | oyjlDataFormat (const char *text) |
| detect data type More... | |
| const char * | oyjlDataFormatToString (int format) |
| name data format More... | |
| char * | oyjlValueText (oyjl_val v, void *(*alloc)(size_t size)) |
| get the value as text string with user allocator More... | |
| char ** | oyjlTreeToPaths (oyjl_val root, int levels, const char *xpath, int flags, int *count) |
| find matching paths More... | |
| const char * | oyjlJsonEscape (const char *in, int flags) |
| Convert strings to pass through JSON. More... | |
| char * | oyjlTreeToText (oyjl_val v, int flags) |
| convert a C tree into a text string More... | |
| void | oyjlTreeToJson (oyjl_val v, int *level, char **json) |
| convert a C tree into a JSON string More... | |
| void | oyjlTreeToYaml (oyjl_val v, int *level, char **text) |
| convert a C tree into a YAML string More... | |
| void | oyjlTreeToXml (oyjl_val v, int *level, char **text) |
| convert a C tree into a XML string More... | |
| void | oyjlTreeToCsv (oyjl_val table, int flags, char **text) |
| convert a C 2D table into a CSV string More... | |
| oyjl_val | oyjlTreeParseCsv (const char *text, const char *delimiter, int flags, char *error_buffer OYJL_UNUSED, size_t error_buffer_size OYJL_UNUSED) |
| read a CSV text string into a C data structure (libOyjl) More... | |
| int | oyjlValueCount (oyjl_val v) |
| return the number of members if any at the node level More... | |
| oyjl_val | oyjlValuePosGet (oyjl_val v, int pos) |
| obtain a child node at the nth position from a object or array node More... | |
| int | oyjlPathMatch (const char *path, const char *xpath, int flags) |
| search for xpath pattern matching in a full path More... | |
| oyjl_val | oyjlTreeNew (const char *path) |
| create a node by a path expression More... | |
| char * | oyjlTreeGetPath (oyjl_val v, oyjl_val node) |
| get a full path string from a child node More... | |
| oyjl_val | oyjlTreeGetValue (oyjl_val v, int flags, const char *xpath) |
| obtain a node by a path expression More... | |
| oyjl_val | oyjlTreeGetValueF (oyjl_val v, int flags, const char *xformat,...) |
| get a child node by a path expression More... | |
| int | oyjlTreeSetStringF (oyjl_val root, int flags, const char *value_text, const char *xformat,...) |
| set a child node to a string value More... | |
| int | oyjlTreeSetDoubleF (oyjl_val root, int flags, double value, const char *xformat,...) |
| set a child node to a string value More... | |
| int | oyjlValueSetDouble (oyjl_val v, double value) |
| set a child node to a string value More... | |
| int | oyjlTreeSetIntF (oyjl_val root, int flags, long long value, const char *xformat,...) |
| set a child node to a string value More... | |
| int | oyjlValueSetInt (oyjl_val v, long long value) |
| set a child node to a number value More... | |
| int | oyjlValueSetString (oyjl_val v, const char *string) |
| set the node value to a string More... | |
| void | oyjlValueClear (oyjl_val v) |
| release all childs recursively More... | |
| void | oyjlValueCopy (oyjl_val v, oyjl_val src) |
| copy only one level of allocation More... | |
| void | oyjlTreeClearValue (oyjl_val root, const char *xpath) |
| release a specific node and all its childs More... | |
| void | oyjlTreeFree (oyjl_val v) |
| release a node and all its childs recursively More... | |
| OYJL_API oyjl_val | oyjlTreeParse (const char *input, char *error_buffer, size_t error_buffer_size) |
| Parse a string. (libOyjl) More... | |
| oyjl_val | oyjlTreeParse2 (const char *text, int flags, const char *error_name, int *status) |
| read a JSON, XML or YAML text string into a C data structure (libOyjl) More... | |
| oyjl_val | oyjlTreeGetNewValueFromArray (oyjl_val root, const char *name, oyjl_val *array_ret, int *pos_ret) |
| obtain a new node object possibly in array More... | |
| oyjl_val | oyjlTreeSerialise (oyjl_val v, int flags, int *size) |
| write tree to data block More... | |
| oyjl_val | oyjlTreeDeSerialise (oyjl_val v, int flags, int size) |
| create tree from serialised data block More... | |
Tree data structure manipulation and I/O.
The API is designed to be easily useable without much boilerplate. It includes a xpath alike syntax to obtain or create nodes inside a tree. A path string is constructed of terms and the slash delimiter '/'. Understood terms are object names or the squared brackets index operator [].
Path Example:
"foo/[3]/bar" will return the "bar" node with the "found" string.
{
"foo": [
{ "ignore": 0 },
{ "ignore_too": 0 },
{ "ignore_it": 0 },
{ "bar": "found" }
]
}
Some API's accept extended paths expressions. Those can contain empty terms, like "//", which matches all keys in the above example. Those are oyjlTreeToPaths() and oyjlPathMatch(). oyjlTreeToPaths() works on the whole tree to match a extended xpath.
Programming Tutorial
The following code examples come from tutorial_json_options.c .
| #define OYJL_ALLOW_STATIC 0x10 |
allow to read static format
| #define OYJL_CREATE_NEW 0x02 |
flag to allocate a new tree node, in case it is not inside
Referenced by oyjlOptionStringToJson(), and oyjlTreeGetNewValueFromArray().
| #define OYJL_CSV 0x20 |
CSV format - needs 2D array.
Referenced by oyjlTreeToText().
| #define OYJL_CSV_SEMICOLON 0x40 |
CSV format - needs 2D array.
Referenced by oyjlTreeToText().
| #define OYJL_DECIMAL_SEPARATOR_COMMA 0x2000 |
use comma ',' as decimal separator
| #define OYJL_DELIMITER_COMMA 0x20 |
',' comma
| #define OYJL_DELIMITER_SEMICOLON 0x40 |
';' semicolon
Referenced by oyjlTreeToCsv().
| #define OYJL_HTML 0x100 |
Formatting flag for markup on output.
| #define OYJL_JSON 0x01 |
JSON format; default.
| #define OYJL_KEY 0x10 |
flat to obtain only keys
Referenced by oyjlTreeGetPath(), and oyjlUiJsonSetDefaults().
| #define OYJL_NO_ALLOC 0x800 |
avoid malloc for oyjlOBJECT_JSON
| #define OYJL_NO_MARKUP 0x10000 |
expect plain text
Referenced by oyjlTreeToCsv(), and oyjlTreeToText().
| #define OYJL_NUMBER_DETECTION 0x1000 |
try to parse values as number
Referenced by oyjlTreeGetNewValueFromArray().
| #define OYJL_OBSERVE 0x200000 |
be verbose on change
Referenced by oyjlTermColorInit().
| #define OYJL_PATH 0x08 |
flag to obtain only path
| #define OYJL_PATH_MATCH_LAST_ITEMS 0x40 |
flag to test only the last path segments, which are separated by slash '/'.
Referenced by oyjlPathMatch().
| #define OYJL_PATH_MATCH_LEN 0x20 |
flag to test if the specified path match with the full length.
Referenced by oyjlPathMatch().
| #define OYJL_XML 0x08 |
XML format.
Referenced by oyjlTreeToText().
| #define OYJL_YAML 0x04 |
YAML format.
Referenced by oyjlTreeToText().
| typedef struct oyjl_val_s* oyjl_val |
A pointer to a node in the parse tree
| typedef struct oyjl_val_s oyjl_val_s |
A JSON value representation capable of holding one of the seven types above. For "string", "number", "object", and "array" additional data is available in the union. The "OYJL_IS_*" and "OYJL_GET_*" macros below allow type checking and convenient value extraction.
| enum oyjl_type |
The original yajl_val_s structure was renamed to oyjl_val_s by Kai-Uwe Behrmann for libOyjl. possible data types that a oyjl_val_s can hold
| enum oyjlPARSE_STATE_e |
| Enumerator | |
|---|---|
| oyjlPARSE_STATE_NONE | nothing to report |
| oyjlPARSE_STATE_NOT_COMPILED | the format is currently not compiled |
| oyjlPARSE_STATE_FORMAT_ERROR | check with oyjlDataFormat() |
| oyjlPARSE_STATE_PARSER_ERROR | message is sent to oyjlMessage_p |
| oyjlPARSE_STATE_RETURN_STATIC | oyjl_val is static and must not be freed; needs OYJL_ALLOW_STATIC flag |
| int oyjlDataFormat | ( | const char * | text | ) |
detect data type
| text | string |
References OYJL_COMPARE_CASE, and oyjlStringStartsWith().
| const char * oyjlDataFormatToString | ( | int | format | ) |
| const char * oyjlJsonEscape | ( | const char * | in, |
| int | flags | ||
| ) |
Convert strings to pass through JSON.
| in | input string |
| flags | support filters:
|
| int oyjlPathMatch | ( | const char * | path, |
| const char * | xpath, | ||
| int | flags | ||
| ) |
search for xpath pattern matching in a full path
The function tries to match a single path expression level by level.
| path | a path expression |
| xpath | a extented path expression |
| flags | optional switches
|
References OYJL_PATH_MATCH_LAST_ITEMS, OYJL_PATH_MATCH_LEN, and oyjlStringSplit().
| void oyjlTreeClearValue | ( | oyjl_val | root, |
| const char * | xpath | ||
| ) |
release a specific node and all its childs
In case parents have no children, release them or clear root.
References oyjl_val_s::array, oyjl_val_s::object, oyjl_t_array, oyjl_t_object, oyjlStringCopy(), oyjlStringSplit(), oyjlTreeFree(), oyjlTreeGetValue(), oyjlValueClear(), oyjl_val_s::type, and oyjl_val_s::u.
create tree from serialised data block
| [in] | v | serialised tree |
| [in] | flags | unused: |
| [in] | size | the size of the data block v - not used |
References oyjlBT(), oyjlOBJECT_JSON, and oyjl_val_s::type.
| void oyjlTreeFree | ( | oyjl_val | v | ) |
release a node and all its childs recursively
Free a parse tree returned by oyjlTreeParse().
| v | Pointer to a JSON value returned by oyjlTreeParse(). Passing NULL is valid and results in a no-op. |
References oyjlOBJECT_JSON, oyjlValueClear(), and oyjl_val_s::type.
Referenced by oyjlTreeClearValue().
| oyjl_val oyjlTreeGetNewValueFromArray | ( | oyjl_val | root, |
| const char * | name, | ||
| oyjl_val * | array_ret, | ||
| int * | pos_ret | ||
| ) |
obtain a new node object possibly in array
The node can even have the same name. It works only for flat path level.
| [in,out] | root | the node |
| [in] | name | flat path, without leveling slash |
| [out] | array_ret | tell if the node is child of that array |
| [out] | pos_ret | position of returned node in array_ret
|
References oyjl_val_s::number, OYJL_CREATE_NEW, OYJL_NUMBER_DETECTION, oyjl_t_array, oyjl_t_number, oyjlStringAdd(), oyjlStringToDouble(), oyjlTreeGetValue(), oyjlTreeGetValueF(), oyjlValueCount(), oyjlValueSetString(), oyjl_val_s::type, and oyjl_val_s::u.
get a full path string from a child node
This function is the reverse from oyjlTreeGetValue(). Use this function to get parent names and resolve xpath expressions to full paths.
| [in] | v | the oyjl node |
| [in] | node | the node to search for inside the v tree |
References OYJL_KEY, oyjlStringListRelease(), oyjlTreeGetValue(), and oyjlTreeToPaths().
obtain a node by a path expression
Referenced by oyjlArgsWebGroupIsMan_(), oyjlTreeClearValue(), oyjlTreeGetNewValueFromArray(), oyjlTreeGetPath(), oyjlTreeGetValueF(), oyjlTreeSetDoubleF(), oyjlTreeSetIntF(), oyjlUi_s::oyjlUiExportToCode(), and oyjlUiJsonSetDefaults().
get a child node by a path expression
Function oyjlTreeGetValueF Creating a new node inside a existing tree needs just a root node - v. The flags should contain OYJL_CREATE_NEW.
Example: "foo/[]/bar" will append a node to the foo array and create the bar node, which is empty.
| [in] | v | the oyjl node |
| [in] | flags | OYJL_CREATE_NEW - returns nodes even if they did not yet exist |
| [in] | xformat | the format for the slashed xpath string |
| [in] | ... | the variable argument list; optional |
References OYJL_CREATE_VA_STRING, and oyjlTreeGetValue().
Referenced by oyjlOptionStringToJson(), and oyjlTreeGetNewValueFromArray().
| oyjl_val oyjlTreeNew | ( | const char * | path | ) |
create a node by a path expression
A NULL argument allocates just a node of type oyjl_t_null.
Referenced by oyjlOptionStringToJson(), and oyOptions_s::oyOptions_GetText().
| oyjl_val oyjlTreeParse | ( | const char * | input, |
| char * | error_buffer, | ||
| size_t | error_buffer_size | ||
| ) |
Parse a string. (libOyjl)
Parses an null-terminated string containing JSON data and returns a pointer to the top-level value (root of the parse tree).
This function needs linking to libOyjl.
| input | Pointer to a null-terminated utf8 string containing JSON data. |
| error_buffer | Pointer to a buffer in which an error message will be stored if oyjlTreeParse() fails, or NULL. The buffer will be initialized before parsing, so its content will be destroyed even if oyjlTreeParse() succeeds. |
| error_buffer_size | Size of the memory area pointed to by error_buffer_size. If error_buffer_size is NULL, this argument is ignored. |
NULL on error. The memory pointed to must be freed using oyjlTreeFree(). In case of an error, a null terminated message describing the error in more detail is stored in error_buffer if it is not NULL. | oyjl_val oyjlTreeParse2 | ( | const char * | text, |
| int | flags, | ||
| const char * | error_name, | ||
| int * | status | ||
| ) |
read a JSON, XML or YAML text string into a C data structure (libOyjl)
This function needs linking to libOyjl.
JSON, Xml and Yaml parsers can not handle term color codes in the data structures. They need to be removed before parsing.
| [in] | text | the JSON/XML/YAML text |
| [in] | flags | for processing
|
| [in] | error_name | add text for error messages |
| [out] | state | report oyjlPARSE_STATE_e |
| oyjl_val oyjlTreeParseCsv | ( | const char * | text, |
| const char * | delimiter, | ||
| int | flags, | ||
| char *error_buffer | OYJL_UNUSED, | ||
| size_t error_buffer_size | OYJL_UNUSED | ||
| ) |
read a CSV text string into a C data structure (libOyjl)
Expected is a 2D table on input.
| [in] | text | the CSV text |
| [in] | delimiter | separator for oyjlStringSplit2 |
| [in] | flags | for processing
|
| [out] | error_buffer | place a error message |
| [out] | error_buffer_size | size of error_buffer |
write tree to data block
| v | tree to serialise | |
| [in] | flags | supported:
|
| [out] | size | the size of the returned data block |
| int oyjlTreeSetDoubleF | ( | oyjl_val | root, |
| int | flags, | ||
| double | value, | ||
| const char * | xformat, | ||
| ... | |||
| ) |
set a child node to a string value
Function oyjlTreeSetDoubleF
| [in,out] | root | the oyjl node |
| [in] | flags | OYJL_CREATE_NEW - allocates nodes even if they did not yet exist |
| [in] | value | IEEE floating point number with double precission |
| [in] | xformat | the format for the slashed xpath string |
| [in] | ... | the variable argument list; optional |
References OYJL_CREATE_VA_STRING, oyjlTreeGetValue(), and oyjlValueSetDouble().
| int oyjlTreeSetIntF | ( | oyjl_val | root, |
| int | flags, | ||
| long long | value, | ||
| const char * | xformat, | ||
| ... | |||
| ) |
set a child node to a string value
Function oyjlTreeSetIntF
| [in,out] | root | the oyjl node |
| [in] | flags | OYJL_CREATE_NEW - allocates nodes even if they did not yet exist |
| [in] | value | integer number |
| [in] | xformat | the format for the slashed xpath string |
| [in] | ... | the variable argument list; optional |
References OYJL_CREATE_VA_STRING, oyjlTreeGetValue(), and oyjlValueSetInt().
| int oyjlTreeSetStringF | ( | oyjl_val | root, |
| int | flags, | ||
| const char * | value_text, | ||
| const char * | xformat, | ||
| ... | |||
| ) |
set a child node to a string value
Function oyjlTreeSetStringF
| [in,out] | root | the oyjl node |
| [in] | flags | OYJL_CREATE_NEW - allocates nodes even if they did not yet exist |
| [in] | value_text | a string |
| [in] | xformat | the format for the slashed xpath string |
| [in] | ... | the variable argument list; optional |
References OYJL_CREATE_VA_STRING.
| void oyjlTreeToCsv | ( | oyjl_val | table, |
| int | flags, | ||
| char ** | text | ||
| ) |
convert a C 2D table into a CSV string
The function uses some assumptions for mapping features of JSON to CSV.
The root object is assumed to be a array of arrays of plain values. Further levels of nesting are ignored.
| table | node of 2D array [[],[]] |
| flags | OYJL_DELIMITER_COMMA, OYJL_DELIMITER_SEMICOLON, OYJL_HTML for HTML markup |
| text | the resulting string |
References oyjl_val_s::array, oyjl_val_s::number, oyjl_val_s::object, OYJL_DELIMITER_SEMICOLON, OYJL_NO_MARKUP, oyjl_t_array, oyjl_t_null, oyjl_t_number, oyjl_t_object, oyjlStr_Add(), oyjlStr_AppendN(), oyjlStr_New(), oyjlValueCount(), oyjl_val_s::type, and oyjl_val_s::u.
Referenced by oyjlTreeToText().
| void oyjlTreeToJson | ( | oyjl_val | v, |
| int * | level, | ||
| char ** | json | ||
| ) |
convert a C tree into a JSON string
References oyjlStr_New().
Referenced by oyjlTreeToText().
| char ** oyjlTreeToPaths | ( | oyjl_val | root, |
| int | levels, | ||
| const char * | xpath, | ||
| int | flags, | ||
| int * | count | ||
| ) |
find matching paths
The function works on the whole tree to match a xpath.
| [in] | root | node |
| levels | desired level depth | |
| xpath | extented path expression; It accepts even empty terms. | |
| flags | support filters:
| |
| [out] | count | number of strings in returned list |
References oyjlOBJECT_JSON, oyjlStringSplit(), and oyjl_val_s::type.
Referenced by oyjlTreeGetPath(), and oyjlUiJsonSetDefaults().
| char * oyjlTreeToText | ( | oyjl_val | v, |
| int | flags | ||
| ) |
convert a C tree into a text string
| [in] | v | input |
| [in] | flags | support
|
References OYJL_CSV, OYJL_CSV_SEMICOLON, OYJL_NO_MARKUP, OYJL_XML, OYJL_YAML, oyjlTreeToCsv(), oyjlTreeToJson(), oyjlTreeToXml(), and oyjlTreeToYaml().
| void oyjlTreeToXml | ( | oyjl_val | v, |
| int * | level, | ||
| char ** | text | ||
| ) |
convert a C tree into a XML string
The function uses some assumptions for mapping features of JSON to XML.
The JSON tree shall consist of one root object. Object keys starting with '@' are mapped to a attribute of the parent key. A object key of "@text" is mapped to the inner XML content of the parent tree object.
| v | node |
| level | desired level depth |
| text | the resulting string |
References oyjl_t_array, oyjl_t_false, oyjl_t_null, oyjl_t_number, oyjl_t_string, oyjl_t_true, oyjlStringAdd(), and oyjl_val_s::type.
Referenced by oyjlTreeToText().
| void oyjlTreeToYaml | ( | oyjl_val | v, |
| int * | level, | ||
| char ** | text | ||
| ) |
convert a C tree into a YAML string
| v | node |
| level | desired level depth |
| text | the resulting string |
References oyjl_val_s::array, oyjl_val_s::number, oyjl_t_array, oyjl_t_false, oyjl_t_null, oyjl_t_number, oyjl_t_string, oyjl_t_true, oyjlBLUE, oyjlBOLD, oyjlGREEN, oyjlRED, oyjlStringAdd(), oyjlStringCopy(), oyjlStringReplace(), oyjlTermColor(), oyjl_val_s::string, oyjl_val_s::type, and oyjl_val_s::u.
Referenced by oyjlTreeToText().
| void oyjlValueClear | ( | oyjl_val | v | ) |
release all childs recursively
Referenced by oyjlTreeClearValue(), oyjlTreeFree(), oyjlValueSetDouble(), oyjlValueSetInt(), and oyjlValueSetString().
| int oyjlValueCount | ( | oyjl_val | v | ) |
return the number of members if any at the node level
This function is useful to traverse through objects and arrays of a unknown JSON tree.
References oyjl_val_s::array, oyjl_val_s::object, oyjl_t_array, oyjl_t_object, oyjl_val_s::type, and oyjl_val_s::u.
Referenced by oyjlOptionStringToJson(), oyjlTreeGetNewValueFromArray(), oyjlTreeToCsv(), and oyjlUiJsonSetDefaults().
obtain a child node at the nth position from a object or array node
References oyjl_val_s::array, oyjl_val_s::object, oyjl_t_array, oyjl_t_object, oyjl_val_s::type, and oyjl_val_s::u.
| int oyjlValueSetDouble | ( | oyjl_val | v, |
| double | value | ||
| ) |
set a child node to a string value
Function oyjlValueSetDouble
| [in,out] | v | the oyjl node |
| [in] | value | IEEE floating point number with double precission |
References oyjl_val_s::number, oyjl_t_number, oyjlStringAdd(), oyjlStringCopy(), oyjlValueClear(), oyjl_val_s::type, and oyjl_val_s::u.
Referenced by oyjlTreeSetDoubleF().
| int oyjlValueSetInt | ( | oyjl_val | v, |
| long long | value | ||
| ) |
set a child node to a number value
Function oyjlValueSetInt
| [in,out] | v | the oyjl node |
| [in] | value | integer number |
References oyjl_val_s::number, oyjl_t_number, oyjlStringAdd(), oyjlValueClear(), oyjl_val_s::type, and oyjl_val_s::u.
Referenced by oyjlTreeSetIntF().
| int oyjlValueSetString | ( | oyjl_val | v, |
| const char * | string | ||
| ) |
set the node value to a string
References oyjl_t_string, oyjlStringAdd(), oyjlValueClear(), oyjl_val_s::string, oyjl_val_s::type, and oyjl_val_s::u.
Referenced by oyjlOptionStringToJson(), and oyjlTreeGetNewValueFromArray().
| char* oyjlValueText | ( | oyjl_val | v, |
| void *(*)(size_t size) | alloc | ||
| ) |
get the value as text string with user allocator
References oyjl_val_s::number, oyjl_t_array, oyjl_t_false, oyjl_t_null, oyjl_t_number, oyjl_t_object, oyjl_t_string, oyjl_t_true, oyjlStringAdd(), oyjl_val_s::string, oyjl_val_s::type, and oyjl_val_s::u.
1.8.13