[#BloombergLP-baltzo-DataFileLoader]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baltzo.adoc[baltzo]::DataFileLoader
:relfileprefix: ../../
:mrdocs:

This component provides a concrete implementation of the `DataLoader` protocol for loading, into a `Zoneinfo`, the properties of a time zone defined by an Zoneinfo (TZ Database) binary file located on the file system&period;

== Synopsis

Declared in `&lt;baltzo&lowbar;datafileloader&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class DataFileLoader
    : public xref:BloombergLP/baltzo/Loader.adoc[Loader]
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/baltzo/Loader.adoc[Loader]`
| This class provides a protocol (a pure abstract interface) for loading a time zone object&period;
|===

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/baltzo/DataFileLoader/allocator_type.adoc[`allocator&lowbar;type`] 
| Allocator type used by this class&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/baltzo/DataFileLoader/2constructor-08.adoc[`DataFileLoader`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/baltzo/DataFileLoader/2destructor.adoc[`&#126;DataFileLoader`] [.small]#[destructor]# [.small]#[virtual]#
| Destroy this data&hyphen;file loader&period;
| xref:BloombergLP/baltzo/DataFileLoader/configureRootPath.adoc[`configureRootPath`] 
| Unconditionally set, to the specified `path`, the root of the file&hyphen;system directory hierarchy from which this loader will read Zoneinfo binary time&hyphen;zone information files&period;
| xref:BloombergLP/baltzo/DataFileLoader/configureRootPathIfPlausible.adoc[`configureRootPathIfPlausible`] 
| Set, to the specified `path`, the root of the file&hyphen;system directory hierarchy from which this loader will read Zoneinfo binary time&hyphen;zone information files&period; Return 0 on success, and a non&hyphen;zero value (without no effect) if `path` is not a directory that appears to contain valid Zoneinfo data, as determined by calling `isPlausibleZoneinfoRootPath` on `path`&period;
| xref:BloombergLP/baltzo/DataFileLoader/get_allocator.adoc[`get&lowbar;allocator`] 
| Return the allocator used by this object to supply memory&period; Note that if no allocator was supplied at construction the default allocator in effect at construction is used&period;
| xref:BloombergLP/baltzo/DataFileLoader/isRootPathPlausible.adoc[`isRootPathPlausible`] 
| Return `true` if the directory returned by the `rootPath` method exists and appears to contain valid Zoneinfo time&hyphen;zone information files, as determined by calling `isPlausibleZoneinfoRootPath` on the value returned by the `rootPath` method&period;
| xref:BloombergLP/baltzo/DataFileLoader/loadTimeZone.adoc[`loadTimeZone`]  [.small]#[virtual]#
| Load into the specified `result` the time&hyphen;zone information for the time zone identified by the specified `timeZoneId`&period; The `result` will have a sentinel transition at 01&hyphen;01&hyphen;001, meeting the first two requirements for a &quot;well&hyphen;formed&quot; object (see `baltzo&colon;&colon;ZoneinfoUtil&colon;&colon;isWellFormed` documentation)&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; A return status of `ErrorCode&colon;&colon;k&lowbar;UNSUPPORTED&lowbar;ID` indicates that `timeZoneId` is not recognized&period; If an error occurs during this operation, `result` will be left in a valid, but unspecified state&period;
| xref:BloombergLP/baltzo/DataFileLoader/loadTimeZoneFilePath-09.adoc[`loadTimeZoneFilePath`] 
| `loadTimeZoneFilePath` overloads
| xref:BloombergLP/baltzo/DataFileLoader/loadTimeZoneRaw.adoc[`loadTimeZoneRaw`] 
| Load into the specified `result` the time&hyphen;zone information for the time zone identified by the specified `timeZoneId` exactly in accordance with the original data&period; The `result` may not be a &quot;well&hyphen;formed&quot; object (see `baltzo&colon;&colon;ZoneinfoUtil&colon;&colon;isWellFormed` documentation for details)&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; A return status of `ErrorCode&colon;&colon;k&lowbar;UNSUPPORTED&lowbar;ID` indicates that `timeZoneId` is not recognized&period; If an error occurs during this operation, `result` will be left in a valid, but unspecified state&period; Note that time zone data files created by certain versions of the `zic` time zone compiler will have a sentinel transition prior to 01&hyphen;01&hyphen;0001 (the first representable `Datetime` value) and the `result` will therefore be non&hyphen;well formed (use `loadTimeZone` instead)&period;
| xref:BloombergLP/baltzo/DataFileLoader/rootPath.adoc[`rootPath`] 
| Return the root of the directory hierarchy from which this loader will attempt to load Zoneinfo binary data files&period; The behavior is undefined unless either `configureRootPath` has been called or `configureRootPathIfValid` has been called successfully&period;
| xref:BloombergLP/baltzo/DataFileLoader/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;DataFileLoader, UsesBslmaAllocator&gt;`] 
| Nested trait declaration for `bslma&colon;&colon;UsesBslmaAllocator`&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/baltzo/DataFileLoader/isPlausibleZoneinfoRootPath.adoc[`isPlausibleZoneinfoRootPath`] 
| Return `true` if there currently exists a directory at the specified file&hyphen;system `path` that appears to contain Zoneinfo time&hyphen;zone information files&period; This method verifies (at a minimum) that `path` is a valid directory, and contains files for a subset of common time&hyphen;zone identifiers, but does not _guarantee_ `path` is currently (or will remain) a correctly configured Zoneinfo database containing a complete set of time&hyphen;zone data&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
