8#ifndef INCLUDED_BSLSTL_STRINGBUF
9#define INCLUDED_BSLSTL_STRINGBUF
183#include <bslscm_version.h>
212#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
217#ifndef BDE_OMIT_INTERNAL_DEPRECATED
218#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
225#ifdef BSLS_ASSERTIMPUTIL_AVOID_STRING_CONSTANTS
226extern const char s_bslstl_stringbuf_h[];
227#undef BSLS_ASSERTIMPUTIL_FILE
228#define BSLS_ASSERTIMPUTIL_FILE BloombergLP::s_bslstl_stringbuf_h
243template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
245 :
public std::basic_streambuf<CHAR_TYPE, CHAR_TRAITS> {
249 typedef std::basic_streambuf<CHAR_TYPE, CHAR_TRAITS> BaseType;
253 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
285 ios_base::openmode d_mode;
337 void updateStreamPositions(
off_type inputOffset = 0,
350 bool extendInputArea();
369 bool arePointersValid(
const char_type *first,
391 ios_base::seekdir whence,
392 ios_base::openmode modeBitMask = ios_base::in | ios_base::out);
402 ios_base::openmode modeBitMask = ios_base::in | ios_base::out);
412 std::streamsize numCharacters);
455 std::streamsize numCharacters);
494 ios_base::openmode modeBitMask,
505 ios_base::openmode modeBitMask);
517 ios_base::openmode modeBitMask,
530 template <
class SALLOC>
541 , d_endHint(initialString.
size())
542 , d_mode(ios_base::in | ios_base::out)
545 updateStreamPositions();
562 template <
class SALLOC>
566 ios_base::openmode modeBitMask,
572 , d_endHint(initialString.
size())
573 , d_mode(modeBitMask)
575 updateStreamPositions(0, d_mode & ios_base::ate ? d_endHint : 0);
578#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
594#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
610 void str(
const StringType& value);
612 void str(BloombergLP::bslmf::MovableRef<StringType> value);
613 template <
class SALLOC>
619 d_endHint = d_str.
size();
620 updateStreamPositions(0, d_mode & ios_base::ate ? d_endHint : 0);
623#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
637#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
663#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
664 StringType
str() const &;
666 StringType
str()
const;
669#ifndef BSLS_PLATFORM_CMP_SUN
684 template <
class SALLOC>
686 bsl::IsStdAllocator<SALLOC>::value,
708#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY) \
709 && defined(BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE)
714template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
745template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
753 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
784 ios_base::openmode modeBitMask,
786 : d_bufObj(initialString, modeBitMask,
allocator)
791 BloombergLP::bslmf::MovableRef<StringType> initialString,
792 ios_base::openmode modeBitMask,
794 : d_bufObj(MoveUtil::move(initialString), modeBitMask,
allocator)
799 BloombergLP::bslmf::MovableRef<StringType> initialString,
800 ios_base::openmode modeBitMask)
801 : d_bufObj(MoveUtil::move(initialString), modeBitMask)
805 template <
class STRING_ITER>
808 ios_base::openmode modeBitMask,
813 d_bufObj.
str(MoveUtil::move(tempStr));
816#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
822 : d_bufObj(
std::move(original.d_bufObj))
830 StringBufContainer(StringBufContainer&& original,
831 const ALLOCATOR& allocator)
832 : d_bufObj(
std::move(original.d_bufObj), allocator)
841#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
848 d_bufObj = std::move(rhs.d_bufObj);
854#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
859 d_bufObj.
swap(other.d_bufObj);
879template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
881basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
882 updateInputPointers(
char_type *currentInputPosition)
887 &d_str[0] +
static_cast<std::ptrdiff_t
>(streamSize()));
892 currentInputPosition,
893 dataPtr +
static_cast<std::ptrdiff_t
>(streamSize()));
894 return pos_type(currentInputPosition - dataPtr);
897template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
899basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
900 updateOutputPointers(
char_type *currentOutputPosition)
907 std::size_t dataSize = d_str.
size();
909 pos_type outputPos = currentOutputPosition - dataPtr;
910 this->setp(dataPtr, dataPtr + dataSize);
912 while (bumpAmount > INT_MAX) {
913 this->pbump(INT_MAX);
914 bumpAmount -= INT_MAX;
917 this->pbump(
int(bumpAmount));
922template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
923void basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
932 if (d_mode & ios_base::out) {
935 std::size_t dataSize = d_str.
size();
936 this->setp(dataPtr, dataPtr + dataSize);
938 while (bumpAmount < INT_MIN) {
939 this->pbump(INT_MIN);
940 bumpAmount -= INT_MIN;
942 while (bumpAmount > INT_MAX) {
943 this->pbump(INT_MAX);
944 bumpAmount -= INT_MAX;
947 this->pbump(
int(bumpAmount));
951 if (d_mode & ios_base::in) {
955 dataPtr + inputOffset,
956 dataPtr +
static_cast<std::ptrdiff_t
>(streamSize()));
960template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
961bool basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::extendInputArea()
965 if (d_mode & ios_base::out && this->pptr() > this->egptr()) {
966 d_endHint = streamSize();
967 updateInputPointers(this->gptr());
975template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
977 basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::streamSize()
const
980 this->pptr() - this->pbase());
987template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
988bool basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::arePointersValid(
993 const bool isNull = first == 0;
996 return first == bufferBegin
1003template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1007 ios_base::seekdir whence,
1008 ios_base::openmode modeBitMask)
1013 if (((modeBitMask & (ios_base::in | ios_base::out)) ==
1014 (ios_base::in | ios_base::out))
1015 && whence == ios_base::cur) {
1023 if ((modeBitMask & ios_base::in) && (d_mode & ios_base::in)) {
1027 case ios_base::beg: {
1028 inputPtr = this->eback() + offset;
1030 case ios_base::cur: {
1031 inputPtr = this->gptr() + offset;
1033 case ios_base::end: {
1034 inputPtr = this->eback()
1035 +
static_cast<std::ptrdiff_t
>(streamSize())
1043 if (inputPtr < this->eback()
1045 this->eback() +
static_cast<std::ptrdiff_t
>(streamSize())) {
1051 newPos = updateInputPointers(inputPtr);
1056 if ((modeBitMask & ios_base::out) && (d_mode & ios_base::out)) {
1060 case ios_base::beg: {
1061 outputPtr = this->pbase() + offset;
1063 case ios_base::cur: {
1064 outputPtr = this->pptr() + offset;
1066 case ios_base::end: {
1067 outputPtr = this->pbase()
1068 +
static_cast<std::ptrdiff_t
>(streamSize())
1075 if (outputPtr < this->pbase()
1077 this->pbase() +
static_cast<std::ptrdiff_t
>(streamSize())) {
1083 newPos = updateOutputPointers(outputPtr);
1089template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1094 ios_base::openmode modeBitMask)
1101template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1105 std::streamsize numCharacters)
1107 if ((d_mode & ios_base::in) == 0) {
1116 if (this->gptr() != this->egptr()) {
1119 std::streamsize available = this->egptr() - this->gptr();
1120 std::streamsize readChars = std::min(available,
1123 traits_type::copy(result, this->gptr(), std::size_t(readChars));
1124 this->gbump(
int(readChars));
1132template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1136 if ((d_mode & ios_base::in) == 0) {
1137 return traits_type::eof();
1140 if (this->gptr() != this->egptr()) {
1143 return traits_type::to_int_type(*this->gptr());
1146 if (extendInputArea()) {
1153 return traits_type::eof();
1156template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1160 if ((d_mode & ios_base::in) == 0) {
1161 return traits_type::eof();
1164 if (this->gptr() != this->egptr()) {
1167 int_type c = traits_type::to_int_type(*this->gptr());
1172 if (extendInputArea()) {
1179 return traits_type::eof();
1182template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1187 if (this->gptr() == this->eback()) {
1191 return traits_type::eof();
1194 if (traits_type::eq_int_type(character, traits_type::eof())
1195 || traits_type::eq_int_type(
1197 traits_type::to_int_type(*(this->gptr() - 1)))) {
1202 return traits_type::to_int_type(*this->gptr());
1205 if (d_mode & ios_base::out) {
1210 *this->gptr() = traits_type::to_char_type(character);
1214 return traits_type::eof();
1217template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1221 std::streamsize numCharacters)
1223 if ((d_mode & ios_base::out) == 0) {
1231 std::streamsize spaceLeft = d_str.
data() + d_str.
size() - this->pptr();
1232 std::ptrdiff_t toOverwrite =
1233 std::ptrdiff_t(std::min(spaceLeft, numCharacters));
1238 traits_type::copy(this->pptr(), inputString, toOverwrite);
1240 off_type inputOffset = this->gptr() - this->eback();
1242 if (numCharacters == toOverwrite) {
1246 off_type newHigh = numCharacters + this->pptr() - this->pbase();
1247 d_endHint = std::max(d_endHint, newHigh);
1249 updateStreamPositions(inputOffset, newHigh);
1255 d_str.
append(inputString + toOverwrite, inputString + numCharacters);
1260 d_endHint = d_str.
size();
1261 updateStreamPositions(inputOffset, d_endHint);
1264 return numCharacters;
1267template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1272 if ((d_mode & ios_base::out) == 0) {
1273 return traits_type::eof();
1276 if (traits_type::eq_int_type(character, traits_type::eof())) {
1279 return traits_type::not_eof(character);
1282 char_type c = traits_type::to_char_type(character);
1283 if (this->pptr() != this->epptr()) {
1290 d_endHint = streamSize();
1296 off_type inputOffset = this->gptr() - this->eback();
1306 d_endHint = d_str.
size();
1307 updateStreamPositions(inputOffset, d_endHint);
1314template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1320, d_mode(ios_base::in | ios_base::out)
1322 updateStreamPositions();
1325template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1332, d_mode(modeBitMask)
1334 updateStreamPositions();
1337template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1343, d_endHint(initialString.
size())
1344, d_mode(ios_base::in | ios_base::out)
1346 updateStreamPositions();
1349template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1353 ios_base::openmode modeBitMask,
1357, d_endHint(initialString.
size())
1358, d_mode(modeBitMask)
1360 updateStreamPositions(0, d_mode & ios_base::ate ? d_endHint : 0);
1363template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1366 basic_stringbuf(BloombergLP::bslmf::MovableRef<StringType> initialString)
1368, d_str(MoveUtil::move(initialString))
1369, d_endHint(d_str.
size())
1370, d_mode(ios_base::in | ios_base::out)
1372 updateStreamPositions();
1375template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1378 basic_stringbuf(BloombergLP::bslmf::MovableRef<StringType> initialString,
1381, d_str(MoveUtil::move(initialString),
allocator)
1382, d_endHint(d_str.
size())
1383, d_mode(ios_base::in | ios_base::out)
1385 updateStreamPositions();
1388template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1391 basic_stringbuf(BloombergLP::bslmf::MovableRef<StringType> initialString,
1392 ios_base::openmode modeBitMask)
1394, d_str(MoveUtil::move(initialString))
1395, d_endHint(d_str.
size())
1396, d_mode(modeBitMask)
1398 updateStreamPositions(0, d_mode & ios_base::ate ? d_endHint : 0);
1401template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1404 basic_stringbuf(BloombergLP::bslmf::MovableRef<StringType> initialString,
1405 ios_base::openmode modeBitMask,
1408, d_str(MoveUtil::move(initialString),
allocator)
1409, d_endHint(d_str.
size())
1410, d_mode(modeBitMask)
1412 updateStreamPositions(0, d_mode & ios_base::ate ? d_endHint : 0);
1415#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
1416template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1421, d_str(
std::move(original.d_str))
1422, d_endHint(
std::move(original.d_endHint))
1423, d_mode(
std::move(original.d_mode))
1427 const off_type inputOffset = original.gptr() - original.eback();
1428 const off_type outputOffset = original.pptr() - original.pbase();
1429 updateStreamPositions(inputOffset, outputOffset);
1431 this->pubimbue(original.getloc());
1433 if (original.d_endHint > 0 &&
1434 static_cast<size_t>(original.d_endHint) > original.d_str.size()) {
1438 original.d_endHint = 0;
1439 original.updateStreamPositions();
1443template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1445basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
1446 basic_stringbuf(basic_stringbuf&& original,
1447 const allocator_type& allocator)
1449, d_str(
std::move(original.d_str), allocator)
1450, d_endHint(
std::move(original.d_endHint))
1451, d_mode(
std::move(original.d_mode))
1455 const off_type inputOffset = original.gptr() - original.eback();
1456 const off_type outputOffset = original.pptr() - original.pbase();
1457 updateStreamPositions(inputOffset, outputOffset);
1459 this->pubimbue(original.getloc());
1461 if (original.d_endHint > 0 &&
1462 static_cast<size_t>(original.d_endHint) > original.d_str.size()) {
1466 original.d_endHint = 0;
1467 original.updateStreamPositions();
1472template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1476 if (d_mode & ios_base::in) {
1482 if (d_mode & ios_base::out) {
1490#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
1491template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1499 const off_type inputOffset = rhs.gptr() - rhs.eback();
1500 const off_type inputSize = rhs.egptr() - rhs.eback();
1501 const off_type outputOffset = rhs.pptr() - rhs.pbase();
1502 const off_type outputSize = rhs.epptr() - rhs.pbase();
1504 this->pubimbue(rhs.getloc());
1506 d_str = std::move(rhs.d_str);
1507 d_endHint = std::move(rhs.d_endHint);
1508 d_mode = std::move(rhs.d_mode);
1512 char_type *dataPtr = &d_str[0];
1516 this->setp(dataPtr, dataPtr + outputSize);
1517 this->pbump(
static_cast<int>(outputOffset));
1519 dataPtr + inputOffset,
1520 dataPtr + inputSize);
1524 if (rhs.d_endHint > 0 &&
1525 static_cast<size_t>(rhs.d_endHint) > rhs.d_str.size()) {
1530 rhs.updateStreamPositions();
1537template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1542 d_endHint = d_str.
size();
1543 updateStreamPositions(0, d_mode & ios_base::ate ? d_endHint : 0);
1546template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1548 BloombergLP::bslmf::MovableRef<StringType> value)
1552 d_str = MoveUtil::move(lvalue);
1553 d_endHint = d_str.
size();
1554 updateStreamPositions(0, d_mode & ios_base::ate ? d_endHint : 0);
1557#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
1558template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1562 if (d_mode & ios_base::out) {
1563 d_str.
resize(
static_cast<typename StringType::size_type
>(streamSize()));
1564 this->setp(d_str.
data(), d_str.
data());
1566 else if (d_mode & ios_base::in) {
1567 if (streamSize() > 0) {
1568 if (this->eback() != d_str.
data()) {
1569 d_str.
erase(0, this->eback() - d_str.
data());
1571 d_str.
resize(
static_cast<typename StringType::size_type
>(
1577 StringType ret = std::move(d_str);
1579 updateStreamPositions();
1584#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
1585template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1597 const off_type inputOffset = this->gptr() - this->eback();
1598 const off_type outputOffset = this->pptr() - this->pbase();
1599 const std::locale loc = this->getloc();
1601 const off_type otherInputOffset = other.gptr() - other.eback();
1602 const off_type otherOutputOffset = other.pptr() - other.pbase();
1603 const std::locale otherLoc = other.getloc();
1607 this->BaseType::swap(other);
1611 this->pubimbue(otherLoc);
1612 other.pubimbue(loc);
1614 d_str.swap(other.d_str);
1615 BloombergLP::bslalg::SwapUtil::swap(&this->d_endHint, &other.d_endHint);
1616 BloombergLP::bslalg::SwapUtil::swap(&this->d_mode, &other.d_mode);
1620 this->updateStreamPositions(otherInputOffset, otherOutputOffset);
1621 other.updateStreamPositions( inputOffset, outputOffset);
1626template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1635template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1638#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
1647template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1653 if (d_mode & ios_base::out) {
1655 static_cast<std::ptrdiff_t
>(streamSize()));
1658 if (d_mode & ios_base::in) {
1659 return ViewType(this->eback(), this->egptr() - this->eback());
1668#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY) \
1669 && defined(BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE)
1670template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1671void bsl::swap(basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>& a,
1672 basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>& b)
1674 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
1676 if (a.get_allocator() == b.get_allocator()
1681 basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> aCopy(
1684 basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> bCopy(
1700template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
1702 bsl::basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> >
1710#ifdef BSLS_ASSERTIMPUTIL_AVOID_STRING_CONSTANTS
1711#undef BSLS_ASSERTIMPUTIL_FILE
1712#define BSLS_ASSERTIMPUTIL_FILE BSLS_ASSERTIMPUTIL_DEFAULTFILE
Definition bslstl_stringbuf.h:746
StreamBufType * rdbuf() const
Definition bslstl_stringbuf.h:864
StringBufContainer(const StringType &initialString, ios_base::openmode modeBitMask, const ALLOCATOR &allocator)
Definition bslstl_stringbuf.h:783
StringBufContainer(ios_base::openmode modeBitMask, const ALLOCATOR &allocator)
Definition bslstl_stringbuf.h:771
StringBufContainer(BloombergLP::bslmf::MovableRef< StringType > initialString, ios_base::openmode modeBitMask)
Definition bslstl_stringbuf.h:798
void swap(StringBufContainer &other)
Definition bslstl_stringbuf.h:857
StringBufContainer(const ALLOCATOR &allocator)
Definition bslstl_stringbuf.h:766
StringBufContainer(STRING_ITER first, STRING_ITER last, ios_base::openmode modeBitMask, const ALLOCATOR &allocator)
Definition bslstl_stringbuf.h:806
StringBufContainer(const StringType &initialString, const ALLOCATOR &allocator)
Definition bslstl_stringbuf.h:777
StringBufContainer(BloombergLP::bslmf::MovableRef< StringType > initialString, ios_base::openmode modeBitMask, const ALLOCATOR &allocator)
Definition bslstl_stringbuf.h:790
~StringBufContainer()=default
Definition bslma_bslallocator.h:580
Definition bslstl_stringview.h:441
Definition bslstl_string.h:1281
basic_string & assign(const basic_string &replacement)
Definition bslstl_string.h:5716
size_type size() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_string.h:6592
allocator_type get_allocator() const BSLS_KEYWORD_NOEXCEPT
Return the allocator used by this string to supply memory.
Definition bslstl_string.h:6723
void push_back(CHAR_TYPE character)
Append the specified character to this string.
Definition bslstl_string.h:5699
CHAR_TYPE * data() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_string.h:6477
void resize(size_type newLength, CHAR_TYPE character)
Definition bslstl_string.h:5364
void swap(basic_string &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits const_iterator begin() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_string.h:2533
basic_string & erase(size_type position=0, size_type numChars=npos)
Definition bslstl_string.h:6069
size_type capacity() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_string.h:6623
basic_string & append(const basic_string &suffix)
Definition bslstl_string.h:5574
Definition bslstl_stringbuf.h:245
void swap(basic_stringbuf &other)
Definition bslstl_stringbuf.h:1586
ViewType view() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_stringbuf.h:1650
virtual pos_type seekoff(off_type offset, ios_base::seekdir whence, ios_base::openmode modeBitMask=ios_base::in|ios_base::out)
Definition bslstl_stringbuf.h:1005
virtual int_type pbackfail(int_type character=traits_type::eof())
Definition bslstl_stringbuf.h:1184
StringType str() const
Definition bslstl_stringbuf.h:1641
virtual pos_type seekpos(pos_type absoluteOffset, ios_base::openmode modeBitMask=ios_base::in|ios_base::out)
Definition bslstl_stringbuf.h:1092
traits_type::off_type off_type
Definition bslstl_stringbuf.h:261
basic_stringbuf(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_stringbuf.h:532
void str(const StringType &value)
Definition bslstl_stringbuf.h:1538
virtual std::streamsize xsgetn(char_type *result, std::streamsize numCharacters)
Definition bslstl_stringbuf.h:1103
allocator_type get_allocator() const BSLS_KEYWORD_NOEXCEPT
Return the allocator used by the underlying string to supply memory.
Definition bslstl_stringbuf.h:1629
CHAR_TYPE char_type
Definition bslstl_stringbuf.h:257
bsl::enable_if< bsl::IsStdAllocator< SALLOC >::value, basic_string< CHAR_TYPE, CHAR_TRAITS, SALLOC > >::type str(const SALLOC &allocator) const
Definition bslstl_stringbuf.h:688
CHAR_TRAITS traits_type
Definition bslstl_stringbuf.h:258
~basic_stringbuf()
Destroy this object.
Definition bslstl_stringbuf.h:1474
virtual int_type uflow()
Definition bslstl_stringbuf.h:1158
basic_stringbuf(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_stringbuf.h:563
virtual std::streamsize xsputn(const char_type *inputString, std::streamsize numCharacters)
Definition bslstl_stringbuf.h:1219
virtual int_type underflow()
Definition bslstl_stringbuf.h:1134
traits_type::int_type int_type
Definition bslstl_stringbuf.h:260
traits_type::pos_type pos_type
Definition bslstl_stringbuf.h:262
virtual int_type overflow(int_type character=traits_type::eof())
Definition bslstl_stringbuf.h:1269
bsl::enable_if<!bsl::is_same< ALLOCATOR, SALLOC >::value, void >::type str(const basic_string< CHAR_TYPE, CHAR_TRAITS, SALLOC > &value)
Definition bslstl_stringbuf.h:616
ALLOCATOR allocator_type
Definition bslstl_stringbuf.h:259
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_ASSERT_OPT(X)
Definition bsls_assert.h:1856
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
void swap(OptionValue &a, OptionValue &b)
bool isNull(const TYPE &object)
Definition bdlb_printmethods.h:283
basic_stringbuf< wchar_t, char_traits< wchar_t >, allocator< wchar_t > > wstringbuf
Definition bslstl_iosfwd.h:100
basic_stringbuf< char, char_traits< char >, allocator< char > > stringbuf
Definition bslstl_iosfwd.h:91
BSLS_KEYWORD_CONSTEXPR size_t size(const TYPE(&)[DIMENSION]) BSLS_KEYWORD_NOEXCEPT
Return the dimension of the specified array argument.
Definition bslstl_iterator.h:1331
BSLS_KEYWORD_CONSTEXPR CONTAINER::value_type * data(CONTAINER &container)
Definition bslstl_iterator.h:1231
Definition balxml_encoderoptions.h:68
Definition bdldfp_decimal.h:5188
Definition bslma_allocatortraits.h:1061
Definition bslmf_enableif.h:525
Definition bslmf_issame.h:146
Definition bslma_usesbslmaallocator.h:343