OnixS Brokertec ITCH Market Data Handler for C++  1.1.0.1
Public Types | Public Member Functions
StringRef Class Reference

Provides efficient way of accessing text-based field values, left justified and right padded. More...

List of all members.

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.
 StringRef (const std::string &stdStr)
 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
void toString (std::string &str) const
std::string toString () const
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 field values, left justified and right padded.


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.