lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
Public Types | Public Member Functions | Protected Attributes
lean::strings::nullterminated_range< Char, Traits > Class Template Reference

Nullterminated character range class that may be constructed from arbitrary string classes. More...

#include <nullterminated_range.h>

Inheritance diagram for lean::strings::nullterminated_range< Char, Traits >:
lean::strings::nullterminated_range_implicit< Char, Traits > lean::strings::nullterminated_implicit< Char, Traits >

List of all members.

Public Types

typedef
nullterminated_range_implicit
< Char, Traits > 
implicit_type
 Corresponding implicit type.
typedef base_type::value_type value_type
 Type of the characters referenced by this range.
typedef base_type::size_type size_type
 Type of the size returned by this range.
typedef base_type::difference_type difference_type
 Type of the difference between the addresses of two elements in this range.
typedef base_type::pointer pointer
 Type of pointers to the elements contained by this range.
typedef base_type::const_pointer const_pointer
 Type of constant pointers to the elements contained by this range.
typedef base_type::reference reference
 Type of references to the elements contained by this range.
typedef base_type::const_reference const_reference
 Type of constant references to the elements contained by this range.
typedef base_type::pointer iterator
 Type of iterators to the elements contained by this range.
typedef base_type::const_iterator const_iterator
 Type of constant iterators to the elements contained by this range.
typedef base_type::traits_type traits_type
 Character traits used by this range.

Public Member Functions

LEAN_INLINE nullterminated_range (typename implicit_type::const_pointer begin)
 Constructs a character range from the given C string.
LEAN_INLINE nullterminated_range (typename implicit_type::const_pointer begin, typename implicit_type::const_pointer end)
 Constructs a character range from the given C string range (*end must be null character).
template<class Compatible >
LEAN_INLINE nullterminated_range (const Compatible &from, typename enable_if< is_nullterminated_compatible< Compatible, value_type, traits_type >::value, const void * >::type=nullptr)
 Constructs a character range from the given compatible object.
LEAN_INLINE nullterminated_range (const implicit_type &right)
 Constructs a character range from the given implicit range.
LEAN_INLINE nullterminated_range (const nullterminated_implicit< Char, Traits > &right)
 Constructs a character range from the given half-range.
LEAN_INLINE nullterminated_range (const nullterminated< Char, Traits > &right)
 Constructs a character range from the given half-range.
LEAN_INLINE operator nullterminated< Char, Traits > () const
 Constructs a half-range from this character range.
LEAN_INLINE bool empty () const
 Gets whether this character range is currently empty.
LEAN_INLINE size_type length () const
 Gets the length of this character range, in characters (same as size()). O(1).
LEAN_INLINE size_type size () const
 Gets the length of this character range, in characters (same as length()). O(1).
LEAN_INLINE size_type count () const
 Gets the length of this character range, in code points (might differ from length() and size()). O(n).
LEAN_INLINE const_iterator end () const
 Returns a constant iterator the last element contained by this character range. O(1).
LEAN_INLINE void swap (nullterminated_range_implicit &right)
 Swaps the contents of this range with the contents of the given range.
LEAN_INLINE void swap (nullterminated_implicit &right)
 Swaps the contents of this range with the contents of the given range.
template<class Compatible >
Compatible to () const
 Constructs a compatible object from this null-terminated character range.
LEAN_INLINE const_reference operator[] (size_type pos) const
 Gets an element by position, access violation on failure.
LEAN_INLINE const_pointer c_str () const
 Gets a pointer to this nullterminated range.
LEAN_INLINE const_pointer data () const
 Gets a pointer to this nullterminated range.
LEAN_INLINE const_iterator begin () const
 Returns a constant iterator to the first element contained by this character range. O(1).

Protected Attributes

const_pointer m_end
const_pointer m_begin

Detailed Description

template<class Char, class Traits = char_traits<typename strip_const<Char>::type>>
class lean::strings::nullterminated_range< Char, Traits >

Nullterminated character range class that may be constructed from arbitrary string classes.


The documentation for this class was generated from the following file: