Skip to content

Commit

Permalink
Updated MaximumTokenSize to be adjustable in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
shravan2x committed Mar 5, 2022
1 parent a042be8 commit af630d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Gameloop.Vdf/VdfReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
5 changes: 5 additions & 0 deletions Gameloop.Vdf/VdfSerializerSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public class VdfSerializerSettings
/// </summary>
public bool UsesConditionals = true;

/// <summary>
/// Sets the size of the token buffer used for deserialization.
/// </summary>
public int MaximumTokenSize = 4096;

// System information
public bool IsXBox360 = false, IsWin32 = true;
public bool IsWindows = true, IsOSX = false, IsLinux = false, IsPosix = false;
Expand Down
2 changes: 1 addition & 1 deletion Gameloop.Vdf/VdfTextReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit af630d6

Please sign in to comment.