Skip to content

Introduce IPath<T> interface for easier code reuse #3776

@devlead

Description

@devlead

Currently, DirectoryPath and FilePath shares several properties and methods typed so can't be in the base class, an IPath<T> interface with type parameter would make it easier to write shared logic between files and directories

Methods / Properties that can be shared:

  • string FullPath { get; }
  • bool IsRelative { get; }
  • bool IsUNC { get; }
  • char Separator { get; }
  • string[] Segments { get; }
  • string ToString();
  • T MakeAbsolute(ICakeEnvironment environment);
  • T MakeAbsolute(DirectoryPath path);
  • T Collapse();
  • public T GetRelativePath(T to);

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions