Git Product home page Git Product logo

gameloop.vdf's Introduction

Vdf.NET

NuGet AppVeyor

A fast, easy-to-use Valve Data Format parser for .NET

Getting Binaries

Vdf.NET is available as a NuGet package. Binaries can also be found on the releases page.

Performance

Vdf.NET was originally written as an experiment in deserialization performance. It is significantly faster than alternatives like SteamKit's KeyValue and even Json.NET (though I admit Json.NET is far more feature rich).

The test source file is VdfNetBenchmark.cs. I used version Vdf.NET 0.4.1 and the TF2 schema, which is available both in JSON and VDF formats (you'll need an API key to obtain them).

The following are the times taken for 10 iterations of deserializing the schema on an Intel i7-4790k processor.

Vdf.NET (VDF)	    : 129ms, 501871ticks average
Json.NET (JSON)	    : 270ms, 1022480ticks average
SK2 KeyValue (VDF)  : 340ms, 1255055ticks average

Documentation

To deserialize a file importantInfo.vdf,

"Steam"
{
	"SSAVersion"		"3"
	"PrivacyPolicyVersion"		"2"
	"SteamDefaultDialog"		"#app_store"
	"DesktopShortcutCheck"		"0"
	"StartMenuShortcutCheck"		"0"
}

do

dynamic volvo = VdfConvert.Deserialize(File.ReadAllText("importantInfo.vdf"));
// 'volvo' is a VProperty, analogous to Json.NET's JProperty

// Now do whatever with this
Console.WriteLine(volvo.Value.SSAVersion); // Prints 3

Note the need to use .Value and skip the enclosing property name Steam. This is because root types in VDF are properties, as opposed to objects in traditional JSON.

Deserialization using models

Vdf.NET does not natively support deserializing to models, but this can be achieved indirectly using the Gameloop.Vdf.JsonConverter extension such as:

VProperty volvo = VdfConvert.Deserialize(File.ReadAllText("importantInfo.vdf"));
SteamModel sm = volvo.ToJson().ToObject<SteamModel>();

where SteamModel is something like

class SteamModel
{
	public int SSAVersion { get; set; } // Json.NET automatically converts strings to target types
	public int PrivacyPolicyVersion { get; set; }
	public string SteamDefaultDialog { get; set; }
	...
}

Extensions

Gameloop.Vdf.JsonConverter: VDF-JSON converters for Vdf.NET.

License

Vdf.NET is released under the MIT license.

gameloop.vdf's People

Contributors

shravan2x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gameloop.vdf's Issues

Binary VDF support?

Hey!

Recently you fixed an issue where it would throw if the VDF was empty - thanks for that. I've been poking around Steam and I've found a very useful looking file: Steam\appcache\appinfo.vdf

Problem is it's using binary VDF, which doesn't seem to be supported.

Are there any plans to extend this library to support it? If not, would you be open to accepting a pull request that adds support?

Allow reading / writing comments

It would be nice if the parser would try to parse commented lines and fallback to just storing them as strings when parsing fails (a regular comment)

Sent from my TAB 2 A10 using FastHub

Add support for conditionals

I tried reading csgo\resource\csgo_german.txt

using System;
using System.Collections.Generic;
using System.IO;
using Gameloop.Vdf;
using Gameloop.Vdf.Linq;
using Gameloop.Vdf.JsonConverter;

namespace WeaponSkinParser
{
    public class LanguageFile
    {
        public string Language { get; set; }
        public FileInfo File { get; set; }
        public LanguageFileContents Content { get; set; }
        public LanguageFile(FileInfo file) {
            File = file;
            Language = file.FileNameWithoutExtension().ToLowerInvariant().Replace("csgo_", "");
            var fcontent = file.ReadAllText();
            VProperty volvo = VdfConvert.Deserialize(fcontent);
            Content = VTokenExtensions.ToJson(volvo).ToObject<LanguageFileContents>();
        }
    }
    public class LanguageFileContents
    {
        string Language { get; set; }
        List<LanguageFileToken> Tokens { get; set; }
    }
    public class LanguageFileToken
    {
        string Token { get; set; }
        string Text { get; set; }
    }
}

VdfConvert deserializing comments somehow

I've tried to deserialize file that contains some comments starts with "\" and I got some weird results. When I enumerate VToken through foreach, it sends me VValue struct with comment itself. Please fix.

VProperty subtitles = VdfConvert.Deserialize(reader: new StreamReader(subtitlesTextStream, leaveOpen: true));
VToken subtitlesTokens = subtitles.Value["Tokens"] ?? throw new InvalidDataException("Cannot find 'Tokens' property.");

foreach (VToken token in subtitlesTokens)
{
    // subtitlesTokens could send me VValue comment. why??
    if (token is VProperty property)
    {
        string key = property.Key;
        string value = property.Value.ToString();

        tokens.Add(new KeyValuePair<string, string>(key, value));
    }
}

System.Exception: Key 'gamelogo' already exists in object.

08:10:21.4855 | ERROR | System.Exception: Key 'gamelogo' already exists in object.
   at Gameloop.Vdf.JsonConverter.VTokenExtensions.HandleValueDuplicateKey(JObject baseObj, VProperty prop, VdfJsonConversionSettings settings)
   at Gameloop.Vdf.JsonConverter.VTokenExtensions.ToJson(VObject obj, VdfJsonConversionSettings settings)
   at Gameloop.Vdf.JsonConverter.VTokenExtensions.ToJson(VToken tok, VdfJsonConversionSettings settings)
   at Gameloop.Vdf.JsonConverter.VTokenExtensions.ToJson(VProperty prop, VdfJsonConversionSettings settings)
   at GModMountManager.Classes.Game..ctor(DirectoryInfo gameDir) in C:\Users\blusc\source\repos\GMod Mount Manager\Classes\GameInfo.cs:line 47

Is this related to #8?

Case insensitive option for ContainsKey and getter?

Hello, i would like to ask if i can retrieve a value by a key name ignoring the case?

In source engine KeyValues class, this code:

KeyValues *pKV = new KeyValues("Test");
pKV->SetInt("Apple", 5);
Msg("%d %d", pKV->GetInt("apple"), pKV->GetInt("APPLE"));

it prints "5 5", which means the cases are ignored

Issue with libraryfolders.vdf

Hi how can i do deserialization on that pls. It seems that it could be array.. But how to assign 1 to json model ??

"LibraryFolders"
{
"TimeNextStatsReport" "1578345576"
"ContentStatsID" "-9082669944124938900"
"1" "D:\Games"
}

How do I navigate the deserialized data?

Trying to get each item in a key just gives me an array of each letter that was there... I am completely lost. And I don't seem to be able to navigate to sub-keys either >.>

Add tests

So things don't get broken inadvertently.

How to parse list to type

I am going insane over this

        private void Main_Load(object sender, EventArgs e)
        {
            var text = File.ReadAllText(@"G:\Steam\steamapps\common\GarrysMod\garrysmod\cfg\mount.cfg"); // ../../garrysmod/cfg/mount.cfg
            var vp = VdfConvert.Deserialize(text);
            var json = vp.ToJson();
            // Console.WriteLine(json);
            var jp = json.Children().Single(); // .Children();// .ToList().ToString();
            // var mounts = new Mounts();
            /*foreach (var child in jp)
            {
                mounts.mounts.Add(new Mount(child.Value<string>(), child.Value<string>()));
                // Console.WriteLine(child.ToString());
            }*/
            var sm = JsonConvert.DeserializeObject<List<Mount>>(jp.ToString());

            // var sm = sms.ToObject<Mounts>();
            var source = new BindingSource() { DataSource = sm };
            dataGridView1.AutoGenerateColumns = true;
            dataGridView1.DataSource = source;
            dataGridView1.AutoResizeColumns(); // DataGridViewAutoSizeColumnsMode.Fill
        }
using System.Collections.Generic;

namespace GModMountManager
{
    public class Mounts
    {
        public List<Mount> mounts { get; set; }
    }

    public class Mount
    {
        /*[JsonIgnore]
        public bool Enabled { get; set; }*/

        public string Name { get; set; }
        public string Path { get; set; }

        public Mount(string Name, string Path)
        {
            this.Name = Name; this.Path = Path;
        }
    }
}

Support preserving unquoted tokens

So re-serializing a deserialized unquoted token should result in an unquoted token. There should be some API to create unquoted tokens artificially, but the default can remain quoted.

EDIT: Supporting these for VValues may be easy, but VPropertyies complicate things. Unless maybe keys are updated to be VValues themselves?

How to update/edit array values

I'm attempting to add a key/value pair to an existing array and can't seem to get the types to match up.

Using a VDF like the following:

"GameInfo"
{
	"game"		"sample"
	"FileSystem"
	{
		"SteamAppId"	"111"
		"SearchPaths"
		{
			"Game"	"|gameinfo_path|."
			"Game"	"search"
			"Game"	"path"
		}
	}
}

I would have expected code like the below to work (this sample won't even compile):

var parsed = VdfConvert.Deserialize(File.ReadAllText("./gameinfo.txt"));
var values = parsed.Value["FileSystem"]["SearchPaths"].Cast<VProperty>();
parsed.Value["FileSystem"]["SearchPaths"] = values.Append(new VProperty("Game", new VValue("test")));

Is there something basic I'm missing here? I can provide a slightly more detailed repro if needed.

How to properly traverse deserialized data?

Trying to traverse the items_game.txt file for CS:GO. As an example I'll try to get to "first_valid_class" under "game_info".
I can do it using an older method from reading an old issue:

dynamic itemsG = VdfConvert.Deserialize(itemsGame);

Log.Info(itemsG.Value["game_info"]["first_valid_class"].ToString());

But when I try to use what I think is a new method that you added, meant to be more like json:

Log.Info(itemsG.game_info.first_valid_class.ToString());

It throws an excpetion: "'Gameloop.Vdf.Linq.VProperty' does not contain a definition for 'game_info'".
What am I getting wrong? It's not clear how to use it from the README file, you use '.Valve' despite nothing in the example being called "Valve".

EDIT: Never mind, all of 5 minutes later and re-read the documentation and saw it says "Value", not "Valve". It now works. However on the documentation you state that you skipped the enclosing property name "Steam", but I still have to include "game_info". What's going on?

Values containing '\' character are not parsed properly

When I try to parse text:

"Config"
{
	"Games"	"Some\text"
}

With code:

var text = "\"Config\"\n{\n    \"Games\"    \"Some\\text\"\n}";
var config = VdfConvert.Deserialize(text);
var games = config.Value["Games"];

Value "Games" is parsed as "some\text" instead of "some\\text" (if you "Console.Write" this you get "some ext").

Could be an issue, just posting my problem.

I have this config file that I just assume is VDF inside one of my game installations called "app.config". Im writing a program but want to make sure the selected folder is in fact a steam game folder.

Here is the file:

{  
	"xal":
	{  
		"title_id":1144039928,
		"service_config_id":"77290100-225e-4768-9373-98164430a9f8",
		"client_id":"000000004825FC1F"
	},
	"steam":
	{
		"app_id":976730
	}
}

I did what the README said to do:

dynamic data = VdfConvert.Deserialize(File.ReadAllText("app.config"));

My issue is that I only have access to the property "xal":
image

If the file I'm using isn't a valid VDF, please excuse my assumptions and close this issue, thanks!

How to traverse through the hierarchy?

Hi! I'm new to programming, what I roughly want to do is to go through all the lines in the file and look for every key that has ".mdl" in it and store in a separate file.

So far I only concluded that I can access keys directly by parsing through and calling them directly

            foreach (dynamic ItemID in prop.Value["items"].Children())
            {
                string model_player = "$modelname" + "\t" + "\"" + ItemID.Value["model_player"] + "\"";
                using (StreamWriter sw = File.CreateText(filename_tf2))
                {
                    sw.WriteLine(model_player.Replace("models/", ""));
                    sw.WriteLine("$include _empty.qci");
                }
            }

But I miss out on a lot of the strings, there's so many styles and inconsistencies and I'd like to know if there's a way to quickly get into every element of the collection and see if it has a string that has ".mdl" in it.

I'm sure I could just parse the whole file and filter out the strings, but I'd rather use this library because I need to filter out some of the lines based on some or another parameter.

Cheers!

Publish with Strong Name

Hello there,
do you have any plans publishing the nuget package with a strong name? Currently I can't use this package because it's not signed.

Something wrong with conditional

I have vdf file and when I try to deserialize a file (example below) I get an exception 'Incomplete VDF data. I've found out that the exception appears when the file contains an odd number of conditionals, but with an even number of conditionals the program works fine.

"lang"
{
"Language" "English"
"Tokens"
{
// ---------------------------------------------------------------------------------------------
// GAMEUI_ENGLISH.txt
"GameUI_MainMenuMovieScene" "Main Menu Background Scenery" [$X360]
"GameUI_MainMenuMovieScene_Vanity" "Change Background Scenery"
"GameUI_MainMenuMovieScene_Tooltip" "This setting allows you to customize the main menu background scenery which sets the mood for visual experience of your entire game."
"GameUI_DisplayMode" "Color Mode"
}
}

Changing value

I have been able to narrow down the values I want to change, but haven't been able to figure out how to cast it to the VToken.

trying to do something like this

foreach (var value in ((Gameloop.Vdf.Linq.VProperty)game).Value)
{
        Console.WriteLine(value);
        ((Gameloop.Vdf.Linq.VProperty)game).Value = "controller_ps4_gamepad_joystick.vdf";
}

Thank you in advance!

There is a problem with Deserialization after the new steam client.

Hello, i am trying to edit loginusers.vdf in steam files. But i found out that after the new steam client, they probably changed their vdf settings. (I am new at coding so i don't know the details but i make a lot tests and found out that something is changed.)

Before the new steam client, i was deserializing loginusers.vdf, change few settings and Serialize it. It was working nicely. But after the new steam client it was not working anymore. As example when i change something in the loginusers.vdf steam just hanging on connecting to account "account-name"...

After long days of testing, i found that before the Deserialization, loginusers.vdf looks like this;
"\"users\"\n{\n\t\"\"\n\t{\n\t\t\"AccountName\"\t\t\"\"\n\t\t\"PersonaName\"\t\t\"Dom\"\n\t\t\"RememberPassword\"\t\t\"0\"\n\t\t\"WantsOfflineMode\"\t\t\"0\"\n\t\t\"SkipOfflineModeWarning\"\t\t\"1\"\n\t\t\"AllowAutoLogin\"\t\t\"1\"\n\t\t\"MostRecent\"\t\t\"1\"\n\t\t\"Timestamp\"\t\t\"1670281542\"\n\t}\n}\n"

And after the Deserialization if you convert it to string, it looks like this;
"\"users\"\r\n{\r\n\t\"\"\r\n\t{\r\n\t\t\"AccountName\" \"\"\r\n\t\t\"PersonaName\" \"Dom\"\r\n\t\t\"RememberPassword\" \"0\"\r\n\t\t\"WantsOfflineMode\" \"0\"\r\n\t\t\"SkipOfflineModeWarning\" \"1\"\r\n\t\t\"AllowAutoLogin\" \"1\"\r\n\t\t\"MostRecent\" \"1\"\r\n\t\t\"Timestamp\" \"1670281542\"\r\n\t}\r\n}\r\n"

When you compare them, you see that steam only uses \n but after Deserialization they replaced to \r\n. I make a research and found out this.
\n is for Unix, \r is for Mac and \r\n is for Windows.

It seems like they using unix now. And deserialization doesnt work as usual. Is there any way to fix this problem ? I try to change vdfSerializerSettings but it didnt work.

Newtonsoft.Json.JsonSerializationException: Unexpected token while deserializing object

10:38:02.9510 | ERROR | Newtonsoft.Json.JsonSerializationException: Unexpected token while deserializing object: PropertyName. Path ''.
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject[T]()
   at GModMountManager.Classes.Game..ctor(DirectoryInfo gameDir) in C:\Users\blusc\source\repos\GMod Mount Manager\Classes\GameInfo.cs:line 49

How to handle duplicate keys?

Sorry for the silly question, I'm new to this entire C# scene, and I'm using this parser for a project. As a result, I'm probably being a complete and total idiot and that my issue is common C# knowledge.

If two keys with the same name exist in the same object, they're both used in that object but have the same value. In the VDF formatted file that I'm using, though, they both have different values.

In other words, is it possible to access these values like a numeric array to avoid this issue? Or is there anything else in this parser that lets me do this?

Steam loginusers.vdf

How would I convert this over in like a list of users with all the data contained into 1 row for each user?

image

Sucks up backslashes


//
// Use this file to mount additional paths to the filesystem
// DO NOT add a slash to the end of the filename
//

"mountcfg"
{
	// "cstrike"			"C:\steamcmd\steamapps\common\Counter-Strike Source Dedicated Server\cstrike"
	// "tf"					"C:\mytf2server\tf"
	"bms"					"S:\Steam\steamapps\common\Black Mesa\bms"
	"downfall"				"S:\Steam\steamapps\common\Half-Life 2 DownFall\downfall"
	"EntropyZero"			"S:\Steam\steamapps\common\Entropy Zero\Entropy Zero\EntropyZero"
	// "hl2update"			"S:\Steam\steamapps\common\Half-Life 2 Update\hl2"
	"portal_stories"		"S:\Steam\steamapps\common\Portal Stories Mel\portal_stories"
	"TWTM"					"S:\Steam\steamapps\common\Thinking with Time Machine\TWTM"
	"csco"					"S:\Steam\steamapps\sourcemods\csco"
	"thecitizenreturns"		"S:\Steam\steamapps\sourcemods\thecitizenreturns"
	"watchingpaintdry"		"S:\Steam\steamapps\sourcemods\watchingpaintdry"
	// "HL2MMod"				"S:\Steam\steamapps\sourcemods\HL2MMod"
	// "HL2MMod_HL2"			"S:\Steam\steamapps\sourcemods\HL2MMod_HL2"
	// "HL2MMod_HL2U"			"S:\Steam\steamapps\sourcemods\HL2MMod_HL2U"
	// "HL2MMod_Cinematic_HL2"	"S:\Steam\steamapps\sourcemods\HL2MMod_Cinematic_HL2"
	// "HL2MMod_EP1"			"S:\Steam\steamapps\sourcemods\HL2MMod_EP1"
	// "HL2MMod_Cinematic_EP1"	"S:\Steam\steamapps\sourcemods\HL2MMod_Cinematic_EP1"
	// "HL2MMod_EP2"			"S:\Steam\steamapps\sourcemods\HL2MMod_EP2"
	// "HL2MMod_Cinematic_EP2"	"S:\Steam\steamapps\sourcemods\HL2MMod_Cinematic_EP2"
	// "HL2MMod_LC"				"S:\Steam\steamapps\sourcemods\HL2MMod_LC"
	// "HL2MMod_METASTASIS"		"S:\Steam\steamapps\sourcemods\HL2MMod_METASTASIS"
}

this file from gmod gets sadly corrupted by Gameloop.vdf:

"WebStorage" section of config.vdf causes a System.IndexOutOfRangeException

Attempting to deserialize Steam's "config.vdf" with Gameloop.Vdf when the config.vdf has a "WebStorage" section causes the mentioned exception. Maybe something to do with the egregious amount of backslashes?

Tested on Steam for Linux client built "Feb 22 2022, at 00:40:10".

A trimmed-down example config.vdf is provided:
testconfig.vdf.zip

My code:

namespace vdftest
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            var vdfpath = Path.Combine("/home/my_username/Projects/vdftest/", "testconfig.vdf");
            var text = File.ReadAllText(vdfpath);
            VProperty volvo = VdfConvert.Deserialize(text);
            Console.WriteLine("Complete");
        }
    }
}

