31 #include <OnixS/CboeCFE/Trading/BOE/Compiler.h> 53 : items_(ONIXS_BATS_BOE_NULLPTR)
59 StrRef(
const Char* chars,
size_t size) ONIXS_BATS_BOE_NOEXCEPT
66 StrRef(
const std::string& data) ONIXS_BATS_BOE_NOEXCEPT
67 : items_(data.c_str())
73 StrRef(
const Char* chars) ONIXS_BATS_BOE_NOEXCEPT
77 size_ = strnlen(chars, 1024);
85 : items_(other.items_)
91 bool empty() const ONIXS_BATS_BOE_NOEXCEPT
97 const Char*
items() const ONIXS_BATS_BOE_NOEXCEPT
103 size_t size() const ONIXS_BATS_BOE_NOEXCEPT
109 Iterator
begin() const ONIXS_BATS_BOE_NOEXCEPT
115 Iterator
end() const ONIXS_BATS_BOE_NOEXCEPT
117 return (items_ + size_);
121 void reset() ONIXS_BATS_BOE_NOEXCEPT
123 reset(ONIXS_BATS_BOE_NULLPTR, 0);
130 size_t size) ONIXS_BATS_BOE_NOEXCEPT
138 size_t index)
const ONIXS_BATS_BOE_NOEXCEPT
140 return items_[index];
148 return items_[index];
150 throw std::invalid_argument(
"index");
158 items_ = other.items_;
167 StrRef& other) ONIXS_BATS_BOE_NOEXCEPT
169 std::swap(items_, other.items_);
170 std::swap(size_, other.size_);
185 const std::string& str)
187 return StrRef(str.data(), str.size());
211 return std::string(ref.
items(), ref.
size());
225 template <
size_t Size>
226 void toStr(std::string& str,
const char (&value)[Size])
228 str.append(value, Size - 1);
238 str.append(1, character);
246 const std::string& value)
272 return !(left == right);
280 const std::string& str)
290 const std::string& str)
299 const std::string& str,
309 const std::string& str,
371 if (0 == compareResult)
374 static_cast<ptrdiff_t
>(
378 return (0 > compareResult);
388 return (right < left);
395 std::ostream& stream,
403 template <
size_t Size>
406 return StrRef(value, Size - 1);
void reset() ONIXS_BATS_BOE_NOEXCEPT
Resets reference to nothing.
std::ostream & operator<<(std::ostream &stream, const FixedPointDecimal< Mantissa, Exponent > &number)
StrRef constructStrRef(const char(&value)[Size])
const Char & operator[](size_t index) const ONIXS_BATS_BOE_NOEXCEPT
Iterator begin() const ONIXS_BATS_BOE_NOEXCEPT
STL-like begin().
bool operator<(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
bool operator>(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
Provides efficient way of accessing text-based field values.
void toStr(std::string &str, const FixedPointDecimal< Mantissa, Exponent > &number)
Serializes fixed-point decimal into a string.
bool empty() const ONIXS_BATS_BOE_NOEXCEPT
Indicates whether array of zero length.
void reset(const Char *chars, size_t size) ONIXS_BATS_BOE_NOEXCEPT
Updates data being referenced.
StrRef(const std::string &data) ONIXS_BATS_BOE_NOEXCEPT
Full initialization.
Iterator end() const ONIXS_BATS_BOE_NOEXCEPT
STL-like end().
StrRef(const Char *chars) ONIXS_BATS_BOE_NOEXCEPT
Explicit initialization.
bool operator==(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
const Char * items() const ONIXS_BATS_BOE_NOEXCEPT
Read-only content.
StrRef(const StrRef &other) ONIXS_BATS_BOE_NOEXCEPT
void swap(StrRef &other) ONIXS_BATS_BOE_NOEXCEPT
Swaps content with other instance.
bool operator!=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
StrRef & operator=(const StrRef &other)
Reinitializes from another instance.
StrRef() ONIXS_BATS_BOE_NOEXCEPT
Initializes blank instance.
StrRef toStrRef(const std::string &str)
Constructs StrRef instance over std::string content.
char Char
Character type alias.
size_t size() const ONIXS_BATS_BOE_NOEXCEPT
Number of chars.
const Char * Iterator
STL-like iterator.
StrRef(const Char *chars, size_t size) ONIXS_BATS_BOE_NOEXCEPT
Full initialization.
const Char & at(size_t index) const