Class DirectoryLibrarySource
A source of library descriptions that is a folder of files: Scripting.json describes the library Scripting.
public sealed class DirectoryLibrarySource : ILibrarySource
- Inheritance
-
DirectoryLibrarySource
- Implements
- Inherited Members
Remarks
It is the Symbols folder of the platform (Resolve(string)), where the descriptions that ship with it are deployed.
A folder that is not there has no libraries, and is not an error: a platform with none to ship is a platform whose projects reference none.
<Name>.json is the library of the name. Another type library of the name is <Name>.<qualifier>.json, the qualifier the
stem of its file (DAO.dao2535.json): a library's name is an identifier, so the first . of a file's name ends it, and the qualifier only keeps
the files apart. Which of them a reference means is what their content says they were made from (LibraryOrigin).
Constructors
DirectoryLibrarySource(IFileSystem, string)
A source of library descriptions that is a folder of files: Scripting.json describes the library Scripting.
public DirectoryLibrarySource(IFileSystem fileSystem, string directory)
Parameters
fileSystemIFileSystemThe file system the folder is read from.
directorystringThe folder.
Remarks
It is the Symbols folder of the platform (Resolve(string)), where the descriptions that ship with it are deployed.
A folder that is not there has no libraries, and is not an error: a platform with none to ship is a platform whose projects reference none.
<Name>.json is the library of the name. Another type library of the name is <Name>.<qualifier>.json, the qualifier the
stem of its file (DAO.dao2535.json): a library's name is an identifier, so the first . of a file's name ends it, and the qualifier only keeps
the files apart. Which of them a reference means is what their content says they were made from (LibraryOrigin).
Fields
Extension
The extension of a description file.
public const string Extension = ".json"
Field Value
Properties
Names
The names of the libraries the source has descriptions of, each once; none for a source that cannot say.
public IEnumerable<string> Names { get; }
Property Value
Methods
DescriptionsOf(string)
The descriptions the source has of libraries of a name: the library of the name (TryGet(string, out LibraryDescription?)) and every other type library of that name it describes.
public IEnumerable<LibraryDescription> DescriptionsOf(string name)
Parameters
namestringThe name of the libraries.
Returns
Exceptions
- InvalidDataException
The source has one, and it cannot be read.
LibraryNameOf(string)
The name of the library a file describes, by its name: DAO for DAO.json and for DAO.dao2535.json.
public static string LibraryNameOf(string fileName)
Parameters
fileNamestringThe name of the file, with or without its folder.
Returns
TryGet(string, out LibraryDescription?)
Gets the description of the library of a name: the one a reference that gives no identifier finds.
public bool TryGet(string name, out LibraryDescription? description)
Parameters
namestringThe name of the library; the case of it does not matter, as it does not in VBA.
descriptionLibraryDescriptionThe description.
Returns
Exceptions
- InvalidDataException
The source has one, and it cannot be read.