Skip to content

Commit

Permalink
More code cleanup, merge interface implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
erikmav committed Feb 5, 2024
1 parent db1d894 commit dfa8e80
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 60 deletions.
11 changes: 7 additions & 4 deletions Service/DirectoryMetadata.cs → Lib/DirectoryMetadata.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using WinVfs.VirtualFilesystem;

namespace WinVfs.Service;
namespace WinVfs.VirtualFilesystem;

internal sealed class DirectoryMetadata : IDirectoryMetadata
/// <summary>
/// Default implementation of <see cref="IDirectoryMetadata"/> with an O(N) lookup in <see cref="GetEntryOrNull"/>
/// and a non-thread-safe writeable collection of entries.
/// </summary>
public sealed class DirectoryMetadata : IDirectoryMetadata
{
public DirectoryMetadata(string relativeBasePath, bool exists = true)
{
Expand All @@ -23,4 +26,4 @@ public DirectoryMetadata(string relativeBasePath, bool exists = true)
{
return WritableEntries.FirstOrDefault(e => e.Name.Equals(fileOrDirName, StringComparison.OrdinalIgnoreCase));
}
}
}
10 changes: 6 additions & 4 deletions Service/FileSystemEntry.cs → Lib/FileSystemEntry.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System;
using WinVfs.VirtualFilesystem;

namespace WinVfs.Service;
namespace WinVfs.VirtualFilesystem;

internal sealed class FileSystemEntry : IFileSystemEntry
/// <summary>
/// Default implementation of <see cref="IFileSystemEntry"/>
/// </summary>
public sealed class FileSystemEntry : IFileSystemEntry
{
public FileSystemEntry(string dirName)
{
Expand All @@ -23,4 +25,4 @@ public FileSystemEntry(string fileName, long fileSize, DateTime? lastUpdateTimeU
public long FileSize { get; }
public string Name { get; }
public DateTime? LastUpdateTimeUtc { get; }
}
}
26 changes: 0 additions & 26 deletions Tests/DirectoryMetadata.cs

This file was deleted.

26 changes: 0 additions & 26 deletions Tests/FileSystemEntry.cs

This file was deleted.

0 comments on commit dfa8e80

Please sign in to comment.