Mercurial > minori
comparison src/core/filesystem.cpp @ 76:3364fadc8a36
*: format source code
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Wed, 04 Oct 2023 01:46:33 -0400 |
parents | fe719c109dbc |
children |
comparison
equal
deleted
inserted
replaced
75:d3e9310598b1 | 76:3364fadc8a36 |
---|---|
66 #endif | 66 #endif |
67 } | 67 } |
68 | 68 |
69 std::string Path::Basename() const { | 69 std::string Path::Basename() const { |
70 unsigned long long pos = _path.find_last_of(DELIM); | 70 unsigned long long pos = _path.find_last_of(DELIM); |
71 return pos != std::string::npos ? _path.substr(pos+1, _path.length()) : ""; | 71 return pos != std::string::npos ? _path.substr(pos + 1, _path.length()) : ""; |
72 } | 72 } |
73 | 73 |
74 std::string Path::Stem() const { | 74 std::string Path::Stem() const { |
75 std::string basename = Basename(); | 75 std::string basename = Basename(); |
76 unsigned long long pos = basename.find_last_of("."); | 76 unsigned long long pos = basename.find_last_of("."); |
78 } | 78 } |
79 | 79 |
80 std::string Path::Extension() const { | 80 std::string Path::Extension() const { |
81 std::string basename = Basename(); | 81 std::string basename = Basename(); |
82 unsigned long long pos = basename.find_last_of("."); | 82 unsigned long long pos = basename.find_last_of("."); |
83 return pos != std::string::npos ? basename.substr(pos+1, basename.length()) : ""; | 83 return pos != std::string::npos ? basename.substr(pos + 1, basename.length()) : ""; |
84 } | 84 } |
85 | 85 |
86 Path Path::GetParent() const { | 86 Path Path::GetParent() const { |
87 return _path.substr(0, _path.find_last_of(DELIM)); | 87 return _path.substr(0, _path.find_last_of(DELIM)); |
88 } | 88 } |