SettingsFolder

References
public sealed class SettingsFolder
Wrapper class for accessing various settings files in a single folder.

Constructors

SettingsFolder

#
public SettingsFolder(string folder)
Constructor.
folder (string)Folder URI.

Properties

Folder

#
public string Folder { get; }
Gets the folder path.

Methods

FileNames

#
public IEnumerable<string> FileNames(string pattern = "*")
Enumerate over all files that match a pattern. This includes not-yet-cached files which are nevertheless on the disc, as well as in-memory-only files which haven't (yet) been written to the disc.
pattern (string = "*")
An enumeration of filenames + extensions. Note that this does not return full paths.

GetBytes

#
public byte[] GetBytes(string name)
Gets the contents of a binary file in this folder.
name (string)Name of binary file. If no extension is included, '.dat' is assumed.

GetSettings

#
public SettingsFile GetSettings(string name)
Gets a settings file in this folder. Settings files are strongly-typed binary files which use the GrasshopperIO serialisation library.
name (string)Name of settings file.

GetText

#
public string GetText(string name)
Gets the contents of a text file in this folder.
name (string)Name of text file. If no extension is included, '.txt' is assumed.

SetBytes

#
public void SetBytes(string name, byte[] bytes)
Set the contents of a binary file in this folder.
name (string)Name of binary file. If no extension is included, '.dat' is assumed.
bytes (byte[])

SetText

#
public void SetText(string name, string text)
Set the contents of a text file in this folder.
name (string)Name of text file. If no extension is included, '.txt' is assumed.
text (string)File contents.