| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261 |
- using System;
- using System.Diagnostics.CodeAnalysis;
- using System.IO;
- using System.IO.Abstractions;
- namespace Quadarax.Foundation.Core.IO.FileSystem.Memory
- {
- public class MemoryPath : IPath
- {
- private readonly MemoryFileSystem _fileSystem;
- private readonly string _tempPath;
- public char DirectorySeparatorChar => Path.DirectorySeparatorChar;
- public char AltDirectorySeparatorChar => Path.AltDirectorySeparatorChar;
- public char PathSeparator => throw new NotImplementedException();
- public char VolumeSeparatorChar => throw new NotImplementedException();
- public IFileSystem FileSystem => _fileSystem;
- public MemoryPath(MemoryFileSystem fileSystem)
- {
- _fileSystem = fileSystem;
- _tempPath = System.IO.Path.GetTempPath(); // Use the real system's temp path
- }
- [return: NotNullIfNotNull("path")]
- public string? ChangeExtension(string? path, string? extension)
- {
- throw new NotImplementedException();
- }
- public string Combine(string path1, string path2)
- {
- return Path.Combine(path1, path2);
- }
- public string Combine(string path1, string path2, string path3)
- {
- throw new NotImplementedException();
- }
- public string Combine(string path1, string path2, string path3, string path4)
- {
- throw new NotImplementedException();
- }
- public string Combine(params string[] paths)
- {
- throw new NotImplementedException();
- }
- public bool EndsInDirectorySeparator(ReadOnlySpan<char> path)
- {
- throw new NotImplementedException();
- }
- public bool EndsInDirectorySeparator(string path)
- {
- throw new NotImplementedException();
- }
- public bool Exists([NotNullWhen(true)] string? path)
- {
- throw new NotImplementedException();
- }
- public string? GetDirectoryName(string? path)
- {
- return Path.GetDirectoryName(path);
- }
- public ReadOnlySpan<char> GetDirectoryName(ReadOnlySpan<char> path)
- {
- throw new NotImplementedException();
- }
- public ReadOnlySpan<char> GetExtension(ReadOnlySpan<char> path)
- {
- throw new NotImplementedException();
- }
- [return: NotNullIfNotNull("path")]
- public string? GetExtension(string? path)
- {
- throw new NotImplementedException();
- }
- public string? GetFileName(string? path)
- {
- return Path.GetFileName(path);
- }
- public ReadOnlySpan<char> GetFileName(ReadOnlySpan<char> path)
- {
- throw new NotImplementedException();
- }
- public ReadOnlySpan<char> GetFileNameWithoutExtension(ReadOnlySpan<char> path)
- {
- throw new NotImplementedException();
- }
- [return: NotNullIfNotNull("path")]
- public string? GetFileNameWithoutExtension(string? path)
- {
- throw new NotImplementedException();
- }
- public string GetFullPath(string path)
- {
- throw new NotImplementedException();
- }
- public string GetFullPath(string path, string basePath)
- {
- throw new NotImplementedException();
- }
- public char[] GetInvalidFileNameChars()
- {
- throw new NotImplementedException();
- }
- public char[] GetInvalidPathChars()
- {
- throw new NotImplementedException();
- }
- public ReadOnlySpan<char> GetPathRoot(ReadOnlySpan<char> path)
- {
- throw new NotImplementedException();
- }
- public string? GetPathRoot(string? path)
- {
- throw new NotImplementedException();
- }
- public string GetRandomFileName()
- {
- throw new NotImplementedException();
- }
- public string GetRelativePath(string relativeTo, string path)
- {
- throw new NotImplementedException();
- }
- public string GetTempFileName()
- {
- throw new NotImplementedException();
- }
- public string GetTempPath()
- {
- return _tempPath;
- }
- public bool HasExtension(ReadOnlySpan<char> path)
- {
- throw new NotImplementedException();
- }
- public bool HasExtension([NotNullWhen(true)] string? path)
- {
- throw new NotImplementedException();
- }
- public bool IsPathFullyQualified(ReadOnlySpan<char> path)
- {
- throw new NotImplementedException();
- }
- public bool IsPathFullyQualified(string path)
- {
- throw new NotImplementedException();
- }
- public bool IsPathRooted(ReadOnlySpan<char> path)
- {
- throw new NotImplementedException();
- }
- public bool IsPathRooted([NotNullWhen(true)] string? path)
- {
- throw new NotImplementedException();
- }
- public string Join(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2)
- {
- throw new NotImplementedException();
- }
- public string Join(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2, ReadOnlySpan<char> path3)
- {
- throw new NotImplementedException();
- }
- public string Join(string? path1, string? path2)
- {
- throw new NotImplementedException();
- }
- public string Join(string? path1, string? path2, string? path3)
- {
- throw new NotImplementedException();
- }
- public string Join(params string?[] paths)
- {
- throw new NotImplementedException();
- }
- public string Join(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2, ReadOnlySpan<char> path3, ReadOnlySpan<char> path4)
- {
- throw new NotImplementedException();
- }
- public string Join(string? path1, string? path2, string? path3, string? path4)
- {
- throw new NotImplementedException();
- }
- public ReadOnlySpan<char> TrimEndingDirectorySeparator(ReadOnlySpan<char> path)
- {
- throw new NotImplementedException();
- }
- public string TrimEndingDirectorySeparator(string path)
- {
- throw new NotImplementedException();
- }
- public bool TryJoin(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2, Span<char> destination, out int charsWritten)
- {
- throw new NotImplementedException();
- }
- public bool TryJoin(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2, ReadOnlySpan<char> path3, Span<char> destination, out int charsWritten)
- {
- throw new NotImplementedException();
- }
- public string Combine(params ReadOnlySpan<string> paths)
- {
- return Path.Combine(paths);
- }
- public string Join(params ReadOnlySpan<string?> paths)
- {
- return Join(paths);
- }
- // Implement other methods as needed
- }
- }
|