Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[CsToml - TOML Parser/Serializer for .NET](https://prozolic.github.io/CsToml)
CsToml - TOML Parser/Serializer for .NET
===

[![MIT License](https://img.shields.io/github/license/prozolic/CsToml)](LICENSE)
Expand Down Expand Up @@ -177,7 +177,7 @@ partial class CsTomlClass : ITomlSerializedObject<CsTomlClass?>
var __Array__RootNode = rootNode[@"Array"u8];
var __Array__ = options.Resolver.GetFormatter<int[]>()!.Deserialize(ref __Array__RootNode, options);
var __Table__RootNode = rootNode[@"Table"u8];
var __Table__ = options.Resolver.GetFormatter<global::CsToml.Generator.Tests.TableClass>()!.Deserialize(ref __Table__RootNode, options);
var __Table__ = options.Resolver.GetFormatter<global::ConsoleApp.TableClass>()!.Deserialize(ref __Table__RootNode, options);

var target = new CsTomlClass(){
Key = __Key__,
Expand Down Expand Up @@ -236,7 +236,7 @@ partial class CsTomlClass : ITomlSerializedObject<CsTomlClass?>
writer.WriteNewLine();
writer.BeginCurrentState(TomlValueState.Table);
writer.PushKey(@"Table"u8);
options.Resolver.GetFormatter<global::CsToml.Generator.Tests.TableClass>()!.Serialize(ref writer, target.Table, options);
options.Resolver.GetFormatter<global::ConsoleApp.TableClass>()!.Serialize(ref writer, target.Table, options);
writer.PopKey();
writer.EndCurrentState();
}
Expand All @@ -245,7 +245,7 @@ partial class CsTomlClass : ITomlSerializedObject<CsTomlClass?>
writer.WriteKey(@"Table"u8);
writer.WriteEqual();
writer.BeginCurrentState(TomlValueState.ArrayOfTable);
options.Resolver.GetFormatter<global::CsToml.Generator.Tests.TableClass>()!.Serialize(ref writer, target.Table, options);
options.Resolver.GetFormatter<global::ConsoleApp.TableClass>()!.Serialize(ref writer, target.Table, options);
writer.EndCurrentState();
writer.EndKeyValue(lastValue_Table);
}
Expand Down Expand Up @@ -285,7 +285,7 @@ partial class CsTomlClass : ITomlSerializedObject<CsTomlClass?>
writer.WriteNewLine();
writer.BeginCurrentState(TomlValueState.Table);
writer.PushKey(@"Table"u8);
options.Resolver.GetFormatter<global::CsToml.Generator.Tests.TableClass>()!.Serialize(ref writer, target.Table, options);
options.Resolver.GetFormatter<global::ConsoleApp.TableClass>()!.Serialize(ref writer, target.Table, options);
writer.PopKey();
writer.EndCurrentState();
}
Expand All @@ -294,7 +294,7 @@ partial class CsTomlClass : ITomlSerializedObject<CsTomlClass?>
writer.WriteKey(@"Table"u8);
writer.WriteEqual();
writer.BeginCurrentState(TomlValueState.ArrayOfTable);
options.Resolver.GetFormatter<global::CsToml.Generator.Tests.TableClass>()!.Serialize(ref writer, target.Table, options);
options.Resolver.GetFormatter<global::ConsoleApp.TableClass>()!.Serialize(ref writer, target.Table, options);
writer.EndCurrentState();
writer.EndKeyValue(lastValue_Table);
}
Expand All @@ -315,9 +315,9 @@ partial class CsTomlClass : ITomlSerializedObject<CsTomlClass?>
}

// Register Formatter in advance.
if (!TomlValueFormatterResolver.IsRegistered<global::CsToml.Generator.Tests.TableClass>())
if (!TomlValueFormatterResolver.IsRegistered<global::ConsoleApp.TableClass>())
{
TomlValueFormatterResolver.Register<global::CsToml.Generator.Tests.TableClass>();
TomlValueFormatterResolver.Register<global::ConsoleApp.TableClass>();
}

}
Expand Down Expand Up @@ -793,10 +793,10 @@ var serializedTomlText = Encoding.UTF8.GetString(serializedText.ByteSpan);
// Name = "Mixed"
```

#### Spec
`Spec` can enable features in Pre-release version features.
For more information, please click [Pre-release version features overview](#pre-release-version-features-overview).
#### Spec

`Spec` can enable features in TOML v1.1.0.
For more information, please click [TOML v1.1.0 features overview](#toml-v110-features-overview).

Built-in support type
---
Expand Down Expand Up @@ -1023,7 +1023,7 @@ using var serializedTomlValue1 = CsTomlSerializer.SerializeValueType(tomlIntValu
// 1234
using var serializedTomlValue2 = CsTomlSerializer.SerializeValueType(tomlStringValue);
// "abc"
using var serializedTomlValue3 = CsTomlSerializer.SerializeValueType(tomlDateTimeValue);
using var serializedTomlValue3 = CsTomlSerializer.SerializeValueType(tomlDateTimeOffsetValue);
// 2024-10-20T15:16:00
using var serializedTomlValue4 = CsTomlSerializer.SerializeValueType(tomlArrayValue);
// [ "red", "yellow", "green" ]
Expand All @@ -1037,7 +1037,7 @@ using var serializedTomlValue6 = CsTomlSerializer.SerializeValueType(tomlTupleVa
---

Use `TomlDocument` when parsing with the TOML structure preserved.
It can get the TOML value by specifying the indexer in the `TomlDocumentNode.RootNode` property.
It can get the TOML value by specifying the indexer in the `TomlDocument.RootNode` property.

### Key/Value Pair

Expand Down Expand Up @@ -1340,7 +1340,7 @@ var value = document.RootNode["table"u8]["key"u8].GetString(); // tablevalue
For example:

```TOML
key = { int = 123, type.name = ""inline table"" }
key = { int = 123, type.name = "inline table" }
```

the key/values of that table can also be retrieved as follows.
Expand Down Expand Up @@ -1382,9 +1382,9 @@ var arrayIndex2 = document.RootNode["array"u8]["of"u8]["tables"u8][2]["array"u8]

### Complex samples.

```TOML
dotted.keys = ""value""
configurations = [1, {key = [ { key2 = [""VALUE""]}]}]
```TOML
dotted.keys = "value"
configurations = [1, {key = [ { key2 = ["VALUE"]}]}]
```

```csharp
Expand Down Expand Up @@ -1464,8 +1464,8 @@ public enum TomlValueType
`TomlDocumentNode.GetValue<T>` and `TomlDocumentNode.TryGetValue<T>` can be used to obtain a value converted from a Toml value type to a specified type.
The type that can be specified for `T` is [Built-in support type](#built-in-support-type).

```TOML
key = ""https://github.com/prozolic/CsToml""
```TOML
key = "https://github.com/prozolic/CsToml"
```

```csharp
Expand Down Expand Up @@ -1552,19 +1552,19 @@ var document = CsTomlSerializer.Deserialize<TomlDocument>(tomlText, v110Options)
This feature permits newline characters after key/value pairs within inline tables.
For example:

```toml
name = {
first = ""CsToml"",
last = ""prozolic"" }
```toml
name = {
first = "CsToml",
last = "prozolic" }
```

### AllowTrailingCommaInInlineTables

This feature supports an optional trailing comma after the last key/value pair in inline tables.
For example:

```toml
name = { first = ""CsToml"", last = ""prozolic"", }
```toml
name = { first = "CsToml", last = "prozolic", }
```

### AllowSecondsOmissionInTime
Expand Down