ReactOS 0.4.15-dev-7934-g1dc8d80
rope< _CharT, _Alloc > Class Template Reference

#include <_rope.h>

Collaboration diagram for rope< _CharT, _Alloc >:

Public Types

typedef _CharT value_type
 
typedef ptrdiff_t difference_type
 
typedef size_t size_type
 
typedef _CharT const_reference
 
typedef const _CharT * const_pointer
 
typedef _Rope_iterator< _CharT, _Allociterator
 
typedef _Rope_const_iterator< _CharT, _Allocconst_iterator
 
typedef _Rope_char_ref_proxy< _CharT, _Allocreference
 
typedef _Rope_char_ptr_proxy< _CharT, _Allocpointer
 
typedef _Alloc allocator_type
 
typedef _Rope_RopeConcatenation< _CharT, _Alloc_RopeConcatenation
 
typedef _Rope_RopeLeaf< _CharT, _Alloc_RopeLeaf
 
typedef _Rope_RopeFunction< _CharT, _Alloc_RopeFunction
 
typedef _Rope_RopeSubstring< _CharT, _Alloc_RopeSubstring
 
typedef _Rope_self_destruct_ptr< _CharT, _Alloc_Self_destruct_ptr
 
typedef _Rope_char_consumer< _CharT > _CharConsumer
 

Public Member Functions

allocator_type get_allocator () const
 
void apply_to_pieces (size_t __begin, size_t __end, _CharConsumer &__c) const
 
 rope (_RopeRep *__t, const allocator_type &__a=allocator_type())
 
bool empty () const
 
int compare (const _Self &__y) const
 
 rope (const _CharT *__s, const allocator_type &__a=allocator_type())
 
 rope (const _CharT *__s, size_t __len, const allocator_type &__a=allocator_type())
 
 rope (const _CharT *__s, const _CharT *__e, const allocator_type &__a=allocator_type())
 
 rope (const const_iterator &__s, const const_iterator &__e, const allocator_type &__a=allocator_type())
 
 rope (const iterator &__s, const iterator &__e, const allocator_type &__a=allocator_type())
 
 rope (_CharT __c, const allocator_type &__a=allocator_type())
 
 rope (size_t __n, _CharT __c, const allocator_type &__a=allocator_type())
 
 rope (const allocator_type &__a=allocator_type())
 
 rope (char_producer< _CharT > *__fn, size_t __len, bool __delete_fn, const allocator_type &__a=allocator_type())
 
 rope (const _Self &__x)
 
 rope (__move_source< _Self > __src)
 
 ~rope ()
 
_Selfoperator= (const _Self &__x)
 
void clear ()
 
void push_back (_CharT __x)
 
void pop_back ()
 
_CharT back () const
 
void push_front (_CharT __x)
 
void pop_front ()
 
_CharT front () const
 
void balance ()
 
void copy (_CharT *__buffer) const
 
size_type copy (size_type __pos, size_type __n, _CharT *__buffer) const
 
const _CharT * c_str () const
 
const _CharT * replace_with_c_str ()
 
void delete_c_str ()
 
_CharT operator[] (size_type __pos) const
 
_CharT at (size_type __pos) const
 
const_iterator begin () const
 
const_iterator const_begin () const
 
const_iterator end () const
 
const_iterator const_end () const
 
size_type size () const
 
size_type length () const
 
size_type max_size () const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator const_rbegin () const
 
const_reverse_iterator rend () const
 
const_reverse_iterator const_rend () const
 
_Selfappend (const _CharT *__iter, size_t __n)
 
_Selfappend (const _CharT *__c_string)
 
_Selfappend (const _CharT *__s, const _CharT *__e)
 
_Selfappend (const_iterator __s, const_iterator __e)
 
_Selfappend (_CharT __c)
 
_Selfappend ()
 
_Selfappend (const _Self &__y)
 
_Selfappend (size_t __n, _CharT __c)
 
void swap (_Self &__b)
 
void insert (size_t __p, const _Self &__r)
 
void insert (size_t __p, size_t __n, _CharT __c)
 
void insert (size_t __p, const _CharT *__i, size_t __n)
 
void insert (size_t __p, const _CharT *__c_string)
 
void insert (size_t __p, _CharT __c)
 
void insert (size_t __p)
 
void insert (size_t __p, const _CharT *__i, const _CharT *__j)
 
void insert (size_t __p, const const_iterator &__i, const const_iterator &__j)
 
void insert (size_t __p, const iterator &__i, const iterator &__j)
 
void replace (size_t __p, size_t __n, const _Self &__r)
 
void replace (size_t __p, size_t __n, const _CharT *__i, size_t __i_len)
 
void replace (size_t __p, size_t __n, _CharT __c)
 
void replace (size_t __p, size_t __n, const _CharT *__c_string)
 
void replace (size_t __p, size_t __n, const _CharT *__i, const _CharT *__j)
 
void replace (size_t __p, size_t __n, const const_iterator &__i, const const_iterator &__j)
 
void replace (size_t __p, size_t __n, const iterator &__i, const iterator &__j)
 
void replace (size_t __p, _CharT __c)
 
void replace (size_t __p, const _Self &__r)
 
void replace (size_t __p, const _CharT *__i, size_t __i_len)
 
void replace (size_t __p, const _CharT *__c_string)
 
void replace (size_t __p, const _CharT *__i, const _CharT *__j)
 
void replace (size_t __p, const const_iterator &__i, const const_iterator &__j)
 
void replace (size_t __p, const iterator &__i, const iterator &__j)
 
void erase (size_t __p, size_t __n)
 
void erase (size_t __p)
 
iterator insert (const iterator &__p, const _Self &__r)
 
iterator insert (const iterator &__p, size_t __n, _CharT __c)
 
iterator insert (const iterator &__p, _CharT __c)
 
iterator insert (const iterator &__p)
 
iterator insert (const iterator &__p, const _CharT *c_string)
 
iterator insert (const iterator &__p, const _CharT *__i, size_t __n)
 
iterator insert (const iterator &__p, const _CharT *__i, const _CharT *__j)
 
iterator insert (const iterator &__p, const const_iterator &__i, const const_iterator &__j)
 
iterator insert (const iterator &__p, const iterator &__i, const iterator &__j)
 
void replace (const iterator &__p, const iterator &__q, const _Self &__r)
 
void replace (const iterator &__p, const iterator &__q, _CharT __c)
 
void replace (const iterator &__p, const iterator &__q, const _CharT *__c_string)
 
void replace (const iterator &__p, const iterator &__q, const _CharT *__i, size_t __n)
 
void replace (const iterator &__p, const iterator &__q, const _CharT *__i, const _CharT *__j)
 
void replace (const iterator &__p, const iterator &__q, const const_iterator &__i, const const_iterator &__j)
 
void replace (const iterator &__p, const iterator &__q, const iterator &__i, const iterator &__j)
 
void replace (const iterator &__p, const _Self &__r)
 
void replace (const iterator &__p, _CharT __c)
 
void replace (const iterator &__p, const _CharT *__c_string)
 
void replace (const iterator &__p, const _CharT *__i, size_t __n)
 
void replace (const iterator &__p, const _CharT *__i, const _CharT *__j)
 
void replace (const iterator &__p, const_iterator __i, const_iterator __j)
 
void replace (const iterator &__p, iterator __i, iterator __j)
 
iterator erase (const iterator &__p, const iterator &__q)
 
iterator erase (const iterator &__p)
 
_Self substr (size_t __start, size_t __len=1) const
 
_Self substr (iterator __start, iterator __end) const
 
_Self substr (iterator __start) const
 
_Self substr (const_iterator __start, const_iterator __end) const
 
rope< _CharT, _Allocsubstr (const_iterator __start)
 
size_type find (const _Self &__s, size_type __pos=0) const
 
size_type find (_CharT __c, size_type __pos=0) const
 
size_type find (const _CharT *__s, size_type __pos=0) const
 
iterator mutable_begin ()
 
iterator mutable_end ()
 
reverse_iterator mutable_rbegin ()
 
reverse_iterator mutable_rend ()
 
reference mutable_reference_at (size_type __pos)
 
const_iterator end ()
 
const_iterator begin ()
 
const_reverse_iterator rend ()
 
const_reverse_iterator rbegin ()
 

Static Public Member Functions

static _CharT _S_fetch (_RopeRep *__r, size_type __pos)
 
static _CharT * _S_fetch_ptr (_RopeRep *__r, size_type __pos)
 
static void _S_unref (_RopeRep *__t)
 
static void _S_ref (_RopeRep *__t)
 
static _RopeRep_S_substring (_RopeRep *__base, size_t __start, size_t __endp1)
 
static _RopeRep_S_concat_char_iter (_RopeRep *__r, const _CharT *__iter, size_t __slen)
 
static _RopeRep_S_destr_concat_char_iter (_RopeRep *__r, const _CharT *__iter, size_t __slen)
 
static _RopeRep_S_concat_rep (_RopeRep *__left, _RopeRep *__right)
 
static size_t _S_char_ptr_len (const _CharT *__s)
 

Public Attributes

 _STLP_DECLARE_RANDOM_ACCESS_REVERSE_ITERATORS
 
_STLP_PRIV _STLP_alloc_proxy< _RopeRep *, _CharT, allocator_type_M_tree_ptr
 

Static Public Attributes

static const unsigned long _S_min_len [__ROPE_DEPTH_SIZE]
 

Protected Types

enum  { _S_copy_max = 23 }
 
typedef _CharT * _Cstrptr
 
typedef _Rope_RopeRep< _CharT, _Alloc_RopeRep
 
typedef _RopeRep::_IsBasicCharType _IsBasicCharType
 
typedef _STLP_PRIV _Rope_Concat_fn< _CharT, _Alloc_Concat_fn
 

Protected Member Functions

void _STLP_FUNCTION_THROWS _M_throw_out_of_range () const
 
void _M_reset (_RopeRep *__r)
 

Static Protected Member Functions

static size_t _S_rounded_up_size (size_t __n)
 
static _RopeLeaf_S_new_RopeLeaf (_CharT *__s, size_t _p_size, allocator_type __a)
 
static _RopeConcatenation_S_new_RopeConcatenation (_RopeRep *__left, _RopeRep *__right, allocator_type __a)
 
static _RopeFunction_S_new_RopeFunction (char_producer< _CharT > *__f, size_t _p_size, bool __d, allocator_type __a)
 
static _RopeSubstring_S_new_RopeSubstring (_Rope_RopeRep< _CharT, _Alloc > *__b, size_t __s, size_t __l, allocator_type __a)
 
static _RopeLeaf_S_RopeLeaf_from_unowned_char_ptr (const _CharT *__s, size_t _p_size, allocator_type __a)
 
static _RopeRep_S_tree_concat (_RopeRep *__left, _RopeRep *__right)
 
static _RopeLeaf_S_leaf_concat_char_iter (_RopeLeaf *__r, const _CharT *__iter, size_t __slen)
 
static _RopeLeaf_S_destr_leaf_concat_char_iter (_RopeLeaf *__r, const _CharT *__iter, size_t __slen)
 
static bool _S_is_balanced (_RopeRep *__r)
 
static bool _S_is_almost_balanced (_RopeRep *__r)
 
static bool _S_is_roughly_balanced (_RopeRep *__r)
 
static _RopeRep_S_concat_and_set_balanced (_RopeRep *__left, _RopeRep *__right)
 
static _RopeRep_S_balance (_RopeRep *__r)
 
static void _S_add_to_forest (_RopeRep *__r, _RopeRep **__forest)
 
static void _S_add_leaf_to_forest (_RopeRep *__r, _RopeRep **__forest)
 
static int _S_compare (const _RopeRep *__x, const _RopeRep *__y)
 
static _RopeRepreplace (_RopeRep *__old, size_t __pos1, size_t __pos2, _RopeRep *__r)
 

Protected Attributes

friend _Concat_fn
 

Static Protected Attributes

static _CharT _S_empty_c_str [1] = { _CharT() }
 

Private Types

typedef rope< _CharT, _Alloc_Self
 

Static Private Member Functions

static _CharT * _S_flatten (_RopeRep *__r, _CharT *__buffer)
 
static _CharT * _S_flatten (_RopeRep *__r, size_t __start, size_t __len, _CharT *__buffer)
 

Friends

class _Rope_iterator< _CharT, _Alloc >
 
class _Rope_const_iterator< _CharT, _Alloc >
 
struct _Rope_RopeRep< _CharT, _Alloc >
 
class _Rope_iterator_base< _CharT, _Alloc >
 
class _Rope_char_ptr_proxy< _CharT, _Alloc >
 
class _Rope_char_ref_proxy< _CharT, _Alloc >
 
struct _Rope_RopeSubstring< _CharT, _Alloc >
 

Detailed Description

template<class _CharT, class _Alloc>
class rope< _CharT, _Alloc >

Definition at line 1083 of file _rope.h.

Member Typedef Documentation

◆ _CharConsumer

template<class _CharT , class _Alloc >
typedef _Rope_char_consumer<_CharT> rope< _CharT, _Alloc >::_CharConsumer

Definition at line 1182 of file _rope.h.

◆ _Concat_fn

template<class _CharT , class _Alloc >
typedef _STLP_PRIV _Rope_Concat_fn<_CharT,_Alloc> rope< _CharT, _Alloc >::_Concat_fn
protected

