diff --git a/Gameloop.Vdf/VdfReader.cs b/Gameloop.Vdf/VdfReader.cs index 0e45400..9df4633 100644 --- a/Gameloop.Vdf/VdfReader.cs +++ b/Gameloop.Vdf/VdfReader.cs @@ -4,8 +4,6 @@ namespace Gameloop.Vdf { public abstract class VdfReader : IDisposable { - protected const int MaximumTokenSize = 4096; - public VdfSerializerSettings Settings { get; } public bool CloseInput { get; set; } public string Value { get; set; } diff --git a/Gameloop.Vdf/VdfSerializerSettings.cs b/Gameloop.Vdf/VdfSerializerSettings.cs index d60e70b..4a93c02 100644 --- a/Gameloop.Vdf/VdfSerializerSettings.cs +++ b/Gameloop.Vdf/VdfSerializerSettings.cs @@ -19,6 +19,11 @@ public class VdfSerializerSettings /// public bool UsesConditionals = true; + /// + /// Sets the size of the token buffer used for deserialization. + /// + public int MaximumTokenSize = 4096; + // System information public bool IsXBox360 = false, IsWin32 = true; public bool IsWindows = true, IsOSX = false, IsLinux = false, IsPosix = false; diff --git a/Gameloop.Vdf/VdfTextReader.cs b/Gameloop.Vdf/VdfTextReader.cs index b501fd8..04f463b 100644 --- a/Gameloop.Vdf/VdfTextReader.cs +++ b/Gameloop.Vdf/VdfTextReader.cs @@ -21,7 +21,7 @@ public VdfTextReader(TextReader reader, VdfSerializerSettings settings) : base(s _reader = reader; _charBuffer = new char[DefaultBufferSize]; - _tokenBuffer = new char[MaximumTokenSize]; + _tokenBuffer = new char[settings.MaximumTokenSize]; _charPos = _charsLen = 0; _tokenSize = 0; _isQuoted = false;