10 if (s.
size() > this->size()) {
14 if (data[i] == s[0]) {
16 for (
Size j = 1; j < s.
size(); ++j) {
17 if (data[i + j] != s[j]) {
40 if (s.
size() > this->size()) {
44 if (data[i - 1] == s[0]) {
46 for (
Size j = 1; j < s.
size(); ++j) {
47 if (data[i + j - 1] != s[j]) {
64 for (
Size i = 0; i < pos; ++i) {
65 replaced.
push(data[i]);
67 for (
Size i = 0; i < s.
size(); ++i) {
70 for (
Size i = pos + n; i < data.
size(); ++i) {
71 replaced.
push(data[i]);
73 *
this =
String(std::move(replaced));
89 for (
Size i = pos; i < pos + m; ++i) {
98 for (; i1 < data.
size(); ++i1) {
99 if (data[i1] !=
' ') {
104 for (; i2 > 0; --i2) {
105 if (data[i2 - 1] !=
' ') {
110 for (
Size i = i1; i < i2; ++i) {
111 trimmed.
push(data[i]);
120 if (c >=
'A' && c <=
'Z') {
129 std::time_t t = std::time(
nullptr);
131 auto retval = strftime(buffer,
sizeof(buffer), format.
cStr(), std::localtime(&t));
#define SPH_ASSERT(x,...)
uint32_t Size
Integral type used to index arrays (by default).
constexpr INLINE T max(const T &f1, const T &f2)
NAMESPACE_SPH_BEGIN constexpr INLINE T min(const T &f1, const T &f2)
Minimum & Maximum value.
#define NAMESPACE_SPH_END
String getFormattedTime(const String &format)
Utility functions.
Object representing a sequence of characters.
Object providing safe access to continuous memory of data.
void reserve(const TCounter newMaxSize)
Allocates enough memory to store the given number of elements.
INLINE void push(U &&u)
Adds new element to the end of the array, resizing the array if necessary.
INLINE TCounter size() const noexcept
void replace(const Size pos, const Size n, const String &s)
const char * cStr() const
Size findAny(ArrayView< String > ss, const Size pos) const
String substr(const Size pos, const Size n=String::npos) const
Size findLast(const String &s) const
INLINE bool empty() const
Size find(const String &s, const Size pos=0) const