diff options
| author | crupest <crupest@outlook.com> | 2022-01-02 18:49:31 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2022-01-02 18:49:31 +0800 |
| commit | 18099ad8f5c24b1c2b1c92238dbc54912eab0406 (patch) | |
| tree | 514207d630a2100262aedaea276ea259bbc108b7 /include/cru/common | |
| parent | 96a93e17baaff2c2050eba2afada639e93001232 (diff) | |
| download | cru-18099ad8f5c24b1c2b1c92238dbc54912eab0406.tar.gz cru-18099ad8f5c24b1c2b1c92238dbc54912eab0406.tar.bz2 cru-18099ad8f5c24b1c2b1c92238dbc54912eab0406.zip | |
...
Diffstat (limited to 'include/cru/common')
| -rw-r--r-- | include/cru/common/String.hpp | 7 | ||||
| -rw-r--r-- | include/cru/common/StringUtil.hpp | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/cru/common/String.hpp b/include/cru/common/String.hpp index ade2d84b..bd079243 100644 --- a/include/cru/common/String.hpp +++ b/include/cru/common/String.hpp @@ -165,6 +165,10 @@ class CRU_BASE_API String { } inline void append(StringView str); + String substr(size_type start, size_type size) const { + return String(this->buffer_ + start, size); + } + public: String& operator+=(value_type value) { this->append(value); @@ -177,6 +181,9 @@ class CRU_BASE_API String { } public: + String& TrimEnd(); + + public: void AppendCodePoint(CodePoint code_point); Utf16CodePointIterator CodePointIterator() const { diff --git a/include/cru/common/StringUtil.hpp b/include/cru/common/StringUtil.hpp index 6c6b47b8..a35da695 100644 --- a/include/cru/common/StringUtil.hpp +++ b/include/cru/common/StringUtil.hpp @@ -221,4 +221,6 @@ Index CRU_BASE_API Utf16NextWord(const char16_t* ptr, Index size, char16_t CRU_BASE_API ToLower(char16_t c); char16_t CRU_BASE_API ToUpper(char16_t c); + +char16_t CRU_BASE_API IsWhitespace(char16_t c); } // namespace cru |
