Oyranos  git-devel
Oyranos is a full featured Color Management System
Data Fields

#include <oyjl_tree.h>

Collaboration diagram for oyjl_val_s:
Collaboration graph

Data Fields

oyjl_type type
 
union {
   char *   string
 UTF-8 text. More...
 
   struct {
      long long   i
 integer value, if representable. More...
 
      double   d
 double value, if representable. More...
 
      char *   r
 unparsed number in string form. More...
 
      unsigned int   flags
 
   }   number
 raw and parsed number types More...
 
   struct {
      char **   keys
 Array of keys. More...
 
      oyjl_val *   values
 Array of values. More...
 
      size_t   len
 Number of key-value-pairs. More...
 
   }   object
 objects with key/value pairs More...
 
   struct {
      oyjl_val *   values
 Array of elements. More...
 
      size_t   len
 Number of elements. More...
 
   }   array
 series of values More...
 
u
 

Detailed Description

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.

Examples:
tutorial_json_options.c.

Field Documentation

◆ array

struct { ... } oyjl_val_s::array

◆ d

double oyjl_val_s::d

double value, if representable.

◆ flags

unsigned int oyjl_val_s::flags

Signals whether the i and d members are valid. See OYJL_NUMBER_INT_VALID and OYJL_NUMBER_DOUBLE_VALID.

◆ i

long long oyjl_val_s::i

integer value, if representable.

◆ keys

char** oyjl_val_s::keys

Array of keys.

◆ len

size_t oyjl_val_s::len

Number of key-value-pairs.

Number of elements.

◆ number

struct { ... } oyjl_val_s::number

◆ object

struct { ... } oyjl_val_s::object

objects with key/value pairs

Referenced by oyjlTreeClearValue(), oyjlTreeToCsv(), oyjlValueCount(), and oyjlValuePosGet().

◆ r

char* oyjl_val_s::r

unparsed number in string form.

◆ string

char* oyjl_val_s::string

UTF-8 text.

Referenced by oyjlTreeToYaml(), oyjlValueSetString(), and oyjlValueText().

◆ type

oyjl_type oyjl_val_s::type

◆ u

union { ... } oyjl_val_s::u

◆ values

oyjl_val* oyjl_val_s::values

Array of values.

Array of elements.