Skip to content

Commit 858eb89

Browse files
committed
Update README.md
1 parent ced102d commit 858eb89

1 file changed

Lines changed: 20 additions & 13 deletions

File tree

README.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
<h1><img src="./Misc/logo.png" width="64" align="center"> Valve's KeyValue for .NET</h1>
1+
<h1 align="center"><img src="./Misc/logo.png" width="64" height="64" align="center"> Valve Key Value for .NET</h1>
22

3-
[![Build Status (GitHub)](https://img.shields.io/github/actions/workflow/status/ValveResourceFormat/ValveKeyValue/ci.yml?label=Build&style=flat-square&branch=master)](https://github.com/ValveResourceFormat/ValveKeyValue/actions)
4-
[![NuGet](https://img.shields.io/nuget/v/ValveKeyValue.svg?label=NuGet&style=flat-square)](https://www.nuget.org/packages/ValveKeyValue/)
5-
[![Coverage Status](https://img.shields.io/codecov/c/github/ValveResourceFormat/ValveKeyValue/master?label=Coverage&style=flat-square)](https://app.codecov.io/gh/ValveResourceFormat/ValveKeyValue)
3+
<p align="center">
4+
<a href="https://github.com/ValveResourceFormat/ValveKeyValue/actions" title="Build Status"><img alt="Build Status" src="https://img.shields.io/github/actions/workflow/status/ValveResourceFormat/ValveKeyValue/ci.yml?logo=github&label=Build&logoColor=ffffff&style=for-the-badge&branch=master"></a>
5+
<a href="https://www.nuget.org/packages/ValveKeyValue/" title="NuGet"><img alt="NuGet" src="https://img.shields.io/nuget/v/ValveKeyValue.svg?logo=nuget&label=NuGet&logoColor=ffffff&color=004880&style=for-the-badge"></a>
6+
<a href="https://app.codecov.io/gh/ValveResourceFormat/ValveKeyValue" title="Code Coverage"><img alt="Code Coverage" src="https://img.shields.io/codecov/c/github/ValveResourceFormat/ValveKeyValue/master?logo=codecov&label=Coverage&logoColor=ffffff&color=F01F7A&style=for-the-badge"></a>
7+
</p>
68

7-
This library aims to be fully compatible with Valve's various implementations of
8-
KeyValues format parsing (believe us, it's not consistent).
9+
KeyValues is a simple key-value pair format used by Valve in Steam and the Source engine for configuration files, game data, and more (`.vdf`, `.res`, `.acf`, etc.). This library aims to be fully compatible with Valve's various implementations of KeyValues format parsing (believe us, it's not consistent).
910

1011
# KeyValues1
1112

@@ -14,7 +15,7 @@ Used by Steam and the Source engine.
1415
## Deserializing text
1516

1617
### Basic deserialization
17-
```cs
18+
```csharp
1819
var stream = File.OpenRead("file.vdf"); // or any other Stream
1920
2021
var kv = KVSerializer.Create(KVSerializationFormat.KeyValues1Text);
@@ -24,7 +25,7 @@ Console.WriteLine(data["some key"]);
2425
```
2526

2627
### Typed deserialization
27-
```cs
28+
```csharp
2829
public class SimpleObject
2930
{
3031
public string Name { get; set; }
@@ -38,18 +39,18 @@ KVObject data = kv.Deserialize<SimpleObject>(stream);
3839
```
3940

4041
### Options
41-
`Deserialize` method also accepts an `KVSerializerOptions` object.
42+
The `Deserialize` method also accepts a `KVSerializerOptions` object.
4243

4344
By default, operating system specific conditionals are enabled based on the OS the code is running on (`RuntimeInformation`).
4445

45-
`KVSerializerOptions` accepts has the following options:
46+
`KVSerializerOptions` has the following options:
4647

4748
* `Conditions` - List of conditions to use to match conditional values.
4849
* `HasEscapeSequences` - Whether the parser should translate escape sequences (e.g. `\n`, `\t`).
49-
* `EnableValveNullByteBugBehavior` - Whether invalid escape sequences should truncate strings rather than throwing a `InvalidDataException`.
50+
* `EnableValveNullByteBugBehavior` - Whether invalid escape sequences should truncate strings rather than throwing an `InvalidDataException`.
5051
* `FileLoader` - Provider for referenced files with `#include` or `#base` directives.
5152

52-
```cs
53+
```csharp
5354
var options = new KVSerializerOptions
5455
{
5556
HasEscapeSequences = true,
@@ -69,7 +70,7 @@ Essentially the same as text, just change `KeyValues1Text` to `KeyValues1Binary`
6970

7071
## Serializing to text
7172

72-
```cs
73+
```csharp
7374
class DataObject
7475
{
7576
public string Name { get; set; }
@@ -100,3 +101,9 @@ kv.Serialize(stream, data, "root object name");
100101
## Serializing to binary
101102

102103
Essentially the same as text, just change `KeyValues1Text` to `KeyValues1Binary`.
104+
105+
# KeyValues3
106+
107+
This library does not currently support KeyValues3. There is an [open pull request](https://github.com/ValveResourceFormat/ValveKeyValue/pull/61) for KV3 support.
108+
109+
If you need KV3 support, use [ValveResourceFormat](https://github.com/ValveResourceFormat/ValveResourceFormat) which supports parsing Source 2 formats including KV3.

0 commit comments

Comments
 (0)