Definition at line 1270 of file _rope.h.

◆ _Cstrptr

template<class _CharT , class _Alloc >
typedef _CharT* rope< _CharT, _Alloc >::_Cstrptr
protected

Definition at line 1111 of file _rope.h.

◆ _IsBasicCharType

template<class _CharT , class _Alloc >
typedef _RopeRep::_IsBasicCharType rope< _CharT, _Alloc >::_IsBasicCharType
protected

Definition at line 1120 of file _rope.h.

◆ _RopeConcatenation

template<class _CharT , class _Alloc >
typedef _Rope_RopeConcatenation<_CharT,_Alloc> rope< _CharT, _Alloc >::_RopeConcatenation

Definition at line 1134 of file _rope.h.

◆ _RopeFunction

template<class _CharT , class _Alloc >
typedef _Rope_RopeFunction<_CharT,_Alloc> rope< _CharT, _Alloc >::_RopeFunction

Definition at line 1136 of file _rope.h.

◆ _RopeLeaf

template<class _CharT , class _Alloc >
typedef _Rope_RopeLeaf<_CharT,_Alloc> rope< _CharT, _Alloc >::_RopeLeaf

Definition at line 1135 of file _rope.h.

◆ _RopeRep

template<class _CharT , class _Alloc >
typedef _Rope_RopeRep<_CharT, _Alloc> rope< _CharT, _Alloc >::_RopeRep
protected

Definition at line 1119 of file _rope.h.

◆ _RopeSubstring

template<class _CharT , class _Alloc >
typedef _Rope_RopeSubstring<_CharT,_Alloc> rope< _CharT, _Alloc >::_RopeSubstring

Definition at line 1137 of file _rope.h.

◆ _Self

template<class _CharT , class _Alloc >
typedef rope<_CharT,_Alloc> rope< _CharT, _Alloc >::_Self
private

Definition at line 1088 of file _rope.h.

◆ _Self_destruct_ptr

template<class _CharT , class _Alloc >
typedef _Rope_self_destruct_ptr<_CharT,_Alloc> rope< _CharT, _Alloc >::_Self_destruct_ptr

Definition at line 1157 of file _rope.h.

◆ allocator_type

template<class _CharT , class _Alloc >
typedef _Alloc rope< _CharT, _Alloc >::allocator_type

Definition at line 1124 of file _rope.h.

◆ const_iterator

template<class _CharT , class _Alloc >
typedef _Rope_const_iterator<_CharT,_Alloc> rope< _CharT, _Alloc >::const_iterator

Definition at line 1096 of file _rope.h.

◆ const_pointer

template<class _CharT , class _Alloc >
typedef const _CharT* rope< _CharT, _Alloc >::const_pointer

Definition at line 1094 of file _rope.h.

◆ const_reference

template<class _CharT , class _Alloc >
typedef _CharT rope< _CharT, _Alloc >::const_reference

Definition at line 1093 of file _rope.h.

◆ difference_type

template<class _CharT , class _Alloc >
typedef ptrdiff_t rope< _CharT, _Alloc >::difference_type

Definition at line 1091 of file _rope.h.

◆ iterator

template<class _CharT , class _Alloc >
typedef _Rope_iterator<_CharT,_Alloc> rope< _CharT, _Alloc >::iterator

Definition at line 1095 of file _rope.h.

◆ pointer

template<class _CharT , class _Alloc >
typedef _Rope_char_ptr_proxy<_CharT,_Alloc> rope< _CharT, _Alloc >::pointer

Definition at line 1098 of file _rope.h.

◆ reference

template<class _CharT , class _Alloc >
typedef _Rope_char_ref_proxy<_CharT,_Alloc> rope< _CharT, _Alloc >::reference

Definition at line 1097 of file _rope.h.

◆ size_type

template<class _CharT , class _Alloc >
typedef size_t rope< _CharT, _Alloc >::size_type

Definition at line 1092 of file _rope.h.

◆ value_type

template<class _CharT , class _Alloc >
typedef _CharT rope< _CharT, _Alloc >::value_type

Definition at line 1090 of file _rope.h.

Member Enumeration Documentation

◆ anonymous enum

template<class _CharT , class _Alloc >
anonymous enum
protected
Enumerator
_S_copy_max 

Definition at line 1115 of file _rope.h.

1115{ _S_copy_max = 23 };
@ _S_copy_max
Definition: _rope.h:1115

Constructor & Destructor Documentation

◆ rope() [1/12]

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc >::rope ( _RopeRep __t,
const allocator_type __a = allocator_type() 
)
inline

Definition at line 1283 of file _rope.h.

1284 : _M_tree_ptr(__a, __t) { }
_STLP_PRIV _STLP_alloc_proxy< _RopeRep *, _CharT, allocator_type > _M_tree_ptr
Definition: _rope.h:1128

◆ rope() [2/12]

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc >::rope ( const _CharT *  __s,
const allocator_type __a = allocator_type() 
)
inline

Definition at line 1363 of file _rope.h.

1365 {}
static _RopeLeaf * _S_RopeLeaf_from_unowned_char_ptr(const _CharT *__s, size_t _p_size, allocator_type __a)
Definition: _rope.h:1229
static size_t _S_char_ptr_len(const _CharT *__s)
Definition: _rope.h:1278

◆ rope() [3/12]

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc >::rope ( const _CharT *  __s,
size_t  __len,
const allocator_type __a = allocator_type() 
)
inline

Definition at line 1367 of file _rope.h.

1369 : _M_tree_ptr(__a, (_S_RopeLeaf_from_unowned_char_ptr(__s, __len, __a)))
1370 {}

◆ rope() [4/12]

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc >::rope ( const _CharT *  __s,
const _CharT *  __e,
const allocator_type __a = allocator_type() 
)
inline

Definition at line 1375 of file _rope.h.

1377 : _M_tree_ptr(__a, _S_RopeLeaf_from_unowned_char_ptr(__s, __e - __s, __a))
1378 {}

◆ rope() [5/12]

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc >::rope ( const const_iterator __s,
const const_iterator __e,
const allocator_type __a = allocator_type() 
)
inline

Definition at line 1380 of file _rope.h.

1382 : _M_tree_ptr(__a, _S_substring(__s._M_root, __s._M_current_pos,
1383 __e._M_current_pos))
1384 {}
static _RopeRep * _S_substring(_RopeRep *__base, size_t __start, size_t __endp1)
Definition: _rope.c:621

◆ rope() [6/12]

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc >::rope ( const iterator __s,
const iterator __e,
const allocator_type __a = allocator_type() 
)
inline

Definition at line 1386 of file _rope.h.

1388 : _M_tree_ptr(__a, _S_substring(__s._M_root, __s._M_current_pos,
1389 __e._M_current_pos))
1390 {}

◆ rope() [7/12]

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc >::rope ( _CharT  __c,
const allocator_type __a = allocator_type() 
)
inline

Definition at line 1392 of file _rope.h.

1393 : _M_tree_ptr(__a, (_RopeRep*)0) {
1394 _CharT* __buf = _M_tree_ptr.allocate(_S_rounded_up_size(1));
1395
1396 _Copy_Construct(__buf, __c);
1397 _S_construct_null(__buf + 1);
1398
1399 _STLP_TRY {
1400 _M_tree_ptr._M_data = _S_new_RopeLeaf(__buf, 1, __a);
1401 }
1403 }
void _Copy_Construct(_Tp *__p, const _Tp &__val)
Definition: _construct.h:130
void _S_construct_null(_CharT *__p)
Definition: _rope.h:148
static _RopeLeaf * _S_new_RopeLeaf(_CharT *__s, size_t _p_size, allocator_type __a)
Definition: _rope.h:1195
_Rope_RopeRep< _CharT, _Alloc > _RopeRep
Definition: _rope.h:1119
static size_t _S_rounded_up_size(size_t __n)
Definition: _rope.h:1190
#define _STLP_UNWIND(action)
Definition: features.h:824
#define _STLP_TRY
Definition: features.h:817
#define __c
Definition: schilyio.h:209
static void _S_free_string(_CharT *__s, size_t __len, allocator_type __a)
Definition: _rope.h:411

◆ rope() [8/12]

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc >::rope ( size_t  __n,
_CharT  __c,
const allocator_type __a = allocator_type() 
)
inline

Definition at line 1405 of file _rope.h.

1406 :
1407 _M_tree_ptr(__a, (_RopeRep*)0) {
1408 if (0 == __n)
1409 return;
1410
1411 rope<_CharT,_Alloc> __result;
1412# define __exponentiate_threshold size_t(32)
1413 _RopeRep* __remainder;
1414 rope<_CharT,_Alloc> __remainder_rope;
1415
1416 // gcc-2.7.2 bugs
1418
1419 size_t __exponent = __n / __exponentiate_threshold;
1420 size_t __rest = __n % __exponentiate_threshold;
1421 if (0 == __rest) {
1422 __remainder = 0;
1423 } else {
1424 _CharT* __rest_buffer = _M_tree_ptr.allocate(_S_rounded_up_size(__rest));
1425 uninitialized_fill_n(__rest_buffer, __rest, __c);
1426 _S_construct_null(__rest_buffer + __rest);
1427 _STLP_TRY {
1428 __remainder = _S_new_RopeLeaf(__rest_buffer, __rest, __a);
1429 }
1430 _STLP_UNWIND(_RopeRep::_S_free_string(__rest_buffer, __rest, __a))
1431 }
1432 __remainder_rope._M_tree_ptr._M_data = __remainder;
1433 if (__exponent != 0) {
1434 _CharT* __base_buffer = _M_tree_ptr.allocate(_S_rounded_up_size(__exponentiate_threshold));
1435 _RopeLeaf* __base_leaf;
1436 rope<_CharT,_Alloc> __base_rope;
1439 _STLP_TRY {
1440 __base_leaf = _S_new_RopeLeaf(__base_buffer,
1442 }
1445 __base_rope._M_tree_ptr._M_data = __base_leaf;
1446 if (1 == __exponent) {
1447 __result = __base_rope;
1448 // One each for base_rope and __result
1449 //_STLP_ASSERT(2 == __result._M_tree_ptr._M_data->_M_ref_count)
1450 } else {
1451 __result = _STLP_PRIV __power(__base_rope, __exponent, _Concat_fn());
1452 }
1453 if (0 != __remainder) {
1454 __result += __remainder_rope;
1455 }
1456 } else {
1457 __result = __remainder_rope;
1458 }
1459 _M_tree_ptr._M_data = __result._M_tree_ptr._M_data;
1460 _M_tree_ptr._M_data->_M_ref_nonnil();
1461# undef __exponentiate_threshold
1462 }
return __n
Definition: _algo.h:75
#define _STLP_PRIV
Definition: _dm.h:70
_Tp __power(_Tp __x, _Integer __n, _MonoidOperation __opr)
Definition: _numeric.c:74
#define __exponentiate_threshold
_STLP_MOVE_TO_STD_NAMESPACE void uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp &__x)
Definition: _rope.h:1087
_Rope_RopeLeaf< _CharT, _Alloc > _RopeLeaf
Definition: _rope.h:1135
_STLP_PRIV _Rope_Concat_fn< _CharT, _Alloc > _Concat_fn
Definition: _rope.h:1270

◆ rope() [9/12]

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc >::rope ( const allocator_type __a = allocator_type())
inline

Definition at line 1464 of file _rope.h.

1465 : _M_tree_ptr(__a, (_RopeRep*)0) {}

◆ rope() [10/12]

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc >::rope ( char_producer< _CharT > *  __fn,
size_t  __len,
bool  __delete_fn,
const allocator_type __a = allocator_type() 
)
inline

Definition at line 1468 of file _rope.h.

1470 : _M_tree_ptr(__a, (_RopeRep*)0) {
1471 _M_tree_ptr._M_data = (0 == __len) ?
1472 0 : _S_new_RopeFunction(__fn, __len, __delete_fn, __a);
1473 }
static _RopeFunction * _S_new_RopeFunction(char_producer< _CharT > *__f, size_t _p_size, bool __d, allocator_type __a)
Definition: _rope.h:1214

◆ rope() [11/12]

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc >::rope ( const _Self __x)
inline

Definition at line 1475 of file _rope.h.

1476 : _M_tree_ptr(__x._M_tree_ptr, __x._M_tree_ptr._M_data) {
1477 _S_ref(_M_tree_ptr._M_data);
1478 }
static void _S_ref(_RopeRep *__t)
Definition: _rope.h:1153

◆ rope() [12/12]

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc >::rope ( __move_source< _Self __src)
inline

Definition at line 1481 of file _rope.h.

1482 : _M_tree_ptr(__src.get()._M_tree_ptr, __src.get()._M_tree_ptr._M_data) {
1483 __src.get()._M_tree_ptr._M_data = 0;
1484 }
_Tp & get() const

◆ ~rope()

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc >::~rope ( )
inline

Definition at line 1487 of file _rope.h.

1487 {
1488 _S_unref(_M_tree_ptr._M_data);
1489 }
static void _S_unref(_RopeRep *__t)
Definition: _rope.h:1150

Member Function Documentation

◆ _M_reset()

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::_M_reset ( _RopeRep __r)
inlineprotected

Definition at line 1346 of file _rope.h.

1346 {
1347 //if (__r != _M_tree_ptr._M_data) {
1348 _S_unref(_M_tree_ptr._M_data);
1349 _M_tree_ptr._M_data = __r;
1350 //}
1351 }

