From 94712ee9915cd46212b589e283a211545ec1141e Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 1 Jul 2023 15:12:17 -0500 Subject: docs --- src/slskd/Files/Types/FilesystemDirectory.cs | 35 ++++++++++++++++++++++++++++ src/slskd/Files/Types/FilesystemFile.cs | 31 ++++++++++++++++++++++++ 2 files changed, 66 insertions(+) (limited to 'src') diff --git a/src/slskd/Files/Types/FilesystemDirectory.cs b/src/slskd/Files/Types/FilesystemDirectory.cs index 9e573906..6628ce15 100644 --- a/src/slskd/Files/Types/FilesystemDirectory.cs +++ b/src/slskd/Files/Types/FilesystemDirectory.cs @@ -21,16 +21,51 @@ namespace slskd.Files using System.Collections.Generic; using System.IO; + /// + /// A file directory on the host filesystem. + /// public record FilesystemDirectory { + /// + /// The name of the directory. + /// public string Name { get; init; } + + /// + /// The fully qualified name of the directory. + /// public string FullName { get; init; } + + /// + /// The directories' attributes. + /// public FileAttributes Attributes { get; init; } + + /// + /// The timestamp at which the directory was created. + /// public DateTime CreatedAt { get; init; } + + /// + /// The timestamp at which the directory was last modified. + /// public DateTime ModifiedAt { get; init; } + + /// + /// The files within the directory. + /// public IEnumerable Files { get; init; } + + /// + /// The directories within the directory. + /// public IEnumerable Directories { get; init; } + /// + /// Maps a from the specified . + /// + /// The DirectoryInfo instance from which to map. + /// A new instance of FilesystemDirectory. public static FilesystemDirectory FromDirectoryInfo(DirectoryInfo i) { return new FilesystemDirectory diff --git a/src/slskd/Files/Types/FilesystemFile.cs b/src/slskd/Files/Types/FilesystemFile.cs index fc36fff0..0b6feeb5 100644 --- a/src/slskd/Files/Types/FilesystemFile.cs +++ b/src/slskd/Files/Types/FilesystemFile.cs @@ -20,15 +20,46 @@ namespace slskd.Files using System; using System.IO; + /// + /// A file on the host filesystem. + /// public record FilesystemFile { + /// + /// The name of the file. + /// public string Name { get; init; } + + /// + /// The fully qualified name of the file. + /// public string FullName { get; init; } + + /// + /// The size of the file, in bytes. + /// public long Length { get; init; } + + /// + /// The file's attributes. + /// public FileAttributes Attributes { get; init; } + + /// + /// The timestamp at which the file was created. + /// public DateTime CreatedAt { get; init; } + + /// + /// The timestamp at which the file was last modified. + /// public DateTime ModifiedAt { get; init; } + /// + /// Maps a from the specified . + /// + /// The FileInfo instance from which to map. + /// A new instance of FilesystemFile. public static FilesystemFile FromFileInfo(FileInfo i) { return new FilesystemFile -- cgit v1.2.3