Esempio n. 1
0
 static public IFileStoreWriter WithMappedPath(
     this IFileStoreWriter originalFileStore, System.Func <IImmutableList <string>, IImmutableList <string> > pathMap) =>
 new DelegatingFileStoreWriter
 {
     SetFileContentDelegate    = pathAndFileContent => originalFileStore.SetFileContent(pathMap(pathAndFileContent.path), pathAndFileContent.fileContent),
     AppendFileContentDelegate = pathAndFileContent => originalFileStore.AppendFileContent(pathMap(pathAndFileContent.path), pathAndFileContent.fileContent),
     DeleteFileDelegate        = originalPath => originalFileStore.DeleteFile(pathMap(originalPath)),
 };
Esempio n. 2
0
 static public IFileStoreWriter ForSubdirectory(
     this IFileStoreWriter originalFileStore, string directoryName) =>
 WithMappedPath(originalFileStore, originalPath => originalPath.Insert(0, directoryName));
Esempio n. 3
0
 static public IFileStoreWriter ForSubdirectory(this IFileStoreWriter originalFileStore, string directoryName) =>
 ForSubdirectory(originalFileStore, ImmutableList.Create(directoryName));
Esempio n. 4
0
 static public IFileStoreWriter ForSubdirectory(
     this IFileStoreWriter originalFileStore, IEnumerable <string> directoryPath) =>
 WithMappedPath(originalFileStore, originalPath => originalPath.InsertRange(0, directoryPath));
Esempio n. 5
0
 public FileStoreFromWriterAndReader(IFileStoreWriter writer, IFileStoreReader reader)
 {
     this.writer = writer;
     this.reader = reader;
 }