CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches

Macros

#define ssdCreateHashtable(...)   _ssdCreateRoot(SSD_Create_Hashtable, NULL, opt_flags(__VA_ARGS__))
 
#define ssdCreateArray(...)   _ssdCreateRoot(SSD_Create_Array, NULL, opt_flags(__VA_ARGS__))
 
#define ssdCreateSingle(...)   _ssdCreateRoot(SSD_Create_Single, NULL, opt_flags(__VA_ARGS__))
 
#define ssdCreateCustom(crtype, tree)   _ssdCreateRoot(crtype, tree, 0)
 

Typedefs

typedef enum SSD_CREATE_TYPE_ENUM SSDCreateType
 Node creation types for specifying which kind of node to create.
 

Enumerations

enum  SSD_FLAGS_ENUM { SSD_CaseInsensitive = 0x0001 }
 Flags for configuring SSD tree behavior. More...
 
enum  SSD_CREATE_TYPE_ENUM {
  SSD_Create_None = 0 , SSD_Create_Hashtable , SSD_Create_Array , SSD_Create_Single ,
  SSD_Create_Count
}
 Node creation types for specifying which kind of node to create. More...
 

Detailed Description

Functions for creating new SSD trees with different root node types.

Macro Definition Documentation

◆ ssdCreateArray

#define ssdCreateArray (   ...)    _ssdCreateRoot(SSD_Create_Array, NULL, opt_flags(__VA_ARGS__))

SSDNode *ssdCreateArray([flags])

Creates a new semi-structured tree with an array as its root.

Array nodes store indexed values accessible by integer indices, analogous to a JSON array.

Parameters
...(flags) Optional flags for the tree
Returns
A new SSDNode with an array root (must be released with objRelease)

Example:

SSDNode *root = ssdCreateArray();
ssdAppend(root, NULL, true, stvar(int32, 42));
objRelease(&root);
#define objRelease(pinst)
Definition objclass.h:223
#define ssdAppend(root, path, createpath, val)
Definition ssdtree.h:675
#define ssdCreateArray(...)
Definition ssdtree.h:51
#define stvar(typen, val)
Definition stvar.h:153

Definition at line 51 of file ssdtree.h.

◆ ssdCreateCustom

#define ssdCreateCustom (   crtype,
  tree 
)    _ssdCreateRoot(crtype, tree, 0)

SSDNode *ssdCreateCustom(crtype, tree)

Creates a tree with a custom node type using factory functions from the provided tree.

This is an advanced function for creating trees with custom derived node classes.

Parameters
crtypeThe SSDCreateType indicating which factory to use
treeThe SSDTree object containing custom factory functions
Returns
A new SSDNode using custom node types

Definition at line 80 of file ssdtree.h.

◆ ssdCreateHashtable

#define ssdCreateHashtable (   ...)    _ssdCreateRoot(SSD_Create_Hashtable, NULL, opt_flags(__VA_ARGS__))

SSDNode *ssdCreateHashtable([flags])

Creates a new semi-structured tree with a hashtable as its root.

Hashtable nodes store key-value pairs where keys are strings and values are stvars. This is the most common root type, analogous to a JSON object.

Parameters
...(flags) Optional flags (SSD_CaseInsensitive for case-insensitive keys)
Returns
A new SSDNode with a hashtable root (must be released with objRelease)

Example:

SSDNode *root = ssdCreateHashtable();
ssdSet(root, _S"name", true, stvar(string, _S"value"));
objRelease(&root);
#define ssdCreateHashtable(...)
Definition ssdtree.h:34
#define ssdSet(root, path, createpath, val)
Definition ssdtree.h:415
#define _S
Creates a static ASCII string from a string literal.
Definition strbase.h:392

Definition at line 34 of file ssdtree.h.

◆ ssdCreateSingle

#define ssdCreateSingle (   ...)    _ssdCreateRoot(SSD_Create_Single, NULL, opt_flags(__VA_ARGS__))

SSDNode *ssdCreateSingle([flags])

Creates a new semi-structured tree with a single value as its root.

Single-value nodes hold exactly one stvar value. Supported types include integers, floats, strings, booleans, and objects.

Parameters
...(flags) Optional flags for the tree
Returns
A new SSDNode with a single-value root (must be released with objRelease)

Example:

SSDNode *root = ssdCreateSingle();
ssdSet(root, NULL, true, stvar(int32, 42));
objRelease(&root);
#define ssdCreateSingle(...)
Definition ssdtree.h:69

Definition at line 69 of file ssdtree.h.

Enumeration Type Documentation

◆ SSD_CREATE_TYPE_ENUM

Node creation types for specifying which kind of node to create.

Enumerator
SSD_Create_None 

Do not create a node.

SSD_Create_Hashtable 

Create a hashtable (key-value) node.

SSD_Create_Array 

Create an array (indexed) node.

SSD_Create_Single 

Create a single-value node.

SSD_Create_Count 

Total number of creation types (internal use)

Definition at line 24 of file ssdshared.h.

◆ SSD_FLAGS_ENUM

Flags for configuring SSD tree behavior.

Enumerator
SSD_CaseInsensitive 

Keys in hashtables are case-insensitive.

Definition at line 19 of file ssdshared.h.