-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
424 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) Alexandre Mutel. All rights reserved. | ||
// Licensed under the BSD-Clause 2 license. | ||
// See license.txt file in the project root for full license information. | ||
|
||
namespace Tomlyn; | ||
using System; | ||
|
||
/// <summary> | ||
/// A datetime value that can represent a TOML: | ||
/// - An offset DateTime | ||
/// - A local DateTime | ||
/// - A local Date | ||
/// - A local Time, | ||
/// </summary> | ||
/// <param name="DateTime"></param> | ||
/// <param name="SecondPrecision"></param> | ||
/// <param name="OffsetKind"></param> | ||
public record struct DateTimeValue(DateTimeOffset DateTime, int SecondPrecision, DateTimeValueOffsetKind OffsetKind) | ||
{ | ||
public DateTimeValue(int year, int month, int day) : this(new DateTimeOffset(new DateTime(year, month, day)), 0, DateTimeValueOffsetKind.None) | ||
{ | ||
} | ||
|
||
public DateTimeValue(DateTime datetime) : this(new DateTimeOffset(datetime), 0, DateTimeValueOffsetKind.None) | ||
{ | ||
} | ||
|
||
public static implicit operator DateTimeValue(DateTime dateTime) | ||
{ | ||
return new DateTimeValue(dateTime, 0, DateTimeValueOffsetKind.None); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) Alexandre Mutel. All rights reserved. | ||
// Licensed under the BSD-Clause 2 license. | ||
// See license.txt file in the project root for full license information. | ||
|
||
namespace Tomlyn; | ||
|
||
/// <summary> | ||
/// Offsets used for a <see cref="DateTimeValue"/> | ||
/// </summary> | ||
public enum DateTimeValueOffsetKind | ||
{ | ||
/// <summary> | ||
/// No offset. | ||
/// </summary> | ||
None, | ||
/// <summary> | ||
/// Zero offset. | ||
/// </summary> | ||
Zero, | ||
/// <summary> | ||
/// Number offset. | ||
/// </summary> | ||
Number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ namespace Tomlyn.Model | |
/// </summary> | ||
public enum ObjectKind | ||
{ | ||
InlineTable, | ||
|
||
Table, | ||
|
||
TableArray, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.