Added implicit operators to JSONValue
parent
12d75bbc64
commit
e8cd08cb4c
|
@ -47,5 +47,16 @@ namespace ln.json
|
||||||
public abstract JSONValue Clone();
|
public abstract JSONValue Clone();
|
||||||
|
|
||||||
public override string ToString() => throw new NotImplementedException();
|
public override string ToString() => throw new NotImplementedException();
|
||||||
|
|
||||||
|
|
||||||
|
public static implicit operator JSONValue(string v) => new JSONString(v);
|
||||||
|
public static implicit operator JSONValue(float v) => new JSONNumber(v);
|
||||||
|
public static implicit operator JSONValue(double v) => new JSONNumber(v);
|
||||||
|
public static implicit operator JSONValue(decimal v) => new JSONNumber(v);
|
||||||
|
public static implicit operator JSONValue(int v) => new JSONNumber(v);
|
||||||
|
public static implicit operator JSONValue(long v) => new JSONNumber(v);
|
||||||
|
public static implicit operator JSONValue(uint v) => new JSONNumber(v);
|
||||||
|
public static implicit operator JSONValue(ulong v) => new JSONNumber(v);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<AssemblyVersion>0.1.0.0</AssemblyVersion>
|
<AssemblyVersion>0.1.0.0</AssemblyVersion>
|
||||||
<FileVersion>0.1.0.0</FileVersion>
|
<FileVersion>0.1.0.0</FileVersion>
|
||||||
<PackageVersion>1.3.0-preview3</PackageVersion>
|
<PackageVersion>1.3.0-preview4</PackageVersion>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue