diff --git a/README.md b/README.md index 8738783..33d4b2e 100644 --- a/README.md +++ b/README.md @@ -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) @@ -177,7 +177,7 @@ partial class CsTomlClass : ITomlSerializedObject var __Array__RootNode = rootNode[@"Array"u8]; var __Array__ = options.Resolver.GetFormatter()!.Deserialize(ref __Array__RootNode, options); var __Table__RootNode = rootNode[@"Table"u8]; - var __Table__ = options.Resolver.GetFormatter()!.Deserialize(ref __Table__RootNode, options); + var __Table__ = options.Resolver.GetFormatter()!.Deserialize(ref __Table__RootNode, options); var target = new CsTomlClass(){ Key = __Key__, @@ -236,7 +236,7 @@ partial class CsTomlClass : ITomlSerializedObject writer.WriteNewLine(); writer.BeginCurrentState(TomlValueState.Table); writer.PushKey(@"Table"u8); - options.Resolver.GetFormatter()!.Serialize(ref writer, target.Table, options); + options.Resolver.GetFormatter()!.Serialize(ref writer, target.Table, options); writer.PopKey(); writer.EndCurrentState(); } @@ -245,7 +245,7 @@ partial class CsTomlClass : ITomlSerializedObject writer.WriteKey(@"Table"u8); writer.WriteEqual(); writer.BeginCurrentState(TomlValueState.ArrayOfTable); - options.Resolver.GetFormatter()!.Serialize(ref writer, target.Table, options); + options.Resolver.GetFormatter()!.Serialize(ref writer, target.Table, options); writer.EndCurrentState(); writer.EndKeyValue(lastValue_Table); } @@ -285,7 +285,7 @@ partial class CsTomlClass : ITomlSerializedObject writer.WriteNewLine(); writer.BeginCurrentState(TomlValueState.Table); writer.PushKey(@"Table"u8); - options.Resolver.GetFormatter()!.Serialize(ref writer, target.Table, options); + options.Resolver.GetFormatter()!.Serialize(ref writer, target.Table, options); writer.PopKey(); writer.EndCurrentState(); } @@ -294,7 +294,7 @@ partial class CsTomlClass : ITomlSerializedObject writer.WriteKey(@"Table"u8); writer.WriteEqual(); writer.BeginCurrentState(TomlValueState.ArrayOfTable); - options.Resolver.GetFormatter()!.Serialize(ref writer, target.Table, options); + options.Resolver.GetFormatter()!.Serialize(ref writer, target.Table, options); writer.EndCurrentState(); writer.EndKeyValue(lastValue_Table); } @@ -315,9 +315,9 @@ partial class CsTomlClass : ITomlSerializedObject } // Register Formatter in advance. - if (!TomlValueFormatterResolver.IsRegistered()) + if (!TomlValueFormatterResolver.IsRegistered()) { - TomlValueFormatterResolver.Register(); + TomlValueFormatterResolver.Register(); } } @@ -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 --- @@ -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" ] @@ -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 @@ -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. @@ -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 @@ -1464,8 +1464,8 @@ public enum TomlValueType `TomlDocumentNode.GetValue` and `TomlDocumentNode.TryGetValue` 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 @@ -1552,10 +1552,10 @@ var document = CsTomlSerializer.Deserialize(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 @@ -1563,8 +1563,8 @@ name = { 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