basic access

This commit is contained in:
Booklordofthedings 2024-08-16 11:49:00 +02:00
parent 11145e278b
commit 0da1c14ed7
2 changed files with 35 additions and 4 deletions

View file

@ -60,7 +60,7 @@ class Bofa
case .BigInteger:
strBuffer.Append(scope $"bi {Name} {Value.BigInteger}");
case .BigNumber:
strBuffer.Append(scope $"bn {Name} {Value.BigNumber}");
strBuffer.Append(scope $"bn {Name} {Value.BigNumber:R}");
case .Boolean:
strBuffer.Append(scope $"b {Name} {Value.Boolean ? "true" : "false"}");
case .Custom:
@ -70,7 +70,7 @@ class Bofa
case .Line:
strBuffer.Append(scope $"l {Name} {Value.Line}");
case .Number:
strBuffer.Append(scope $"n {Name} {Value.Number}");
strBuffer.Append(scope $"n {Name} {Value.Number:R}");
case .Object:
strBuffer.Append(scope $"o {Name}");
case .Text:
@ -152,4 +152,35 @@ class Bofa
else if(Type == .Array)
DeleteContainerAndItems!(Value.Array);
}
public ref Bofa this[StringView view]
{
[Checked]
get
{
Runtime.Assert(Type == .Object);
Runtime.Assert(Value.Object.ContainsKey(view));
return ref Value.Object[view];
}
[Unchecked, Inline]
get
{
return ref Value.Object[view];
}
[Checked]
set
{
Runtime.Assert(Type == .Object);
Runtime.Assert(!Value.Object.ContainsKey(view));
Value.Object[view] = value;
}
[Unchecked, Inline]
set
{
Value.Object[view] = value;
}
}
}

View file

@ -16,7 +16,7 @@ class Consistency
t textgoes here
- Text addendum
n tone 12.5
bn biggie 6.56456e+10
bn biggie 65645654535.553001
i int 234345
bi bint 38432847329847329
o object