Referenced by rope< _CharT, _Alloc >::append(), rope< _CharT, _Alloc >::erase(), rope< _CharT, _Alloc >::insert(), rope< _CharT, _Alloc >::operator=(), rope< _CharT, _Alloc >::push_back(), and rope< _CharT, _Alloc >::replace().

◆ _M_throw_out_of_range()

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::_M_throw_out_of_range
protected

Definition at line 369 of file _rope.c.

369 {
371}
_STLP_THROW_FUNCT_SPEC _STLP_CALL __stl_throw_out_of_range(const char *__msg)
Definition: _range_errors.c:69

Referenced by rope< _CharT, _Alloc >::at(), rope< _CharT, _Alloc >::erase(), rope< _CharT, _Alloc >::insert(), rope< _CharT, _Alloc >::replace(), and rope< _CharT, _Alloc >::substr().

◆ _S_add_leaf_to_forest()

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::_S_add_leaf_to_forest ( _RopeRep __r,
_RopeRep **  __forest 
)
staticprotected

Definition at line 1079 of file _rope.c.

1080{
1081 _RopeRep* __insertee; // included in refcount
1082 _RopeRep* __too_tiny = 0; // included in refcount
1083 int __i; // forest[0..__i-1] is empty
1084 size_t __s = __r->_M_size._M_data;
1085
1086 for (__i = 0; __s >= _S_min_len[__i+1]/* not this bucket */; ++__i) {
1087 if (0 != __forest[__i]) {
1088 _Self_destruct_ptr __old(__too_tiny);
1089 __too_tiny = _S_concat_and_set_balanced(__forest[__i], __too_tiny);
1090 __forest[__i]->_M_unref_nonnil();
1091 __forest[__i] = 0;
1092 }
1093 }
1094 {
1095 _Self_destruct_ptr __old(__too_tiny);
1096 __insertee = _S_concat_and_set_balanced(__too_tiny, __r);
1097 }
1098 // Too_tiny dead, and no longer included in refcount.
1099 // Insertee is live and included.
1101 _STLP_ASSERT(__insertee->_M_depth <= __r->_M_depth + 1)
1102 for (;; ++__i) {
1103 if (0 != __forest[__i]) {
1104 _Self_destruct_ptr __old(__insertee);
1105 __insertee = _S_concat_and_set_balanced(__forest[__i], __insertee);
1106 __forest[__i]->_M_unref_nonnil();
1107 __forest[__i] = 0;
1109 }
1110 _STLP_ASSERT(_S_min_len[__i] <= __insertee->_M_size._M_data)
1111 _STLP_ASSERT(__forest[__i] == 0)
1112 if (__i == _RopeRep::_S_max_rope_depth ||
1113 __insertee->_M_size._M_data < _S_min_len[__i+1]) {
1114 __forest[__i] = __insertee;
1115 // refcount is OK since __insertee is now dead.
1116 return;
1117 }
1118 }
1119}
#define _STLP_ASSERT(expr)
Definition: _debug.h:165
static _RopeRep * _S_concat_and_set_balanced(_RopeRep *__left, _RopeRep *__right)
Definition: _rope.h:1315
static bool _S_is_almost_balanced(_RopeRep *__r)
Definition: _rope.h:1304
static const unsigned long _S_min_len[__ROPE_DEPTH_SIZE]
Definition: _rope.h:1299
_Rope_self_destruct_ptr< _CharT, _Alloc > _Self_destruct_ptr
Definition: _rope.h:1157
if(dx< 0)
Definition: linetemp.h:194
#define for
Definition: utility.h:88

◆ _S_add_to_forest()

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::_S_add_to_forest ( _RopeRep __r,
_RopeRep **  __forest 
)
staticprotected

Definition at line 1061 of file _rope.c.

1062{
1063 if (__r -> _M_is_balanced) {
1064 _S_add_leaf_to_forest(__r, __forest);
1065 return;
1066 }
1067 _STLP_ASSERT(__r->_M_tag == _RopeRep::_S_concat)
1068 {
1070
1071 _S_add_to_forest(__c->_M_left, __forest);
1072 _S_add_to_forest(__c->_M_right, __forest);
1073 }
1074}
_Rope_RopeConcatenation< _CharT, _Alloc > _RopeConcatenation
Definition: _rope.h:1134
static void _S_add_leaf_to_forest(_RopeRep *__r, _RopeRep **__forest)
Definition: _rope.c:1079
static void _S_add_to_forest(_RopeRep *__r, _RopeRep **__forest)
Definition: _rope.c:1061

◆ _S_balance()

template<class _CharT , class _Alloc >
__RopeRep__ * rope< _CharT, _Alloc >::_S_balance ( _RopeRep __r)
staticprotected

Definition at line 1026 of file _rope.c.

1026 {
1027 _RopeRep* __forest[_RopeRep::_S_max_rope_depth + 1] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1028 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1029 0,0,0,0,0,0};
1030 _RopeRep* __result = 0;
1031 int __i;
1032 // Invariant:
1033 // The concatenation of forest in descending order is equal to __r.
1034 // __forest[__i]._M_size._M_data >= _S_min_len[__i]
1035 // __forest[__i]._M_depth = __i
1036 // References from forest are included in refcount.
1037
1038 _STLP_TRY {
1039 _S_add_to_forest(__r, __forest);
1040 for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
1041 if (0 != __forest[__i]) {
1042 _Self_destruct_ptr __old(__result);
1043 __result = _S_concat_rep(__forest[__i], __result);
1044 __forest[__i]->_M_unref_nonnil();
1045# ifdef _STLP_USE_EXCEPTIONS
1046 __forest[__i] = 0;
1047# endif
1048 }
1049 }
1050 _STLP_UNWIND(for(__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
1051 _S_unref(__forest[__i]))
1052 if (__result->_M_depth > _RopeRep::_S_max_rope_depth) {
1053 __stl_throw_range_error("rope too long");
1054 }
1055 return(__result);
1056}
_STLP_THROW_FUNCT_SPEC _STLP_CALL __stl_throw_range_error(const char *__msg)
Definition: _range_errors.c:66
static _RopeRep * _S_concat_rep(_RopeRep *__left, _RopeRep *__right)
Definition: _rope.c:577
@ _S_max_rope_depth
Definition: _rope.h:344

Referenced by rope< _CharT, _Alloc >::balance().

◆ _S_char_ptr_len()

template<class _CharT , class _Alloc >
static size_t rope< _CharT, _Alloc >::_S_char_ptr_len ( const _CharT *  __s)
inlinestatic

Definition at line 1278 of file _rope.h.

1278 {
1279 return char_traits<_CharT>::length(__s);
1280 }
static size_t _STLP_CALL length(const char_type *__s)
Definition: char_traits.h:153

Referenced by rope< _CharT, _Alloc >::append(), rope< _CharT, _Alloc >::find(), rope< _CharT, _Alloc >::insert(), and operator+().

◆ _S_compare()

template<class _CharT , class _Alloc >
int rope< _CharT, _Alloc >::_S_compare ( const _RopeRep __x,
const _RopeRep __y 
)
staticprotected

Definition at line 1227 of file _rope.c.

1228 {
1229 size_t __left_len;
1230 size_t __right_len;
1231
1232 if (0 == __right) return 0 != __left;
1233 if (0 == __left) return -1;
1234 __left_len = __left->_M_size._M_data;
1235 __right_len = __right->_M_size._M_data;
1236 if (_RopeRep::_S_leaf == __left->_M_tag) {
1237 const _RopeLeaf* __l = __STATIC_CAST(const _RopeLeaf*, __left);
1238 if (_RopeRep::_S_leaf == __right->_M_tag) {
1239 const _RopeLeaf* __r = __STATIC_CAST(const _RopeLeaf*, __right);
1240 return _STLP_PRIV __lexicographical_compare_3way(__l->_M_data, __l->_M_data + __left_len,
1241 __r->_M_data, __r->_M_data + __right_len);
1242 }
1243 else {
1244 const_iterator __rstart(__right, 0);
1245 const_iterator __rend(__right, __right_len);
1246 return _STLP_PRIV __lexicographical_compare_3way(__l->_M_data, __l->_M_data + __left_len,
1247 __rstart, __rend);
1248 }
1249 }
1250 else {
1251 const_iterator __lstart(__left, 0);
1252 const_iterator __lend(__left, __left_len);
1253 if (_RopeRep::_S_leaf == __right->_M_tag) {
1254 const _RopeLeaf* __r = __STATIC_CAST(const _RopeLeaf*, __right);
1255 return _STLP_PRIV __lexicographical_compare_3way(__lstart, __lend,
1256 __r->_M_data, __r->_M_data + __right_len);
1257 }
1258 else {
1259 const_iterator __rstart(__right, 0);
1260 const_iterator __rend(__right, __right_len);
1261 return _STLP_PRIV __lexicographical_compare_3way(__lstart, __lend, __rstart, __rend);
1262 }
1263 }
1264}
_STLP_MOVE_TO_PRIV_NAMESPACE int __lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2)
Definition: _algobase.c:78
_Rope_const_iterator< _CharT, _Alloc > const_iterator
Definition: _rope.h:1096
#define __STATIC_CAST(__x, __y)
Definition: features.h:585

Referenced by rope< _CharT, _Alloc >::compare().

◆ _S_concat_and_set_balanced()

template<class _CharT , class _Alloc >
static _RopeRep * rope< _CharT, _Alloc >::_S_concat_and_set_balanced ( _RopeRep __left,
_RopeRep __right 
)
inlinestaticprotected

Definition at line 1315 of file _rope.h.

1316 {
1317 _RopeRep* __result = _S_concat_rep(__left, __right);
1318 if (_S_is_balanced(__result)) __result->_M_is_balanced = true;
1319 return __result;
1320 }
static bool _S_is_balanced(_RopeRep *__r)
Definition: _rope.h:1301

◆ _S_concat_char_iter()

template<class _CharT , class _Alloc >
__RopeRep__ * rope< _CharT, _Alloc >::_S_concat_char_iter ( _RopeRep __r,
const _CharT *  __iter,
size_t  __slen 
)
static

Definition at line 474 of file _rope.c.

475 {
476 _RopeRep* __result;
477 if (0 == __slen) {
478 _S_ref(__r);
479 return __r;
480 }
481 if (0 == __r)
482 return _S_RopeLeaf_from_unowned_char_ptr(__s, __slen, __r->get_allocator());
483 if (_RopeRep::_S_leaf == __r->_M_tag &&
484 __r->_M_size._M_data + __slen <= _S_copy_max) {
485 __result = _S_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
486 // _STLP_ASSERT(1 == __result->_M_ref_count)
487 return __result;
488 }
489 if (_RopeRep::_S_concat == __r->_M_tag &&
490 _RopeRep::_S_leaf == ((_RopeConcatenation*)__r)->_M_right->_M_tag) {
491 _RopeLeaf* __right = (_RopeLeaf* )(((_RopeConcatenation* )__r)->_M_right);
492 if (__right->_M_size._M_data + __slen <= _S_copy_max) {
493 _RopeRep* __left = ((_RopeConcatenation*)__r)->_M_left;
494 _RopeRep* __nright = _S_leaf_concat_char_iter((_RopeLeaf*)__right, __s, __slen);
495 __left->_M_ref_nonnil();
496 _STLP_TRY {
497 __result = _S_tree_concat(__left, __nright);
498 }
499 _STLP_UNWIND(_S_unref(__left); _S_unref(__nright))
500 // _STLP_ASSERT(1 == __result->_M_ref_count)
501 return __result;
502 }
503 }
504 _RopeRep* __nright =
505 _S_RopeLeaf_from_unowned_char_ptr(__s, __slen, __r->get_allocator());
506 _STLP_TRY {
507 __r->_M_ref_nonnil();
508 __result = _S_tree_concat(__r, __nright);
509 }
510 _STLP_UNWIND(_S_unref(__r); _S_unref(__nright))
511 // _STLP_ASSERT(1 == __result->_M_ref_count)
512 return __result;
513}
static _RopeRep * _S_tree_concat(_RopeRep *__left, _RopeRep *__right)
Definition: _rope.c:443
static _RopeLeaf * _S_leaf_concat_char_iter(_RopeLeaf *__r, const _CharT *__iter, size_t __slen)
Definition: _rope.c:377

Referenced by rope< _CharT, _Alloc >::insert().

◆ _S_concat_rep()

template<class _CharT , class _Alloc >
__RopeRep__ * rope< _CharT, _Alloc >::_S_concat_rep ( _RopeRep __left,
_RopeRep __right 
)
static

Definition at line 577 of file _rope.c.

