From Jason Turner

[stringstream]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp5pniqs5g/{from.md → to.md} +79 -1
tmp/tmp5pniqs5g/{from.md → to.md} RENAMED
@@ -34,11 +34,11 @@ namespace std {
34
  basic_stringbuf<charT,traits,Allocator>* rdbuf() const;
35
  basic_string<charT,traits,Allocator> str() const;
36
  void str(const basic_string<charT,traits,Allocator>& str);
37
 
38
  private:
39
- basic_stringbuf<charT, traits> sb; // exposition onlyr
40
  };
41
 
42
  template <class charT, class traits, class Allocator>
43
  void swap(basic_stringstream<charT, traits, Allocator>& x,
44
  basic_stringstream<charT, traits, Allocator>& y);
@@ -52,5 +52,83 @@ and writing from objects of class
52
  associated sequence. For the sake of exposition, the maintained data is
53
  presented here as
54
 
55
  - `sb`, the `stringbuf` object.
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  basic_stringbuf<charT,traits,Allocator>* rdbuf() const;
35
  basic_string<charT,traits,Allocator> str() const;
36
  void str(const basic_string<charT,traits,Allocator>& str);
37
 
38
  private:
39
+ basic_stringbuf<charT, traits> sb; // exposition only
40
  };
41
 
42
  template <class charT, class traits, class Allocator>
43
  void swap(basic_stringstream<charT, traits, Allocator>& x,
44
  basic_stringstream<charT, traits, Allocator>& y);
 
52
  associated sequence. For the sake of exposition, the maintained data is
53
  presented here as
54
 
55
  - `sb`, the `stringbuf` object.
56
 
57
+ #### basic_stringstream constructors <a id="stringstream.cons">[[stringstream.cons]]</a>
58
+
59
+ ``` cpp
60
+ explicit basic_stringstream(
61
+ ios_base::openmode which = ios_base::out|ios_base::in);
62
+ ```
63
+
64
+ *Effects:* Constructs an object of class
65
+ `basic_stringstream<charT,traits>`, initializing the base class with
66
+ `basic_iostream(&sb)` and initializing `sb` with
67
+ `basic_stringbuf<charT,traits,Allocator>(which)`.
68
+
69
+ ``` cpp
70
+ explicit basic_stringstream(
71
+ const basic_string<charT,traits,Allocator>& str,
72
+ ios_base::openmode which = ios_base::out|ios_base::in);
73
+ ```
74
+
75
+ *Effects:* Constructs an object of class
76
+ `basic_stringstream<charT, traits>`, initializing the base class with
77
+ `basic_iostream(&sb)` and initializing `sb` with
78
+ `basic_stringbuf<charT, traits, Allocator>(str, which)`.
79
+
80
+ ``` cpp
81
+ basic_stringstream(basic_stringstream&& rhs);
82
+ ```
83
+
84
+ *Effects:* Move constructs from the rvalue `rhs`. This is accomplished
85
+ by move constructing the base class, and the contained
86
+ `basic_stringbuf`. Next `basic_istream<charT,traits>::set_rdbuf(&sb)` is
87
+ called to install the contained `basic_stringbuf`.
88
+
89
+ #### Assign and swap <a id="stringstream.assign">[[stringstream.assign]]</a>
90
+
91
+ ``` cpp
92
+ basic_stringstream& operator=(basic_stringstream&& rhs);
93
+ ```
94
+
95
+ *Effects:* Move assigns the base and members of `*this` from the base
96
+ and corresponding members of `rhs`.
97
+
98
+ *Returns:* `*this`.
99
+
100
+ ``` cpp
101
+ void swap(basic_stringstream& rhs);
102
+ ```
103
+
104
+ *Effects:* Exchanges the state of `*this` and `rhs` by calling
105
+ `basic_iostream<charT,traits>::swap(rhs)` and `sb.swap(rhs.sb)`.
106
+
107
+ ``` cpp
108
+ template <class charT, class traits, class Allocator>
109
+ void swap(basic_stringstream<charT, traits, Allocator>& x,
110
+ basic_stringstream<charT, traits, Allocator>& y);
111
+ ```
112
+
113
+ *Effects:* `x.swap(y)`.
114
+
115
+ #### Member functions <a id="stringstream.members">[[stringstream.members]]</a>
116
+
117
+ ``` cpp
118
+ basic_stringbuf<charT,traits,Allocator>* rdbuf() const;
119
+ ```
120
+
121
+ *Returns:* `const_cast<basic_stringbuf<charT,traits,Allocator>*>(&sb)`
122
+
123
+ ``` cpp
124
+ basic_string<charT,traits,Allocator> str() const;
125
+ ```
126
+
127
+ *Returns:* `rdbuf()->str()`.
128
+
129
+ ``` cpp
130
+ void str(const basic_string<charT,traits,Allocator>& str);
131
+ ```
132
+
133
+ *Effects:* Calls `rdbuf()->str(str)`.
134
+