Releases: Galaco/keyvalues
Releases · Galaco/keyvalues
Fix for \r carriage returns
Type parsing improvements
3 changes in this version, 1 potentially breaking:
- Add
NewKeyValuePair()
function; because there may be a situation where manually crafting a node is desired. This can only be used with raw types; slices are not supported. - Fixed some issues with type conversions. These stem from test code assuming that keyvalues would be created using values of their mapped types. In reality a keyvalue stream will always interpret keyvalues as
string:string
pairs.AsString()
,AsInt()
,AsFloat()
now convert accordingly. - In some cases (e.g.
Vmf
) a KeyValues file can have multiple root nodes. Before, this was treated as being the case always, and all nodes were placed under a root node with key$root
. This doesn't make sense for the majority of cases. Now, for cases where there is only a single root node, this$root
node does not exist, and the actual defined root in the KeyValues stream will be the root returned from the reader.
Patch & Replace improvements
Simplified Patch and Replace requirements.
Support for Patch & Replace
- Removed
MergeInto
function from*KeyValue
- Added
Patch
andReplace
functions to*KeyValue
. Both require the top level node to match the rules of key beingpatch
andreplace
respectively.
Allow for node deletion from tree
v1.2.3 Add function to remove a child from tree
Support for "patch" key
v1.2.2 Added support for reserved "patch" property
Escaping Improvements
v1.2.1 Improved escaping
Reverse tree access, recursive tree merging
- Added parent link to KeyValue nodes.
- Add new function to KeyValue struct;
MergeInto()
(see below)
A KeyValue can now be merged with another KeyValue. The entire tree of A will be merged with B, resulting in a tree that contains all nodes in A and B.
If a key appears in both A and B, A will replace B assuming they have the same Type, unless they both have child nodes, in which case they will be recursively merged. Merge will fail if there are mismatched types on nodes that appear in both A and B.
Correctly handle escaped '{' characters
v1.1.1 Fix OOB when '{' inside escaped value
Improved vmt support, improved key escape character removal
v1.1.0 Update README.md