Class ExchangeSetRoot
- Namespace
- EncDotNet.S100.ExchangeSets
- Assembly
- EncDotNet.S100.ExchangeSets.dll
Finds an S-100 exchange set's catalogue in a folder or ZIP archive: at the
top level, or else in an S100_ROOT folder, the layout S-100 Part 17
gives an exchange set on media (the IHO S-164 test data is packaged this
way).
public static class ExchangeSetRoot
- Inheritance
-
ExchangeSetRoot
- Inherited Members
Remarks
The facade, collection indexing and SoundCharts all use this rule, so they agree on what an S-100 exchange set is.
Fields
FolderName
The folder S-100 Part 17 puts an exchange set under.
public const string FolderName = "S100_ROOT"
Field Value
Properties
CatalogueNames
Accepted catalogue file names, preferred first. S-100 Part 17 names the
file CATALOG.XML; some producers write CATALOGUE.XML.
public static IReadOnlyList<string> CatalogueNames { get; }
Property Value
Methods
FindInFolder(string)
Finds the catalogue in folderPath or its
S100_ROOT folder, or returns null when there's
none or the folder can't be read.
public static ExchangeSetRootLocation? FindInFolder(string folderPath)
Parameters
folderPathstringThe folder to look in.
Returns
FindInZip(IEnumerable<string>)
Finds the catalogue among a ZIP archive's entry names: at the top
level, or else under S100_ROOT/. Returns
null when there's none.
public static ExchangeSetRootLocation? FindInZip(IEnumerable<string> entryNames)
Parameters
entryNamesIEnumerable<string>The archive's entry names (
ZipArchiveEntry.FullName).
Returns
FindInZip(string)
Opens the ZIP archive at zipPath and finds its
catalogue (see FindInZip(IEnumerable<string>)). Returns
null when the file is missing, isn't a readable ZIP,
or has no catalogue.
public static ExchangeSetRootLocation? FindInZip(string zipPath)
Parameters
zipPathstringThe ZIP archive.
Returns
IsCatalogueName(string?)
True when fileName is a catalogue file name (case-insensitive).
public static bool IsCatalogueName(string? fileName)
Parameters
fileNamestringA file name without a folder.
Returns
PickCatalogue(IEnumerable<string?>)
Picks the catalogue among fileNames, preferring
CATALOG.XML, or returns null.
public static string? PickCatalogue(IEnumerable<string?> fileNames)
Parameters
fileNamesIEnumerable<string>File names without folders.