Table of Contents

Class AmlDataSetMetadata

Namespace
EncDotNet.S57.Aml
Assembly
EncDotNet.S57.dll

Represents the structured metadata that NATO Additional Military Layers (AML) cells carry in the data set identification comment (Comment).

public sealed class AmlDataSetMetadata
Inheritance
AmlDataSetMetadata
Inherited Members

Remarks

An AML DSID COMT is a list of key=value pairs separated by semicolons, for example title=Wrecks; IDO Status = Final; Protective Marking = UNCLASSIFIED; Owner Authority = UKHO, optionally followed by a caveat. Keys are matched without regard to case or white space, so IDO Status, ido status and IDOStatus are the same key. Values are trimmed and may contain =; they can't contain ;.

The well-known keys are exposed as properties, which are null when the comment doesn't have the key. Every pair, including keys this type doesn't recognise, is available from Entries.

Properties

Caveat

Gets the handling caveat (Caveat), or null if absent.

public string? Caveat { get; }

Property Value

string

Entries

Gets every key/value pair in the comment, keyed by the trimmed key as written. Lookups ignore case. When a key appears more than once, the first value wins.

public IReadOnlyDictionary<string, string> Entries { get; }

Property Value

IReadOnlyDictionary<string, string>

IdoStatus

Gets the Information and Data Object (IDO) status (IDO Status), or null if absent.

public string? IdoStatus { get; }

Property Value

string

OwnerAuthority

Gets the authority that owns the data (Owner Authority), or null if absent.

public string? OwnerAuthority { get; }

Property Value

string

ProtectiveMarking

Gets the security classification (Protective Marking), or null if absent.

public string? ProtectiveMarking { get; }

Property Value

string

Title

Gets the data set title (title), or null if absent.

public string? Title { get; }

Property Value

string

Methods

Parse(string)

Parses an AML data set identification comment.

public static AmlDataSetMetadata Parse(string comment)

Parameters

comment string

The DSID COMT text.

Returns

AmlDataSetMetadata

The metadata the comment holds.

Exceptions

ArgumentNullException

comment is null.

FormatException

comment isn't an AML comment; see TryParse(string?, out AmlDataSetMetadata?).

TryParse(string?, out AmlDataSetMetadata?)

Tries to parse an AML data set identification comment.

public static bool TryParse(string? comment, out AmlDataSetMetadata? metadata)

Parameters

comment string

The DSID COMT text.

metadata AmlDataSetMetadata

When this method returns true, the metadata the comment holds; otherwise, null.

Returns

bool

true if every non-empty, semicolon-separated part of comment is a key=value pair with a non-empty key and at least one key is a well-known AML key; otherwise, false.