Documentation
Table of Contents

Constructor DocumentId

Namespace
IntentSharp.Documents
Assembly
IntentSharp.dll

DocumentId(string)

Creates the id of the document at path. Backslashes become forward slashes, surrounding white space is trimmed, one leading / is removed and repeated slashes are collapsed, so "\rules\orders.yaml" and "rules//orders.yaml" both name "rules/orders.yaml".

public DocumentId(string path)

Parameters

path string

The document's path relative to the store's root.

Remarks

The same paths are refused on every platform, so an id that works on one works on all, and no id can name a file other than the one its path spells: Windows drops a trailing dot or space from a file name, reads a colon as the start of a file's alternate stream, and opens a device for a reserved name. So no segment may end with a dot or a space, no path may contain a colon, and no segment may be a reserved Windows device name (CON, PRN, AUX, NUL, COM1 to COM9, LPT1 to LPT9 and their spellings with a superscript 1, 2 or 3, and the console names CONIN$ and CONOUT$, in any case, alone or followed by an extension as in nul.json or con.rules.yaml).

Exceptions

ArgumentNullException

path is null.

ArgumentException

The path is empty, ends with a slash, is rooted (a drive such as C:, also behind the one leading slash as in "/C:/x", or a network path starting with two slashes), contains a . or .. segment, a segment that ends with a dot or a space, a segment that is a reserved device name, a colon or a control character (see the remarks).