577 {
578 if (0 == __left) {
579 _S_ref(__right);
580 return __right;
581 }
582 if (0 == __right) {
583 __left->_M_ref_nonnil();
584 return __left;
585 }
586 if (_RopeRep::_S_leaf == __right->_M_tag) {
587 if (_RopeRep::_S_leaf == __left->_M_tag) {
588 if (__right->_M_size._M_data + __left->_M_size._M_data <= _S_copy_max) {
590 __STATIC_CAST(_RopeLeaf*, __right)->_M_data,
591 __right->_M_size._M_data);
592 }
593 } else if (_RopeRep::_S_concat == __left->_M_tag &&
594 _RopeRep::_S_leaf == __STATIC_CAST(_RopeConcatenation*, __left)->_M_right->_M_tag) {
595 _RopeLeaf* __leftright =
597 if (__leftright->_M_size._M_data + __right->_M_size._M_data <= _S_copy_max) {
598 _RopeRep* __leftleft = __STATIC_CAST(_RopeConcatenation*, __left)->_M_left;
599 _RopeRep* __rest = _S_leaf_concat_char_iter(__leftright,
600 __STATIC_CAST(_RopeLeaf*, __right)->_M_data,
601 __right->_M_size._M_data);
602 __leftleft->_M_ref_nonnil();
603 _STLP_TRY {
604 return _S_tree_concat(__leftleft, __rest);
605 }
606 _STLP_UNWIND(_S_unref(__leftleft); _S_unref(__rest))
607 }
608 }
609 }
610 __left->_M_ref_nonnil();
611 __right->_M_ref_nonnil();
612 _STLP_TRY {
613 return _S_tree_concat(__left, __right);
614 }
615 _STLP_UNWIND(_S_unref(__left); _S_unref(__right))
617}
#define _STLP_RET_AFTER_THROW(data)
Definition: features.h:829

Referenced by rope< _CharT, _Alloc >::_S_concat_and_set_balanced(), rope< _CharT, _Alloc >::append(), rope< _CharT, _Alloc >::insert(), rope< _CharT, _Alloc >::push_front(), and rope< _CharT, _Alloc >::replace().

◆ _S_destr_concat_char_iter()

template<class _CharT , class _Alloc >
__RopeRep__ * rope< _CharT, _Alloc >::_S_destr_concat_char_iter ( _RopeRep __r,
const _CharT *  __iter,
size_t  __slen 
)
static

Definition at line 517 of file _rope.c.

518 {
519 _RopeRep* __result;
520 if (0 == __r)
521 return _S_RopeLeaf_from_unowned_char_ptr(__s, __slen,
522 __r->get_allocator());
523 // size_t __count = __r->_M_ref_count;
524 size_t __orig_size = __r->_M_size._M_data;
525 // _STLP_ASSERT(__count >= 1)
526 if ( /* __count > 1 */ __r->_M_incr() > 2 ) {
527 __r->_M_decr();
528 return _S_concat_char_iter(__r, __s, __slen);
529 }
530 if (0 == __slen) {
531 return __r;
532 }
533 __r->_M_decr();
534 if (__orig_size + __slen <= _S_copy_max && _RopeRep::_S_leaf == __r->_M_tag) {
535 return _S_destr_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
536 }
537 if (_RopeRep::_S_concat == __r->_M_tag) {
539 if (_RopeRep::_S_leaf == __right->_M_tag &&
540 __right->_M_size._M_data + __slen <= _S_copy_max) {
541 _RopeRep* __new_right = _S_destr_leaf_concat_char_iter(__right, __s, __slen);
542 if (__right == __new_right) {
543 // _STLP_ASSERT(__new_right->_M_ref_count == 2)
544 // __new_right->_M_ref_count = 1;
545 __new_right->_M_decr();
546 } else {
547 // _STLP_ASSERT(__new_right->_M_ref_count >= 1)
548 __right->_M_unref_nonnil();
549 }
550 // _STLP_ASSERT(__r->_M_ref_count == 1)
551 // __r->_M_ref_count = 2; // One more than before.
552 __r->_M_incr();
553 __STATIC_CAST(_RopeConcatenation*, __r)->_M_right = __new_right;
554 // E.Musser : moved below
555 // __r->_M_size._M_data = __orig_size + __slen;
556 if (0 != __r->_M_c_string) {
557 __r->_M_free_c_string();
558 __r->_M_c_string = 0;
559 }
560 __r->_M_size._M_data = __orig_size + __slen;
561 return __r;
562 }
563 }
564 _RopeRep* __right =
565 _S_RopeLeaf_from_unowned_char_ptr(__s, __slen, __r->get_allocator());
566 __r->_M_ref_nonnil();
567 _STLP_TRY {
568 __result = _S_tree_concat(__r, __right);
569 }
570 _STLP_UNWIND(_S_unref(__r); _S_unref(__right))
571 // _STLP_ASSERT(1 == __result->_M_ref_count)
572 return __result;
573}
static _RopeLeaf * _S_destr_leaf_concat_char_iter(_RopeLeaf *__r, const _CharT *__iter, size_t __slen)
Definition: _rope.c:413
static _RopeRep * _S_concat_char_iter(_RopeRep *__r, const _CharT *__iter, size_t __slen)
Definition: _rope.c:474

Referenced by rope< _CharT, _Alloc >::append(), and rope< _CharT, _Alloc >::push_back().

◆ _S_destr_leaf_concat_char_iter()

template<class _CharT , class _Alloc >
__RopeLeaf__ * rope< _CharT, _Alloc >::_S_destr_leaf_concat_char_iter ( _RopeLeaf __r,
const _CharT *  __iter,
size_t  __slen 
)
staticprotected

Definition at line 413 of file _rope.c.

413 {
414 //_STLP_ASSERT(__r->_M_ref_count >= 1)
415 if ( /* __r->_M_ref_count > 1 */ __r->_M_incr() > 2 ) { // - ptr
416 __r->_M_decr(); // - ptr
417 return _S_leaf_concat_char_iter(__r, __iter, __len);
418 }
419 __r->_M_decr(); // - ptr, __r->_M_ref_count == 1 or 0
420 size_t __old_len = __r->_M_size._M_data;
421 if (_S_rounded_up_size(__old_len) == _S_rounded_up_size(__old_len + __len)) {
422 // The space has been partially initialized for the standard
423 // character types. But that doesn't matter for those types.
424 _STLP_PRIV __ucopy_n(__iter, __len, __r->_M_data + __old_len);
425 _Terminate_RopeLeaf(__r, __old_len + __len, _IsBasicCharType());
426 __r->_M_size._M_data = __old_len + __len;
427 // _STLP_ASSERT(__r->_M_ref_count == 1)
428 // __r->_M_ref_count = 2;
429 __r->_M_incr(); // i.e. __r->_M_ref_count = 2
430 return __r;
431 } else {
432 _RopeLeaf* __result = _S_leaf_concat_char_iter(__r, __iter, __len);
433 //_STLP_ASSERT(__result->_M_ref_count == 1)
434 return __result;
435 }
436}
void _Terminate_RopeLeaf(_Rope_RopeLeaf< _CharT, _Alloc > *__r, size_t __size, const __true_type &)
Definition: _rope.c:395
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP pair< _InputIter, _ForwardIter > __ucopy_n(_InputIter __first, _Size __count, _ForwardIter __result, const input_iterator_tag &)
_RopeRep::_IsBasicCharType _IsBasicCharType
Definition: _rope.h:1120

◆ _S_fetch()

template<class _CharT , class _Alloc >
_CharT rope< _CharT, _Alloc >::_S_fetch ( _RopeRep __r,
size_type  __pos 
)
static

Definition at line 1123 of file _rope.c.

1124{
1125 _CharT* __cstr = __r->_M_c_string;
1126
1127 _STLP_ASSERT(__i < __r->_M_size._M_data)
1128 if (0 != __cstr) return __cstr[__i];
1129 for(;;) {
1130 switch(__r->_M_tag) {
1132 {
1134 _RopeRep* __left = __c->_M_left;
1135 size_t __left_len = __left->_M_size._M_data;
1136
1137 if (__i >= __left_len) {
1138 __i -= __left_len;
1139 __r = __c->_M_right;
1140 } else {
1141 __r = __left;
1142 }
1143 }
1144 break;
1145 case _RopeRep::_S_leaf:
1146 {
1147 _RopeLeaf* __l = (_RopeLeaf*)__r;
1148 return __l->_M_data[__i];
1149 }
1152 {
1153 _RopeFunction* __f = (_RopeFunction*)__r;
1154 _CharT __result;
1155
1156 (*(__f->_M_fn))(__i, 1, &__result);
1157 return __result;
1158 }
1159 }
1160 }
1161#if defined(_STLP_NEED_UNREACHABLE_RETURN)
1162 return 0;
1163#endif
1164}
_Rope_RopeFunction< _CharT, _Alloc > _RopeFunction
Definition: _rope.h:1136
@ _S_function
Definition: _rope.h:345
@ _S_substringfn
Definition: _rope.h:345

Referenced by rope< _CharT, _Alloc >::back(), rope< _CharT, _Alloc >::front(), _Rope_const_iterator< _CharT, _Alloc >::operator[](), and rope< _CharT, _Alloc >::operator[]().

◆ _S_fetch_ptr()

template<class _CharT , class _Alloc >
_CharT * rope< _CharT, _Alloc >::_S_fetch_ptr ( _RopeRep __r,
size_type  __pos 
)
static

Definition at line 1170 of file _rope.c.

1171{
1173 size_t __csptr = 0;
1174
1175 for(;;) {
1176 // if (__r->_M_ref_count > 1) return 0;
1177 if ( __r->_M_incr() > 2 ) {
1178 __r->_M_decr();
1179 return 0;
1180 }
1181 switch(__r->_M_tag) {
1183 {
1185 _RopeRep* __left = __c->_M_left;
1186 size_t __left_len = __left->_M_size._M_data;
1187
1188 if (__c->_M_c_string != 0) __clrstack[__csptr++] = __c;
1189 if (__i >= __left_len) {
1190 __i -= __left_len;
1191 __r = __c->_M_right;
1192 } else {
1193 __r = __left;
1194 }
1195 }
1196 break;
1197 case _RopeRep::_S_leaf:
1198 {
1199 _RopeLeaf* __l = (_RopeLeaf*)__r;
1200 if (__l->_M_c_string != __l->_M_data && __l->_M_c_string != 0)
1201 __clrstack[__csptr++] = __l;
1202 while (__csptr > 0) {
1203 -- __csptr;
1204 _RopeRep* __d = __clrstack[__csptr];
1205 __d->_M_free_c_string();
1206 __d->_M_c_string = 0;
1207 }
1208 return __l->_M_data + __i;
1209 }
1212 return 0;
1213 }
1214 }
1215#if defined(_STLP_NEED_UNREACHABLE_RETURN)
1216 return 0;
1217#endif
1218
1219}

◆ _S_flatten() [1/2]

template<class _CharT , class _Alloc >
_CharT * rope< _CharT, _Alloc >::_S_flatten ( _RopeRep __r,
_CharT *  __buffer 
)
staticprivate

Definition at line 918 of file _rope.c.

918 {
919 if (0 == __r) return __buffer;
920 switch(__r->_M_tag) {
922 {
924 _RopeRep* __left = __c->_M_left;
925 _RopeRep* __right = __c->_M_right;
926 _CharT* __rest = _S_flatten(__left, __buffer);
927 return _S_flatten(__right, __rest);
928 }
930 {
931 _RopeLeaf* __l = __STATIC_CAST(_RopeLeaf*, __r);
932 return _STLP_PRIV __ucopy_n(__l->_M_data, __l->_M_size._M_data, __buffer).second;
933 }
936 // We dont yet do anything with substring nodes.
937 // This needs to be fixed before ropefiles will work well.
938 {
940 (*(__f->_M_fn))(0, __f->_M_size._M_data, __buffer);
941 return __buffer + __f->_M_size._M_data;
942 }
943 default:
944 _STLP_ASSERT(false)
945 /*NOTREACHED*/
946 return 0;
947 }
948}
return
Definition: dirsup.c:529
static _CharT * _S_flatten(_RopeRep *__r, _CharT *__buffer)
Definition: _rope.c:918

Referenced by rope< _CharT, _Alloc >::copy().

◆ _S_flatten() [2/2]

template<class _CharT , class _Alloc >
_CharT * rope< _CharT, _Alloc >::_S_flatten ( _RopeRep __r,
size_t  __start,
size_t  __len,
_CharT *  __buffer 
)
staticprivate

Definition at line 897 of file _rope.c.

899 {
901 _S_apply_to_pieces(__c, __r, __start, __start + __len);
902 return(__buffer + __len);
903}
bool _S_apply_to_pieces(_CharConsumer &__c, _Rope_RopeRep< _CharT, _Alloc > *__r, size_t __begin, size_t __end)
Definition: _rope.c:785

◆ _S_is_almost_balanced()

template<class _CharT , class _Alloc >
static bool rope< _CharT, _Alloc >::_S_is_almost_balanced ( _RopeRep __r)
inlinestaticprotected

Definition at line 1304 of file _rope.h.

1304 {
1305 return (__r->_M_depth == 0 ||
1306 __r->_M_size._M_data >= _S_min_len[__r->_M_depth - 1]);
1307 }

◆ _S_is_balanced()

template<class _CharT , class _Alloc >
static bool rope< _CharT, _Alloc >::_S_is_balanced ( _RopeRep __r)
inlinestaticprotected

Definition at line 1301 of file _rope.h.

1302 { return (__r->_M_size._M_data >= _S_min_len[__r->_M_depth]); }

Referenced by rope< _CharT, _Alloc >::_S_concat_and_set_balanced().

◆ _S_is_roughly_balanced()

template<class _CharT , class _Alloc >
static bool rope< _CharT, _Alloc >::_S_is_roughly_balanced ( _RopeRep __r)
inlinestaticprotected

Definition at line 1309 of file _rope.h.

