SettingsFolder

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

Constructors

SettingsFolder

#
Constructor.
public SettingsFolder(
folder
Folder URI.
)

Properties

Folder

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

Methods

FileNames

#
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.
public IEnumerable<string> FileNames(
pattern = "*"
)
An enumeration of filenames + extensions. Note that this does not return full paths.

GetBytes

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

GetSettings

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

GetText

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

SetBytes

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

SetText

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