31 #include <OnixS/SgxTitan/MarketData/Itch/Bootstrap.h> 34 ONIXS_SGXTITAN_ITCH_NAMESPACE_BEGIN
47 ONIXS_SGXTITAN_ITCH_CONSTEXPR
50 : items_(ONIXS_SGXTITAN_ITCH_NULLPTR)
66 template <
size_t Size>
68 ONIXS_SGXTITAN_ITCH_CONSTEXPR
79 const std::string&
string)
81 : items_(
string.c_str())
82 , size_(
string.size())
93 : items_(other.items_)
98 #if defined(ONIXS_SGXTITAN_ITCH_COMPILER_CXX_RVALUE_REFERENCES) && ONIXS_SGXTITAN_ITCH_COMPILER_CXX_RVALUE_REFERENCES 100 ONIXS_SGXTITAN_ITCH_CONSTEXPR
104 : items_(std::move(other.items_))
105 , size_(std::move(other.size_))
115 items_ = std::move(other.items_);
116 size_ = std::move(other.size_);
155 return (items_ + size_);
162 reset(ONIXS_SGXTITAN_ITCH_NULLPTR, 0);
180 return items_[index];
188 return items_[index];
190 throw std::invalid_argument(
"index");
199 items_ = other.items_;
211 std::swap(items_, other.items_);
212 std::swap(size_, other.size_);
219 size_t length = size();
221 while(length > 0 && isspace(
operator[](length - 1)))
224 return StrRef(items(), length);
239 const std::string& str)
241 return StrRef(str.data(), str.size());
265 return std::string(ref.
items(), ref.
size());
284 return std::string(1, character);
294 str.append(1, character);
302 const std::string& value)
328 return !(left == right);
336 const std::string& str)
346 const std::string& str)
355 const std::string& str,
365 const std::string& str,
427 if (0 == compareResult)
430 static_cast<ptrdiff_t
>(
434 return (0 > compareResult);
444 return (right < left);
451 std::ostream& stream,
459 ONIXS_SGXTITAN_ITCH_NAMESPACE_END
char Char
Character type alias.
bool empty() const
Indicates whether array of zero length.
const Char * Iterator
STL-like iterator.
Iterator begin() const
STL-like begin().
bool operator<(const StrRef &left, const StrRef &right)
Establishes order over string refs.
void reset()
Resets reference to nothing.
bool operator>(const StrRef &left, const StrRef &right)
Establishes order over string refs.
void toStr(std::string &str, const std::string &value)
Appends one string another one.
ONIXS_SGXTITAN_ITCH_CONSTEXPR StrRef()
Initializes blank instance.
void swap(StrRef &other)
Swaps content with other instance.
void reset(const Char *chars, size_t size)
Updates data being referenced.
#define ONIXS_SGXTITAN_ITCH_NOTHROW
StrRef(const Char *chars, size_t size)
Full initialization.
std::ostream & operator<<(std::ostream &stream, const StrRef &text)
StrRef serialization operator.
bool operator==(const Char *str, const StrRef &ref)
Compares StrRef with zero-terminated/C-like string.
ONIXS_SGXTITAN_ITCH_CONSTEXPR StrRef(const char(&value)[Size])
Full initialization.
Iterator end() const
STL-like end().
size_t size() const
Number of chars.
StrRef toStrRef(const Char *cStr)
Initializes instance from zero-terminated/C-like string.
const Char * items() const
Read-only content.
const Char & at(size_t index) const
bool operator!=(const Char *str, const StrRef &ref)
Compares StrRef with zero-terminated/C-like string.
StrRef(const StrRef &other)
Provides efficient way of accessing text-based FIX field values.
StrRef(const std::string &string)
Full initialization.