diff options
author | crupest <crupest@outlook.com> | 2022-03-09 23:12:26 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-03-09 23:12:26 +0800 |
commit | dceef749139061fdac4946df77219f1cc8aa6483 (patch) | |
tree | 0b413e605183226034fdaf342adfd6dc5e8fc08e /include/cru/common/String.h | |
parent | 78f5221e8fbab510bb8b5ac268b7d42bed762961 (diff) | |
download | cru-dceef749139061fdac4946df77219f1cc8aa6483.tar.gz cru-dceef749139061fdac4946df77219f1cc8aa6483.tar.bz2 cru-dceef749139061fdac4946df77219f1cc8aa6483.zip |
...
Diffstat (limited to 'include/cru/common/String.h')
-rw-r--r-- | include/cru/common/String.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/include/cru/common/String.h b/include/cru/common/String.h index 60d0912e..9ec494c6 100644 --- a/include/cru/common/String.h +++ b/include/cru/common/String.h @@ -2,6 +2,7 @@ #include "Base.h" #include "Range.h" +#include "StringToNumberConverter.h" #include "StringUtil.h" #include <double-conversion/double-conversion.h> @@ -13,13 +14,6 @@ #include <vector> namespace cru { -struct StringToFloatFlags { - constexpr static int kNoFlags = 0; - constexpr static int kAllowLeadingSpaces = 1 << 0; - constexpr static int kAllowTrailingSpaces = 1 << 1; - constexpr static int kAllowTrailingJunk = 1 << 2; -}; - class StringView; class CRU_BASE_API String { @@ -219,9 +213,9 @@ class CRU_BASE_API String { Range RangeFromCodePointToCodeUnit(Range code_point_range) const; float ParseToFloat(Index* processed_characters_count = nullptr, - int flags = StringToFloatFlags::kNoFlags) const; + unsigned flags = StringToNumberFlags::kNoFlags) const; double ParseToDouble(Index* processed_characters_count = nullptr, - int flags = StringToFloatFlags::kNoFlags) const; + unsigned flags = StringToNumberFlags::kNoFlags) const; std::vector<float> ParseToFloatList(value_type separator = u' ') const; std::vector<double> ParseToDoubleList(value_type separator = u' ') const; @@ -346,9 +340,9 @@ class CRU_BASE_API StringView { Range RangeFromCodePointToCodeUnit(Range code_point_range) const; float ParseToFloat(Index* processed_characters_count = nullptr, - int flags = StringToFloatFlags::kNoFlags) const; + unsigned flags = StringToNumberFlags::kNoFlags) const; double ParseToDouble(Index* processed_characters_count = nullptr, - int flags = StringToFloatFlags::kNoFlags) const; + unsigned flags = StringToNumberFlags::kNoFlags) const; std::vector<float> ParseToFloatList(value_type separator = u' ') const; std::vector<double> ParseToDoubleList(value_type separator = u' ') const; |