diff options
author | crupest <crupest@outlook.com> | 2022-01-19 22:55:22 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-01-19 22:55:22 +0800 |
commit | 2028bc4914638360fb756079dbddbdbe52676821 (patch) | |
tree | bcbcf8d2d7eead39689324a06767e83faef72dfe /include/cru/common/String.hpp | |
parent | a42609c6cc6d89501d0421f371e4a2dc10dd1685 (diff) | |
download | cru-2028bc4914638360fb756079dbddbdbe52676821.tar.gz cru-2028bc4914638360fb756079dbddbdbe52676821.tar.bz2 cru-2028bc4914638360fb756079dbddbdbe52676821.zip |
...
Diffstat (limited to 'include/cru/common/String.hpp')
-rw-r--r-- | include/cru/common/String.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/cru/common/String.hpp b/include/cru/common/String.hpp index 8db012cb..e7688555 100644 --- a/include/cru/common/String.hpp +++ b/include/cru/common/String.hpp @@ -4,6 +4,7 @@ #include "Range.hpp" #include "StringUtil.hpp" +#include <double-conversion/double-conversion.h> #include <algorithm> #include <array> #include <charconv> @@ -23,6 +24,9 @@ class StringView; class CRU_BASE_API String { public: + static double_conversion::StringToDoubleConverter + kDefaultStringToDoubleConverter; + using value_type = char16_t; using size_type = Index; using difference_type = Index; @@ -195,6 +199,8 @@ class CRU_BASE_API String { String& TrimEnd(); String& Trim(); + std::vector<String> Split(value_type separator, + bool remove_space_line = false) const; std::vector<String> SplitToLines(bool remove_space_line = false) const; bool StartWith(StringView str) const; @@ -225,6 +231,9 @@ class CRU_BASE_API String { int Compare(const String& other) const; + float ParseToFloat(Index* processed_characters_count = nullptr) const; + double ParseToDouble(Index* processed_characters_count = nullptr) const; + private: static char16_t kEmptyBuffer[1]; |