TomlNotableDateCache Class
Definition
- Namespace
- Bodu.Globalization.Calendar.Caching
- Assembly
- Bodu.Globalization.Calendar.Caching.dll
- Package
- Bodu.Globalization.Calendar.Caching 1.0.0
- Source
- TomlNotableDateCache.cs
An INotableDateCache that persists computed years as TOML files, one file per territory.
public sealed class TomlNotableDateCache : FileNotableDateCacheBase, INotableDateCache
- Inheritance
-
TomlNotableDateCache
- Implements
- Inherited Members
- Extension Methods
Remarks
Each file records the territory as a top-level key, an array of tables under Entries - one table per cached
civil year with its version and computed instant - and an array of tables under Occurrences, one flat table
per emitted occurrence carrying its year and version so it associates back to its entry. Dates and instants use
TOML's native RFC 3339 forms.
Malformed content is treated as an empty result, and all file-level resilience - including atomic temp-and-move writes and the parse memo - is provided by FileNotableDateCacheBase.
Constructors
TomlNotableDateCache(FileNotableDateCacheOptions, TimeProvider?, ILogger?)
Initializes a new instance of the TomlNotableDateCache class.
public TomlNotableDateCache(FileNotableDateCacheOptions options, TimeProvider? timeProvider = null, ILogger? logger = null)
Parameters
optionsFileNotableDateCacheOptionsThe file-cache options that select the storage directory.
timeProviderTimeProviderThe time source the swallowed-failure warning rate-limiting is measured against, or null to use System.
loggerILoggerThe logger that receives a rate-limited warning when a best-effort storage failure is swallowed, or null to disable that reporting.
Exceptions
- ArgumentNullException
Thrown when
optionsis null.- ArgumentException
Thrown when
optionsfails validation.
Properties
FileExtension
Gets the file extension used by the concrete format, including the leading dot.
protected override string FileExtension { get; }
Property Value
- string
The file extension, such as
.tomlor.json.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |