From f6fba6a6f4c9687ef496d1b74a2b40758ec33c1c Mon Sep 17 00:00:00 2001 From: Marcin Celej Date: Sat, 13 Jan 2024 22:35:34 +0100 Subject: [PATCH] #27: Added CodeFile.ChangeExtension() method --- .../Public/Api.of.Synergy.Documentation.verified.md | 3 +++ Documentation/Synergy.Documentation/Code/CodeFile.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Documentation/Synergy.Documentation.Tests/Architecture/Public/Api.of.Synergy.Documentation.verified.md b/Documentation/Synergy.Documentation.Tests/Architecture/Public/Api.of.Synergy.Documentation.verified.md index a708398..f904ca6 100644 --- a/Documentation/Synergy.Documentation.Tests/Architecture/Public/Api.of.Synergy.Documentation.verified.md +++ b/Documentation/Synergy.Documentation.Tests/Architecture/Public/Api.of.Synergy.Documentation.verified.md @@ -62,6 +62,9 @@ - ctor( filePath: string ) + - ChangeExtension( + extension: string + ) : CodeFile - CodeFile.Current( path: string [CallerFilePath, Optional] ) : CodeFile diff --git a/Documentation/Synergy.Documentation/Code/CodeFile.cs b/Documentation/Synergy.Documentation/Code/CodeFile.cs index c064dfd..2037095 100644 --- a/Documentation/Synergy.Documentation/Code/CodeFile.cs +++ b/Documentation/Synergy.Documentation/Code/CodeFile.cs @@ -36,8 +36,8 @@ public CodeFolder Folder public override string ToString() => FilePath; - // public CodeFile RelativeTo(CodeFile file) - // => new(Path.GetRelativePath(file.FilePath, FilePath)); + public CodeFile ChangeExtension(string extension) + => new (Path.ChangeExtension(FilePath, extension)); public CodeFile RelativeTo(CodeFolder folder) => new(Path.GetRelativePath(folder.Path, FilePath));