Quick Links:

bal | bbl | bdl | bsl

Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends

bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > Class Template Reference
[Component bslstl_string]

#include <bslstl_string.h>

Inheritance diagram for bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >:
bsl::String_Imp< CHAR_TYPE, allocator_traits< ALLOCATOR >::size_type >

List of all members.

Public Types

typedef CHAR_TRAITS traits_type
typedef CHAR_TRAITS::char_type value_type
typedef ALLOCATOR allocator_type
typedef AllocatorTraits::size_type size_type
typedef
AllocatorTraits::difference_type 
difference_type
typedef AllocatorTraits::pointer pointer
typedef
AllocatorTraits::const_pointer 
const_pointer
typedef value_typereference
typedef const value_typeconst_reference
typedef CHAR_TYPE * iterator
typedef const CHAR_TYPE * const_iterator
typedef bsl::reverse_iterator
< iterator
reverse_iterator
typedef bsl::reverse_iterator
< const_iterator
const_reverse_iterator

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION_IF (basic_string, BloombergLP::bslmf::IsBitwiseMoveable, BloombergLP::bslmf::IsBitwiseMoveable< ALLOCATOR >::value)
 basic_string () BSLS_KEYWORD_NOEXCEPT
 basic_string (const ALLOCATOR &basicAllocator) BSLS_KEYWORD_NOEXCEPT
 basic_string (const basic_string &original)
 basic_string (const basic_string &original, const ALLOCATOR &basicAllocator)
 basic_string (BloombergLP::bslmf::MovableRef< basic_string > original) BSLS_KEYWORD_NOEXCEPT
 basic_string (BloombergLP::bslmf::MovableRef< basic_string > original, const ALLOCATOR &basicAllocator)
 basic_string (const basic_string &original, size_type position, const ALLOCATOR &basicAllocator=ALLOCATOR())
 basic_string (const basic_string &original, size_type position, size_type numChars, const ALLOCATOR &basicAllocator=ALLOCATOR())
 basic_string (const CHAR_TYPE *characterString, const ALLOCATOR &basicAllocator=ALLOCATOR())
 basic_string (const CHAR_TYPE *characterString, size_type numChars, const ALLOCATOR &basicAllocator=ALLOCATOR())
 basic_string (size_type numChars, CHAR_TYPE character, const ALLOCATOR &basicAllocator=ALLOCATOR())
template<class INPUT_ITER >
 basic_string (INPUT_ITER first, INPUT_ITER last, const ALLOCATOR &basicAllocator=ALLOCATOR())
template<class ALLOC2 >
 basic_string (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &original, const ALLOCATOR &basicAllocator=ALLOCATOR())
 basic_string (const BloombergLP::bslstl::StringRefData< CHAR_TYPE > &strRef, const ALLOCATOR &basicAllocator=ALLOCATOR())
template<class STRING_VIEW_LIKE_TYPE >
 basic_string (const STRING_VIEW_LIKE_TYPE &object, typename bsl::enable_if< String_IsConvertibleToStringView< CHAR_TYPE, CHAR_TRAITS, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value &&!String_IsConvertibleToCString< CHAR_TYPE, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value, const ALLOCATOR & >::type basicAllocator=ALLOCATOR())
template<class STRING_VIEW_LIKE_TYPE >
 basic_string (const STRING_VIEW_LIKE_TYPE &object, size_type position, size_type numChars, const ALLOCATOR &basicAllocator=ALLOCATOR(), typename bsl::enable_if< String_IsConvertibleToStringView< CHAR_TYPE, CHAR_TRAITS, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value >::type *=0)
 basic_string (std::initializer_list< CHAR_TYPE > values, const ALLOCATOR &basicAllocator=ALLOCATOR())
 ~basic_string ()
