This commit is contained in:
2021-10-09 16:36:17 +03:00
parent 502d679848
commit 6602744325
8 changed files with 69 additions and 32 deletions

View File

@@ -16,6 +16,7 @@ namespace DTLib.Dtsod
// парсер теперь не может игнорировать комменты, потом починю
// теперь числовые значения конвертируются в правильный тип, а не в int64/uint64 (новый вариант switch из c#9.0 делал какую-то херню)
// исправлены некоторые другие баги
public class DtsodV21 : Dictionary<string, dynamic>
{
static readonly bool debug = false;
@@ -82,15 +83,6 @@ namespace DTLib.Dtsod
List,
Complex,
String,
/*Double,
Long,
Ulong,
Short,
Ushort,
Int,
Uint,
Null,
Bool,*/
Default
}
@@ -356,7 +348,6 @@ namespace DTLib.Dtsod
}
}
void Debug(params string[] msg)
{
if(debug)
@@ -369,3 +360,4 @@ namespace DTLib.Dtsod
}
}
}

View File

@@ -43,6 +43,23 @@ namespace DTLib.Dtsod
}
}
public enum ValueTypes
{
List,
Complex,
String,
Short,
Int,
Long,
UShort,
UInt,
ULong,
Double,
Null,
Bool,
Unknown
}
public DtsodV22() { }
public DtsodV22(string text)
@@ -51,7 +68,6 @@ namespace DTLib.Dtsod
Add(pair.Key, pair.Value);
}
public DtsodV22(Dictionary<string, DtsodV22.ValueStruct> dict)
{
foreach(KeyValuePair<string, ValueStruct> pair in dict)

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DTLib.Dtsod
{
public class DtsodSerializableAttribute : Attribute
{
public DtsodVersion Version;
public DtsodSerializableAttribute(DtsodVersion ver) => Version=ver;
}
}

23
Dtsod/V30/DtsodV30.cs Normal file
View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DTLib.Dtsod
{
static public class DtsodV30
{
/*
public static DtsodV30 FromObject(object target)
{
}
public T ToObject<T>()
{
}
*/
}
}

View File

@@ -0,0 +1,9 @@
namespace DTLib.Dtsod
{
public enum DtsodVersion : byte
{
V21 = 21,
V22 = 22,
V30 = 30
}
}

View File

@@ -1,19 +0,0 @@
namespace DTLib.Dtsod
{
public enum ValueTypes
{
List,
Complex,
String,
Short,
Int,
Long,
UShort,
UInt,
ULong,
Double,
Null,
Bool,
Unknown
}
}