Free Electron
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
fixed_char_buf< SIZE, CharT, Traits > Class Template Reference

This class implements the minimal string interface and is intended to be used as a base class for xstring<>, which provides the full string interface. More...

#include <fixed_char_buf.h>

Public Types

typedef CharT value_type
 
typedef value_type * pointer
 
typedef const value_type * const_pointer
 
typedef value_type & reference
 
typedef const value_type & const_reference
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef const value_type * const_iterator
 
typedef value_type * iterator
 
typedef std::reverse_iterator< const_iterator > const_reverse_iterator
 
typedef std::reverse_iterator< iterator > reverse_iterator
 
typedef std::allocator< CharT > allocator_type
 
typedef Traits traits_type
 

Public Member Functions

 fixed_char_buf (allocator_type const &a=_allocator)
 
 fixed_char_buf (fixed_char_buf const &s)
 
fixed_char_bufoperator= (fixed_char_buf const &s)
 
template<class InputIter >
void insert (iterator pos, InputIter first, InputIter last)
 
iterator erase (iterator first, iterator last)
 
const allocator_type & get_allocator () const
 (Replace can be defined in terms of erase and insert, so the minimal interface can skip it.) More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
void clear ()
 
size_t max_size () const
 
bool empty () const
 
size_type size () const
 
void swap (fixed_char_buf &s)
 
void reserve (size_type n=0)
 
size_type capacity () const
 
const CharT * c_str () const
 
const CharT * data () const
 

Static Public Attributes

static const size_type npos = (fixed_char_buf<SIZE,CharT,Traits>::size_type) -1
 Definition of "npos" constant: More...
 

Protected Member Functions

void element_initialize (size_type n, value_type c)
 
template<class InputIter >
void range_initialize (InputIter first, InputIter last)
 

Private Attributes

CharT _buffer [SIZE+1]
 
CharT * _end
 

Static Private Attributes

static const allocator_type _allocator
 Definition of "_allocator" dummy constant: More...
 

Detailed Description

template<size_t SIZE, class CharT = char, class Traits = std::char_traits<CharT>>
class fixed_char_buf< SIZE, CharT, Traits >

This class implements the minimal string interface and is intended to be used as a base class for xstring<>, which provides the full string interface.

Member Function Documentation

◆ get_allocator()

template<size_t SIZE, class CharT = char, class Traits = std::char_traits<CharT>>
const allocator_type& fixed_char_buf< SIZE, CharT, Traits >::get_allocator ( ) const
inline

(Replace can be defined in terms of erase and insert, so the minimal interface can skip it.)

References fixed_char_buf< SIZE, CharT, Traits >::_allocator.

◆ swap()

template<size_t SIZE, class CharT = char, class Traits = std::char_traits<CharT>>
void fixed_char_buf< SIZE, CharT, Traits >::swap ( fixed_char_buf< SIZE, CharT, Traits > &  s)
inline

Not as cheap as some swaps, but guaranteed not to throw:

Member Data Documentation

◆ _allocator

template<size_t SIZE, class CharT = char, class Traits = std::char_traits<CharT>>
const fixed_char_buf< SIZE, CharT, Traits >::allocator_type fixed_char_buf< SIZE, CharT, Traits >::_allocator
staticprivate

Definition of "_allocator" dummy constant:

Referenced by fixed_char_buf< SIZE, CharT, Traits >::get_allocator().

◆ npos

template<size_t SIZE, class CharT = char, class Traits = std::char_traits<CharT>>
const fixed_char_buf< SIZE, CharT, Traits >::size_type fixed_char_buf< SIZE, CharT, Traits >::npos = (fixed_char_buf<SIZE,CharT,Traits>::size_type) -1
static

Definition of "npos" constant:


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