1309 {
1310 return (__r->_M_depth <= 1 ||
1311 __r->_M_size._M_data >= _S_min_len[__r->_M_depth - 2]);
1312 }

◆ _S_leaf_concat_char_iter()

template<class _CharT , class _Alloc >
__RopeLeaf__ * rope< _CharT, _Alloc >::_S_leaf_concat_char_iter ( _RopeLeaf __r,
const _CharT *  __iter,
size_t  __slen 
)
staticprotected

Definition at line 377 of file _rope.c.

378 {
379 size_t __old_len = __r->_M_size._M_data;
380 _CharT* __new_data = __r->_M_size.allocate(_S_rounded_up_size(__old_len + __len));
381 _RopeLeaf* __result;
382
383 _STLP_PRIV __ucopy_n(__r->_M_data, __old_len, __new_data);
384 _STLP_PRIV __ucopy_n(__iter, __len, __new_data + __old_len);
385 _S_construct_null(__new_data + __old_len + __len);
386 _STLP_TRY {
387 __result = _S_new_RopeLeaf(__new_data, __old_len + __len, __r->get_allocator());
388 }
389 _STLP_UNWIND(_RopeRep::_S_free_string(__new_data, __old_len + __len,
390 __r->get_allocator()))
391 return __result;
392}

◆ _S_new_RopeConcatenation()

template<class _CharT , class _Alloc >
static _RopeConcatenation * rope< _CharT, _Alloc >::_S_new_RopeConcatenation ( _RopeRep __left,
_RopeRep __right,
allocator_type  __a 
)
inlinestaticprotected

Definition at line 1207 of file _rope.h.

1208 {
1210 _RopeConcatenation).allocate(1);
1211 return new(__space) _RopeConcatenation(__left, __right, __a);
1212 }
#define _STLP_CREATE_ALLOCATOR(__atype, __a, _Tp)
Definition: _rope.h:81
_Alloc allocator_type
Definition: _rope.h:1124

◆ _S_new_RopeFunction()

template<class _CharT , class _Alloc >
static _RopeFunction * rope< _CharT, _Alloc >::_S_new_RopeFunction ( char_producer< _CharT > *  __f,
size_t  _p_size,
bool  __d,
allocator_type  __a 
)
inlinestaticprotected

Definition at line 1214 of file _rope.h.

1215 {
1217 _RopeFunction).allocate(1);
1218 return new(__space) _RopeFunction(__f, _p_size, __d, __a);
1219 }

Referenced by rope< _CharT, _Alloc >::rope().

◆ _S_new_RopeLeaf()

template<class _CharT , class _Alloc >
static _RopeLeaf * rope< _CharT, _Alloc >::_S_new_RopeLeaf ( _CharT *  __s,
size_t  _p_size,
allocator_type  __a 
)
inlinestaticprotected

Definition at line 1195 of file _rope.h.

1196 {
1198 _RopeLeaf).allocate(1);
1199 _STLP_TRY {
1200 new(__space) _RopeLeaf(__s, _p_size, __a);
1201 }
1203 _RopeLeaf).deallocate(__space, 1))
1204 return __space;
1205 }

Referenced by rope< _CharT, _Alloc >::_S_RopeLeaf_from_unowned_char_ptr(), and rope< _CharT, _Alloc >::rope().

◆ _S_new_RopeSubstring()

template<class _CharT , class _Alloc >
static _RopeSubstring * rope< _CharT, _Alloc >::_S_new_RopeSubstring ( _Rope_RopeRep< _CharT, _Alloc > *  __b,
size_t  __s,
size_t  __l,
allocator_type  __a 
)
inlinestaticprotected

Definition at line 1221 of file _rope.h.

1222 {
1224 _RopeSubstring).allocate(1);
1225 return new(__space) _RopeSubstring(__b, __s, __l, __a);
1226 }
_Rope_RopeSubstring< _CharT, _Alloc > _RopeSubstring
Definition: _rope.h:1137

◆ _S_ref()

template<class _CharT , class _Alloc >
static void rope< _CharT, _Alloc >::_S_ref ( _RopeRep __t)
inlinestatic

Definition at line 1153 of file _rope.h.

1153 {
1154 _RopeRep::_S_ref(__t);
1155 }
static void _S_ref(_Self *__t)
Definition: _rope.h:442

Referenced by rope< _CharT, _Alloc >::operator=(), rope< _CharT, _Alloc >::replace(), and rope< _CharT, _Alloc >::rope().

◆ _S_RopeLeaf_from_unowned_char_ptr()

template<class _CharT , class _Alloc >
static _RopeLeaf * rope< _CharT, _Alloc >::_S_RopeLeaf_from_unowned_char_ptr ( const _CharT *  __s,
size_t  _p_size,
allocator_type  __a 
)
inlinestaticprotected

Definition at line 1229 of file _rope.h.

1230 {
1231 if (0 == _p_size) return 0;
1232
1233 _CharT* __buf = _STLP_CREATE_ALLOCATOR(allocator_type,__a, _CharT).allocate(_S_rounded_up_size(_p_size));
1234
1235 _STLP_PRIV __ucopy_n(__s, _p_size, __buf);
1236 _S_construct_null(__buf + _p_size);
1237
1238 _STLP_TRY {
1239 return _S_new_RopeLeaf(__buf, _p_size, __a);
1240 }
1241 _STLP_UNWIND(_RopeRep::_S_free_string(__buf, _p_size, __a))
1243 }

Referenced by rope< _CharT, _Alloc >::push_front().

◆ _S_rounded_up_size()

template<class _CharT , class _Alloc >
static size_t rope< _CharT, _Alloc >::_S_rounded_up_size ( size_t  __n)
inlinestaticprotected

Definition at line 1190 of file _rope.h.

static size_t _S_rounded_up_size(size_t __n)
Definition: _rope.h:407

Referenced by rope< _CharT, _Alloc >::_S_RopeLeaf_from_unowned_char_ptr(), and rope< _CharT, _Alloc >::rope().

◆ _S_substring()

template<class _CharT , class _Alloc >
__RopeRep__ * rope< _CharT, _Alloc >::_S_substring ( _RopeRep __base,
size_t  __start,
size_t  __endp1 
)
static

Definition at line 621 of file _rope.c.

622 {
623 if (0 == __base) return 0;
624 size_t __len = __base->_M_size._M_data;
625 size_t __adj_endp1;
626 const size_t __lazy_threshold = 128;
627
628 if (__endp1 >= __len) {
629 if (0 == __start) {
630 __base->_M_ref_nonnil();
631 return __base;
632 } else {
633 __adj_endp1 = __len;
634 }
635 } else {
636 __adj_endp1 = __endp1;
637 }
638 switch(__base->_M_tag) {
640 {
642 _RopeRep* __left = __c->_M_left;
643 _RopeRep* __right = __c->_M_right;
644 size_t __left_len = __left->_M_size._M_data;
645 _RopeRep* __result;
646
647 if (__adj_endp1 <= __left_len) {
648 return _S_substring(__left, __start, __endp1);
649 } else if (__start >= __left_len) {
650 return _S_substring(__right, __start - __left_len,
651 __adj_endp1 - __left_len);
652 }
653 _Self_destruct_ptr __left_result(_S_substring(__left, __start, __left_len));
654 _Self_destruct_ptr __right_result(_S_substring(__right, 0, __endp1 - __left_len));
655 _STLP_MPWFIX_TRY //*TY 06/01/2000 - mpw forgets to call dtor on __left_result and __right_result without this try block
656 __result = _S_concat_rep(__left_result, __right_result);
657 // _STLP_ASSERT(1 == __result->_M_ref_count)
658 return __result;
659 _STLP_MPWFIX_CATCH //*TY 06/01/2000 -
660 }
662 {
663 _RopeLeaf* __l = __STATIC_CAST(_RopeLeaf*, __base);
664 _RopeLeaf* __result;
665 size_t __result_len;
666 if (__start >= __adj_endp1) return 0;
667 __result_len = __adj_endp1 - __start;
668 if (__result_len > __lazy_threshold) goto lazy;
669 const _CharT* __section = __l->_M_data + __start;
670 // We should sometimes create substring node instead.
671 __result = _S_RopeLeaf_from_unowned_char_ptr(__section, __result_len,
672 __base->get_allocator());
673 return __result;
674 }
676 // Avoid introducing multiple layers of substring nodes.
677 {
679 size_t __result_len;
680 if (__start >= __adj_endp1) return 0;
681 __result_len = __adj_endp1 - __start;
682 if (__result_len > __lazy_threshold) {
683 _RopeSubstring* __result = _S_new_RopeSubstring(__old->_M_base,
684 __start + __old->_M_start,
685 __adj_endp1 - __start,
686 __base->get_allocator());
687 return __result;
688 } // *** else fall through: ***
689 }
691 {
693 if (__start >= __adj_endp1) return 0;
694 size_t __result_len = __adj_endp1 - __start;
695
696 if (__result_len > __lazy_threshold) goto lazy;
697 _CharT* __section = __base->_M_size.allocate(_S_rounded_up_size(__result_len));
698 _STLP_TRY {
699 (*(__f->_M_fn))(__start, __result_len, __section);
700 }
702 __result_len, __base->get_allocator()))
703 _S_construct_null(__section + __result_len);
704 return _S_new_RopeLeaf(__section, __result_len,
705 __base->get_allocator());
706 }
707 }
708 /*NOTREACHED*/
710 lazy:
711 {
712 // Create substring node.
713 return _S_new_RopeSubstring(__base, __start, __adj_endp1 - __start,
714 __base->get_allocator());
715 }
716}
#define _STLP_MPWFIX_CATCH
Definition: _apple.h:111
#define _STLP_MPWFIX_TRY
Definition: _apple.h:110
allocator_type get_allocator() const
Definition: _rope.h:1131
static _RopeSubstring * _S_new_RopeSubstring(_Rope_RopeRep< _CharT, _Alloc > *__b, size_t __s, size_t __l, allocator_type __a)
Definition: _rope.h:1221
#define false
Definition: stdbool.h:37

Referenced by rope< _CharT, _Alloc >::append(), rope< _CharT, _Alloc >::insert(), rope< _CharT, _Alloc >::pop_back(), rope< _CharT, _Alloc >::pop_front(), rope< _CharT, _Alloc >::replace(), and rope< _CharT, _Alloc >::substr().

◆ _S_tree_concat()

template<class _CharT , class _Alloc >
__RopeRep__ * rope< _CharT, _Alloc >::_S_tree_concat ( _RopeRep __left,
_RopeRep __right 
)
staticprotected

Definition at line 443 of file _rope.c.

443 {
444 _RopeConcatenation* __result =
445 _S_new_RopeConcatenation(__left, __right, __left->get_allocator());
446 size_t __depth = __result->_M_depth;
447
448 _STLP_ASSERT(__left->get_allocator() == __right->get_allocator())
449 if (__depth > 20 && (__result->_M_size._M_data < 1000 ||
450 __depth > _RopeRep::_S_max_rope_depth)) {
451 _RopeRep* __balanced;
452
453 _STLP_TRY {
454 __balanced = _S_balance(__result);
455 // _STLP_ASSERT(__result == __balanced ||
456 // 1 == __result->_M_ref_count &&
457 // 1 == __balanced->_M_ref_count)
458 __result->_M_unref_nonnil();
459 }
461 _RopeConcatenation).deallocate(__result,1)))
462 // In case of exception, we need to deallocate
463 // otherwise dangling result node. But caller
464 // still owns its children. Thus unref is
465 // inappropriate.
466 return __balanced;
467 } else {
468 return __result;
469 }
470}
static _RopeRep * _S_balance(_RopeRep *__r)
Definition: _rope.c:1026
static _RopeConcatenation * _S_new_RopeConcatenation(_RopeRep *__left, _RopeRep *__right, allocator_type __a)
Definition: _rope.h:1207
else
Definition: tritemp.h:161

◆ _S_unref()

◆ append() [1/8]

template<class _CharT , class _Alloc >
_Self & rope< _CharT, _Alloc >::append ( )
inline

Definition at line 1688 of file _rope.h.

1688{ return append(_CharT()); } // XXX why?
_Self & append()
Definition: _rope.h:1688

Referenced by rope< _CharT, _Alloc >::append().

◆ append() [2/8]

template<class _CharT , class _Alloc >
_Self & rope< _CharT, _Alloc >::append ( _CharT  __c)
inline

Definition at line 1683 of file _rope.h.

1683 {
1685 return *this;
1686 }
static _RopeRep * _S_destr_concat_char_iter(_RopeRep *__r, const _CharT *__iter, size_t __slen)
Definition: _rope.c:517
void _M_reset(_RopeRep *__r)
Definition: _rope.h:1346

◆ append() [3/8]

template<class _CharT , class _Alloc >
_Self & rope< _CharT, _Alloc >::append ( const _CharT *  __c_string)
inline

Definition at line 1664 of file _rope.h.

1664 {
1665 size_t __len = _S_char_ptr_len(__c_string);
1666 append(__c_string, __len);
1667 return *this;
1668 }

◆ append() [4/8]

template<class _CharT , class _Alloc >
_Self & rope< _CharT, _Alloc >::append ( const _CharT *  __iter,
size_t  __n 
)
inline

Definition at line 1659 of file _rope.h.

1659 {
1661 return *this;
1662 }

