Changeset 1276
- Timestamp:
- 09/09/23 15:20:04 (14 months ago)
- Location:
- cpp/common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/util-string.cpp
r1130 r1276 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-202 1Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2023 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 108 108 } 109 109 110 bool ends_with(std::string_view str, std::string_view suffix) 111 { 112 return str.size() >= suffix.size() && 0 == str.compare(str.size() - suffix.size(), suffix.size(), suffix); 113 } 114 115 110 116 char* strmove(char *a, char *b) //strcpy that works well for overlapping strings ("Source and destination overlap") 111 117 { -
cpp/common/util-string.h
r1125 r1276 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-202 1Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2023 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 14 14 bool str_starts_with(const char *str, const char *prefix); 15 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++20 16 bool ends_with(std::string_view str, std::string_view suffix); 16 17 17 18 string ssprintf(const char* format, ...);
Note: See TracChangeset
for help on using the changeset viewer.