8#ifndef INCLUDED_BSLSTL_ISTRINGSTREAM
9#define INCLUDED_BSLSTL_ISTRINGSTREAM
138#include <bslscm_version.h>
160#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
173template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
176 ,
public std::basic_istream<CHAR_TYPE, CHAR_TRAITS> {
185 typedef std::basic_istream<CHAR_TYPE, CHAR_TRAITS> BaseStream;
186 typedef std::ios_base ios_base;
188 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
233 ios_base::openmode modeBitMask,
238 BloombergLP::bslmf::MovableRef<StringType> initialString);
240 BloombergLP::bslmf::MovableRef<StringType> initialString,
243 BloombergLP::bslmf::MovableRef<StringType> initialString,
244 ios_base::openmode modeBitMask);
256 BloombergLP::bslmf::MovableRef<StringType> initialString,
257 ios_base::openmode modeBitMask,
273 template <
class SALLOC>
302 template <
class SALLOC>
306 ios_base::openmode modeBitMask,
312 modeBitMask | ios_base::in,
318#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
330#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
344 void str(BloombergLP::bslmf::MovableRef<StringType> value);
345 template <
class SALLOC>
353#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
364 StreamBufType *
rdbuf()
const;
366#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
367 StringType
str() const &;
369 StringType
str()
const;
374#ifndef BSLS_PLATFORM_CMP_SUN
382 template <
class SALLOC>
384 bsl::IsStdAllocator<SALLOC>::value,
388 return this->
rdbuf()->
str(allocator);
412template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
421template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
431template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
441template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
445 ios_base::openmode modeBitMask,
452template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
456:
BaseType(MoveUtil::move(initialString), ios_base::in)
461template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
471template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
475 ios_base::openmode modeBitMask)
476:
BaseType(MoveUtil::move(initialString), modeBitMask | ios_base::in)
481template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
485 ios_base::openmode modeBitMask,
487:
BaseType(MoveUtil::move(initialString),
488 modeBitMask | ios_base::in,
494#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
495template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
499: BaseType(
std::move(original))
500, BaseStream(
std::move(original))
507#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
508template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
510basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>&
511basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
512operator=(basic_istringstream&& rhs)
514 this->BaseType::operator=(std::move(rhs));
515 this->BaseStream::operator=(std::move(rhs));
521template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
526 this->rdbuf()->str(value);
529template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
532 BloombergLP::bslmf::MovableRef<StringType> value)
534 this->rdbuf()->str(MoveUtil::move(value));
537#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
538template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
543 return std::move(*this->rdbuf()).str();
548template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
551basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::StreamBufType *
554 return this->BaseType::rdbuf();
557#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
558template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
563 return this->rdbuf()->str();
566template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
568typename basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::StringType
571 return this->rdbuf()->str();
575template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
581 return this->rdbuf()->view();
593template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
595 bsl::basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> >
Definition bslstl_stringbuf.h:746
StreamBufType * rdbuf() const
Definition bslstl_stringbuf.h:864
Definition bslma_bslallocator.h:580
Definition bslstl_istringstream.h:176
bsl::enable_if< bsl::IsStdAllocator< SALLOC >::value, basic_string< CHAR_TYPE, CHAR_TRAITS, SALLOC > >::type str(const SALLOC &allocator) const
Definition bslstl_istringstream.h:386
~basic_istringstream()=default
CHAR_TRAITS traits_type
Definition bslstl_istringstream.h:198
basic_istringstream(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_istringstream.h:303
basic_istringstream(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_istringstream.h:274
ALLOCATOR allocator_type
Definition bslstl_istringstream.h:199
traits_type::int_type int_type
Definition bslstl_istringstream.h:200
traits_type::pos_type pos_type
Definition bslstl_istringstream.h:202
ViewType view() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_istringstream.h:578
bsl::enable_if<!bsl::is_same< ALLOCATOR, SALLOC >::value, void >::type str(const basic_string< CHAR_TYPE, CHAR_TRAITS, SALLOC > &value)
Definition bslstl_istringstream.h:348
StringType str() const
Definition bslstl_istringstream.h:569
CHAR_TYPE char_type
Definition bslstl_istringstream.h:197
traits_type::off_type off_type
Definition bslstl_istringstream.h:201
StreamBufType * rdbuf() const
Definition bslstl_istringstream.h:552
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
#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