Skip to content

Commit

Permalink
Rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Feb 9, 2024
1 parent 9b72cfc commit 3a0c305
Show file tree
Hide file tree
Showing 20 changed files with 5 additions and 87 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using NUnit.Framework;

namespace ValveKeyValue.Test.TextKV3
{
class BasicKV3TestCases
Expand Down Expand Up @@ -97,7 +95,7 @@ public void DeserializesArray()

var arrayValue = (KVArrayValue)data["arrayValue"];

Assert.That(arrayValue.Count, Is.EqualTo(2));
Assert.That(arrayValue, Has.Count.EqualTo(2));
Assert.That(arrayValue[0].ToString(), Is.EqualTo("a"));
Assert.That(arrayValue[1].ToString(), Is.EqualTo("b"));

Expand Down
3 changes: 0 additions & 3 deletions ValveKeyValue/ValveKeyValue.Test/TextKV3/HeadersTestCase.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.IO;
using System.Text;
using NUnit.Framework;

namespace ValveKeyValue.Test.TextKV3
{
Expand Down
4 changes: 0 additions & 4 deletions ValveKeyValue/ValveKeyValue.Test/TextKV3/Kv1ToKv3TestCase.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.IO;
using NUnit.Framework;

namespace ValveKeyValue.Test.TextKV3
{
class Kv1ToKv3TestCase
Expand Down
3 changes: 0 additions & 3 deletions ValveKeyValue/ValveKeyValue.Test/TextKV3/Kv3ToKv1TestCase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System.IO;
using NUnit.Framework;

namespace ValveKeyValue.Test.TextKV3
{
class Kv3ToKv1TestCase
Expand Down
2 changes: 0 additions & 2 deletions ValveKeyValue/ValveKeyValue.Test/TextKV3/RootTypesTestCase.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using NUnit.Framework;

namespace ValveKeyValue.Test.TextKV3
{
class RootTypesTestCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System.IO;
using NUnit.Framework;

namespace ValveKeyValue.Test.TextKV3
{
class SerializationTestCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Globalization;
using System.IO;
using ValveKeyValue.Abstraction;

namespace ValveKeyValue.Deserialization.KeyValues3
Expand Down Expand Up @@ -183,7 +181,7 @@ void ReadText(string text)

void ReadBinaryBlob(string text)
{
var bytes = Utils.ParseHexStringAsByteArrayNoReverse(text);
var bytes = HexStringHelper.ParseHexStringAsByteArray(text);
var value = new KVBinaryBlob(bytes)
{
Flag = stateMachine.GetAndResetFlag()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace ValveKeyValue.Deserialization.KeyValues3
namespace ValveKeyValue.Deserialization.KeyValues3
{
enum KV3TextReaderState
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Collections.Generic;

namespace ValveKeyValue.Deserialization.KeyValues3
{
class KV3TextReaderStateMachine
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using ValveKeyValue.KeyValues3;
Expand Down
2 changes: 0 additions & 2 deletions ValveKeyValue/ValveKeyValue/KVArrayValue.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;

namespace ValveKeyValue
{
Expand Down
1 change: 0 additions & 1 deletion ValveKeyValue/ValveKeyValue/KVBinaryBlob.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Text;

namespace ValveKeyValue
Expand Down
2 changes: 0 additions & 2 deletions ValveKeyValue/ValveKeyValue/KVFile.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace ValveKeyValue
{
public class KVFile : KVObject
Expand Down
2 changes: 0 additions & 2 deletions ValveKeyValue/ValveKeyValue/KVFlag.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace ValveKeyValue
{
public enum KVFlag
Expand Down
2 changes: 0 additions & 2 deletions ValveKeyValue/ValveKeyValue/KVHeader.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace ValveKeyValue
{
public class KVHeader
Expand Down
2 changes: 0 additions & 2 deletions ValveKeyValue/ValveKeyValue/KeyValues3/Encoding.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace ValveKeyValue.KeyValues3
{
public class Encoding
Expand Down
2 changes: 0 additions & 2 deletions ValveKeyValue/ValveKeyValue/KeyValues3/Format.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace ValveKeyValue.KeyValues3
{
public class Format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public KV1TextSerializer(Stream stream, KVSerializerOptions options)
readonly KVSerializerOptions options;
readonly TextWriter writer;
int indentation = 0;
Stack<int> arrayCount = new();
readonly Stack<int> arrayCount = new();

public void Dispose()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using ValveKeyValue.Abstraction;

Expand All @@ -23,7 +20,7 @@ public KV3TextSerializer(Stream stream)

readonly TextWriter writer;
int indentation = 0;
Stack<bool> inArray = new();
readonly Stack<bool> inArray = new();

bool IsInArray => inArray.Count > 0 && inArray.Peek();

Expand Down
42 changes: 0 additions & 42 deletions ValveKeyValue/ValveKeyValue/Utils.cs

This file was deleted.

0 comments on commit 3a0c305

Please sign in to comment.