21 : data(other.data.clone()) {}
25 data = std::move(other.data);
29 : data(
std::move(buffer)) {
35 const Size length = strlen(s);
37 for (
Size i = 0; i < length; ++i) {
49 data = std::move(other.data);
74 return data == other.data;
78 return data != other.data;
91 return data.
size() - 1;
95 return data.
size() == 1;
109 return data.
end() - 1;
113 return data.
end() - 1;
117 stream << str.
cStr();
135 template <
typename... TArgs>
138 replace(std::forward<TArgs>(args)...);
155 return std::lexicographical_compare(s1.
begin(), s1.
end(), s2.
begin(), s2.
end());
162 template <
typename T>
164 std::stringstream ss;
166 return ss.str().c_str();
Generic dynamically allocated resizable storage.
INLINE CopyableArray< T, TAllocator, TCounter > copyable(const Array< T, TAllocator, TCounter > &array)
#define SPH_ASSERT(x,...)
uint32_t Size
Integral type used to index arrays (by default).
#define INLINE
Macros for conditional compilation based on selected compiler.
#define NAMESPACE_SPH_END
INLINE String toString(const T &value)
String getFormattedTime(const String &format)
Utility functions.
INLINE bool operator<(const String &s1, const String &s2)
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 Iterator< StorageType > end() noexcept
INLINE void push(U &&u)
Adds new element to the end of the array, resizing the array if necessary.
INLINE T pop()
Removes the last element from the array and return its value.
INLINE TCounter size() const noexcept
INLINE bool empty() const noexcept
INLINE Iterator< StorageType > begin() noexcept
void pushAll(const TIter first, const TIter last)
Simple (forward) iterator over continuous array of objects of type T.
void replace(const Size pos, const Size n, const String &s)
const char * cStr() const
bool operator==(const String &other) const
friend std::ostream & operator<<(std::ostream &stream, const String &str)
String(Array< char > &&buffer)
Size findAny(ArrayView< String > ss, const Size pos) const
String substr(const Size pos, const Size n=String::npos) const
INLINE char operator[](const Size idx) const
friend String operator+(const String &s1, const String &s2)
String & operator+=(const char c)
String & operator=(String &&other)
void replace(const String &old, const String &s, TArgs &&... args)
String & operator+=(const String &other)
Size findLast(const String &s) const
String & operator=(const String &other)
INLINE bool empty() const
Size find(const String &s, const Size pos=0) const
bool operator!=(const String &other) const
Iterator< const char > begin() const
String(const String &other)
Iterator< const char > end() const
Overload of std::swap for Sph::Array.