|
CX Framework
Cross-platform C utility framework
|
Macros | |
| #define | setsGetSub(sets, path) ssdSubtree(sets, path, SSD_Create_Hashtable) |
| #define | setsGet(sets, path, type, out, def) ssdCopyOutD(sets, path, type, out, def) |
| #define | setsSet(sets, path, type, val) ssdSet(sets, path, true, stvar(type, val)) |
| #define | setsRemove(sets, path) ssdRemove(sets, path) |
Compatibility macros for code written against an earlier version of the settings API. These wrap the underlying SSD tree operations. New code should use the SSD tree functions directly (ssdCopyOutD, ssdSet, ssdRemove, ssdSubtree).
| #define setsGet | ( | sets, | |
| path, | |||
| type, | |||
| out, | |||
| def | |||
| ) | ssdCopyOutD(sets, path, type, out, def) |
bool setsGet(SSDNode *sets, strref path, type, out, def)
Retrieves a setting value with type conversion and a default.
Reads the value at the specified path, converts it to the requested type, and stores it in the output variable. If the path doesn't exist or conversion fails, the default value is used instead.
| sets | The settings tree root |
| path | Path to the setting (e.g., "window/width") |
| type | Expected type (e.g., int32, string, float32) |
| out | Pointer to output variable |
| def | Default value to use if path doesn't exist |
Example:
Definition at line 301 of file settings.h.
| #define setsGetSub | ( | sets, | |
| path | |||
| ) | ssdSubtree(sets, path, SSD_Create_Hashtable) |
SSDNode *setsGetSub(SSDNode *sets, strref path)
Retrieves a subtree node, creating it as a hashtable if it doesn't exist.
This is a compatibility wrapper around ssdSubtree() that automatically creates hashtable nodes. New code should use ssdSubtree() directly.
Important: The returned node has an acquired reference - caller must call objRelease().
| sets | The settings tree root |
| path | Path to the subtree (e.g., "display/advanced") |
Example:
Definition at line 279 of file settings.h.
| #define setsRemove | ( | sets, | |
| path | |||
| ) | ssdRemove(sets, path) |
void setsRemove(SSDNode *sets, strref path)
Removes a setting from the tree.
Deletes the value at the specified path. This is a compatibility wrapper around ssdRemove().
| sets | The settings tree root |
| path | Path to the setting to remove |
Example:
Definition at line 335 of file settings.h.
void setsSet(SSDNode *sets, strref path, type, val)
Sets a setting value, creating intermediate nodes as needed.
Stores a value at the specified path. If intermediate nodes don't exist, they are automatically created as hashtables.
| sets | The settings tree root |
| path | Path where to store the value (e.g., "audio/volume") |
| type | Type of the value (e.g., int32, string, bool) |
| val | The value to store |
Example:
Definition at line 320 of file settings.h.