本帖最后由 Nameker 于 2020-3-24 18:44 编辑
测试代码,请用于务生产环境
窗口程序集名 | 保 留 | 保 留 | 备 注 | XPath, , 公开 | | | | 变量名 | 类 型 | 数组 | 备 注 | m_hHeap | 整数型 | |
m_hHeap = HeapCreate (4, 0, 0 )HeapDestroy (m_hHeap )|
Instance | 整数型 | | |
pointer | 整数型 | | | | Type | 整数型 | | | | Keys | 字节集 | | | | Value | 字节集 | | | |
变量名 | 类 型 | 静态 | 数组 | 备 注 | This | 整数型 | | | KeysPtr | 整数型 | | | ValuePtr | 整数型 | | | KeysLen | 整数型 | | | ValueLen | 整数型 | | | Prev | 整数型 | | | Next | 整数型 | | | Nums | 整数型 | | | 判断 (pointer > 0 )Prev = _get (pointer, #Prev )Next = _get (pointer, #Next )Nums = _get (pointer, #Nums )This = HeapAlloc (m_hHeap, 8, 36 ). if (This > 0 )_inc (pointer, #Nums )_set (This, #Heap, m_hHeap )_set (Prev, #Next, This )_set (Next, #Prev, This )_set (This, #Prev, Prev )_set (This, #Next, Next )_set (This, #Nums, 0 )_set (This, #Type, Type )KeysLen = 取字节集长度 (Keys ). if (KeysLen > 0 )KeysPtr = HeapAlloc (m_hHeap, 8, KeysLen )CopyMemory (KeysPtr, 取变量xx地址 (Keys ), KeysLen )_set (This, #Keys, KeysPtr)_set (This, #KeysLen, KeysLen )ValueLen = 取字节集长度 (Value ). if (ValueLen > 0 )ValuePtr = HeapAlloc (m_hHeap, 8, ValueLen )CopyMemory (ValuePtr, 取变量xx地址 (Value ), ValueLen )_set (This, #Value, ValuePtr)_set (This, #ValueLen, ValueLen )This = HeapAlloc (m_hHeap, 8, 36 ). if (This > 0 )_set (This, #Heap, m_hHeap )_set (This, #Prev, This )_set (This, #Next, This )_set (This, #Nums, 0 )_set (This, #Type, Type )KeysLen = 取字节集长度 (Keys ). if (KeysLen > 0 )KeysPtr = HeapAlloc (m_hHeap, 8, KeysLen )CopyMemory (KeysPtr, 取变量xx地址 (Keys ), KeysLen )_set (This, #Keys, KeysPtr)_set (This, #KeysLen, KeysLen )ValueLen = 取字节集长度 (Value ). if (ValueLen > 0 )ValuePtr = HeapAlloc (m_hHeap, 8, ValueLen )CopyMemory (ValuePtr, 取变量xx地址 (Value ), ValueLen )_set (This, #Value, ValuePtr)_set (This, #ValueLen, ValueLen )return (This)变量名 | 类 型 | 静态 | 数组 | 备 注 | Heap | 整数型 | | | Prev | 整数型 | | | Next | 整数型 | | | Nums | 整数型 | | |
Heap = _get (pointer, #Heap )Prev = _get (pointer, #Prev )Next = _get (pointer, #Next )Nums = _get (pointer, #Nums )调试输出 (_get (pointer, #Type )) _set (Prev, #Next, Next )_set (Next, #Prev, Prev )_dec (pointer, #Nums )HeapFree (Heap, 0, pointer )return (Next )|
XPath | 整数型 | | |
pointer | 整数型 | | | | Link | 字节集 | | | |
变量名 | 类 型 | 静态 | 数组 | 备 注 | Path | 字节集 | | 0 | Nums | 整数型 | | | Index | 整数型 | | | This | 整数型 | | | Ptr | 整数型 | | | KeysPtr | 整数型 | | | KeysLen | 整数型 | | | ValuePtr | 整数型 | | | ValueLen | 整数型 | | | Sub | 整数型 | | |
Path = 分割字节集 (Link, 到字节集 (“.”), )Nums = 取数组成员数 (Path ). if (Ptr = 0 )Ptr = pointer .counter (Nums, Index)Sub = 0 This = 0 . counter (_get (Ptr, #Nums ), ). if (This = 0 )This = Ptr This = _get (This, #Next )KeysPtr = _get (This, #Keys )KeysLen = _get (This, #KeysLen )ValuePtr = _get (This, #Value )ValueLen = _get (This, #ValueLen ). if (_get (This, #Type ) = #Sub 且 指针到字节集 (KeysPtr, KeysLen ) = Path [Index ])Sub = 取字节集xx (指针到字节集 (ValuePtr, ValueLen ), #整数型, 1 )break (). CounterLoop ()判断 (This = 0 )Sub = Instance (0, #Parent )This = Instance (Ptr, #Sub, Path [Index ], 到字节集 (Sub )) Ptr = Sub . switch (Sub = 0 )Sub = Instance (0, #Parent )setValue (This, 到字节集 (Sub )) Ptr = Sub Ptr = Sub . CounterLoop ()return (Ptr )变量名 | 类 型 | 静态 | 数组 | 备 注 | ValuePtr | 整数型 | | | ValueLen | 整数型 | | | Cache | 字节集 | | |
ValuePtr = _get (pointer, #Value )ValueLen = _get (pointer, #ValueLen )Cache = 指针到字节集 (ValuePtr, ValueLen )return (Cache )变量名 | 类 型 | 静态 | 数组 | 备 注 | ValuePtr | 整数型 | | | ValueLen | 整数型 | | | Cache | 字节集 | | |
ValuePtr = _get (pointer, #Keys )ValueLen = _get (pointer, #KeysLen )Cache = 指针到字节集 (ValuePtr, ValueLen )return (Cache )|
setValue | | | |
pointer | 整数型 | | | | Value | 字节集 | | | |
变量名 | 类 型 | 静态 | 数组 | 备 注 | ValuePtr | 整数型 | | | ValueLen | 整数型 | | |
ValueLen = 取字节集长度 (Value ). if (ValueLen > 0 )ValuePtr = HeapAlloc (m_hHeap, 8, ValueLen )CopyMemory (ValuePtr, 取变量xx地址 (Value ), ValueLen )_set (pointer, #Value, ValuePtr)_set (pointer, #ValueLen, ValueLen )Nums = _get (pointer, #Nums )return (Nums ) |