mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-13 17:05:37 -04:00
Remove expensive path.string() calls, UI changes
This commit is contained in:
parent
06643df6a5
commit
bf4ed416bd
8 changed files with 254 additions and 147 deletions
|
@ -250,6 +250,16 @@ std::string filesystem_error::what() const {
|
|||
}
|
||||
}
|
||||
|
||||
path path::parent_path() const {
|
||||
const auto t = filename().native();
|
||||
const auto index = t.find_last_of(preferred_separator);
|
||||
if( index == t.npos ) {
|
||||
return *this;
|
||||
} else {
|
||||
return t.substr(0, index);
|
||||
}
|
||||
}
|
||||
|
||||
path path::extension() const {
|
||||
const auto t = filename().native();
|
||||
const auto index = t.find_last_of(u'.');
|
||||
|
@ -296,6 +306,10 @@ path& path::replace_extension(const path& replacement) {
|
|||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const path& lhs, const path& rhs) {
|
||||
return lhs.native() == rhs.native();
|
||||
}
|
||||
|
||||
bool operator<(const path& lhs, const path& rhs) {
|
||||
return lhs.native() < rhs.native();
|
||||
}
|
||||
|
@ -304,6 +318,12 @@ bool operator>(const path& lhs, const path& rhs) {
|
|||
return lhs.native() > rhs.native();
|
||||
}
|
||||
|
||||
path operator/(const path& lhs, const path& rhs) {
|
||||
path result = lhs;
|
||||
result /= rhs;
|
||||
return result;
|
||||
}
|
||||
|
||||
directory_iterator::directory_iterator(
|
||||
std::filesystem::path path,
|
||||
std::filesystem::path wild
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue