8#ifndef INCLUDED_BSLSTL_STRINGSTREAM
9#define INCLUDED_BSLSTL_STRINGSTREAM
146#include <bslscm_version.h>
168#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
181template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
184 ,
public std::basic_iostream<CHAR_TYPE, CHAR_TRAITS> {
193 typedef std::basic_iostream<CHAR_TYPE, CHAR_TRAITS> BaseStream;
194 typedef std::ios_base ios_base;
196 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
241 ios_base::openmode modeBitMask,
246 BloombergLP::bslmf::MovableRef<StringType> initialString);
248 BloombergLP::bslmf::MovableRef<StringType> initialString,
251 BloombergLP::bslmf::MovableRef<StringType> initialString,
252 ios_base::openmode modeBitMask);
263 BloombergLP::bslmf::MovableRef<StringType> initialString,
264 ios_base::openmode modeBitMask,
278 template <
class SALLOC>
287 ios_base::in | ios_base::out,
306 template <
class SALLOC>
310 ios_base::openmode modeBitMask,
324#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
337#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
349 void str(BloombergLP::bslmf::MovableRef<StringType> value);
350 template <
class SALLOC>
359#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
370 StreamBufType *
rdbuf()
const;
374#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
375 StringType
str() const &;
377 StringType
str()
const;
380#ifndef BSLS_PLATFORM_CMP_SUN
386 template <
class SALLOC>
388 bsl::IsStdAllocator<SALLOC>::value,
393 return this->
rdbuf()->
str(allocator);
414template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
416 bsl::basic_stringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> >
434template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
443template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
453template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
463template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
467 ios_base::openmode modeBitMask,
474template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
478:
BaseType(MoveUtil::move(initialString), ios_base::in | ios_base::out)
483template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
488:
BaseType(MoveUtil::move(initialString),
489 ios_base::in | ios_base::out,
495template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
499 ios_base::openmode modeBitMask)
500:
BaseType(MoveUtil::move(initialString), modeBitMask)
505template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
509 ios_base::openmode modeBitMask,
516#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
517template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
521: BaseType(
std::move(original))
522, BaseStream(
std::move(original))
529#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
530template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
532basic_stringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>&
533basic_stringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
534operator=(basic_stringstream&& rhs)
536 this->BaseType::operator=(std::move(rhs));
537 this->BaseStream::operator=(std::move(rhs));
543template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
548 this->rdbuf()->str(value);
551template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
554 BloombergLP::bslmf::MovableRef<StringType> value)
556 this->rdbuf()->str(MoveUtil::move(value));
559#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
560template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
565 return std::move(*this->rdbuf()).str();
570template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
572typename basic_stringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::StreamBufType *
575 return this->BaseType::rdbuf();
578#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
579template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
584 return this->rdbuf()->str();
587template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
589typename basic_stringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::StringType
592 return this->rdbuf()->str();
596template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
602 return this->rdbuf()->view();
Definition bslstl_stringbuf.h:746
StreamBufType * rdbuf() const
Definition bslstl_stringbuf.h:864
Definition bslma_bslallocator.h:580
Definition bslstl_stringview.h:441
Definition bslstl_string.h:1281
Definition bslstl_stringbuf.h:245
void str(const StringType &value)
Definition bslstl_stringbuf.h:1538
Definition bslstl_stringstream.h:184
CHAR_TRAITS traits_type
Definition bslstl_stringstream.h:206
traits_type::pos_type pos_type
Definition bslstl_stringstream.h:210
StringType str() const
Definition bslstl_stringstream.h:590
traits_type::int_type int_type
Definition bslstl_stringstream.h:208
basic_stringstream(const bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, SALLOC > &initialString, const allocator_type &allocator=allocator_type(), typename bsl::enable_if< !bsl::is_same< ALLOCATOR, SALLOC >::value, void * >::type=0)
Definition bslstl_stringstream.h:279
bsl::enable_if< bsl::IsStdAllocator< SALLOC >::value, basic_string< CHAR_TYPE, CHAR_TRAITS, SALLOC > >::type str(const SALLOC &allocator) const
Definition bslstl_stringstream.h:390
traits_type::off_type off_type
Definition bslstl_stringstream.h:209
~basic_stringstream()=default
Destroy this object.
bsl::enable_if<!bsl::is_same< ALLOCATOR, SALLOC >::value, void >::type str(const basic_string< CHAR_TYPE, CHAR_TRAITS, SALLOC > &value)
Definition bslstl_stringstream.h:353
CHAR_TYPE char_type
Definition bslstl_stringstream.h:205
StreamBufType * rdbuf() const
Definition bslstl_stringstream.h:573
ALLOCATOR allocator_type
Definition bslstl_stringstream.h:207
ViewType view() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_stringstream.h:599
basic_stringstream(const bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, SALLOC > &initialString, ios_base::openmode modeBitMask, const allocator_type &allocator=allocator_type(), typename bsl::enable_if< !bsl::is_same< ALLOCATOR, SALLOC >::value, void * >::type=0)
Definition bslstl_stringstream.h:307
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
Definition bdlb_printmethods.h:283
T::iterator begin(T &container)
Definition bslstl_iterator.h:1495
T::iterator end(T &container)
Definition bslstl_iterator.h:1523
Definition balxml_encoderoptions.h:68
Definition bdldfp_decimal.h:5188
Definition bslmf_enableif.h:525
Definition bslmf_issame.h:146
Definition bslma_usesbslmaallocator.h:343