fs/Traits: add function Relative()
Move code from Path::RelativeFS() and make it generic.
This commit is contained in:
@@ -105,6 +105,15 @@ struct PathTraitsFS {
|
||||
gcc_pure gcc_nonnull_all
|
||||
static string GetParent(const_pointer p);
|
||||
|
||||
/**
|
||||
* Determine the relative part of the given path to this
|
||||
* object, not including the directory separator. Returns an
|
||||
* empty string if the given path equals this object or
|
||||
* nullptr on mismatch.
|
||||
*/
|
||||
gcc_pure gcc_nonnull_all
|
||||
static const_pointer Relative(const_pointer base, const_pointer other);
|
||||
|
||||
/**
|
||||
* Constructs the path from the given components.
|
||||
* If either of the components is empty string,
|
||||
@@ -179,6 +188,15 @@ struct PathTraitsUTF8 {
|
||||
gcc_pure gcc_nonnull_all
|
||||
static string GetParent(const_pointer p);
|
||||
|
||||
/**
|
||||
* Determine the relative part of the given path to this
|
||||
* object, not including the directory separator. Returns an
|
||||
* empty string if the given path equals this object or
|
||||
* nullptr on mismatch.
|
||||
*/
|
||||
gcc_pure gcc_nonnull_all
|
||||
static const_pointer Relative(const_pointer base, const_pointer other);
|
||||
|
||||
/**
|
||||
* Constructs the path from the given components.
|
||||
* If either of the components is empty string,
|
||||
|
Reference in New Issue
Block a user