Skip to content

Commit e457593

Browse files
committed
Update README.md
1 parent a689023 commit e457593

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,24 @@ This library does not currently support KeyValues2 (Datamodel). If you need KV2/
108108

109109
# KeyValues3
110110

111-
This library does not currently support KeyValues3. There is an [open pull request](https://github.com/ValveResourceFormat/ValveKeyValue/pull/61) for KV3 support.
111+
Used by the Source 2 engine.
112112

113-
If you need KV3 support, use [ValveResourceFormat](https://github.com/ValveResourceFormat/ValveResourceFormat) which supports parsing Source 2 formats including KV3.
113+
## Deserializing text
114+
115+
```csharp
116+
var stream = File.OpenRead("file.kv3"); // or any other Stream
117+
118+
var kv = KVSerializer.Create(KVSerializationFormat.KeyValues3Text);
119+
KVObject data = kv.Deserialize(stream);
120+
121+
Console.WriteLine(data["some key"]);
122+
```
123+
124+
## Serializing to text
125+
126+
```csharp
127+
using var stream = File.OpenWrite("file.kv3");
128+
129+
var kv = KVSerializer.Create(KVSerializationFormat.KeyValues3Text);
130+
kv.Serialize(stream, data);
131+
```

0 commit comments

Comments
 (0)