Skip to content

Type parsing improvements

Compare
Choose a tag to compare
@Galaco Galaco released this 17 Sep 22:33
· 9 commits to master since this release

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.