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< Char, Traits > Class Template Reference

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

#include <nullterminated.h>

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

List of all members.

Public Types

typedef
nullterminated_implicit< Char,
Traits > 
implicit_type
 Corresponding implicit type.
typedef strip_const< Char >::type value_type
 Type of the characters referenced by this range.
typedef size_t size_type
 Type of the size returned by this range.
typedef ptrdiff_t difference_type
 Type of the difference between the addresses of two elements in this range.
typedef value_typepointer
 Type of pointers to the elements contained by this range.
typedef const value_typeconst_pointer
 Type of constant pointers to the elements contained by this range.
typedef value_typereference
 Type of references to the elements contained by this range.
typedef const value_typeconst_reference
 Type of constant references to the elements contained by this range.
typedef pointer iterator
 Type of iterators to the elements contained by this range.
typedef const_pointer const_iterator
 Type of constant iterators to the elements contained by this range.
typedef Traits traits_type
 Character traits used by this range.

Public Member Functions

LEAN_INLINE nullterminated (typename implicit_type::const_pointer begin)
 Constructs a (half) character range from the given C string.
template<class Compatible >
LEAN_INLINE nullterminated (const Compatible &from, typename enable_if< is_nullterminated_compatible< Compatible, value_type, traits_type >::value, const void * >::type=nullptr)
 Constructs a (half) character range from the given compatible object.
LEAN_INLINE nullterminated (const implicit_type &right)
 Constructs a (half) character range from the given implicit half 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(n).
LEAN_INLINE size_type size () const
 Gets the length of this character range, in characters (same as length()). O(n).
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_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).
LEAN_INLINE const_iterator end () const
 Returns a constant iterator the last element contained by this character range. O(n).
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.

Protected Attributes

const_pointer m_begin

Detailed Description

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

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


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