Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Compatibility
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 56863976c623
Choose a base ref
...
head repository: mockingbirdnest/Compatibility
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7546ba231d84
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on May 3, 2020

  1. Copy the full SHA
    7546ba2 View commit details
Showing with 16 additions and 0 deletions.
  1. +16 −0 filesystem/filesystem
16 changes: 16 additions & 0 deletions filesystem/filesystem
Original file line number Diff line number Diff line change
@@ -50,6 +50,22 @@ class path {
return *this;
}

path stem() const {
auto const pos1 = native_.find_last_of('/');
auto const pos2 = native_.find_last_of('.');
return path(native_.substr(pos1 + 1, pos2 - pos1 - 1));
}

path extension() const {
auto const pos = native_.find_last_of('.');
return path(native_.substr(pos + 1));
}

path parent_path() const {
auto const pos = native_.find_last_of('/');
return path(native_.substr(0, pos));
}

private:
std::string native_;
};