libzed 1.9.9
A general-purpose library for quick and simple data manipulation.
 
Loading...
Searching...
No Matches
string.hpp
1#pragma once
2
3#include <complex>
4#include <cstring>
5#include <functional>
6#include <initializer_list>
7#include <type_traits>
8#include <utility>
9
10#include <istream>
11#include <ostream>
12
13#include "../encoding.hpp"
14#include "charFunctions.hpp"
15#include "hash32.hpp"
16#include "zstr.hpp"
17
18#include "arrayLike.hpp"
19#include "sizable.hpp"
20
21#include "stringIterator.hpp"
22
23#ifdef __has_include
24#if __has_include(<cereal/cereal.hpp>)
25#include <cereal/types/string.hpp>
26#endif
27#endif
28
29namespace z {
30namespace core {
61template <encoding E = utf8>
62class string : public sizable, public arrayLike<uint32_t, stringIterator<E>> {
63 friend string<ascii>;
64 friend string<utf8>;
65 friend string<utf16>;
66 friend string<utf32>;
67
68private:
69 uint8_t *data;
70 int data_len;
71 int character_ct;
72
73 void initChar(uint32_t, int) noexcept;
74 int charSize() const noexcept;
75
76 void initInt(long long, int, int) noexcept;
77 void initFloat(double, int, int, bool, int) noexcept;
78 void initPointer(void *) noexcept;
79 void initComplex(const std::complex<double> &, int, int, bool, int) noexcept;
80
81public:
84
92 explicit string(char chr) noexcept;
93
101 explicit string(wchar_t chr) noexcept;
102
112 string(const uint32_t &chr) noexcept;
113
121 string(const char *str) noexcept;
122
131 string(const char *str, size_t len) noexcept;
132
141 string(const wchar_t *str) noexcept;
142
151 string(const wchar_t *str, size_t len) noexcept;
152
160 string(const std::string &str) noexcept : string(str.c_str(), str.size()) {}
161
176 template <typename INT, typename = typename std::enable_if<std::is_integral<INT>::value && !std::is_same<INT, char>::value && !std::is_same<INT, wchar_t>::value, INT>::type>
177 string(INT value, int base = 10, int padSize = 0) noexcept {
178 this->initInt((long long)value, base, padSize);
179 }
180
191 template <typename PTR, typename = typename std::enable_if<std::is_pointer<PTR>::value && !std::is_same<PTR, char *>::value && !std::is_same<PTR, wchar_t *>::value, PTR>::type>
192 string(PTR pointer) noexcept {
193 this->initPointer((void *)pointer);
194 }
195
216 string(FLT value, int base = 10, int precision = 0, bool scientific = true, int padSize = 0) noexcept {
217 this->initFloat((double)value, base, precision, scientific, padSize);
218 }
219
238 string(const std::complex<T> &value, int base = 10, int precision = 0, bool scientific = true, int padSize = 0) noexcept {
239 this->initComplex((std::complex<double>)value, base, precision, scientific, padSize);
240 }
241
250 string(const string<ascii> &other) noexcept;
251
260 string(const string<utf8> &other) noexcept;
261
270 string(const string<utf16> &other) noexcept;
271
280 string(const string<utf32> &other) noexcept;
281
289 string(string &&other) noexcept {
290 data = other.data;
291 data_len = other.data_len;
292 character_ct = other.character_ct;
293 other.data = NULL;
294 }
295
304 string &operator=(string &&other) noexcept {
305 if (&other != this) {
306 delete[] data;
307 data = other.data;
308 data_len = other.data_len;
309 character_ct = other.character_ct;
310 other.data = NULL;
311 }
312
313 return *this;
314 }
315
318 if (data) {
319 delete[] data;
320 }
321 }
322
332 void increase(int charCount) noexcept;
333
349 uint32_t at(int index) const noexcept override;
350
357
369
381
389
397
405
414 return E;
415 }
416
431 long integer(int base = 10, uint32_t decimal = '.') const noexcept;
432
437 template <typename INT, typename = typename std::enable_if<std::is_integral<INT>::value, INT>::type>
439 return integer();
440 }
441
453 double floating(int base = 10, uint32_t decimal = '.') const noexcept;
454
460 return floating();
461 }
462
467 explicit operator float() const noexcept {
468 return floating();
469 }
470
475 constexpr explicit operator bool() const noexcept {
476 return length() > 0;
477 }
478
490 std::complex<double> complex(int base = 10, uint32_t decimal = '.') const noexcept;
491
501
515 int find(const string &other, int occurrence = 1) const noexcept {
516 return this->findAfter(other, 0, occurrence);
517 }
518
531 int found(const string &other, int occurrence = 1) const noexcept {
532 return this->findAfter(other, 0, occurrence) >= 0;
533 }
534
548 int findLast(const string &other, int occurrence = 1) const noexcept {
549 return this->findBefore(other, this->character_ct, occurrence);
550 }
551
566 int findAfter(const string &other, int index, int occurrence = 1) const noexcept {
568 for (int i = index; i < character_ct; i++) {
569 if (foundAt(other, i)) {
570 return i;
571 }
572 }
573
574 return -1;
575 }
576
591 int findBefore(const string &other, int index, int occurrence = 1) const noexcept;
592
602 bool foundAt(const string &other, int index) const noexcept;
603
613 bool foundEndAt(const string &other, int index) const noexcept;
614
624 return this->foundAt(other, 0);
625 }
626
635 bool endsWith(const string &other) const noexcept {
636 return this->foundEndAt(other, character_ct - 1);
637 }
638
652 bool isInteger(int base = 10) const noexcept {
653 return type(base) & (zstr::integer);
654 }
655
673 return type(base, decimal) & (zstr::integer | zstr::floating);
674 }
675
692 bool isComplex(int base = 10, uint32_t decimal = '.') const noexcept {
693 return type(base, decimal) & (zstr::integer | zstr::floating | zstr::complex);
694 }
695
709 int type(int base = 10, uint32_t decimal = '.') const noexcept;
710
724 string substr(int index, int count) const noexcept;
725
735 string &append(const string &other) noexcept {
736 return operator+=(other);
737 }
738
751 string &append(uint32_t chr) noexcept;
752
765 string &insert(const string &other, int index) noexcept;
766
780 string &remove(const string &other, int occurrence = 0) noexcept;
781
793 string &remove(int index, int count) noexcept;
794
806 string &truncate(int index) noexcept;
807
822 string &replace(const string &findStr, const string &replStr, int occurrence = 0) noexcept;
823
836 string &replace(int index, int count, const string &other) noexcept;
837
851 string padLeft(const string &other, int padSize) const noexcept {
852 string newString = *this;
853 return newString.padLeftIn(other, padSize);
854 }
855
869 string &padLeftIn(const string &other, int padSize) noexcept;
870
884 string padRight(const string &other, int padSize) const noexcept {
885 string newString = *this;
886 return newString.padRightIn(other, padSize);
887 }
888
902 string &padRightIn(const string &other, int padSize) noexcept;
903
911 string repeat(int count) const noexcept {
912 string value;
913 value.increase(character_ct * count);
914 for (int i = 0; i < count; ++i) {
915 value.append(*this);
916 }
917 return value;
918 }
919
930 string trimLeft(const string &other = "") const noexcept {
931 if ((character_ct < other.character_ct) || !character_ct) {
932 return *this;
933 }
934
935 int index = 0;
936 if (other.length()) {
937 while (foundAt(other, index)) {
938 index += other.character_ct;
939 }
940 } else {
941 while (isWhiteSpace(at(index))) {
942 ++index;
943 }
944 }
945
946 return substr(index, character_ct - index);
947 }
948
959 string trimRight(const string &other = "") const noexcept {
960 if ((character_ct < other.character_ct) || !character_ct) {
961 return *this;
962 }
963
964 int index = character_ct - 1;
965 if (other.length()) {
966 while (foundEndAt(other, index)) {
967 index -= other.character_ct;
968 }
969 } else {
970 while (isWhiteSpace(at(index))) {
971 --index;
972 }
973 }
974
975 return substr(0, index + 1);
976 }
977
988 string &trimLeftIn(const string &other = "") noexcept {
989 if ((character_ct < other.character_ct) || !character_ct) {
990 return *this;
991 }
992
993 int index = 0;
994 if (other.length()) {
995 while (foundAt(other, index)) {
996 index += other.character_ct;
997 }
998 } else {
999 while (isWhiteSpace(this->at(index))) {
1000 ++index;
1001 }
1002 }
1003
1004 return remove(0, index);
1005 }
1006
1017 string &trimRightIn(const string &other = "") noexcept {
1018 if ((character_ct < other.character_ct) || !character_ct) {
1019 return *this;
1020 }
1021
1022 int index = character_ct - 1;
1023 if (other.length()) {
1024 while (foundEndAt(other, index)) {
1025 index -= other.character_ct;
1026 }
1027 } else {
1028 while (isWhiteSpace(at(index))) {
1029 --index;
1030 }
1031 }
1032
1033 return remove(index + 1, character_ct);
1034 }
1035
1046 string trim(const string &other = "") const noexcept {
1047 auto result = trimLeft(other);
1048 return result.trimRightIn(other);
1049 }
1050
1061 string &trimIn(const string &other = "") noexcept {
1063 return trimRightIn(other);
1064 }
1065
1070
1082
1091 return string(*this).toUpper();
1092 }
1093
1102 return string(*this).toLower();
1103 }
1104
1113 return string(*this).toCamel();
1114 }
1115
1124
1133
1142
1156 return filter({first, last}, invert);
1157 }
1158
1170 string filter(const std::pair<uint32_t, uint32_t> &range, bool invert = false) const noexcept {
1171 return filter({range}, invert);
1172 }
1173
1185 string filter(const std::initializer_list<const std::pair<uint32_t, uint32_t>> &list, bool invert = false) const noexcept;
1186
1197 string filter(const string &list, bool invert = false) const noexcept;
1198
1209 string filter(std::function<bool(uint32_t)> lambda) const noexcept;
1210
1227
1240 bool contains(const std::pair<uint32_t, uint32_t> &range, bool exclusive = false) const noexcept {
1241 return contains({range}, exclusive);
1242 }
1243
1256 bool contains(const std::initializer_list<const std::pair<uint32_t, uint32_t>> &list, bool exclusive = false) const noexcept;
1257
1269 bool contains(const string &list, bool exclusive = false) const noexcept;
1270
1282 string cipher(const string &keys, const string &values) const noexcept;
1283
1295 string cipher(std::function<uint32_t(uint32_t)> lambda) const noexcept;
1296
1304 static string words(long long value, bool ordinal = false) noexcept;
1305
1314 static string ordinal(long long value) noexcept;
1315
1324 static inline string precision(double value, int precision, bool forcePrecision = false) noexcept {
1325 return string(value, 10, precision, false, forcePrecision ? precision : 0);
1326 }
1327
1338 static string numberFormat(double value, int precision = 0, bool forcePrecision = false, char decimal = '.', char thousands = ',') noexcept;
1339
1352 string concat(const string &other) const noexcept {
1353 return *this + other;
1354 }
1355
1366 string operator+(const string &other) const noexcept;
1367
1377 string &operator+=(const string &other) noexcept;
1378
1389 string &operator=(const string &other) noexcept;
1390
1398 bool operator==(const string &other) const noexcept;
1399
1407 bool operator!=(const string &other) const noexcept {
1408 return !operator==(other);
1409 }
1410
1418 bool operator>(const string &other) const noexcept;
1419
1427 bool operator>=(const string &other) const noexcept {
1428 return !operator<(other);
1429 }
1430
1438 bool operator<(const string &other) const noexcept;
1439
1447 bool operator<=(const string &other) const noexcept {
1448 return !operator>(other);
1449 }
1450
1464 string &read(std::istream &stream, uint32_t delim = 0) noexcept;
1465
1477 string &readln(std::istream &stream) noexcept;
1478
1489 string &readall(std::istream &stream) noexcept;
1490
1496 void write(std::ostream &stream) const noexcept {
1497 stream << *this << std::flush;
1498 }
1499
1507 void writeln(std::ostream &stream) const noexcept {
1508 stream << *this << std::endl;
1509 }
1510
1520 return stringIterator<E>(data, 0);
1521 }
1522
1532 return stringIterator<E>(data, character_ct);
1533 }
1534
1535#ifdef __has_include
1536#if __has_include(<cereal/cereal.hpp>)
1537
1543 template <class archive>
1544 std::string save_minimal(archive &ar) const {
1545 (void)ar;
1546 return string<utf8>(*this).cstring();
1547 }
1548
1554 template <class archive>
1555 void load_minimal(archive const &ar, std::string const &value) {
1556 (void)ar;
1557 operator=(value.c_str());
1558 }
1559#endif
1560#endif
1561
1568 friend std::ostream &operator<<(std::ostream &ostr, const z::core::string<E> &str) {
1569 return ostr << string<utf8>(str).cstring();
1570 }
1571
1578 friend std::istream &operator>>(std::istream &istr, z::core::string<E> &str) {
1579 std::string s;
1580 istr >> s;
1581
1582 if (s.length()) {
1583 str = s.c_str(); // not efficient to cast strings back & forth, but it works for now.
1584 }
1585 return istr;
1586 }
1587
1592 inline std::string str() const noexcept {
1593 return string<utf8>(*this).cstring();
1594 }
1595
1601};
1602} // namespace core
1603} // namespace z
1604
1605typedef z::core::string<> zstring;
1606typedef z::core::string<z::utf8> zpath;
1607
1608// Custom literals for simple string construction
1609z::core::string<z::utf32> operator"" _u32(char value);
1610z::core::string<z::utf32> operator"" _u32(wchar_t value);
1611z::core::string<z::utf32> operator"" _u32(const char *value);
1612z::core::string<z::utf32> operator"" _u32(const char *value, size_t);
1613z::core::string<z::utf32> operator"" _u32(const wchar_t * value, size_t);
1614
1615z::core::string<z::utf16> operator"" _u16(char value);
1616z::core::string<z::utf16> operator"" _u16(wchar_t value);
1617z::core::string<z::utf16> operator"" _u16(const char *value);
1618z::core::string<z::utf16> operator"" _u16(const char *value, size_t);
1619z::core::string<z::utf16> operator"" _u16(const wchar_t * value, size_t);
1620
1621z::core::string<z::utf8> operator"" _u8(char value);
1622z::core::string<z::utf8> operator"" _u8(wchar_t value);
1623z::core::string<z::utf8> operator"" _u8(const char *value);
1624z::core::string<z::utf8> operator"" _u8(const char *value, size_t);
1625z::core::string<z::utf8> operator"" _u8(const wchar_t * value, size_t);
1626
1627z::core::string<z::ascii> operator"" _asc(char value);
1628z::core::string<z::ascii> operator"" _asc(wchar_t value);
1629z::core::string<z::ascii> operator"" _asc(const char *value);
1630z::core::string<z::ascii> operator"" _asc(const char *value, size_t);
1631z::core::string<z::ascii> operator"" _asc(const wchar_t * value, size_t);
1632
1633zstring operator"" _zs(char value);
1634zstring operator"" _zs(wchar_t value);
1635zstring operator"" _zs(const char *value);
1636zstring operator"" _zs(const char *value, size_t);
1637zstring operator"" _zs(const wchar_t *value, size_t);
An interface for all objects that can be both iterated over and directly indexed.
Definition arrayLike.hpp:13
A wrapper for std::vector.
Definition array.hpp:72
int length() const noexcept override
Get the length of the array.
Definition array.hpp:1011
An interface for getting an object's size.
Definition sizable.hpp:13
A template class for character strings.
Definition string.hpp:62
bool isInteger(int base=10) const noexcept
Check if this string can convert to an integer.
Definition string.hpp:652
string(const std::complex< T > &value, int base=10, int precision=0, bool scientific=true, int padSize=0) noexcept
Construct from complex number.
Definition string.hpp:238
static string words(long long value, bool ordinal=false) noexcept
Generate an English representation of a given number.
string & trimRightIn(const string &other="") noexcept
Remove padding from the right side of this string.
Definition string.hpp:1017
string & toLower() noexcept
Convert all characters in the string to lowercase.
int count(const string &other) const noexcept
Count the occurrences of a sub-string.
string & cutDuplicates(const string &other) noexcept
Remove all sequential duplicates from this string.
int find(const string &other, int occurrence=1) const noexcept
Find a specific occurrence of a sub-string.
Definition string.hpp:515
string & padRightIn(const string &other, int padSize) noexcept
Right-pad this string up to a given character count.
size_t size() const noexcept override
Get the size of the string in memory.
bool operator!=(const string &other) const noexcept
Inequality comparison.
Definition string.hpp:1407
string padLeft(const string &other, int padSize) const noexcept
Copy this string, left-padded given character count.
Definition string.hpp:851
std::string str() const noexcept
Convert to a std::string.
Definition string.hpp:1592
string(INT value, int base=10, int padSize=0) noexcept
Construct from an integer.
Definition string.hpp:177
void load_minimal(archive const &ar, std::string const &value)
Serialization input.
Definition string.hpp:1555
bool operator>=(const string &other) const noexcept
Greater-than or equal comparison.
Definition string.hpp:1427
string operator+(const string &other) const noexcept
Concatenate two strings.
string(const string< ascii > &other) noexcept
Construct from an ASCII string.
string & toCamel() noexcept
Convert all characters in the string to camelcase.
bool foundEndAt(const string &other, int index) const noexcept
Check if a sub-string ends at the given index.
int length() const noexcept override
Get the character count of the string.
friend std::ostream & operator<<(std::ostream &ostr, const z::core::string< E > &str)
Stream output operator.
Definition string.hpp:1568
string trim(const string &other="") const noexcept
Copies this string and removes padding from both sides of the result.
Definition string.hpp:1046
static string numberFormat(double value, int precision=0, bool forcePrecision=false, char decimal='.', char thousands=',') noexcept
Create a string from a number with thousands separators.
string & replace(const string &findStr, const string &replStr, int occurrence=0) noexcept
Replace occurrences of the given sub-string.
string filter(const std::pair< uint32_t, uint32_t > &range, bool invert=false) const noexcept
Filter out all characters not in the given range.
Definition string.hpp:1170
string trimLeft(const string &other="") const noexcept
Copies this string and removes padding from the left side of the result.
Definition string.hpp:930
double floating(int base=10, uint32_t decimal='.') const noexcept
Convert this string to a floating-point value.
bool endsWith(const string &other) const noexcept
Check if the string ends with a given sub-string.
Definition string.hpp:635
string padRight(const string &other, int padSize) const noexcept
Copy this string, right-padded given character count.
Definition string.hpp:884
long integer(int base=10, uint32_t decimal='.') const noexcept
Convert this string to an integer.
string filter(uint32_t first, uint32_t last, bool invert=false) const noexcept
Filter out all characters not in the given range.
Definition string.hpp:1155
const uint16_t * nstring() const noexcept
Get the two-byte cstring pointer.
bool contains(const std::pair< uint32_t, uint32_t > &range, bool exclusive=false) const noexcept
Check if this string contains any characters in the given range.
Definition string.hpp:1240
uint32_t at(int index) const noexcept override
Get the character at the given index.
string & readln(std::istream &stream) noexcept
Read string data from a stream until a newline is encountered.
stringIterator< E > end() const noexcept override
Get an iterator for the end of the string.
Definition string.hpp:1531
string camel() const noexcept
Get a camelcase version of this string.
Definition string.hpp:1112
int findLast(const string &other, int occurrence=1) const noexcept
Reverse-find a specific occurrence of a sub-string.
Definition string.hpp:548
static string ordinal(long long value) noexcept
Get the ordinal suffix of a given integer.
bool operator>(const string &other) const noexcept
Greater-than comparison.
string(const string< utf32 > &other) noexcept
Construct from a UTF32 string.
const uint32_t * wstring() const noexcept
Get the four-byte cstring pointer.
string & operator=(const string &other) noexcept
Assign the contents of this string.
string lower() const noexcept
Get a lowercase version of this string.
Definition string.hpp:1101
string & append(const string &other) noexcept
Append another string to the end of this one.
Definition string.hpp:735
string & remove(const string &other, int occurrence=0) noexcept
Remove occurrences of the given sub-string.
const char * cstring() const noexcept
Get the single-byte cstring pointer.
friend std::istream & operator>>(std::istream &istr, z::core::string< E > &str)
Stream input operator.
Definition string.hpp:1578
~string() noexcept
Destructor.
Definition string.hpp:317
bool contains(uint32_t first, uint32_t last, bool exclusive=false) const noexcept
Check if this string contains any characters in the given range.
Definition string.hpp:1224
void write(std::ostream &stream) const noexcept
Write string data to a stream in that stream's encoding.
Definition string.hpp:1496
bool isComplex(int base=10, uint32_t decimal='.') const noexcept
Check if this string can convert to a complex value.
Definition string.hpp:692
string cipher(const string &keys, const string &values) const noexcept
Convert this string from one set of characters to another.
string() noexcept
Default string constructor.
string(const string< utf16 > &other) noexcept
Construct from a UTF16 string.
string & operator+=(const string &other) noexcept
Append another string to the end of this one.
string & trimIn(const string &other="") noexcept
Remove padding from the both sides of this string.
Definition string.hpp:1061
int type(int base=10, uint32_t decimal='.') const noexcept
Determine the most basic type that this string can cast to.
string(FLT value, int base=10, int precision=0, bool scientific=true, int padSize=0) noexcept
Construct from floating-point.
Definition string.hpp:216
std::string save_minimal(archive &ar) const
Serialization output.
Definition string.hpp:1544
string(const string< utf8 > &other) noexcept
Construct from a UTF-8 string.
string concat(const string &other) const noexcept
Concatenate two strings.
Definition string.hpp:1352
string & append(uint32_t chr) noexcept
Append a single character to the end of the string.
string & readall(std::istream &stream) noexcept
Read an entire stream's contents into this string.
int findAfter(const string &other, int index, int occurrence=1) const noexcept
Find a specific occurrence of a sub-string.
Definition string.hpp:566
stringIterator< E > begin() const noexcept override
Get an iterator for the beginning of the string.
Definition string.hpp:1519
string filter(const std::initializer_list< const std::pair< uint32_t, uint32_t > > &list, bool invert=false) const noexcept
Filter out all characters not in the given range.
string trimRight(const string &other="") const noexcept
Copies this string and removes padding from the right side of the result.
Definition string.hpp:959
int found(const string &other, int occurrence=1) const noexcept
Check if a specific occurrence of a sub-string exists.
Definition string.hpp:531
int findBefore(const string &other, int index, int occurrence=1) const noexcept
Reverse-find a specific occurrence of a sub-string.
string substr(int index, int count) const noexcept
Get a sub-string from this string.
std::complex< double > complex(int base=10, uint32_t decimal='.') const noexcept
Convert this string to a complex value.
bool operator<(const string &other) const noexcept
Less-than comparison.
string repeat(int count) const noexcept
Repeat this string a specific number of times.
Definition string.hpp:911
string & operator=(string &&other) noexcept
Move assignment operator.
Definition string.hpp:304
bool contains(const std::initializer_list< const std::pair< uint32_t, uint32_t > > &list, bool exclusive=false) const noexcept
Check if this string contains any characters in the given ranges.
void clear() noexcept
Reset to a null string.
string & toUpper() noexcept
Convert all characters in the string to uppercase.
string(PTR pointer) noexcept
Construct from a pointer.
Definition string.hpp:192
bool beginsWith(const string &other) const noexcept
Check if the string begins with a given sub-string.
Definition string.hpp:623
string upper() const noexcept
Get an uppercase version of this string.
Definition string.hpp:1090
void increase(int charCount) noexcept
Increase the space allocated for this string.
string & trimLeftIn(const string &other="") noexcept
Remove padding from the left side of this string.
Definition string.hpp:988
bool operator<=(const string &other) const noexcept
Less-than or equal comparison.
Definition string.hpp:1447
string & read(std::istream &stream, uint32_t delim=0) noexcept
Read string data from a stream until the given delimiter is encountered.
string & truncate(int index) noexcept
Remove all characters from a given index to the end of the string.
bool foundAt(const string &other, int index) const noexcept
Check if a sub-string is found at the given index.
int chars() const noexcept
Get the individual character count of the string.
static string precision(double value, int precision, bool forcePrecision=false) noexcept
Create a string from a number with a fixed number of decimal places.
Definition string.hpp:1324
string(string &&other) noexcept
Move constructor.
Definition string.hpp:289
bool operator==(const string &other) const noexcept
Equality comparison.
string & insert(const string &other, int index) noexcept
Insert another string into this one.
constexpr encoding format() const noexcept
Get the encoding of this string.
Definition string.hpp:413
void writeln(std::ostream &stream) const noexcept
Write string data to a stream in its format, appending a newline.
Definition string.hpp:1507
string & padLeftIn(const string &other, int padSize) noexcept
Left-pad this string up to a given character count.
hash32 hash() const noexcept
Compute the CRC32 hash of this string.
bool isFloating(int base=10, uint32_t decimal='.') const noexcept
Check if this string can convert to a floating-point value.
Definition string.hpp:672
encoding
Supported string encoding schemes.
Definition encoding.hpp:12
bool isWhiteSpace(uint32_t ch) noexcept
Check if the given character is white space.
generator< long, long > range(long begin, long end, long step=1) noexcept
Generate a sequence of integers in a specified range.