This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

View File

@@ -0,0 +1,142 @@
[stringstream.cons]
# 31 Input/output library [[input.output]](./#input.output)
## 31.8 String-based streams [[string.streams]](string.streams#stringstream.cons)
### 31.8.5 Class template basic_stringstream [[stringstream]](stringstream#cons)
#### 31.8.5.2 Constructors [stringstream.cons]
[🔗](#lib:basic_stringstream,constructor)
`explicit basic_stringstream(ios_base::openmode which);
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9720)
*Effects*: Initializes the base class withbasic_iostream<charT, traits>(addressof(*sb*)) ([[iostream.cons]](iostream.cons "31.7.5.7.2Constructors"))
and*sb* withbasic_stringbuf<charT, traits, Allocator>(which)[.](#1.sentence-1)
[🔗](#lib:basic_stringstream,constructor_)
`explicit basic_stringstream(
const basic_string<charT, traits, Allocator>& s,
ios_base::openmode which = ios_base::out | ios_base::in);
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9738)
*Effects*: Initializes the base class withbasic_iostream<charT, traits>(addressof(*sb*)) ([[iostream.cons]](iostream.cons "31.7.5.7.2Constructors"))
and*sb* withbasic_stringbuf<charT, traits, Allocator>(s, which)[.](#2.sentence-1)
[🔗](#lib:basic_stringstream,constructor__)
`basic_stringstream(ios_base::openmode which, const Allocator& a);
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9754)
*Effects*: Initializes the base class withbasic_iostream<charT, traits>(addressof(*sb*)) ([[iostream.cons]](iostream.cons "31.7.5.7.2Constructors"))
and *sb* withbasic_stringbuf<charT, traits, Allocator>(which, a) ([[stringbuf.cons]](stringbuf.cons "31.8.2.2Constructors"))[.](#3.sentence-1)
[🔗](#lib:basic_stringstream,constructor___)
`explicit basic_stringstream(
basic_string<charT, traits, Allocator>&& s,
ios_base::openmode which = ios_base::out | ios_base::in);
`
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9770)
*Effects*: Initializes the base class withbasic_iostream<charT, traits>(addressof(*sb*)) ([[iostream.cons]](iostream.cons "31.7.5.7.2Constructors"))
and *sb* withbasic_stringbuf<charT, traits, Allocator>(std::move(s), which) ([[stringbuf.cons]](stringbuf.cons "31.8.2.2Constructors"))[.](#4.sentence-1)
[🔗](#lib:basic_stringstream,constructor____)
`template<class SAlloc>
basic_stringstream(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which, const Allocator& a);
`
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9787)
*Effects*: Initializes the base class withbasic_iostream<charT, traits>(addressof(*sb*)) ([[iostream.cons]](iostream.cons "31.7.5.7.2Constructors"))
and *sb* withbasic_stringbuf<charT, traits, Allocator>(s, which, a) ([[stringbuf.cons]](stringbuf.cons "31.8.2.2Constructors"))[.](#5.sentence-1)
[🔗](#lib:basic_stringstream,constructor_____)
`template<class SAlloc>
explicit basic_stringstream(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which = ios_base::out | ios_base::in);
`
[6](#6)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9804)
*Constraints*: is_same_v<SAlloc, Allocator> is false[.](#6.sentence-1)
[7](#7)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9808)
*Effects*: Initializes the base class withbasic_iostream<charT, traits>(addressof(*sb*)) ([[iostream.cons]](iostream.cons "31.7.5.7.2Constructors"))
and *sb* withbasic_stringbuf<charT, traits, Allocator>(s, which) ([[stringbuf.cons]](stringbuf.cons "31.8.2.2Constructors"))[.](#7.sentence-1)
[🔗](#lib:basic_stringstream,constructor______)
`template<class T>
explicit basic_stringstream(const T& t, ios_base::openmode which = ios_base::out | ios_base::in);
template<class T>
basic_stringstream(const T& t, const Allocator& a);
template<class T>
basic_stringstream(const T& t, ios_base::openmode which, const Allocator& a);
`
[8](#8)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9827)
Let which be ios_base::out | ios_base::in for the overload with no parameter which, anda be Allocator() for the overload with no parameter a[.](#8.sentence-1)
[9](#9)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9832)
*Constraints*: is_convertible_v<const T&, basic_string_view<charT, traits>> is true[.](#9.sentence-1)
[10](#10)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9837)
*Effects*: Initializes the base class with addressof(*sb*), and
direct-non-list-initializes *sb* with t, which, a[.](#10.sentence-1)
[🔗](#lib:basic_stringstream,constructor_______)
`basic_stringstream(basic_stringstream&& rhs);
`
[11](#11)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9849)
*Effects*: Move constructs from the rvalue rhs[.](#11.sentence-1)
This
is accomplished by move constructing the base class, and the containedbasic_stringbuf[.](#11.sentence-2)
Then calls basic_istream<charT, traits>::set_rdbuf(addressof(*sb*)) to install the contained basic_stringbuf[.](#11.sentence-3)

View File

@@ -0,0 +1,43 @@
[stringstream.general]
# 31 Input/output library [[input.output]](./#input.output)
## 31.8 String-based streams [[string.streams]](string.streams#stringstream.general)
### 31.8.5 Class template basic_stringstream [[stringstream]](stringstream#general)
#### 31.8.5.1 General [stringstream.general]
[🔗](#lib:basic_stringstream)
namespace std {template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>>class basic_stringstream : public basic_iostream<charT, traits> {public:using char_type = charT; using int_type = typename traits::int_type; using pos_type = typename traits::pos_type; using off_type = typename traits::off_type; using traits_type = traits; using allocator_type = Allocator; // [[stringstream.cons]](stringstream.cons "31.8.5.2Constructors"), constructors basic_stringstream() : basic_stringstream(ios_base::out | ios_base::in) {}explicit basic_stringstream(ios_base::openmode which); explicit basic_stringstream(const basic_string<charT, traits, Allocator>& s,
ios_base::openmode which = ios_base::out | ios_base::in);
basic_stringstream(ios_base::openmode which, const Allocator& a); explicit basic_stringstream( basic_string<charT, traits, Allocator>&& s,
ios_base::openmode which = ios_base::out | ios_base::in); template<class SAlloc> basic_stringstream(const basic_string<charT, traits, SAlloc>& s, const Allocator& a): basic_stringstream(s, ios_base::out | ios_base::in, a) {}template<class SAlloc> basic_stringstream(const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which, const Allocator& a); template<class SAlloc>explicit basic_stringstream(const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which = ios_base::out | ios_base::in); template<class T>explicit basic_stringstream(const T& t,
ios_base::openmode which = ios_base::out | ios_base::in); template<class T> basic_stringstream(const T& t, const Allocator& a); template<class T> basic_stringstream(const T& t, ios_base::openmode which, const Allocator& a);
basic_stringstream(const basic_stringstream&) = delete;
basic_stringstream(basic_stringstream&& rhs);
basic_stringstream& operator=(const basic_stringstream&) = delete;
basic_stringstream& operator=(basic_stringstream&& rhs); // [[stringstream.swap]](stringstream.swap "31.8.5.3Swap"), swapvoid swap(basic_stringstream& rhs); // [[stringstream.members]](stringstream.members "31.8.5.4Member functions"), members basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
basic_string<charT, traits, Allocator> str() const &; template<class SAlloc> basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
basic_string<charT, traits, Allocator> str() &&;
basic_string_view<charT, traits> view() const noexcept; void str(const basic_string<charT, traits, Allocator>& s); template<class SAlloc>void str(const basic_string<charT, traits, SAlloc>& s); void str(basic_string<charT, traits, Allocator>&& s); template<class T>void str(const T& t); private: basic_stringbuf<charT, traits, Allocator> *sb*; // *exposition only*};}
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9697)
The
class templatebasic_stringstream<charT, traits> supports reading and writing from objects of classbasic_string<charT, traits, Allocator>[.](#1.sentence-1)
It uses abasic_stringbuf<charT, traits, Allocator> object to control the associated sequence[.](#1.sentence-2)
For the sake of exposition, the maintained data is presented here as
- [(1.1)](#1.1)
*sb*, the stringbuf object[.](#1.sentence-3)

View File

@@ -0,0 +1,117 @@
[stringstream.members]
# 31 Input/output library [[input.output]](./#input.output)
## 31.8 String-based streams [[string.streams]](string.streams#stringstream.members)
### 31.8.5 Class template basic_stringstream [[stringstream]](stringstream#members)
#### 31.8.5.4 Member functions [stringstream.members]
[🔗](#lib:rdbuf,basic_stringstream)
`basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9896)
*Returns*: const_cast<basic_stringbuf<charT, traits, Allocator>*>(addressof(*sb*))[.](#1.sentence-1)
[🔗](#lib:str,basic_stringstream)
`basic_string<charT, traits, Allocator> str() const &;
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9907)
*Effects*: Equivalent to: return rdbuf()->str();
[🔗](#lib:str,basic_stringstream_)
`template<class SAlloc>
basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9919)
*Effects*: Equivalent to: return rdbuf()->str(sa);
[🔗](#lib:str,basic_stringstream__)
`basic_string<charT,traits,Allocator> str() &&;
`
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9930)
*Effects*: Equivalent to: return std::move(*rdbuf()).str();
[🔗](#lib:view,basic_stringstream)
`basic_string_view<charT, traits> view() const noexcept;
`
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9941)
*Effects*: Equivalent to: return rdbuf()->view();
[🔗](#lib:str,basic_stringstream___)
`void str(const basic_string<charT, traits, Allocator>& s);
`
[6](#6)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9952)
*Effects*: Equivalent to: rdbuf()->str(s);
[🔗](#lib:str,basic_stringstream____)
`template<class SAlloc>
void str(const basic_string<charT, traits, SAlloc>& s);
`
[7](#7)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9964)
*Effects*: Equivalent to: rdbuf()->str(s);
[🔗](#lib:str,basic_stringstream_____)
`void str(basic_string<charT, traits, Allocator>&& s);
`
[8](#8)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9975)
*Effects*: Equivalent to: rdbuf()->str(std::move(s));
[🔗](#lib:str,basic_stringstream______)
`template<class T>
void str(const T& t);
`
[9](#9)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9987)
*Constraints*: is_convertible_v<const T&, basic_string_view<charT, traits>> is true[.](#9.sentence-1)
[10](#10)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9992)
*Effects*: Equivalent to: rdbuf()->str(t);

View File

@@ -0,0 +1,33 @@
[stringstream.swap]
# 31 Input/output library [[input.output]](./#input.output)
## 31.8 String-based streams [[string.streams]](string.streams#stringstream.swap)
### 31.8.5 Class template basic_stringstream [[stringstream]](stringstream#swap)
#### 31.8.5.3 Swap [stringstream.swap]
[🔗](#lib:swap,basic_stringstream)
`void swap(basic_stringstream& rhs);
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9866)
*Effects*: Equivalent to:basic_iostream<charT,traits>::swap(rhs);*sb*.swap(rhs.*sb*);
[🔗](#lib:swap,basic_stringstream_)
`template<class charT, class traits, class Allocator>
void swap(basic_stringstream<charT, traits, Allocator>& x,
basic_stringstream<charT, traits, Allocator>& y);
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L9883)
*Effects*: Equivalent to x.swap(y)[.](#2.sentence-1)