Expected result:

Hello World!
Complete

Actual result:

Hello World!

Unhandled Exception:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
  at Gameloop.Vdf.VdfTextReader.ReadToken () [0x001ff] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfSerializer.ReadProperty (Gameloop.Vdf.VdfReader reader) [0x0000d] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfSerializer.ReadObject (Gameloop.Vdf.VdfReader reader) [0x00035] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfSerializer.ReadProperty (Gameloop.Vdf.VdfReader reader) [0x00058] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfSerializer.ReadObject (Gameloop.Vdf.VdfReader reader) [0x00035] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfSerializer.ReadProperty (Gameloop.Vdf.VdfReader reader) [0x00058] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfSerializer.Deserialize (System.IO.TextReader textReader) [0x0003c] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfConvert.Deserialize (System.IO.TextReader reader, Gameloop.Vdf.VdfSerializerSettings settings) [0x00014] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfConvert.Deserialize (System.String value, Gameloop.Vdf.VdfSerializerSettings settings) [0x00006] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfConvert.Deserialize (System.String value) [0x00006] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at vdftest.MainClass.Main (System.String[] args) [0x00023] in /home/my_username/Projects/vdftest/vdftest/Program.cs:27 
[ERROR] FATAL UNHANDLED EXCEPTION: System.IndexOutOfRangeException: Index was outside the bounds of the array.
  at Gameloop.Vdf.VdfTextReader.ReadToken () [0x001ff] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfSerializer.ReadProperty (Gameloop.Vdf.VdfReader reader) [0x0000d] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfSerializer.ReadObject (Gameloop.Vdf.VdfReader reader) [0x00035] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfSerializer.ReadProperty (Gameloop.Vdf.VdfReader reader) [0x00058] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfSerializer.ReadObject (Gameloop.Vdf.VdfReader reader) [0x00035] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfSerializer.ReadProperty (Gameloop.Vdf.VdfReader reader) [0x00058] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfSerializer.Deserialize (System.IO.TextReader textReader) [0x0003c] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfConvert.Deserialize (System.IO.TextReader reader, Gameloop.Vdf.VdfSerializerSettings settings) [0x00014] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfConvert.Deserialize (System.String value, Gameloop.Vdf.VdfSerializerSettings settings) [0x00006] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at Gameloop.Vdf.VdfConvert.Deserialize (System.String value) [0x00006] in <0d48bf6fbeb842b39220c642cedcbd03>:0 
  at vdftest.MainClass.Main (System.String[] args) [0x00023] in /home/my_username/Projects/vdftest/vdftest/Program.cs:27 

Support complex root structures

The KeyValues wiki states that statements like "#base" "panelBase.res" may be present in VDF files. Automatically executing import statements is out of scope for this library, but we should support these if possible. There may also be other root tokens like comments. One way to return these is as a IReadOnlyList<VToken>.

TODO:

  • Are such "complex" root structures common? Do any users rely on hacks to solve this problem?
  • Should this be a breaking change or an overload?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.