Referenced by operator+=().

◆ append() [5/8]

template<class _CharT , class _Alloc >
_Self & rope< _CharT, _Alloc >::append ( const _CharT *  __s,
const _CharT *  __e 
)
inline

Definition at line 1670 of file _rope.h.

1670 {
1671 _M_reset(_S_destr_concat_char_iter(_M_tree_ptr._M_data, __s, __e - __s));
1672 return *this;
1673 }

◆ append() [6/8]

template<class _CharT , class _Alloc >
_Self & rope< _CharT, _Alloc >::append ( const _Self __y)
inline

Definition at line 1690 of file _rope.h.

1690 {
1691 _STLP_ASSERT(__y.get_allocator() == get_allocator())
1692 _M_reset(_S_concat_rep(_M_tree_ptr._M_data, __y._M_tree_ptr._M_data));
1693 return *this;
1694 }

◆ append() [7/8]

template<class _CharT , class _Alloc >
_Self & rope< _CharT, _Alloc >::append ( const_iterator  __s,
const_iterator  __e 
)
inline

Definition at line 1675 of file _rope.h.

1675 {
1676 _STLP_ASSERT(__s._M_root == __e._M_root)
1677 _STLP_ASSERT(get_allocator() == __s._M_root->get_allocator())
1678 _Self_destruct_ptr __appendee(_S_substring(__s._M_root, __s._M_current_pos, __e._M_current_pos));
1679 _M_reset(_S_concat_rep(_M_tree_ptr._M_data, (_RopeRep*)__appendee));
1680 return *this;
1681 }

◆ append() [8/8]

template<class _CharT , class _Alloc >
_Self & rope< _CharT, _Alloc >::append ( size_t  __n,
_CharT  __c 
)
inline

Definition at line 1696 of file _rope.h.

