| 8 | namespace tt::string { |
| 9 | |
| 10 | bool getPathParent(const std::string& path, std::string& output) { |
| 11 | auto index = path.find_last_of('/'); |
| 12 | if (index == std::string::npos) { |
| 13 | return false; |
| 14 | } else if (index == 0) { |
| 15 | output = "/"; |
| 16 | return true; |
| 17 | } else { |
| 18 | output = path.substr(0, index); |
| 19 | return true; |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | std::string getLastPathSegment(const std::string& path) { |
| 24 | auto index = path.find_last_of('/'); |
no outgoing calls
no test coverage detected