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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Class template `wbuffer_convert` <a id="depr.conversions.buffer">[[depr.conversions.buffer]]</a>
|
| 2 |
+
|
| 3 |
+
Class template `wbuffer_convert` looks like a wide stream buffer, but
|
| 4 |
+
performs all its I/O through an underlying byte stream buffer that you
|
| 5 |
+
specify when you construct it. Like class template `wstring_convert`, it
|
| 6 |
+
lets you specify a code conversion facet to perform the conversions,
|
| 7 |
+
without affecting any streams or locales.
|
| 8 |
+
|
| 9 |
+
``` cpp
|
| 10 |
+
namespace std {
|
| 11 |
+
template <class Codecvt, class Elem = wchar_t, class Tr = char_traits<Elem>>
|
| 12 |
+
class wbuffer_convert : public basic_streambuf<Elem, Tr> {
|
| 13 |
+
public:
|
| 14 |
+
using state_type = typename Codecvt::state_type;
|
| 15 |
+
|
| 16 |
+
explicit wbuffer_convert(streambuf* bytebuf = 0,
|
| 17 |
+
Codecvt* pcvt = new Codecvt,
|
| 18 |
+
state_type state = state_type());
|
| 19 |
+
|
| 20 |
+
~wbuffer_convert();
|
| 21 |
+
|
| 22 |
+
wbuffer_convert(const wbuffer_convert&) = delete;
|
| 23 |
+
wbuffer_convert& operator=(const wbuffer_convert&) = delete;
|
| 24 |
+
|
| 25 |
+
streambuf* rdbuf() const;
|
| 26 |
+
streambuf* rdbuf(streambuf* bytebuf);
|
| 27 |
+
|
| 28 |
+
state_type state() const;
|
| 29 |
+
|
| 30 |
+
private:
|
| 31 |
+
streambuf* bufptr; // exposition only
|
| 32 |
+
Codecvt* cvtptr; // exposition only
|
| 33 |
+
state_type cvtstate; // exposition only
|
| 34 |
+
};
|
| 35 |
+
}
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
The class template describes a stream buffer that controls the
|
| 39 |
+
transmission of elements of type `Elem`, whose character traits are
|
| 40 |
+
described by the class `Tr`, to and from a byte stream buffer of type
|
| 41 |
+
`streambuf`. Conversion between a sequence of `Elem` values and
|
| 42 |
+
multibyte sequences is performed by an object of class `Codecvt`, which
|
| 43 |
+
shall meet the requirements of the standard code-conversion facet
|
| 44 |
+
`codecvt<Elem, char, mbstate_t>`.
|
| 45 |
+
|
| 46 |
+
An object of this class template stores:
|
| 47 |
+
|
| 48 |
+
- `bufptr` — a pointer to its underlying byte stream buffer
|
| 49 |
+
- `cvtptr` — a pointer to the allocated conversion object (which is
|
| 50 |
+
freed when the `wbuffer_convert` object is destroyed)
|
| 51 |
+
- `cvtstate` — a conversion state object
|
| 52 |
+
|
| 53 |
+
``` cpp
|
| 54 |
+
state_type state() const;
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
*Returns:* `cvtstate`.
|
| 58 |
+
|
| 59 |
+
``` cpp
|
| 60 |
+
streambuf* rdbuf() const;
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
*Returns:* `bufptr`.
|
| 64 |
+
|
| 65 |
+
``` cpp
|
| 66 |
+
streambuf* rdbuf(streambuf* bytebuf);
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
*Effects:* Stores `bytebuf` in `bufptr`.
|
| 70 |
+
|
| 71 |
+
*Returns:* The previous value of `bufptr`.
|
| 72 |
+
|
| 73 |
+
``` cpp
|
| 74 |
+
using state_type = typename Codecvt::state_type;
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
The type shall be a synonym for `Codecvt::state_type`.
|
| 78 |
+
|
| 79 |
+
``` cpp
|
| 80 |
+
explicit wbuffer_convert(
|
| 81 |
+
streambuf* bytebuf = 0,
|
| 82 |
+
Codecvt* pcvt = new Codecvt,
|
| 83 |
+
state_type state = state_type());
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
*Requires:* `pcvt != nullptr`.
|
| 87 |
+
|
| 88 |
+
*Effects:* The constructor constructs a stream buffer object,
|
| 89 |
+
initializes `bufptr` to `bytebuf`, initializes `cvtptr` to `pcvt`, and
|
| 90 |
+
initializes `cvtstate` to `state`.
|
| 91 |
+
|
| 92 |
+
``` cpp
|
| 93 |
+
~wbuffer_convert();
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
*Effects:* The destructor shall delete `cvtptr`.
|
| 97 |
+
|
| 98 |
+
<!-- Link reference definitions -->
|
| 99 |
+
[basic.align]: basic.md#basic.align
|
| 100 |
+
[basic.scope.namespace]: basic.md#basic.scope.namespace
|
| 101 |
+
[basic.types]: basic.md#basic.types
|
| 102 |
+
[class.copy]: special.md#class.copy
|
| 103 |
+
[class.dtor]: special.md#class.dtor
|
| 104 |
+
[cmath.syn]: numerics.md#cmath.syn
|
| 105 |
+
[complex.syn]: numerics.md#complex.syn
|
| 106 |
+
[containers]: containers.md#containers
|
| 107 |
+
[cstddef.syn]: language.md#cstddef.syn
|
| 108 |
+
[dcl.attr.deprecated]: dcl.md#dcl.attr.deprecated
|
| 109 |
+
[dcl.fct.def]: dcl.md#dcl.fct.def
|
| 110 |
+
[default.allocator]: utilities.md#default.allocator
|
| 111 |
+
[depr]: #depr
|
| 112 |
+
[depr.c.headers]: #depr.c.headers
|
| 113 |
+
[depr.ccomplex.syn]: #depr.ccomplex.syn
|
| 114 |
+
[depr.codecvt.syn]: #depr.codecvt.syn
|
| 115 |
+
[depr.conversions]: #depr.conversions
|
| 116 |
+
[depr.conversions.buffer]: #depr.conversions.buffer
|
| 117 |
+
[depr.conversions.string]: #depr.conversions.string
|
| 118 |
+
[depr.cpp.headers]: #depr.cpp.headers
|
| 119 |
+
[depr.cstdalign.syn]: #depr.cstdalign.syn
|
| 120 |
+
[depr.cstdbool.syn]: #depr.cstdbool.syn
|
| 121 |
+
[depr.ctgmath.syn]: #depr.ctgmath.syn
|
| 122 |
+
[depr.default.allocator]: #depr.default.allocator
|
| 123 |
+
[depr.except.spec]: #depr.except.spec
|
| 124 |
+
[depr.func.adaptor.binding]: #depr.func.adaptor.binding
|
| 125 |
+
[depr.func.adaptor.typedefs]: #depr.func.adaptor.typedefs
|
| 126 |
+
[depr.impldec]: #depr.impldec
|
| 127 |
+
[depr.istrstream]: #depr.istrstream
|
| 128 |
+
[depr.istrstream.cons]: #depr.istrstream.cons
|
| 129 |
+
[depr.istrstream.members]: #depr.istrstream.members
|
| 130 |
+
[depr.iterator.basic]: #depr.iterator.basic
|
| 131 |
+
[depr.iterator.primitives]: #depr.iterator.primitives
|
| 132 |
+
[depr.locale.stdcvt]: #depr.locale.stdcvt
|
| 133 |
+
[depr.locale.stdcvt.req]: #depr.locale.stdcvt.req
|
| 134 |
+
[depr.meta.types]: #depr.meta.types
|
| 135 |
+
[depr.negators]: #depr.negators
|
| 136 |
+
[depr.ostrstream]: #depr.ostrstream
|
| 137 |
+
[depr.ostrstream.cons]: #depr.ostrstream.cons
|
| 138 |
+
[depr.ostrstream.members]: #depr.ostrstream.members
|
| 139 |
+
[depr.static_constexpr]: #depr.static_constexpr
|
| 140 |
+
[depr.storage.iterator]: #depr.storage.iterator
|
| 141 |
+
[depr.str.strstreams]: #depr.str.strstreams
|
| 142 |
+
[depr.strstream]: #depr.strstream
|
| 143 |
+
[depr.strstream.cons]: #depr.strstream.cons
|
| 144 |
+
[depr.strstream.dest]: #depr.strstream.dest
|
| 145 |
+
[depr.strstream.oper]: #depr.strstream.oper
|
| 146 |
+
[depr.strstreambuf]: #depr.strstreambuf
|
| 147 |
+
[depr.strstreambuf.cons]: #depr.strstreambuf.cons
|
| 148 |
+
[depr.strstreambuf.members]: #depr.strstreambuf.members
|
| 149 |
+
[depr.strstreambuf.virtuals]: #depr.strstreambuf.virtuals
|
| 150 |
+
[depr.temporary.buffer]: #depr.temporary.buffer
|
| 151 |
+
[depr.uncaught]: #depr.uncaught
|
| 152 |
+
[depr.util.smartptr.shared.obs]: #depr.util.smartptr.shared.obs
|
| 153 |
+
[depr.weak.result_type]: #depr.weak.result_type
|
| 154 |
+
[expr.unary.op]: expr.md#expr.unary.op
|
| 155 |
+
[func.bind.bind]: utilities.md#func.bind.bind
|
| 156 |
+
[func.def]: utilities.md#func.def
|
| 157 |
+
[function.objects]: utilities.md#function.objects
|
| 158 |
+
[meta.rqmts]: utilities.md#meta.rqmts
|
| 159 |
+
[namespace.udecl]: dcl.md#namespace.udecl
|
| 160 |
+
[new.delete]: language.md#new.delete
|
| 161 |
+
[output.iterators]: iterators.md#output.iterators
|
| 162 |
+
[sf.cmath]: numerics.md#sf.cmath
|
| 163 |
+
[support.types.byteops]: language.md#support.types.byteops
|
| 164 |
+
[tab:future.c.headers]: #tab:future.c.headers
|
| 165 |
+
[tab:future.newoff.values]: #tab:future.newoff.values
|
| 166 |
+
[tab:future.seekoff.positioning]: #tab:future.seekoff.positioning
|
| 167 |
+
[tab:future.strstreambuf.effects]: #tab:future.strstreambuf.effects
|
| 168 |
+
[tab:future.strstreambuf1.effects]: #tab:future.strstreambuf1.effects
|
| 169 |
+
[tab:future.strstreambuf2.effects]: #tab:future.strstreambuf2.effects
|
| 170 |
+
[temp.deduct]: temp.md#temp.deduct
|
| 171 |
+
[unord.hash]: utilities.md#unord.hash
|
| 172 |
+
[util.smartptr.shared]: utilities.md#util.smartptr.shared
|
| 173 |
+
|
| 174 |
+
[^1]: The function signature `strlen(const char*)` is declared in
|
| 175 |
+
`<cstring>` ([[cstring.syn]]). The macro `INT_MAX` is defined in
|
| 176 |
+
`<climits>` ([[climits.syn]]).
|
| 177 |
+
|
| 178 |
+
[^2]: An implementation should consider `alsize` in making this
|
| 179 |
+
decision.
|
| 180 |
+
|
| 181 |
+
[^3]: The function signature `strlen(const char*)` is declared in
|
| 182 |
+
`<cstring>` ([[cstring.syn]]).
|