46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
// /**
|
|
// * File: JSONValue.cs
|
|
// * Author: haraldwolff
|
|
// *
|
|
// * This file and it's content is copyrighted by the Author and / or copyright holder.
|
|
// * Any use wihtout proper permission is illegal and may lead to legal actions.
|
|
// *
|
|
// *
|
|
// **/
|
|
using System;
|
|
using System.Collections.Generic;
|
|
namespace ln.json
|
|
{
|
|
public enum JSONValueType
|
|
{
|
|
NULL, OBJECT, ARRAY, STRING, NUMBER, TRUE, FALSE
|
|
}
|
|
public abstract class JSONValue
|
|
{
|
|
public JSONValueType ValueType { get; private set; }
|
|
|
|
public virtual bool HasChildren => false;
|
|
public virtual IEnumerable<JSONValue> Children => throw new NotSupportedException();
|
|
|
|
public virtual object ToNative() => throw new NotImplementedException();
|
|
|
|
public JSONValue(JSONValueType valueType)
|
|
{
|
|
ValueType = valueType;
|
|
}
|
|
|
|
public virtual JSONValue this[string property]
|
|
{
|
|
get => throw new NotSupportedException();
|
|
set => throw new NotSupportedException();
|
|
}
|
|
public virtual JSONValue this[int index]
|
|
{
|
|
get => throw new NotSupportedException();
|
|
set => throw new NotSupportedException();
|
|
}
|
|
|
|
public override string ToString() => throw new NotImplementedException();
|
|
}
|
|
}
|