1696 {
1698 return append(__last);
1699 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68

◆ apply_to_pieces()

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::apply_to_pieces ( size_t  __begin,
size_t  __end,
_CharConsumer __c 
) const
inline

Definition at line 1184 of file _rope.h.

1186 { _S_apply_to_pieces(__c, _M_tree_ptr._M_data, __begin, __end); }

Referenced by _S_io_get().

◆ at()

template<class _CharT , class _Alloc >
_CharT rope< _CharT, _Alloc >::at ( size_type  __pos) const
inline

Definition at line 1601 of file _rope.h.

1601 {
1602 if (__pos >= size()) _M_throw_out_of_range();
1603 return (*this)[__pos];
1604 }
void _STLP_FUNCTION_THROWS _M_throw_out_of_range() const
Definition: _rope.c:369
size_type size() const
Definition: _rope.h:1623

◆ back()

template<class _CharT , class _Alloc >
_CharT rope< _CharT, _Alloc >::back ( ) const
inline

Definition at line 1513 of file _rope.h.

1513 {
1514 return _S_fetch(_M_tree_ptr._M_data, _M_tree_ptr._M_data->_M_size._M_data - 1);
1515 }
static _CharT _S_fetch(_RopeRep *__r, size_type __pos)
Definition: _rope.c:1123

◆ balance()

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::balance ( )
inline

Definition at line 1539 of file _rope.h.

1539 {
1540 _RopeRep* __old = _M_tree_ptr._M_data;
1541 _M_tree_ptr._M_data = _S_balance(_M_tree_ptr._M_data);
1542 _S_unref(__old);
1543 }

◆ begin() [1/2]

template<class _CharT , class _Alloc >
const_iterator rope< _CharT, _Alloc >::begin ( )
inline

Definition at line 2053 of file _rope.h.

2053{ return const_begin(); }
const_iterator const_begin() const
Definition: _rope.h:1611

◆ begin() [2/2]

template<class _CharT , class _Alloc >
const_iterator rope< _CharT, _Alloc >::begin ( ) const
inline

Definition at line 1606 of file _rope.h.

1606 {
1607 return(const_iterator(_M_tree_ptr._M_data, 0));
1608 }

Referenced by rope< _CharT, _Alloc >::const_rend(), rope< _CharT, _Alloc >::find(), and rope< _CharT, _Alloc >::rend().

◆ c_str()

template<class _CharT , class _Alloc >
const _CharT * rope< _CharT, _Alloc >::c_str

Definition at line 1310 of file _rope.c.

1310 {
1311 if (0 == _M_tree_ptr._M_data) {
1312 // Possibly redundant, but probably fast.
1314 return _S_empty_c_str;
1315 }
1316 _CharT* __old_c_string = _M_tree_ptr._M_data->_M_c_string;
1317 if (0 != __old_c_string) return __old_c_string;
1318 size_t __s = size();
1319 _CharT* __result = _STLP_CREATE_ALLOCATOR(allocator_type,(const allocator_type&)_M_tree_ptr, _CharT).allocate(__s + 1);
1320 _S_flatten(_M_tree_ptr._M_data, __result);
1321 _S_construct_null(__result + __s);
1322 __old_c_string = __STATIC_CAST(_CharT*, _Atomic_swap_ptr(__REINTERPRET_CAST(void* _STLP_VOLATILE*, &(_M_tree_ptr._M_data->_M_c_string)),
1323 __result));
1324 if (0 != __old_c_string) {
1325 // It must have been added in the interim. Hence it had to have been
1326 // separately allocated. Deallocate the old copy, since we just
1327 // replaced it.
1328 _STLP_STD::_Destroy_Range(__old_c_string, __old_c_string + __s + 1);
1329 _STLP_CREATE_ALLOCATOR(allocator_type,(const allocator_type&)_M_tree_ptr, _CharT).deallocate(__old_c_string, __s + 1);
1330 }
1331 return __result;
1332}
#define _STLP_DEFAULT_CONSTRUCTED(_TTp)
Definition: _construct.h:265
void *_STLP_CALL _Atomic_swap_ptr(void *_STLP_VOLATILE *__p, void *__q)
Definition: _threads.h:628
static _CharT _S_empty_c_str[1]
Definition: _rope.h:1113
#define __REINTERPRET_CAST(__x, __y)
Definition: features.h:586
#define _STLP_VOLATILE
Definition: features.h:277

Referenced by RopeTest::bug_report().

◆ clear()

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::clear ( )
inline

Definition at line 1498 of file _rope.h.

1498 {
1499 _S_unref(_M_tree_ptr._M_data);
1500 _M_tree_ptr._M_data = 0;
1501 }

◆ compare()

template<class _CharT , class _Alloc >
int rope< _CharT, _Alloc >::compare ( const _Self __y) const
inline

Definition at line 1359 of file _rope.h.

1359 {
1360 return _S_compare(_M_tree_ptr._M_data, __y._M_tree_ptr._M_data);
1361 }
static int _S_compare(const _RopeRep *__x, const _RopeRep *__y)
Definition: _rope.c:1227

Referenced by operator<(), and operator==().

◆ const_begin()

template<class _CharT , class _Alloc >
const_iterator rope< _CharT, _Alloc >::const_begin ( ) const
inline

Definition at line 1611 of file _rope.h.

1611 {
1612 return(const_iterator(_M_tree_ptr._M_data, 0));
1613 }

Referenced by rope< _CharT, _Alloc >::begin(), and rope< _CharT, _Alloc >::find().

◆ const_end()

template<class _CharT , class _Alloc >
const_iterator rope< _CharT, _Alloc >::const_end ( ) const
inline

Definition at line 1619 of file _rope.h.

1619 {
1620 return(const_iterator(_M_tree_ptr._M_data, size()));
1621 }
GLsizeiptr size
Definition: glext.h:5919

Referenced by rope< _CharT, _Alloc >::end(), and rope< _CharT, _Alloc >::find().

◆ const_rbegin()

template<class _CharT , class _Alloc >
const_reverse_iterator rope< _CharT, _Alloc >::const_rbegin ( ) const
inline

Definition at line 1642 of file _rope.h.

1642 {
1643 return const_reverse_iterator(end());
1644 }
const_iterator end() const
Definition: _rope.h:1615

Referenced by rope< _CharT, _Alloc >::rbegin().

◆ const_rend()

template<class _CharT , class _Alloc >
const_reverse_iterator rope< _CharT, _Alloc >::const_rend ( ) const
inline

Definition at line 1650 of file _rope.h.

1650 {
1651 return const_reverse_iterator(begin());
1652 }
const_iterator begin() const
Definition: _rope.h:1606

Referenced by rope< _CharT, _Alloc >::rend().

◆ copy() [1/2]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::copy ( _CharT *  __buffer) const
inline

Definition at line 1545 of file _rope.h.

1545 {
1546 _STLP_STD::_Destroy_Range(__buffer, __buffer + size());
1547 _S_flatten(_M_tree_ptr._M_data, __buffer);
1548 }

◆ copy() [2/2]

template<class _CharT , class _Alloc >
size_type rope< _CharT, _Alloc >::copy ( size_type  __pos,
size_type  __n,
_CharT *  __buffer 
) const
inline

Definition at line 1557 of file _rope.h.

1557 {
1558 size_t _p_size = size();
1559 size_t __len = (__pos + __n > _p_size? _p_size - __pos : __n);
1560
1561 _STLP_STD::_Destroy_Range(__buffer, __buffer + __len);
1562 _S_flatten(_M_tree_ptr._M_data, __pos, __len, __buffer);
1563 return __len;
1564 }

◆ delete_c_str()

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::delete_c_str ( )
inline

Definition at line 1585 of file _rope.h.

1585 {
1586 if (0 == _M_tree_ptr._M_data) return;
1587 if (_RopeRep::_S_leaf == _M_tree_ptr._M_data->_M_tag &&
1588 ((_RopeLeaf*)_M_tree_ptr._M_data)->_M_data ==
1589 _M_tree_ptr._M_data->_M_c_string) {
1590 // Representation shared
1591 return;
1592 }
1593 _M_tree_ptr._M_data->_M_free_c_string();
1594 _M_tree_ptr._M_data->_M_c_string = 0;
1595 }

◆ empty()

template<class _CharT , class _Alloc >
bool rope< _CharT, _Alloc >::empty ( ) const
inline

Definition at line 1354 of file _rope.h.

1354{ return 0 == _M_tree_ptr._M_data; }

Referenced by _Rope_iterator< _CharT, _Alloc >::_Rope_iterator().

◆ end() [1/2]

template<class _CharT , class _Alloc >
const_iterator rope< _CharT, _Alloc >::end ( )
inline

Definition at line 2051 of file _rope.h.

2051{ return const_end(); }
const_iterator const_end() const
Definition: _rope.h:1619

◆ end() [2/2]

template<class _CharT , class _Alloc >
const_iterator rope< _CharT, _Alloc >::end ( ) const
inline

Definition at line 1615 of file _rope.h.

1615 {
1616 return(const_iterator(_M_tree_ptr._M_data, size()));
1617 }

Referenced by rope< _CharT, _Alloc >::const_rbegin(), rope< _CharT, _Alloc >::find(), and rope< _CharT, _Alloc >::rbegin().

◆ erase() [1/4]

template<class _CharT , class _Alloc >
iterator rope< _CharT, _Alloc >::erase ( const iterator __p)
inline

Definition at line 1935 of file _rope.h.

1935 {
1936 size_t __p_index = __p.index();
1937 erase(__p_index, 1);
1938 return iterator(this, __p_index);
1939 }
void erase(size_t __p, size_t __n)
Definition: _rope.h:1857
_Rope_iterator< _CharT, _Alloc > iterator
Definition: _rope.h:1095

◆ erase() [2/4]

template<class _CharT , class _Alloc >
iterator rope< _CharT, _Alloc >::erase ( const iterator __p,
const iterator __q 
)
inline

Definition at line 1930 of file _rope.h.

1930 {
1931 size_t __p_index = __p.index();
1932 erase(__p_index, __q.index() - __p_index);
1933 return iterator(this, __p_index);
1934 }

◆ erase() [3/4]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::erase ( size_t  __p)
inline

Definition at line 1863 of file _rope.h.

1863 {
1864 erase(__p, __p + 1);
1865 }

◆ erase() [4/4]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::erase ( size_t  __p,
size_t  __n 
)
inline

Definition at line 1857 of file _rope.h.

1857 {
1858 if (__p > size()) _M_throw_out_of_range();
1859 _M_reset(replace(_M_tree_ptr._M_data, __p, __p + __n, 0));
1860 }
static _RopeRep * replace(_RopeRep *__old, size_t __pos1, size_t __pos2, _RopeRep *__r)
Definition: _rope.h:1710

Referenced by rope< _CharT, _Alloc >::erase().

◆ find() [1/3]

template<class _CharT , class _Alloc >
size_t rope< _CharT, _Alloc >::find ( _CharT  __c,
size_type  __pos = 0 
) const

Definition at line 906 of file _rope.c.

906 {
908 _S_apply_to_pieces(__c, _M_tree_ptr._M_data, __start, size());
909 size_type __result_pos = __start + __c._M_count;
910#ifndef _STLP_OLD_ROPE_SEMANTICS
911 if (__result_pos == size()) __result_pos = npos;
912#endif
913 return __result_pos;
914}
static const size_t npos
Definition: _string_npos.h:26
size_t size_type
Definition: _rope.h:1092

◆ find() [2/3]

template<class _CharT , class _Alloc >
size_type rope< _CharT, _Alloc >::find ( const _CharT *  __s,
size_type  __pos = 0 
) const
inline

Definition at line 1985 of file _rope.h.

1985 {
1986 size_type __result_pos;
1987 const_iterator __result = _STLP_STD::search(const_begin() + (ptrdiff_t)__pos, const_end(),
1988 __s, __s + _S_char_ptr_len(__s));
1989 __result_pos = __result.index();
1990# ifndef _STLP_OLD_ROPE_SEMANTICS
1991 if (__result_pos == size()) __result_pos = npos;
1992# endif
1993 return __result_pos;
1994 }
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247

◆ find() [3/3]

template<class _CharT , class _Alloc >
size_type rope< _CharT, _Alloc >::find ( const _Self __s,
size_type  __pos = 0 
) const
inline

Definition at line 1968 of file _rope.h.

1968 {
1969 if (__pos >= size())
1970# ifndef _STLP_OLD_ROPE_SEMANTICS
1971 return npos;
1972# else
1973 return size();
1974# endif
1975
1976 size_type __result_pos;
1977 const_iterator __result = _STLP_STD::search(const_begin() + (ptrdiff_t)__pos, const_end(), __s.begin(), __s.end() );
1978 __result_pos = __result.index();
1979# ifndef _STLP_OLD_ROPE_SEMANTICS
1980 if (__result_pos == size()) __result_pos = npos;
1981# endif
1982 return __result_pos;
1983 }

◆ front()

template<class _CharT , class _Alloc >
_CharT rope< _CharT, _Alloc >::front ( ) const
inline

Definition at line 1535 of file _rope.h.

1535 {
1536 return _S_fetch(_M_tree_ptr._M_data, 0);
1537 }

◆ get_allocator()

template<class _CharT , class _Alloc >
allocator_type rope< _CharT, _Alloc >::get_allocator ( ) const
inline

◆ insert() [1/18]

template<class _CharT , class _Alloc >
iterator rope< _CharT, _Alloc >::insert ( const iterator __p)
inline

Definition at line 1874 of file _rope.h.

1875 { insert(__p.index()); return __p; }
static int insert
Definition: xmllint.c:138

◆ insert() [2/18]

template<class _CharT , class _Alloc >
iterator rope< _CharT, _Alloc >::insert ( const iterator __p,
_CharT  __c 
)
inline

Definition at line 1872 of file _rope.h.

1873 { insert(__p.index(), __c); return __p; }

◆ insert() [3/18]

template<class _CharT , class _Alloc >
iterator rope< _CharT, _Alloc >::insert ( const iterator __p,
const _CharT *  __i,
const _CharT *  __j 
)
inline

Definition at line 1880 of file _rope.h.

1882 { insert(__p.index(), __i, __j); return __p; }

◆ insert() [4/18]

template<class _CharT , class _Alloc >
iterator rope< _CharT, _Alloc >::insert ( const iterator __p,
const _CharT *  __i,
size_t  __n 
)
inline

Definition at line 1878 of file _rope.h.

1879 { insert(__p.index(), __i, __n); return __p; }

◆ insert() [5/18]

template<class _CharT , class _Alloc >
iterator rope< _CharT, _Alloc >::insert ( const iterator __p,
const _CharT *  c_string 
)
inline

Definition at line 1876 of file _rope.h.

1877 { insert(__p.index(), c_string); return __p; }

◆ insert() [6/18]

template<class _CharT , class _Alloc >
iterator rope< _CharT, _Alloc >::insert ( const iterator __p,
const _Self __r 
)
inline

Definition at line 1868 of file _rope.h.

1869 { insert(__p.index(), __r); return __p; }

◆ insert() [7/18]

template<class _CharT , class _Alloc >
iterator rope< _CharT, _Alloc >::insert ( const iterator __p,
const const_iterator __i,
const const_iterator __j 
)
inline

Definition at line 1883 of file _rope.h.

1885 { insert(__p.index(), __i, __j); return __p; }

◆ insert() [8/18]

template<class _CharT , class _Alloc >
iterator rope< _CharT, _Alloc >::insert ( const iterator __p,
const iterator __i,
const iterator __j 
)
inline

Definition at line 1886 of file _rope.h.

1888 { insert(__p.index(), __i, __j); return __p; }

◆ insert() [9/18]

template<class _CharT , class _Alloc >
iterator rope< _CharT, _Alloc >::insert ( const iterator __p,
size_t  __n,
_CharT  __c 
)
inline

Definition at line 1870 of file _rope.h.

1871 { insert(__p.index(), __n, __c); return __p; }

◆ insert() [10/18]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::insert ( size_t  __p)
inline

Definition at line 1761 of file _rope.h.

1761 {
1762 _CharT __c = _CharT();
1763 insert(__p, &__c, 1);
1764 }

◆ insert() [11/18]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::insert ( size_t  __p,
_CharT  __c 
)
inline

Definition at line 1757 of file _rope.h.

1757 {
1758 insert(__p, &__c, 1);
1759 }

◆ insert() [12/18]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::insert ( size_t  __p,
const _CharT *  __c_string 
)
inline

Definition at line 1753 of file _rope.h.

1753 {
1754 insert(__p, __c_string, _S_char_ptr_len(__c_string));
1755 }

◆ insert() [13/18]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::insert ( size_t  __p,
const _CharT *  __i,
const _CharT *  __j 
)
inline

Definition at line 1766 of file _rope.h.

1766 {
1767 _Self __r(__i, __j);
1768 insert(__p, __r);
1769 }
rope< _CharT, _Alloc > _Self
Definition: _rope.h:1088

◆ insert() [14/18]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::insert ( size_t  __p,
const _CharT *  __i,
size_t  __n 
)
inline

Definition at line 1741 of file _rope.h.

1741 {
1742 if (__p > size()) _M_throw_out_of_range();
1743 _Self_destruct_ptr __left(_S_substring(_M_tree_ptr._M_data, 0, __p));
1744 _Self_destruct_ptr __right(_S_substring(_M_tree_ptr._M_data, __p, size()));
1745 _Self_destruct_ptr __left_result(
1746 _S_concat_char_iter(__left, __i, __n));
1747 // _S_ destr_concat_char_iter should be safe here.
1748 // But as it stands it's probably not a win, since __left
1749 // is likely to have additional references.
1750 _M_reset(_S_concat_rep(__left_result, __right));
1751 }

◆ insert() [15/18]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::insert ( size_t  __p,
const _Self __r 
)
inline

Definition at line 1730 of file _rope.h.

1730 {
1731 if (__p > size()) _M_throw_out_of_range();
1732 _STLP_ASSERT(get_allocator() == __r.get_allocator())
1733 _M_reset(replace(_M_tree_ptr._M_data, __p, __p, __r._M_tree_ptr._M_data));
1734 }

◆ insert() [16/18]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::insert ( size_t  __p,
const const_iterator __i,
const const_iterator __j 
)
inline

Definition at line 1771 of file _rope.h.

1772 {
1773 _Self __r(__i, __j);
1774 insert(__p, __r);
1775 }

◆ insert() [17/18]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::insert ( size_t  __p,
const iterator __i,
const iterator __j 
)
inline

Definition at line 1777 of file _rope.h.

1778 {
1779 _Self __r(__i, __j);
1780 insert(__p, __r);
1781 }

◆ insert() [18/18]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::insert ( size_t  __p,
size_t  __n,
_CharT  __c 
)
inline

Definition at line 1736 of file _rope.h.

1736 {
1738 insert(__p, __r);
1739 }

◆ length()

template<class _CharT , class _Alloc >
size_type rope< _CharT, _Alloc >::length ( ) const
inline

Definition at line 1627 of file _rope.h.

1627 {
1628 return size();
1629 }

◆ max_size()

template<class _CharT , class _Alloc >
size_type rope< _CharT, _Alloc >::max_size ( ) const
inline

Definition at line 1631 of file _rope.h.

1631 {
1632 return _S_min_len[__ROPE_MAX_DEPTH-1] - 1;
1633 // Guarantees that the result can be sufficiently
1634 // balanced. Longer ropes will probably still work,
1635 // but it's harder to make guarantees.
1636 }
#define __ROPE_MAX_DEPTH
Definition: _rope.h:342

◆ mutable_begin()

template<class _CharT , class _Alloc >
iterator rope< _CharT, _Alloc >::mutable_begin ( )
inline

Definition at line 1996 of file _rope.h.

1996 {
1997 return(iterator(this, 0));
1998 }

Referenced by rope< _CharT, _Alloc >::mutable_rend().

◆ mutable_end()

template<class _CharT , class _Alloc >
iterator rope< _CharT, _Alloc >::mutable_end ( )
inline

Definition at line 2000 of file _rope.h.

2000 {
2001 return(iterator(this, size()));
2002 }

Referenced by rope< _CharT, _Alloc >::mutable_rbegin().

◆ mutable_rbegin()

template<class _CharT , class _Alloc >
reverse_iterator rope< _CharT, _Alloc >::mutable_rbegin ( )
inline

Definition at line 2004 of file _rope.h.

2004 {
2005 return reverse_iterator(mutable_end());
2006 }
#define reverse_iterator
Definition: _abbrevs.h:34
iterator mutable_end()
Definition: _rope.h:2000

◆ mutable_reference_at()

template<class _CharT , class _Alloc >
reference rope< _CharT, _Alloc >::mutable_reference_at ( size_type  __pos)
inline

Definition at line 2012 of file _rope.h.

2012 {
2013 return reference(this, __pos);
2014 }
_Rope_char_ref_proxy< _CharT, _Alloc > reference
Definition: _rope.h:1097

◆ mutable_rend()

template<class _CharT , class _Alloc >
reverse_iterator rope< _CharT, _Alloc >::mutable_rend ( )
inline

Definition at line 2008 of file _rope.h.

2008 {
2010 }
iterator mutable_begin()
Definition: _rope.h:1996

◆ operator=()

template<class _CharT , class _Alloc >
_Self & rope< _CharT, _Alloc >::operator= ( const _Self __x)
inline

Definition at line 1491 of file _rope.h.

1491 {
1492 _STLP_ASSERT(get_allocator() == __x.get_allocator())
1493 _S_ref(__x._M_tree_ptr._M_data);
1494 _M_reset(__x._M_tree_ptr._M_data);
1495 return *this;
1496 }

◆ operator[]()

template<class _CharT , class _Alloc >
_CharT rope< _CharT, _Alloc >::operator[] ( size_type  __pos) const
inline

Definition at line 1597 of file _rope.h.

1597 {
1598 return _S_fetch(_M_tree_ptr._M_data, __pos);
1599 }

◆ pop_back()

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::pop_back ( )
inline

Definition at line 1506 of file _rope.h.

1506 {
1507 _RopeRep* __old = _M_tree_ptr._M_data;
1508 _M_tree_ptr._M_data =
1509 _S_substring(_M_tree_ptr._M_data, 0, _M_tree_ptr._M_data->_M_size._M_data - 1);
1510 _S_unref(__old);
1511 }

◆ pop_front()

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::pop_front ( )
inline

Definition at line 1529 of file _rope.h.

1529 {
1530 _RopeRep* __old = _M_tree_ptr._M_data;
1531 _M_tree_ptr._M_data = _S_substring(_M_tree_ptr._M_data, 1, _M_tree_ptr._M_data->_M_size._M_data);
1532 _S_unref(__old);
1533 }

◆ push_back()

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::push_back ( _CharT  __x)
inline

Definition at line 1502 of file _rope.h.

1502 {
1504 }

◆ push_front()

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::push_front ( _CharT  __x)
inline

Definition at line 1517 of file _rope.h.

1517 {
1518 _RopeRep* __old = _M_tree_ptr._M_data;
1519 _RopeRep* __left =
1521 _STLP_TRY {
1522 _M_tree_ptr._M_data = _S_concat_rep(__left, _M_tree_ptr._M_data);
1523 _S_unref(__old);
1524 _S_unref(__left);
1525 }
1526 _STLP_UNWIND(_S_unref(__left))
1527 }

◆ rbegin() [1/2]

template<class _CharT , class _Alloc >
const_reverse_iterator rope< _CharT, _Alloc >::rbegin ( )
inline

Definition at line 2057 of file _rope.h.

2057{ return const_rbegin(); }
const_reverse_iterator const_rbegin() const
Definition: _rope.h:1642

◆ rbegin() [2/2]

template<class _CharT , class _Alloc >
const_reverse_iterator rope< _CharT, _Alloc >::rbegin ( ) const
inline

Definition at line 1638 of file _rope.h.

1638 {
1639 return const_reverse_iterator(end());
1640 }

◆ rend() [1/2]

template<class _CharT , class _Alloc >
const_reverse_iterator rope< _CharT, _Alloc >::rend ( )
inline

Definition at line 2055 of file _rope.h.

2055{ return const_rend(); }
const_reverse_iterator const_rend() const
Definition: _rope.h:1650

◆ rend() [2/2]

template<class _CharT , class _Alloc >
const_reverse_iterator rope< _CharT, _Alloc >::rend ( ) const
inline

Definition at line 1646 of file _rope.h.

1646 {
1647 return const_reverse_iterator(begin());
1648 }

◆ replace() [1/29]

template<class _CharT , class _Alloc >
static _RopeRep * rope< _CharT, _Alloc >::replace ( _RopeRep __old,
size_t  __pos1,
size_t  __pos2,
_RopeRep __r 
)
inlinestaticprotected

Definition at line 1710 of file _rope.h.

1711 {
1712 if (0 == __old) { _S_ref(__r); return __r; }
1713 _Self_destruct_ptr __left(_S_substring(__old, 0, __pos1));
1714 _Self_destruct_ptr __right(_S_substring(__old, __pos2, __old->_M_size._M_data));
1715 _STLP_MPWFIX_TRY //*TY 06/01/2000 -
1716 _RopeRep* __result;
1717
1718 if (0 == __r) {
1719 __result = _S_concat_rep(__left, __right);
1720 } else {
1721 _STLP_ASSERT(__old->get_allocator() == __r->get_allocator())
1722 _Self_destruct_ptr __left_result(_S_concat_rep(__left, __r));
1723 __result = _S_concat_rep(__left_result, __right);
1724 }
1725 return __result;
1726 _STLP_MPWFIX_CATCH //*TY 06/01/2000 -
1727 }

Referenced by rope< _CharT, _Alloc >::erase(), rope< _CharT, _Alloc >::insert(), and rope< _CharT, _Alloc >::replace().

◆ replace() [2/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( const iterator __p,
_CharT  __c 
)
inline

Definition at line 1915 of file _rope.h.

1916 { replace(__p.index(), __c); }

◆ replace() [3/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( const iterator __p,
const _CharT *  __c_string 
)
inline

Definition at line 1917 of file _rope.h.

1918 { replace(__p.index(), __c_string); }

◆ replace() [4/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( const iterator __p,
const _CharT *  __i,
const _CharT *  __j 
)
inline

Definition at line 1921 of file _rope.h.

1922 { replace(__p.index(), __i, __j); }

◆ replace() [5/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( const iterator __p,
const _CharT *  __i,
size_t  __n 
)
inline

Definition at line 1919 of file _rope.h.

1920 { replace(__p.index(), __i, __n); }

◆ replace() [6/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( const iterator __p,
const _Self __r 
)
inline

Definition at line 1913 of file _rope.h.

1914 { replace(__p.index(), __r); }

◆ replace() [7/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( const iterator __p,
const iterator __q,
_CharT  __c 
)
inline

Definition at line 1894 of file _rope.h.

1895 { replace(__p.index(), __q.index() - __p.index(), __c); }

◆ replace() [8/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( const iterator __p,
const iterator __q,
const _CharT *  __c_string 
)
inline

Definition at line 1896 of file _rope.h.

1898 { replace(__p.index(), __q.index() - __p.index(), __c_string); }

◆ replace() [9/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( const iterator __p,
const iterator __q,
const _CharT *  __i,
const _CharT *  __j 
)
inline

Definition at line 1902 of file _rope.h.

1904 { replace(__p.index(), __q.index() - __p.index(), __i, __j); }

◆ replace() [10/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( const iterator __p,
const iterator __q,
const _CharT *  __i,
size_t  __n 
)
inline

Definition at line 1899 of file _rope.h.

1901 { replace(__p.index(), __q.index() - __p.index(), __i, __n); }

◆ replace() [11/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( const iterator __p,
const iterator __q,
const _Self __r 
)
inline

Definition at line 1891 of file _rope.h.

1893 { replace(__p.index(), __q.index() - __p.index(), __r); }

◆ replace() [12/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( const iterator __p,
const iterator __q,
const const_iterator __i,
const const_iterator __j 
)
inline

Definition at line 1905 of file _rope.h.

1907 { replace(__p.index(), __q.index() - __p.index(), __i, __j); }

◆ replace() [13/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( const iterator __p,
const iterator __q,
const iterator __i,
const iterator __j 
)
inline

Definition at line 1908 of file _rope.h.

1910 { replace(__p.index(), __q.index() - __p.index(), __i, __j); }

◆ replace() [14/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( const iterator __p,
const_iterator  __i,
const_iterator  __j 
)
inline

Definition at line 1923 of file _rope.h.

1925 { replace(__p.index(), __i, __j); }

◆ replace() [15/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( const iterator __p,
iterator  __i,
iterator  __j 
)
inline

Definition at line 1926 of file _rope.h.

1927 { replace(__p.index(), __i, __j); }

◆ replace() [16/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( size_t  __p,
_CharT  __c 
)
inline

Definition at line 1824 of file _rope.h.

1824 {
1825 if (__p > size()) _M_throw_out_of_range();
1826 iterator __i(this, __p);
1827 *__i = __c;
1828 }

◆ replace() [17/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( size_t  __p,
const _CharT *  __c_string 
)
inline

Definition at line 1838 of file _rope.h.

1838 {
1839 replace(__p, 1, __c_string);
1840 }

◆ replace() [18/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( size_t  __p,
const _CharT *  __i,
const _CharT *  __j 
)
inline

Definition at line 1842 of file _rope.h.

1842 {
1843 replace(__p, 1, __i, __j);
1844 }

◆ replace() [19/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( size_t  __p,
const _CharT *  __i,
size_t  __i_len 
)
inline

Definition at line 1834 of file _rope.h.

1834 {
1835 replace(__p, 1, __i, __i_len);
1836 }

◆ replace() [20/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( size_t  __p,
const _Self __r 
)
inline

Definition at line 1830 of file _rope.h.

1830 {
1831 replace(__p, 1, __r);
1832 }

◆ replace() [21/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( size_t  __p,
const const_iterator __i,
const const_iterator __j 
)
inline

Definition at line 1846 of file _rope.h.

1847 {
1848 replace(__p, 1, __i, __j);
1849 }

◆ replace() [22/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( size_t  __p,
const iterator __i,
const iterator __j 
)
inline

Definition at line 1851 of file _rope.h.

1852 {
1853 replace(__p, 1, __i, __j);
1854 }

◆ replace() [23/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( size_t  __p,
size_t  __n,
_CharT  __c 
)
inline

Definition at line 1795 of file _rope.h.

1795 {
1796 _Self __r(__c);
1797 replace(__p, __n, __r);
1798 }

◆ replace() [24/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( size_t  __p,
size_t  __n,
const _CharT *  __c_string 
)
inline

Definition at line 1800 of file _rope.h.

1800 {
1801 _Self __r(__c_string);
1802 replace(__p, __n, __r);
1803 }

◆ replace() [25/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( size_t  __p,
size_t  __n,
const _CharT *  __i,
const _CharT *  __j 
)
inline

Definition at line 1805 of file _rope.h.

1806 {
1807 _Self __r(__i, __j);
1808 replace(__p, __n, __r);
1809 }

◆ replace() [26/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( size_t  __p,
size_t  __n,
const _CharT *  __i,
size_t  __i_len 
)
inline

Definition at line 1789 of file _rope.h.

1790 {
1791 _Self __r(__i, __i_len);
1792 replace(__p, __n, __r);
1793 }

◆ replace() [27/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( size_t  __p,
size_t  __n,
const _Self __r 
)
inline

Definition at line 1784 of file _rope.h.

1784 {
1785 if (__p > size()) _M_throw_out_of_range();
1786 _M_reset(replace(_M_tree_ptr._M_data, __p, __p + __n, __r._M_tree_ptr._M_data));
1787 }

◆ replace() [28/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( size_t  __p,
size_t  __n,
const const_iterator __i,
const const_iterator __j 
)
inline

Definition at line 1811 of file _rope.h.

1812 {
1813 _Self __r(__i, __j);
1814 replace(__p, __n, __r);
1815 }

◆ replace() [29/29]

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::replace ( size_t  __p,
size_t  __n,
const iterator __i,
const iterator __j 
)
inline

Definition at line 1817 of file _rope.h.

1818 {
1819 _Self __r(__i, __j);
1820 replace(__p, __n, __r);
1821 }

◆ replace_with_c_str()

template<class _CharT , class _Alloc >
const _CharT * rope< _CharT, _Alloc >::replace_with_c_str

Definition at line 1335 of file _rope.c.

1335 {
1336 if (0 == _M_tree_ptr._M_data) {
1338 return _S_empty_c_str;
1339 }
1340 _CharT* __old_c_string = _M_tree_ptr._M_data->_M_c_string;
1341 if (_RopeRep::_S_leaf == _M_tree_ptr._M_data->_M_tag && 0 != __old_c_string) {
1342 return __old_c_string;
1343 }
1344 size_t __s = size();
1345 _CharT* __result = _M_tree_ptr.allocate(_S_rounded_up_size(__s));
1346 _S_flatten(_M_tree_ptr._M_data, __result);
1347 _S_construct_null(__result + __s);
1348 _M_tree_ptr._M_data->_M_unref_nonnil();
1349 _M_tree_ptr._M_data = _S_new_RopeLeaf(__result, __s, _M_tree_ptr);
1350 return __result;
1351}

◆ size()

◆ substr() [1/5]

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc > rope< _CharT, _Alloc >::substr ( const_iterator  __start)
inline

Definition at line 1961 of file _rope.h.

1961 {
1962 size_t __pos = __start.index();
1963 return rope<_CharT,_Alloc>(_S_substring(_M_tree_ptr._M_data, __pos, __pos + 1));
1964 }

◆ substr() [2/5]

template<class _CharT , class _Alloc >
_Self rope< _CharT, _Alloc >::substr ( const_iterator  __start,
const_iterator  __end 
) const
inline

Definition at line 1955 of file _rope.h.

1955 {
1956 // This might eventually take advantage of the cache in the
1957 // iterator.
1958 return rope<_CharT,_Alloc>(_S_substring(_M_tree_ptr._M_data, __start.index(), __end.index()));
1959 }

◆ substr() [3/5]

template<class _CharT , class _Alloc >
_Self rope< _CharT, _Alloc >::substr ( iterator  __start) const
inline

Definition at line 1950 of file _rope.h.

1950 {
1951 size_t __pos = __start.index();
1952 return rope<_CharT,_Alloc>(_S_substring(_M_tree_ptr._M_data, __pos, __pos + 1));
1953 }

◆ substr() [4/5]

template<class _CharT , class _Alloc >
_Self rope< _CharT, _Alloc >::substr ( iterator  __start,
iterator  __end 
) const
inline

Definition at line 1946 of file _rope.h.

1946 {
1947 return rope<_CharT,_Alloc>(_S_substring(_M_tree_ptr._M_data, __start.index(), __end.index()));
1948 }

◆ substr() [5/5]

template<class _CharT , class _Alloc >
_Self rope< _CharT, _Alloc >::substr ( size_t  __start,
size_t  __len = 1 
) const
inline

Definition at line 1941 of file _rope.h.

1941 {
1942 if (__start > size()) _M_throw_out_of_range();
1943 return rope<_CharT,_Alloc>(_S_substring(_M_tree_ptr._M_data, __start, __start + __len));
1944 }

Referenced by _Rope_rotate().

◆ swap()

template<class _CharT , class _Alloc >
void rope< _CharT, _Alloc >::swap ( _Self __b)
inline

Definition at line 1701 of file _rope.h.

1701 {
1702 _M_tree_ptr.swap(__b._M_tree_ptr);
1703 }

Referenced by swap().

Friends And Related Function Documentation

◆ _Rope_char_ptr_proxy< _CharT, _Alloc >

template<class _CharT , class _Alloc >
friend class _Rope_char_ptr_proxy< _CharT, _Alloc >
friend

Definition at line 1098 of file _rope.h.

◆ _Rope_char_ref_proxy< _CharT, _Alloc >

template<class _CharT , class _Alloc >
friend class _Rope_char_ref_proxy< _CharT, _Alloc >
friend

Definition at line 1098 of file _rope.h.

◆ _Rope_const_iterator< _CharT, _Alloc >

template<class _CharT , class _Alloc >
friend class _Rope_const_iterator< _CharT, _Alloc >
friend

Definition at line 1098 of file _rope.h.

◆ _Rope_iterator< _CharT, _Alloc >

template<class _CharT , class _Alloc >
friend class _Rope_iterator< _CharT, _Alloc >
friend

Definition at line 1098 of file _rope.h.

◆ _Rope_iterator_base< _CharT, _Alloc >

template<class _CharT , class _Alloc >
friend class _Rope_iterator_base< _CharT, _Alloc >
friend

Definition at line 1098 of file _rope.h.

◆ _Rope_RopeRep< _CharT, _Alloc >

template<class _CharT , class _Alloc >
friend struct _Rope_RopeRep< _CharT, _Alloc >
friend

Definition at line 1098 of file _rope.h.

◆ _Rope_RopeSubstring< _CharT, _Alloc >

template<class _CharT , class _Alloc >
friend struct _Rope_RopeSubstring< _CharT, _Alloc >
friend

Definition at line 1098 of file _rope.h.

Member Data Documentation

◆ _Concat_fn

template<class _CharT , class _Alloc >
friend rope< _CharT, _Alloc >::_Concat_fn
protected

Definition at line 1272 of file _rope.h.

◆ _M_tree_ptr

◆ _S_empty_c_str

template<class _CharT , class _Alloc >
_CharT rope< _CharT, _Alloc >::_S_empty_c_str = { _CharT() }
staticprotected

Definition at line 1113 of file _rope.h.

◆ _S_min_len

◆ _STLP_DECLARE_RANDOM_ACCESS_REVERSE_ITERATORS

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc >::_STLP_DECLARE_RANDOM_ACCESS_REVERSE_ITERATORS

Definition at line 1108 of file _rope.h.


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