Changeset 1288 for cpp/common/util-string.h
- Timestamp:
- 12/06/23 03:32:58 (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/util-string.h
r1276 r1288 13 13 char* strmove(char *a, char *b); //strcpy that works well for overlapping strings ("Source and destination overlap") 14 14 bool str_starts_with(const char *str, const char *prefix); 15 inline bool starts_with(const string& str, const char *prefix) { return str_starts_with(str.c_str(), prefix); } //std::string.starts_with(...) since c++2015 inline bool starts_with(const string& str, const char *prefix) { return str_starts_with(str.c_str(), prefix); } //std::string.starts_with(...) since c++20 16 16 bool ends_with(std::string_view str, std::string_view suffix); 17 bool strip_prefix(string& modify_me, const char* prefix); //@return true if the prefix is found and removed 17 18 18 19 string ssprintf(const char* format, ...); … … 23 24 string getFileDir(const string& filename); // get path component excluding filename ("" if no dir in file) 24 25 string stripFileDir(const string& filename); // strip path component from filename 26 string concatPath(const string& path, const string& other_path); // concatenate paths, adding PATH_SEPARATOR_CHAR if necessary 25 27 26 28 void ltrim_inplace(string &s);
Note: See TracChangeset
for help on using the changeset viewer.