Skip to content

Commit

Permalink
Added Prefix to files. Prefix is a name without extension
Browse files Browse the repository at this point in the history
  • Loading branch information
EGSP committed Dec 27, 2022
1 parent fbba8a0 commit 972e7cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Automata/IO/FileExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ namespace Automata.IO;

public static partial class FileExtensions
{
public static string Prefix(this IFile file)
{
return IOShared.FileSystem.Path.GetFileNameWithoutExtension(file.Name);
}

public static void Create(this IFile file)
{
if (!file.Directory.Exist())
Expand Down
5 changes: 5 additions & 0 deletions Automata/IO/Relatives/RelativeFileExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ namespace Automata.IO;

public static class RelativeFileExtensions
{
public static string Prefix(this IRelativeFile file)
{
return IOShared.FileSystem.Path.GetFileNameWithoutExtension(file.Name);
}

public static IRelativeFile RelativeFile(this IFile file, IDirectory excludeDirectoryPath)
{
return RelativeIO.RelativeFile(excludeDirectoryPath.Path, file.Path);
Expand Down

0 comments on commit 972e7cb

Please sign in to comment.