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

Macros

#define ssdGraft(dest, destpath, src, srcpath)    _ssdGraft(dest, destpath, (SSDLockState*)_ssdCurrentLockState, src, srcpath, NULL)
 

Detailed Description

Advanced tree manipulation functions like grafting subtrees.

Macro Definition Documentation

◆ ssdGraft

#define ssdGraft (   dest,
  destpath,
  src,
  srcpath 
)     _ssdGraft(dest, destpath, (SSDLockState*)_ssdCurrentLockState, src, srcpath, NULL)

bool ssdGraft(SSDNode *dest, strref destpath, SSDNode *src, strref srcpath)

Grafts a subtree from the source tree onto the destination tree.

This performs a deep copy of the source subtree and attaches it to the destination at the specified path. If the destination tree uses custom node classes, those will be used for the copied nodes.

IMPORTANT: If used within a locked transaction, it must be for the DESTINATION tree. The source tree is automatically locked in read-only mode with a transient lock and must NOT already be locked by the caller.

Parameters
destThe destination tree root
destpathPath in destination where to attach the subtree
srcThe source tree root
srcpathPath in source to the subtree to copy
Returns
true on success, false on failure

Example:

// Copy config/database from one tree to another
ssdGraft(destTree, _S"config/database", srcTree, _S"config/database");
#define ssdGraft(dest, destpath, src, srcpath)
Definition ssdtree.h:713
#define _S
Creates a static ASCII string from a string literal.
Definition strbase.h:392

Definition at line 713 of file ssdtree.h.