32 #include <OnixS/SgxTitan/Trading/OUCH/Compiler.h> 48 ONIXS_SGX_OUCH_CONSTEXPR
50 ONIXS_SGX_OUCH_NOTHROW
51 : items_(ONIXS_SGX_OUCH_NULLPTR)
60 ONIXS_SGX_OUCH_NOTHROW
67 template <
size_t Size>
69 ONIXS_SGX_OUCH_CONSTEXPR
71 ONIXS_SGX_OUCH_NOTHROW
80 const std::string&
string)
81 ONIXS_SGX_OUCH_NOTHROW
82 : items_(
string.c_str())
83 , size_(
string.size())
93 ONIXS_SGX_OUCH_NOTHROW
94 : items_(other.items_)
99 #if defined(ONIXS_SGX_OUCH_COMPILER_CXX_RVALUE_REFERENCES) && ONIXS_SGX_OUCH_COMPILER_CXX_RVALUE_REFERENCES 101 ONIXS_SGX_OUCH_CONSTEXPR
104 ONIXS_SGX_OUCH_NOTHROW
105 : items_(std::move(other.items_))
106 , size_(std::move(other.size_))
111 ONIXS_SGX_OUCH_NOTHROW
116 items_ = std::move(other.items_);
117 size_ = std::move(other.size_);
126 ONIXS_SGX_OUCH_NOTHROW
133 ONIXS_SGX_OUCH_NOTHROW
140 ONIXS_SGX_OUCH_NOTHROW
147 ONIXS_SGX_OUCH_NOTHROW
154 ONIXS_SGX_OUCH_NOTHROW
156 return (items_ + size_);
161 ONIXS_SGX_OUCH_NOTHROW
163 reset(ONIXS_SGX_OUCH_NULLPTR, 0);
171 ONIXS_SGX_OUCH_NOTHROW
181 return items_[index];
189 return items_[index];
191 throw std::invalid_argument(
"index");
198 ONIXS_SGX_OUCH_NOTHROW
200 items_ = other.items_;
210 ONIXS_SGX_OUCH_NOTHROW
212 std::swap(items_, other.items_);
213 std::swap(size_, other.size_);
218 ONIXS_SGX_OUCH_NOTHROW
220 size_t length = size();
222 while(length > 0 && isspace(
operator[](length - 1)))
225 return StrRef(items(), length);
240 const std::string& str)
242 return StrRef(str.data(), str.size());
266 return std::string(ref.
items(), ref.
size());
285 return std::string(1, character);
295 str.append(1, character);
303 const std::string& value)
329 return !(left == right);
337 const std::string& str)
347 const std::string& str)
356 const std::string& str,
366 const std::string& str,
428 if (0 == compareResult)
431 static_cast<ptrdiff_t
>(
435 return (0 > compareResult);
445 return (right < left);
452 std::ostream& stream,
bool operator<(const StrRef &left, const StrRef &right)
Establishes order over string refs.
char Char
Character type alias.
const Char & at(size_t index) const
void swap(StrRef &other)
Swaps content with other instance.
ONIXS_SGX_OUCH_CONSTEXPR StrRef(const char(&value)[Size])
Full initialization.
void reset(const Char *chars, size_t size)
Updates data being referenced.
StrRef(const Char *chars, size_t size)
Full initialization.
std::ostream & operator<<(std::ostream &stream, const StrRef &text)
StrRef serialization operator.
const Char * Iterator
STL-like iterator.
StrRef(const std::string &string)
Full initialization.
Iterator end() const
STL-like end().
StrRef(const StrRef &other)
bool operator==(const Char *str, const StrRef &ref)
Compares StrRef with zero-terminated/C-like string.
StrRef toStrRef(const Char *cStr)
Initializes instance from zero-terminated/C-like string.
bool operator!=(const Char *str, const StrRef &ref)
Compares StrRef with zero-terminated/C-like string.
size_t size() const
Number of chars.
Provides efficient way of accessing text-based FIX field values.
bool empty() const
Indicates whether array of zero length.
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_END
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_BEGIN
void toStr(std::string &str, const std::string &value)
Appends one string another one.
bool operator>(const StrRef &left, const StrRef &right)
Establishes order over string refs.
Iterator begin() const
STL-like begin().
void reset()
Resets reference to nothing.
const Char * items() const
Read-only content.
ONIXS_SGX_OUCH_CONSTEXPR StrRef()
Initializes blank instance.