Skip to content

Commit

Permalink
#27: Added CodeFile.ChangeExtension() method
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinCelej committed Jan 13, 2024
1 parent 7a1ce05 commit f6fba6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
- ctor(
filePath: string
)
- ChangeExtension(
extension: string
) : CodeFile
- CodeFile.Current(
path: string [CallerFilePath, Optional]
) : CodeFile
Expand Down
4 changes: 2 additions & 2 deletions Documentation/Synergy.Documentation/Code/CodeFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit f6fba6a

Please sign in to comment.