BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bsl::StringBufContainer< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > Class Template Reference

#include <bslstl_stringbuf.h>

Inheritance diagram for bsl::StringBufContainer< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >:
bsl::basic_istringstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > bsl::basic_ostringstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > bsl::basic_stringstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >

Detailed Description

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

This class enables the implementation of string-stream types by providing a trivial type containing a basic_stringbuf that is suitable as a (private) base class for a string-stream. Inheriting from StringBufContainer allows the string-stream to ensure that the contained basic_stringbuf is initialized before initializing other base classes or data members without potentially overriding virtual methods in the basic_stringbuf type.

Note
Note that implementations of string-stream types must pass the address of a string-buffer to their public base class (e.g., basic_stream ), so the string-stream must ensure (using private inheritance) that the string-buffer is initialized before constructing the public base class. If a string-stream implementation were to directly inherit from basic_streambuf , then virtual methods defined in that string-stream (e.g., underflow) might incorrectly override those in the basic_stringbuf implementation.

See bslstl_stringbuf

Public Member Functions

 StringBufContainer (const ALLOCATOR &allocator)
 
 StringBufContainer (ios_base::openmode modeBitMask, const ALLOCATOR &allocator)
 
 StringBufContainer (const StringType &initialString, const ALLOCATOR &allocator)
 
 StringBufContainer (const StringType &initialString, ios_base::openmode modeBitMask, const ALLOCATOR &allocator)
 
 StringBufContainer (BloombergLP::bslmf::MovableRef< StringType > initialString, ios_base::openmode modeBitMask, const ALLOCATOR &allocator)
 
 StringBufContainer (BloombergLP::bslmf::MovableRef< StringType > initialString, ios_base::openmode modeBitMask)
 
template<class STRING_ITER >
 StringBufContainer (STRING_ITER first, STRING_ITER last, ios_base::openmode modeBitMask, const ALLOCATOR &allocator)
 
template<class STRING_VIEW_LIKE_TYPE >
 StringBufContainer (const STRING_VIEW_LIKE_TYPE &initialString, ios_base::openmode modeBitMask, allocator)
 
 ~StringBufContainer ()=default
 
StreamBufType * rdbuf () const
 

Constructor & Destructor Documentation

◆ StringBufContainer() [1/8]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::StringBufContainer< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::StringBufContainer ( const ALLOCATOR &  allocator)
inlineexplicit

◆ StringBufContainer() [2/8]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::StringBufContainer< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::StringBufContainer ( ios_base::openmode  modeBitMask,
const ALLOCATOR &  allocator 
)
inline

◆ StringBufContainer() [3/8]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::StringBufContainer< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::StringBufContainer ( const StringType initialString,
const ALLOCATOR &  allocator 
)
inline

◆ StringBufContainer() [4/8]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::StringBufContainer< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::StringBufContainer ( const StringType initialString,
ios_base::openmode  modeBitMask,
const ALLOCATOR &  allocator 
)
inline

◆ StringBufContainer() [5/8]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::StringBufContainer< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::StringBufContainer ( BloombergLP::bslmf::MovableRef< StringType initialString,
ios_base::openmode  modeBitMask,
const ALLOCATOR &  allocator 
)
inline

◆ StringBufContainer() [6/8]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::StringBufContainer< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::StringBufContainer ( BloombergLP::bslmf::MovableRef< StringType initialString,
ios_base::openmode  modeBitMask 
)
inline

◆ StringBufContainer() [7/8]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_ITER >
bsl::StringBufContainer< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::StringBufContainer ( STRING_ITER  first,
STRING_ITER  last,
ios_base::openmode  modeBitMask,
const ALLOCATOR &  allocator 
)
inline

◆ StringBufContainer() [8/8]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
bsl::StringBufContainer< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::StringBufContainer ( const STRING_VIEW_LIKE_TYPE &  initialString,
ios_base::openmode  modeBitMask,
allocator   
)
inline

Create a StringBufContainer object. Use the specified initialString (of a type convertible to basic_string_view<CHAR_TYPE, CHAR_TRAITS> but not to const CHAR_TYPE *) indicating the initial sequence of characters that this buffer will access or manipulate. Use the specified modeBitMask to indicate whether this buffer may be read from, written to, or both. Use the specified allocator to supply memory.

◆ ~StringBufContainer()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::StringBufContainer< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::~StringBufContainer ( )
default

Member Function Documentation

◆ rdbuf()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
StreamBufType * bsl::StringBufContainer< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::rdbuf ( ) const
inline

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