OnixS C++ CME Market Data Handler  2.56.0.0
Public Types | Public Member Functions | List of all members
StringRef Class Reference

Provides efficient way of accessing text-based FIX field values. More...

Public Types

typedef const char * ConstIterator
 Immutable iterator over chars.
 

Public Member Functions

 StringRef ()
 Initializes blank instance.
 
 StringRef (const char *chars, size_t size)
 Full initialization.
 
 StringRef (const StringRef &other)
 Initializes as clone of other instance. More...
 
 StringRef (const std::string &stdStr)
 Initializes instance from string content.
 
 StringRef (const String &ownStr)
 Initializes instance from string content.
 
 StringRef (const char *cStr)
 Initializes instance from zero-terminated string.
 
bool empty () const
 Indicates whether array of zero length.
 
const char * data () const
 Read-only content.
 
ConstIterator begin () const
 STL-like begin().
 
ConstIterator end () const
 STL-like end().
 
size_t size () const
 Number of chars.
 
void reset ()
 Resets reference to nothing.
 
void reset (const char *chars, size_t size)
 Updates data being referenced.
 
const char & operator[] (size_t index) const
 
const char & at (size_t index) const
 
template<typename NumericType >
bool toNumber (NumericType &number) const
 Returns number if text is string representation of an integer. More...
 
void toString (std::string &str) const
 
std::string toString () const
 
 operator std::string () const
 Implicit conversion to std::string.
 
bool operator== (const StringRef &other) const
 Compares with another instance.
 
bool operator!= (const StringRef &other) const
 Compares with another instance.
 
StringRefoperator= (const StringRef &other)
 Reinitializes from another instance.
 
void swap (StringRef &other)
 Swaps content with other instance.
 

Detailed Description

Provides efficient way of accessing text-based FIX field values.

Constructor & Destructor Documentation

StringRef ( const StringRef other)
inline

Initializes as clone of other instance.

Data referenced by clone is not copied. Instead both instances will refer to same text segment.

Member Function Documentation

bool toNumber ( NumericType &  number) const
inline

Returns number if text is string representation of an integer.