65 : items_(other.items_)
97 return (items_ + size_);
117 return items_[index];
124 return items_[index];
126 throw std::invalid_argument(
"index");
132 items_ = other.items_;
141 std::swap(items_, other.items_);
143 std::swap(size_, other.size_);
157 return StrRef(str.data(), str.size());
163 return StrRef(cStr, cStr ? strlen(cStr) : 0);
169 return std::string(ref.
items(), ref.
size());
181 return std::string(1, character);
187 str.append(1, character);
191 inline void toStr(std::string& str,
const std::string&
value)
205 return !(left == right);
261 return (0 != result ? (0 > result) : (left.
size() < right.
size()));
267 return (right < left);
Iterator begin() const
STL-like begin().
StrRef()
Initializes the instance referring to nothing.
void swap(StrRef &other)
Swaps content with the other instance.
bool empty() const
Indicates whether the referenced text is empty.
#define ONIXS_CMEMDH_NULLPTR
void toStr(std::string &str, const std::string &value)
Appends one string another one.
const Char * Iterator
STL-like iterator.
StrRef toStrRef(const Char *cStr)
Initializes instance from zero-terminated/C-like string.
std::ostream & operator<<(std::ostream &stream, const StrRef &text)
StrRef serialization operator.
const Char & at(size_t index) const
Provides bound-checked per-item access.
bool operator!=(const Char *str, const StrRef &ref)
Compares StrRef with zero-terminated/C-like string.
bool operator==(const Char *str, const StrRef &ref)
Compares StrRef with zero-terminated/C-like string.
bool operator<(const StrRef &left, const StrRef &right)
Establishes order over string refs.
#define ONIXS_CMEMDH_LTWT
const Char & operator[](size_t index) const
Provides per-item access.
char Char
Character type alias.
bool value(Number &number, const MultiContainer &container, Tag tag)
Finds a tag-value entry in the given collection by the given tag and returns its value component tran...
void reset(const Char *chars, size_t size)
Updates the given instance to refer to the new text.
const Char * items() const
Read-only content.
Provides efficient way of accessing text-based values without copying content of the text being refer...
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
StrRef(const StrRef &other)
Initializes as the clone of other instance.
bool operator>(const StrRef &left, const StrRef &right)
Establishes order over string refs.
StrRef & operator=(const StrRef &other)
Reinitializes from the other instance.
Iterator end() const
STL-like end().
size_t size() const
Number of chars.
void reset()
Resets the reference to nothing.
StrRef(const Char *chars, size_t size)
Explicit reference initialization.
#define ONIXS_CMEMDH_NAMESPACE_END