basic_stringoperator= (const basic_string &rhs)
template<class STRING_VIEW_LIKE_TYPE >
basic_string &operator=(BloombergLP::bslmf::MovableRef
< basic_string > rhs)
BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits 
operator= (const STRING_VIEW_LIKE_TYPE &rhs) bsl::enable_if< String_IsConvertibleToStringView< CHAR_TYPE, CHAR_TRAITS, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value &&!String_IsConvertibleToCString< CHAR_TYPE, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value, basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & >::type
basic_stringoperator= (const CHAR_TYPE *rhs)
basic_stringoperator= (CHAR_TYPE character)
template<class ALLOC2 >
basic_stringoperator= (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &rhs)
basic_stringoperator= (std::initializer_list< CHAR_TYPE > values)
void resize (size_type newLength, CHAR_TYPE character)
void resize (size_type newLength)
void reserve (size_type newCapacity=0)
void shrink_to_fit ()
void clear () BSLS_KEYWORD_NOEXCEPT
iterator begin () BSLS_KEYWORD_NOEXCEPT
iterator end () BSLS_KEYWORD_NOEXCEPT
reverse_iterator rbegin () BSLS_KEYWORD_NOEXCEPT
reverse_iterator rend () BSLS_KEYWORD_NOEXCEPT
reference operator[] (size_type position)
reference at (size_type position)
CHAR_TYPE & front ()
CHAR_TYPE & back ()
basic_stringoperator+= (const basic_string &rhs)
basic_stringoperator+= (const CHAR_TYPE *rhs)
basic_stringoperator+= (CHAR_TYPE character)
template<class STRING_VIEW_LIKE_TYPE >
bsl::enable_if
< String_IsConvertibleToStringView
< CHAR_TYPE, CHAR_TRAITS,
typename bsl::enable_if
< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value
&&!String_IsConvertibleToCString
< CHAR_TYPE, typename
bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value, basic_string
< CHAR_TYPE, CHAR_TRAITS,
ALLOCATOR > & >::type 
operator+= (const STRING_VIEW_LIKE_TYPE &rhs)
template<class ALLOC2 >
basic_stringoperator+= (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &rhs)
basic_stringappend (const basic_string &suffix)
basic_stringappend (const basic_string &suffix, size_type position, size_type numChars=npos)
basic_stringappend (const CHAR_TYPE *characterString, size_type numChars)
basic_stringappend (const CHAR_TYPE *characterString)
basic_stringappend (size_type numChars, CHAR_TYPE character)
template<class STRING_VIEW_LIKE_TYPE >
bsl::enable_if
< String_IsConvertibleToStringView
< CHAR_TYPE, CHAR_TRAITS,
typename bsl::enable_if
< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value
&&!String_IsConvertibleToCString
< CHAR_TYPE, typename
bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value, basic_string
< CHAR_TYPE, CHAR_TRAITS,
ALLOCATOR > & >::type 
append (const STRING_VIEW_LIKE_TYPE &suffix)
template<class STRING_VIEW_LIKE_TYPE >
bsl::enable_if
< String_IsConvertibleToStringView
< CHAR_TYPE, CHAR_TRAITS,
typename bsl::enable_if
< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value
&&!String_IsConvertibleToCString
< CHAR_TYPE, typename
bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value, basic_string
< CHAR_TYPE, CHAR_TRAITS,
ALLOCATOR > & >::type 
append (const STRING_VIEW_LIKE_TYPE &suffix, size_type position, size_type numChars=npos)
template<class INPUT_ITER >
basic_stringappend (INPUT_ITER first, INPUT_ITER last)
basic_stringappend (std::initializer_list< CHAR_TYPE > values)
void push_back (CHAR_TYPE character)
basic_stringassign (const basic_string &replacement)
basic_stringassign (BloombergLP::bslmf::MovableRef< basic_string > replacement) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(false)
basic_stringassign (const basic_string &replacement, size_type position, size_type numChars=npos)
basic_stringassign (const CHAR_TYPE *characterString)
basic_stringassign (const CHAR_TYPE *characterString, size_type numChars)
template<class STRING_VIEW_LIKE_TYPE >
bsl::enable_if
< String_IsConvertibleToStringView
< CHAR_TYPE, CHAR_TRAITS,
typename bsl::enable_if
< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value
&&!String_IsConvertibleToCString
< CHAR_TYPE, typename
bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value, basic_string
< CHAR_TYPE, CHAR_TRAITS,
ALLOCATOR > & >::type 
assign (const STRING_VIEW_LIKE_TYPE &replacement)
template<class STRING_VIEW_LIKE_TYPE >
bsl::enable_if
< String_IsConvertibleToStringView
< CHAR_TYPE, CHAR_TRAITS,
typename bsl::enable_if
< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value
&&!String_IsConvertibleToCString
< CHAR_TYPE, typename
bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value, basic_string
< CHAR_TYPE, CHAR_TRAITS,
ALLOCATOR > & >::type 
assign (const STRING_VIEW_LIKE_TYPE &replacement, size_type position, size_type numChars=npos)
template<class ALLOC2 >
basic_stringassign (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &string)
basic_stringassign (size_type numChars, CHAR_TYPE character)
template<class INPUT_ITER >
basic_stringassign (INPUT_ITER first, INPUT_ITER last)
basic_stringassign (std::initializer_list< CHAR_TYPE > values)
basic_stringinsert (size_type position, const basic_string &other)
basic_stringinsert (size_type position, const basic_string &other, size_type sourcePosition, size_type numChars=npos)
basic_stringinsert (size_type position, const CHAR_TYPE *characterString, size_type numChars)
basic_stringinsert (size_type position, const CHAR_TYPE *characterString)
basic_stringinsert (size_type position, size_type numChars, CHAR_TYPE character)
iterator insert (const_iterator position, CHAR_TYPE character)
template<class INPUT_ITER >
iterator insert (const_iterator position, INPUT_ITER first, INPUT_ITER last)
iterator insert (const_iterator position, size_type numChars, CHAR_TYPE character)
template<class STRING_VIEW_LIKE_TYPE >
bsl::enable_if
< String_IsConvertibleToStringView
< CHAR_TYPE, CHAR_TRAITS,
typename bsl::enable_if
< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value
&&!String_IsConvertibleToCString
< CHAR_TYPE, typename
bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value, basic_string
< CHAR_TYPE, CHAR_TRAITS,
ALLOCATOR > & >::type 
insert (size_type position, const STRING_VIEW_LIKE_TYPE &other)
template<class STRING_VIEW_LIKE_TYPE >
bsl::enable_if
< String_IsConvertibleToStringView
< CHAR_TYPE, CHAR_TRAITS,
typename bsl::enable_if
< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value
&&!String_IsConvertibleToCString
< CHAR_TYPE, typename
bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value, basic_string
< CHAR_TYPE, CHAR_TRAITS,
ALLOCATOR > & >::type 
insert (size_type position, const STRING_VIEW_LIKE_TYPE &other, size_type sourcePosition, size_type numChars=npos)
iterator insert (const_iterator position, std::initializer_list< CHAR_TYPE > values)
basic_stringerase (size_type position=0, size_type numChars=npos)
iterator erase (const_iterator position)
iterator erase (const_iterator first, const_iterator last)
void pop_back ()
basic_stringreplace (size_type outPosition, size_type outNumChars, const basic_string &replacement)
basic_stringreplace (size_type outPosition, size_type outNumChars, const basic_string &replacement, size_type position, size_type numChars=npos)
basic_stringreplace (size_type outPosition, size_type outNumChars, const CHAR_TYPE *characterString, size_type numChars)
basic_stringreplace (size_type outPosition, size_type outNumChars, const CHAR_TYPE *characterString)
basic_stringreplace (size_type outPosition, size_type outNumChars, size_type numChars, CHAR_TYPE character)
template<class STRING_VIEW_LIKE_TYPE >
bsl::enable_if
< String_IsConvertibleToStringView
< CHAR_TYPE, CHAR_TRAITS,
typename bsl::enable_if
< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value
&&!String_IsConvertibleToCString
< CHAR_TYPE, typename
bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value, basic_string
< CHAR_TYPE, CHAR_TRAITS,
ALLOCATOR > & >::type 
replace (size_type outPosition, size_type outNumChars, const STRING_VIEW_LIKE_TYPE &replacement)
template<class STRING_VIEW_LIKE_TYPE >
bsl::enable_if
< String_IsConvertibleToStringView
< CHAR_TYPE, CHAR_TRAITS,
typename bsl::enable_if
< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value
&&!String_IsConvertibleToCString
< CHAR_TYPE, typename
bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value, basic_string
< CHAR_TYPE, CHAR_TRAITS,
ALLOCATOR > & >::type 
replace (size_type outPosition, size_type outNumChars, const STRING_VIEW_LIKE_TYPE &replacement, size_type position, size_type numChars=npos)
basic_stringreplace (const_iterator first, const_iterator last, const basic_string &replacement)
template<class STRING_VIEW_LIKE_TYPE >
bsl::enable_if
< String_IsConvertibleToStringView
< CHAR_TYPE, CHAR_TRAITS,
typename bsl::enable_if
< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value
&&!String_IsConvertibleToCString
< CHAR_TYPE, typename
bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE),
const STRING_VIEW_LIKE_TYPE & >
::type >::value, basic_string
< CHAR_TYPE, CHAR_TRAITS,
ALLOCATOR > & >::type 
replace (const_iterator first, const_iterator last, const STRING_VIEW_LIKE_TYPE &replacement)
basic_stringreplace (const_iterator first, const_iterator last, const CHAR_TYPE *characterString, size_type numChars)
basic_stringreplace (const_iterator first, const_iterator last, const CHAR_TYPE *characterString)
basic_stringreplace (const_iterator first, const_iterator last, size_type numChars, CHAR_TYPE character)
template<class INPUT_ITER >
basic_stringreplace (const_iterator first, const_iterator last, INPUT_ITER stringFirst, INPUT_ITER stringLast)
CHAR_TYPE * data () BSLS_KEYWORD_NOEXCEPT
const_iterator cbegin () const BSLS_KEYWORD_NOEXCEPT
const_iterator end () const BSLS_KEYWORD_NOEXCEPT
const_iterator cend () const BSLS_KEYWORD_NOEXCEPT
const_reverse_iterator rbegin () const BSLS_KEYWORD_NOEXCEPT
const_reverse_iterator crbegin () const BSLS_KEYWORD_NOEXCEPT
const_reverse_iterator rend () const BSLS_KEYWORD_NOEXCEPT
const_reverse_iterator crend () const BSLS_KEYWORD_NOEXCEPT
size_type length () const BSLS_KEYWORD_NOEXCEPT
size_type size () const BSLS_KEYWORD_NOEXCEPT
size_type max_size () const BSLS_KEYWORD_NOEXCEPT
size_type capacity () const BSLS_KEYWORD_NOEXCEPT
bool empty () const BSLS_KEYWORD_NOEXCEPT
const_reference operator[] (size_type position) const
const_reference at (size_type position) const
const CHAR_TYPE & front () const
const CHAR_TYPE & back () const
size_type copy (CHAR_TYPE *characterString, size_type numChars, size_type position=0) const
const CHAR_TYPE * c_str () const BSLS_KEYWORD_NOEXCEPT
const CHAR_TYPE * data () const BSLS_KEYWORD_NOEXCEPT
allocator_type get_allocator () const BSLS_KEYWORD_NOEXCEPT
size_type find (const basic_string &substring, size_type position=0) const BSLS_KEYWORD_NOEXCEPT
template<class STRING_VIEW_LIKE_TYPE >
size_type find (const STRING_VIEW_LIKE_TYPE &substring, size_type position=0, typename bsl::enable_if< String_IsConvertibleToStringView< CHAR_TYPE, CHAR_TRAITS, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value &&!String_IsConvertibleToCString< CHAR_TYPE, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value >::type *=0) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
size_type find (const CHAR_TYPE *substring, size_type position, size_type numChars) const
size_type find (const CHAR_TYPE *substring, size_type position=0) const
size_type find (CHAR_TYPE character, size_type position=0) const
size_type rfind (const basic_string &substring, size_type position=npos) const BSLS_KEYWORD_NOEXCEPT
template<class STRING_VIEW_LIKE_TYPE >
size_type rfind (const STRING_VIEW_LIKE_TYPE &substring, size_type position=npos, typename bsl::enable_if< String_IsConvertibleToStringView< CHAR_TYPE, CHAR_TRAITS, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value &&!String_IsConvertibleToCString< CHAR_TYPE, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value >::type *=0) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
size_type rfind (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
size_type rfind (const CHAR_TYPE *characterString, size_type position=npos) const
size_type rfind (CHAR_TYPE character, size_type position=npos) const
size_type find_first_of (const basic_string &characterString, size_type position=0) const BSLS_KEYWORD_NOEXCEPT
template<class STRING_VIEW_LIKE_TYPE >
size_type find_first_of (const STRING_VIEW_LIKE_TYPE &characterString, size_type position=0, typename bsl::enable_if< String_IsConvertibleToStringView< CHAR_TYPE, CHAR_TRAITS, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value &&!String_IsConvertibleToCString< CHAR_TYPE, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value >::type *=0) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
size_type find_first_of (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
size_type find_first_of (const CHAR_TYPE *characterString, size_type position=0) const
size_type find_first_of (CHAR_TYPE character, size_type position=0) const
size_type find_last_of (const basic_string &characterString, size_type position=npos) const BSLS_KEYWORD_NOEXCEPT
template<class STRING_VIEW_LIKE_TYPE >
size_type find_last_of (const STRING_VIEW_LIKE_TYPE &characterString, size_type position=npos, typename bsl::enable_if< String_IsConvertibleToStringView< CHAR_TYPE, CHAR_TRAITS, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value &&!String_IsConvertibleToCString< CHAR_TYPE, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value >::type *=0) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
size_type find_last_of (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
size_type find_last_of (const CHAR_TYPE *characterString, size_type position=npos) const
size_type find_last_of (CHAR_TYPE character, size_type position=npos) const
size_type find_first_not_of (const basic_string &characterString, size_type position=0) const BSLS_KEYWORD_NOEXCEPT
template<class STRING_VIEW_LIKE_TYPE >
size_type find_first_not_of (const STRING_VIEW_LIKE_TYPE &characterString, size_type position=0, typename bsl::enable_if< String_IsConvertibleToStringView< CHAR_TYPE, CHAR_TRAITS, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value &&!String_IsConvertibleToCString< CHAR_TYPE, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value >::type *=0) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
size_type find_first_not_of (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
size_type find_first_not_of (const CHAR_TYPE *characterString, size_type position=0) const
size_type find_first_not_of (CHAR_TYPE character, size_type position=0) const
size_type find_last_not_of (const basic_string &characterString, size_type position=npos) const BSLS_KEYWORD_NOEXCEPT
template<class STRING_VIEW_LIKE_TYPE >
size_type find_last_not_of (const STRING_VIEW_LIKE_TYPE &characterString, size_type position=npos, typename bsl::enable_if< String_IsConvertibleToStringView< CHAR_TYPE, CHAR_TRAITS, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value &&!String_IsConvertibleToCString< CHAR_TYPE, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value >::type *=0) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
size_type find_last_not_of (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
size_type find_last_not_of (const CHAR_TYPE *characterString, size_type position=npos) const
size_type find_last_not_of (CHAR_TYPE character, size_type position=npos) const
bool starts_with (basic_string_view< CHAR_TYPE, CHAR_TRAITS > characterString) const BSLS_KEYWORD_NOEXCEPT
bool starts_with (CHAR_TYPE character) const BSLS_KEYWORD_NOEXCEPT
bool starts_with (const CHAR_TYPE *characterString) const
bool ends_with (basic_string_view< CHAR_TYPE, CHAR_TRAITS > characterString) const BSLS_KEYWORD_NOEXCEPT
bool ends_with (CHAR_TYPE character) const BSLS_KEYWORD_NOEXCEPT
bool ends_with (const CHAR_TYPE *characterString) const
basic_string substr (size_type position=0, size_type numChars=npos) const
int compare (const basic_string &other) const BSLS_KEYWORD_NOEXCEPT
int compare (size_type position, size_type numChars, const basic_string &other) const
int compare (size_type lhsPosition, size_type lhsNumChars, const basic_string &other, size_type otherPosition, size_type otherNumChars=npos) const
int compare (const CHAR_TYPE *other) const
int compare (size_type lhsPosition, size_type lhsNumChars, const CHAR_TYPE *other, size_type otherNumChars) const
int compare (size_type lhsPosition, size_type lhsNumChars, const CHAR_TYPE *other) const
template<class STRING_VIEW_LIKE_TYPE >
int compare (const STRING_VIEW_LIKE_TYPE &other, typename bsl::enable_if< String_IsConvertibleToStringView< CHAR_TYPE, CHAR_TRAITS, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value &&!String_IsConvertibleToCString< CHAR_TYPE, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value >::type *=0) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
template<class STRING_VIEW_LIKE_TYPE >
int compare (size_type position, size_type numChars, const STRING_VIEW_LIKE_TYPE &other, typename bsl::enable_if< String_IsConvertibleToStringView< CHAR_TYPE, CHAR_TRAITS, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value &&!String_IsConvertibleToCString< CHAR_TYPE, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value >::type *=0) const
template<class STRING_VIEW_LIKE_TYPE >
int compare (size_type lhsPosition, size_type lhsNumChars, const STRING_VIEW_LIKE_TYPE &other, size_type otherPosition, size_type otherNumChars=npos, typename bsl::enable_if< String_IsConvertibleToStringView< CHAR_TYPE, CHAR_TRAITS, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value &&!String_IsConvertibleToCString< CHAR_TYPE, typename bsl::enable_if< 0!=sizeof(STRING_VIEW_LIKE_TYPE), const STRING_VIEW_LIKE_TYPE & >::type >::value >::type *=0) const
template<class ALLOC2 >
 operator std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > () const
 operator basic_string_view< CHAR_TYPE, CHAR_TRAITS > () const

Public Attributes

void swap(basic_string &other)
BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits
const_iterator 
begin () const BSLS_KEYWORD_NOEXCEPT

Static Public Attributes

static const size_type npos = ~size_type(0)

Private Types

enum  ShortBufferConstraints
enum  ConfigurableParameters

Private Member Functions

 BSLMF_ASSERT (SHORT_BUFFER_BYTES >=sizeof(CHAR_TYPE *))
 BSLMF_NESTED_TRAIT_DECLARATION (String_Imp, BloombergLP::bslmf::IsBitwiseMoveable)
void swap (String_Imp &other)
void resetFields ()
CHAR_TYPE * dataPtr ()
const CHAR_TYPE * dataPtr () const
bool isShortString () const

Static Private Member Functions

static allocator_traits
< ALLOCATOR >::size_type 
computeNewCapacity (allocator_traits< ALLOCATOR >::size_typenewLength, allocator_traits< ALLOCATOR >::size_typeoldCapacity, allocator_traits< ALLOCATOR >::size_typemaxSize)

Private Attributes

BloombergLP::bsls::AlignedBuffer
< SHORT_BUFFER_BYTES,
BloombergLP::bsls::AlignmentFromType
< CHAR_TYPE >::VALUE > 
d_short
CHAR_TYPE * d_start_p
union {
   BloombergLP::bsls::AlignedBuffer
< SHORT_BUFFER_BYTES,
BloombergLP::bsls::AlignmentFromType
< CHAR_TYPE >::VALUE >   d_short
   CHAR_TYPE *   bsl::String_Imp::d_start_p
}; 
allocator_traits< ALLOCATOR >
::size_type 
d_length
allocator_traits< ALLOCATOR >
::size_type 
d_capacity

Friends

class String_ClearProctor< basic_string >
string to_string (int)
string to_string (long)
string to_string (long long)
string to_string (unsigned)
string to_string (unsigned long)
string to_string (unsigned long long)

Detailed Description

template<class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
class bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >

This class template provides an STL-compliant string that conforms to the bslma::Allocator model. For the requirements of a string class, consult the second revision of the ISO/IEC 14882 Programming Language C++ (2003). Note that the (template parameter) CHAR_TYPE must be equal to ALLOCATOR::value_type. In addition, this implementation offers strong exception guarantees (see below), with the general rules that:

  1. any method that would result in a string of length larger than the size returned by max_size throws std::length_error, and
  2. any method that attempts to access a position outside the valid range of a string throws std::out_of_range.

Circumstances where a method throws bsl::length_error (1) are clear and not repeated in the individual function-level documentations below.

More generally, this class supports an almost complete set of in-core value semantic operations, including copy construction, assignment, equality comparison (but excluding ostream printing since this component is below STL). A precise operational definition of when two objects have the same value can be found in the description of operator== for the class. This class is exception neutral with full guarantee of rollback: if an exception is thrown during the invocation of a method on a pre-existing object, the object is left unchanged. In no event is memory leaked.

Note that aliasing (e.g., using all or part of an object as both source and destination) is supported in all cases in the public interface of basic_string. However, the private interface (...Raw methods) should be assumed to be not alias-safe unless specifically noted otherwise.

See Component bslstl_string


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