BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlde_utf8checkinginstreambufwrapper.h
Go to the documentation of this file.
1/// @file bdlde_utf8checkinginstreambufwrapper.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bdlde_utf8checkinginstreambufwrapper.h -*-C++-*-
8#ifndef INCLUDED_BDLDE_UTF8CHECKINGINSTREAMBUFWRAPPER
9#define INCLUDED_BDLDE_UTF8CHECKINGINSTREAMBUFWRAPPER
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bdlde_utf8checkinginstreambufwrapper bdlde_utf8checkinginstreambufwrapper
15/// @brief Provide a stream buffer wrapper for validating UTF-8 input.
16/// @addtogroup bdl
17/// @{
18/// @addtogroup bdlde
19/// @{
20/// @addtogroup bdlde_utf8checkinginstreambufwrapper
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bdlde_utf8checkinginstreambufwrapper-purpose"> Purpose</a>
25/// * <a href="#bdlde_utf8checkinginstreambufwrapper-classes"> Classes </a>
26/// * <a href="#bdlde_utf8checkinginstreambufwrapper-description"> Description </a>
27/// * <a href="#bdlde_utf8checkinginstreambufwrapper-positioning-at-the-start"> Positioning at the Start </a>
28/// * <a href="#bdlde_utf8checkinginstreambufwrapper-behavior-of-reads"> Behavior of Reads </a>
29/// * <a href="#bdlde_utf8checkinginstreambufwrapper-errorstatus"> errorStatus </a>
30/// * <a href="#bdlde_utf8checkinginstreambufwrapper-seeking"> Seeking </a>
31/// * <a href="#bdlde_utf8checkinginstreambufwrapper-valid-state"> Valid State </a>
32/// * <a href="#bdlde_utf8checkinginstreambufwrapper-usage"> Usage </a>
33/// * <a href="#bdlde_utf8checkinginstreambufwrapper-example-1-detecting-invalid-utf-8-read-from-a-streambuf"> Example 1: Detecting invalid UTF-8 read from a streambuf </a>
34///
35/// # Purpose {#bdlde_utf8checkinginstreambufwrapper-purpose}
36/// Provide a stream buffer wrapper for validating UTF-8 input.
37///
38/// # Classes {#bdlde_utf8checkinginstreambufwrapper-classes}
39///
40/// - bdlde::Utf8CheckingInStreamBufWrapper: wraps input streambuf, checks UTF-8
41///
42/// @see bsl_streambuf
43///
44/// # Description {#bdlde_utf8checkinginstreambufwrapper-description}
45/// This component provides a mechanism,
46/// `bdlde::Utf8CheckingInStreamBufWrapper`, that inherits from
47/// `bsl::streambuf`, and that holds and wraps another `streambuf`. It forwards
48/// input through the held streambuf, checking for invalid UTF-8. The wrapping
49/// object does not support output, only input. All normal input functions are
50/// supported. If the held `streambuf` supports seeking, seeks are supported,
51/// though not forward seeks, and `pubseekoff(0, bsl::ios_base::cur)` is
52/// supported whether the wrapped `streambuf` supports seeking or not.
53///
54/// Input is buffered, the buffer cannot be changed -- `pubsetbuf` is a no-op.
55///
56/// The client is normally recommended to use this object by reading from it
57/// until it behaves as though it has reached the end of input, and then call
58/// `errorStatus` to see if a UTF-8 error happened, and if so, then call
59/// `pubseekoff(0, bsl::ios_base::cur)` to find the position of the beginning of
60/// the invalid UTF-8 code point.
61///
62/// ## Positioning at the Start {#bdlde_utf8checkinginstreambufwrapper-positioning-at-the-start}
63///
64///
65/// When starting to read, the wrapped `streambuf` must be positioned at the
66/// beginning of a UTF-8 code point, or the end of data, otherwise, the wrapper
67/// will interpret the first byte read as incorrect UTF-8.
68///
69/// ## Behavior of Reads {#bdlde_utf8checkinginstreambufwrapper-behavior-of-reads}
70///
71///
72/// If incorrect UTF-8 exists in the data stream, reads will succeed until
73/// reaching the start of the incorrect code point, after which reads will
74/// behave as though the end of data were reached. All data returned by reads
75/// will be valid UTF-8. Reads of limited length that end before the end of
76/// data may return incomplete, truncated portions of valid UTF-8 code points.
77/// In that case, following reads will return the remainder of the same valid
78/// UTF-8 code point.
79///
80/// ## errorStatus {#bdlde_utf8checkinginstreambufwrapper-errorstatus}
81///
82///
83/// The `errorStatus` accessor is not a virtual function and is not inherited
84/// from `streambuf`.
85///
86/// If invalid UTF-8 is encountered while reading, input will succeed right up
87/// to the beginning of the invalid code point, at which point the object will
88/// behave as though it has reached the end of data, with the object positioned
89/// to exactly the start of the invalid code point. `errorStatus` will reflect
90/// the nature of the UTF-8 error.
91///
92/// If a seek error occurs, `errorStatus` will change to `k_SEEK_FAIL` and
93/// subsequent reads and relative seeks will fail, including
94/// `pubseekoff(0, bsl::ios_base::cur)`. A `reset` or an absolute seek to the
95/// start of data will reset `errorStatus` to 0 and the object will recover to
96/// being able to perform input and relative seeks.
97///
98/// UTF-8 errors can be recovered from by calling `reset` or by seeking at least
99/// one byte backward. Note that `pubseekoff(0, bsl::ios_base::cur)` after a
100/// UTF-8 error will return the object's position without changing the error
101/// state. Note that an absolute seek to the beginning of data will not recover
102/// unless it amounts to a seek at least one byte backward.
103///
104/// If input has reached invalid UTf-8, `errorStatus()` will be negative, and
105/// one of the values from `bdlde::Utf8Util::ErrorStatus`.
106///
107/// The class method `toAscii` can be called to translate any value returned by
108/// `errorStatus()` to a human-readable string.
109///
110/// ## Seeking {#bdlde_utf8checkinginstreambufwrapper-seeking}
111///
112///
113/// The wrapped `streambuf` must either support seeking or always return a
114/// negative value when a seek attempt is made.
115///
116/// Forward seeks and seeks relative to the end of data are not supported.
117///
118/// If the wrapped `streambuf` does not support seeking,
119/// `pubseekoff(0, bsl::ios_base::cur)` will still work on the wrapper and will
120/// return the offset relative to the input position when the wrapper was bound
121/// to the held `streambuf`, without changing the error state.
122///
123/// Seeks can fail for a number of reasons (see `seekoff`), and if that happens,
124/// the object will enter a "failed seek state", having no valid position, and
125/// will no longer be able to do input or do relative seeks until recovering by
126/// either doing an absolute seek to 0 or by having `reset` called. When the
127/// object is in a failed seek state, `errorStatus()` will equal `k_SEEK_FAIL`.
128///
129/// ## Valid State {#bdlde_utf8checkinginstreambufwrapper-valid-state}
130///
131///
132/// If the object has been bound via `reset` to a held `streambuf` and is not in
133/// a failed seek state, the object is in a valid state.
134///
135/// ## Usage {#bdlde_utf8checkinginstreambufwrapper-usage}
136///
137///
138/// This section illustrates intended use of this component.
139///
140/// ### Example 1: Detecting invalid UTF-8 read from a streambuf {#bdlde_utf8checkinginstreambufwrapper-example-1-detecting-invalid-utf-8-read-from-a-streambuf}
141///
142///
143/// Suppose one has a `streambuf`, `myStreamBuf` containing UTF-8 that one wants
144/// to read, checking that it is valid UTF-8.
145///
146/// First, create a `Utf8CheckingInStreamBufWrapper` that will wrap
147/// `myStreamBuf`:
148/// @code
149/// typedef bdlde::Utf8CheckingInStreamBufWrapper Obj;
150/// Obj wrapper;
151/// wrapper.reset(&myStreamBuf);
152/// @endcode
153/// Then, read the data from the `wrapper` `streambuf` until it stops yielding
154/// data.
155/// @code
156/// std::string s;
157/// bsl::streamsize len = 0, bytesRead;
158/// do {
159/// enum { k_READ_CHUNK = 10 };
160///
161/// s.resize(len + k_READ_CHUNK);
162///
163/// bytesRead = wrapper.sgetn(&s[len], k_READ_CHUNK);
164///
165/// assert(0 <= bytesRead);
166/// assert(bytesRead <= k_READ_CHUNK);
167///
168/// s.resize((len += bytesRead));
169/// } while (0 < bytesRead);
170///
171/// assert(wrapper.pubseekoff(0, bsl::ios_base::cur) == Obj::pos_type(len));
172/// @endcode
173/// Next, use the `errorStatus` accessor and `pubseekoff` manipulator to see
174/// what, if anything, went wrong and where.
175/// @code
176/// const int es = wrapper.errorStatus();
177///
178/// if (0 == es) {
179/// cout << "No errors occurred.\n";
180/// }
181/// else if (es < 0) {
182/// cout << "Incorrect UTF-8 encountered " << Obj::toAscii(es) <<
183/// " at offset " << wrapper.pubseekoff(0, bsl::ios_base::cur) << endl;
184/// }
185/// else {
186/// cout << "Non-UTF-8 error " << Obj::toAscii(es) << endl;
187/// }
188/// @endcode
189/// Now, we observe the output:
190/// @code
191/// Incorrect UTF-8 encountered UNEXPECTED_CONTINUATION_OCTET at offset 79
192/// @endcode
193/// Finally, we observe that all the data from `myStreamBuf` up to offset 79
194/// was read into `s`, and that it's all correct UTF-8.
195/// @code
196/// assert(len == s.end() - s.begin());
197/// assert(bdlde::Utf8Util::isValid(&s[0], len));
198/// @endcode
199/// @}
200/** @} */
201/** @} */
202
203/** @addtogroup bdl
204 * @{
205 */
206/** @addtogroup bdlde
207 * @{
208 */
209/** @addtogroup bdlde_utf8checkinginstreambufwrapper
210 * @{
211 */
212
213#include <bdlscm_version.h>
214
215#include <bslma_allocator.h>
217
219
220#include <bsls_keyword.h>
221#include <bsls_types.h>
222
223#include <bsl_ios.h> // 'streamsize'
224#include <bsl_locale.h>
225#include <bsl_streambuf.h> // 'char_type', 'int_type', 'pos_type', 'off_type',
226 // @ref traits_type are within the 'bsl::streambuf'
227 // class
228
229
230namespace bdlde {
231
232 // ====================================
233 // class Utf8CheckingInStreamBufWrapper
234 // ====================================
235
236/// This `class` inherits from `bsl::streambuf`, and holds and wraps another
237/// `streambuf`. It forwards input through the held streambuf, and checks
238/// for invalid UTF-8. The wrapping object does not support ouput, only
239/// input. If the held `streambuf` supports seeking, seeks are supported,
240/// though not forward seeks, and `pubseekoff(0, bsl::ios_base::cur)` is
241/// supported whether the wrapped `streambuf` supports seeking or not.
242///
243/// See @ref bdlde_utf8checkinginstreambufwrapper
244class Utf8CheckingInStreamBufWrapper : public bsl::streambuf {
245
246 // PRIVATE TYPES
247 typedef bsls::Types::IntPtr IntPtr; // A signed integral type the size of
248 // a pointer
249
250 enum {
251 k_PBACK_BUF_SIZE = 8, // size of putback buffer
252 k_BUF_SIZE = 8 * 1024 // input buffer size
253 };
254
255 public:
256 // PUBLIC TYPES
257 enum {
258 k_SEEK_FAIL = +1 // seek failure
259 };
260
261 private:
262 // DATA
263 bsl::streambuf *d_heldStreamBuf_p; // the 'streambuf' that this object
264 // wraps around, which is held, not
265 // owned.
266
267 int d_errorStatus; // The error status of this object.
268 //: o A value from
269 //: 'Utf8Util::ErrorStatus' if a
270 //: UTF-8 error has occurred. Note
271 //: that these are all -ve values.
272 //:
273 //: o 'k_SEEK_FAIL' (positive)
274 //: if a seek error has occurred
275 //:
276 //: o 0 if no error has occured,
277 //: including if end of file has
278 //: been reached
279
280 int d_bufEndStatus; // status at the end of the buffer,
281 // which may not have been reached
282 // yet
283
284 char_type *d_buf_p; // input buffer
285
286 char d_pBackBuf[k_PBACK_BUF_SIZE];
287 // for putback mode (see above)
288
289 char_type *d_savedEback_p; // only used in putback-mode, the
290 // saved value of non-putback mode
291 // 'eback' from the base class (note
292 // that when we enter putback-mode,
293 // 'eback() == gptr()', so it's not
294 // necessary to have a
295 // 'd_savedGptr_p')
296
297 char_type *d_savedEgptr_p; // only used in putback-mode, the
298 // saved value of non-putback mode
299 // 'egptr' from the base class
300
301 pos_type d_offset; // in non-putback mode, the offset of
302 // 'eback()', in putback mode, the
303 // offset of 'egptr()'
304
305 bool d_seekable; // 'true' if held 'streambuf' is
306 // seekable and 'false' otherwise
307
308 bool d_putBackMode; // 'true' if we're in putback mode,
309 // 'false' if normal input
310
311 bslma::Allocator *d_allocator_p; // used for allocation of 'd_buf_p'
312
313 public:
314 // TRAITS
317
318 private:
319 // PRIVATE MANIPULATOR
320
321 /// Set the state of this object to the failed seek state and return a
322 /// negative position, if the held `streambuf` is seekable, pass the
323 /// specified `mode` to a seek to the beginning of the file.
324 pos_type setSeekFailure(bsl::ios_base::openmode mode);
325
326 protected:
327 // PROTECTED MANIPULATORS
328
329 // implementation functions
330
331 // The following member functions are virtual and protected. They are part
332 // of the implementation and are called by other functions in this class or
333 // by functions in the base class. These functions have no corresponding
334 // public member functions that call them.
335
336 /// Unconditionally return `traits_type::eof()`. The optionally
337 /// specified argument is ignored.
338 int_type overflow(int_type = traits_type::eof()) BSLS_KEYWORD_OVERRIDE;
339
340 /// Return the number of bytes that are guaranteed that can be read
341 /// before `underflow` returns `eof`. If the object is not in a valid
342 /// state, -1 will be returned. Note that often, the actual number of
343 /// bytes that can be read will be much greater than the value returned
344 /// by this function.
346
347 /// Replenish the input buffer with data obtained from the held
348 /// `streambuf`, and return the next byte of input (or `eof` if no input
349 /// is available). This function assumes that either the input buffer
350 /// is empty or that the end of it has been reached. If this object is
351 /// not in a valid state, `eof` will be returned.
353
354 // functions forwarded to by
355 // corresponding public functions
356
357 // The following protected virtual functions all have corresponding public
358 // methods in the base class that forward to them.
359
360 /// If `sb` is the name of the `streambuf` held by this object, set `sb`
361 /// to the specified `locale` as though `sb.pubimbue(locale)` had been
362 /// called. If this object does not hold a `streambuf`, this method has
363 /// no effect. Note that this function is forwarded to by the public
364 /// method `pubimbue` in the base class.
365 void imbue(const bsl::locale& locale) BSLS_KEYWORD_OVERRIDE;
366
367 /// Back up input one byte. Return the byte at the new position, or
368 /// `eof` with the state of this object unchanged on failure. If the
369 /// optionally specified `c` is not `eof`, substitute `c` for the
370 /// previous byte and return that value. If `c` is `eof`, do not
371 /// substitute it for the previous byte and return the byte was there,
372 /// or if the previous byte is unknown, fail. If values of `c` that are
373 /// not `eof` are specified, this function will succeed for at least 8
374 /// successive calls, possibly many more times. The behavior is
375 /// undefined unless `c` is either `eof` or a value representable as a
376 /// @ref char_type . Note that this is forwarded to with a @ref char_type
377 /// passed to `c` by the public method `sputbackc` in the base class,
378 /// and called with `eof` passed to `c` by the public method `sungetc`
379 /// in the base class.
380 int_type pbackfail(int_type c = traits_type::eof()) BSLS_KEYWORD_OVERRIDE;
381
382 /// Move the position associated with this object according to the
383 /// specified `offset` and `whence`:
384 ///
385 /// * If `whence` is `bsl::ios_base::beg`, set the position to `offset`
386 /// bytes from the beginning.
387 /// * If `whence` is `bsl::ios_base::cur`, advance the position by
388 /// `offset` bytes (note that `offset` is signed).
389 /// * `whence == bsl::ios_base::end` is unsupported and a seek fail
390 /// will result.
391 ///
392 /// A seek can fail if
393 ///
394 /// * the object was already in a failed seek state and the seek was
395 /// not an absolute seek to the beginning,
396 /// * the object is not bound to a held `streambuf`,
397 /// * `whence` is not `bsl::ios_base::beg` or `bsl::ios_base::cur`,
398 /// * the destination is negative,
399 /// * the destination is forward of the current position, or
400 /// * a seek on the held `streambuf` is necessary and that `streambuf`
401 /// does not support seeking,
402 ///
403 /// which will put the object into a `failed seek state`. When the
404 /// object is in a failed seek state, `errorStatus()` will equal
405 /// `k_SEEK_FAIL` and the object will no longer have a valid position,
406 /// meaning that input and relative seeks will fail, until the object is
407 /// made to recover by either calling `reset` or an absolute seek to
408 /// position 0.
409 ///
410 /// If a seek is performed on the held `streambuf`, the specified `mode`
411 /// will be propagated to it. The behavior is undefined unless
412 /// `bsl::ios_base::in` is set in `mode`. Note that this function is
413 /// forwarded to by the public method `pubseekoff` in the base class.
414 ///
415 /// `seekoff(0, bsl::ios_base::cur, mode)` is permissible whether the
416 /// held `streambuf` is seekable or not and will never result in a seek
417 /// on the held `streambuf`, returning the position in terms of the held
418 /// `streambuf` if that `streambuf` is seekable and returning the
419 /// position relative to when the held `streambuf` was bound to this
420 /// object otherwise.
421 ///
422 /// Some non-zero seeks will be performed without a seek on the held
423 /// `streambuf`, but there is no simple way for the client to predict
424 /// when this will be the case.
425 pos_type seekoff(off_type offset,
426 bsl::ios_base::seekdir whence,
427 bsl::ios_base::openmode mode) BSLS_KEYWORD_OVERRIDE;
428
429 /// Set the position of this object to the specified absolute `offset`.
430 /// If a seek on the held `streambuf` occurs, the specified `mode` is
431 /// passed to it. This function delegates to
432 /// `seekoff(offset, bsl::ios_base::beg, mode)`, see that function for
433 /// further detail. The behavior is undefined unless
434 /// `bsl::ios_base::in` is set in `mode`. Note that this function is
435 /// forwarded to by the public method `pubseekpos` in the base class.
436 pos_type seekpos(pos_type offset,
437 bsl::ios_base::openmode mode) BSLS_KEYWORD_OVERRIDE;
438
439 /// Read up to the specified `numBytes` characters from this object to
440 /// the specified `buffer` and return the number of characters
441 /// successfully read. A return value of 0 means that either a UTF-8
442 /// error or end of file has been encountered (`errorStatus` must be
443 /// called to distinguish between the two), but a non-zero return value
444 /// less than `numBytes` will usually be returned when neither end of
445 /// file nor a UTF-8 error has been encountered. The behavior is
446 /// undefined unless `4 <= numBytes`. Note that this function is
447 /// forwarded to by the public method `sgetn` in the base class.
448 bsl::streamsize xsgetn(char *buffer,
449 bsl::streamsize numBytes) BSLS_KEYWORD_OVERRIDE;
450
451 /// Output function, not supported in this input-only implementation;
452 /// stubbed out, arguments ignored, returns 0. Note that this function
453 /// is forwarded to by `sputn` in the base class.
454 bsl::streamsize xsputn(const char *,
455 bsl::streamsize ) BSLS_KEYWORD_OVERRIDE;
456
457 private:
458 // NOT IMPLEMENTED
463
464 public:
465 // CLASS METHODS
466
467 /// Return a description of the specified `errorStatus`. Note that
468 /// `errorStatus` is either:
469 /// * `k_SEEK_FAIL`
470 /// * A value from `Utf8Util::ErrorStatus`, which are all negative, in
471 /// the case of invalid UTF-8.
472 /// * 0 if no errors have occurred, in which case `NO_ERROR` will be
473 /// returned. Note that this includes the case where end of file has
474 /// been reached without any error occurring.
475 /// * If `errorStatus` is an invalid value, "(* unrecognized value *)"
476 /// will be returned.
477 static
478 const char *toAscii(int errorStatus);
479
480 // CREATORS
481
483 /// Create a `Utf8StreamBufInputWrapper` object having no associated
484 /// `streambuf`. Optionally specify a `basicAllocator` used to supply
485 /// memory. If `basicAllocator` is 0 or not specified, the currently
486 /// installed default allocator is used.
487 explicit Utf8CheckingInStreamBufWrapper(bslma::Allocator *basicAllocator);
488
489 /// Create a `Utf8StreamBufInputWrapper` associated with the specified
490 /// `streamBuf`. Optionally specify a `basicAllocator` used to supply
491 /// memory. If `basicAllocator` is 0, the currently installed default
492 /// allocator is used.
493 explicit
494 Utf8CheckingInStreamBufWrapper(bsl::streambuf *streamBuf,
495 bslma::Allocator *basicAllocator = 0);
496
497 /// Destroy this object.
499
500 // MANIPULATOR
501
502 /// Associate this object with the specified `streamBuf`, releasing any
503 /// previously held `streambuf`.
504 void reset(bsl::streambuf *streamBuf);
505
506 // ACCESSORS
507
508 /// Return the current error mode of this object. This will be either 0
509 /// (no errors or end of data), `k_SEEK_FAIL`, which is positive, or a
510 /// value from `Utf8Util::ErrorStatus`, which are all negative.
511 int errorStatus() const;
512
513 /// Return `true` if this wrapper currently holds a `streambuf` and is
514 /// not in a failed seek state.
515 bool isValid() const;
516};
517
518// ============================================================================
519// INLINE DEFINITIONS
520// ============================================================================
521
522// ACCESSORS
523inline
525{
526 return d_errorStatus;
527}
528
529inline
531{
532 return d_heldStreamBuf_p && k_SEEK_FAIL != d_errorStatus;
533}
534
535} // close package namespace
536
537
538#endif
539
540// ----------------------------------------------------------------------------
541// Note that this implementation is derived from 'bdls::FdStreamBuf' which is
542// based on STLPort's implementation of 'filebuf', with copyright notice as
543// follows:
544//
545// Adapted to bde from STLport, 2009
546// 'bdls::FdStreamBuf' from 'bsl::filebuf'
547// 'bdls::FdStreamBuf_FileHandler' from 'bsl::_Filebuf_base'
548//
549// Copyright (c) 1999
550// Silicon Graphics Computer Systems, Inc.
551//
552// Copyright (c) 1999
553// Boris Fomitchev
554//
555// This material is provided "as is", with absolutely no warranty expressed
556// or implied. Any use is at your own risk.
557//
558// Permission to use or copy this software for any purpose is hereby granted
559// without fee, provided the above notices are retained on all copies.
560// Permission to modify the code and to distribute modified code is granted,
561// provided the above notices are retained, and a notice that the code was
562// modified is included with the above copyright notice.
563// ----------------------------------------------------------------------------
564
565// ----------------------------------------------------------------------------
566// Copyright 2020 Bloomberg Finance L.P.
567//
568// Licensed under the Apache License, Version 2.0 (the "License");
569// you may not use this file except in compliance with the License.
570// You may obtain a copy of the License at
571//
572// http://www.apache.org/licenses/LICENSE-2.0
573//
574// Unless required by applicable law or agreed to in writing, software
575// distributed under the License is distributed on an "AS IS" BASIS,
576// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
577// See the License for the specific language governing permissions and
578// limitations under the License.
579// ----------------------------- END-OF-FILE ----------------------------------
580
581/** @} */
582/** @} */
583/** @} */
Definition bdlde_utf8checkinginstreambufwrapper.h:244
pos_type seekoff(off_type offset, bsl::ios_base::seekdir whence, bsl::ios_base::openmode mode) BSLS_KEYWORD_OVERRIDE
int_type pbackfail(int_type c=traits_type::eof()) BSLS_KEYWORD_OVERRIDE
bsl::streamsize xsputn(const char *, bsl::streamsize) BSLS_KEYWORD_OVERRIDE
pos_type seekpos(pos_type offset, bsl::ios_base::openmode mode) BSLS_KEYWORD_OVERRIDE
bsl::streamsize showmanyc() BSLS_KEYWORD_OVERRIDE
@ k_SEEK_FAIL
Definition bdlde_utf8checkinginstreambufwrapper.h:258
BSLMF_NESTED_TRAIT_DECLARATION(Utf8CheckingInStreamBufWrapper, bslma::UsesBslmaAllocator)
void reset(bsl::streambuf *streamBuf)
bsl::streamsize xsgetn(char *buffer, bsl::streamsize numBytes) BSLS_KEYWORD_OVERRIDE
int errorStatus() const
Definition bdlde_utf8checkinginstreambufwrapper.h:524
void imbue(const bsl::locale &locale) BSLS_KEYWORD_OVERRIDE
int_type overflow(int_type=traits_type::eof()) BSLS_KEYWORD_OVERRIDE
bool isValid() const
Definition bdlde_utf8checkinginstreambufwrapper.h:530
static const char * toAscii(int errorStatus)
int_type underflow() BSLS_KEYWORD_OVERRIDE
Definition bslma_allocator.h:457
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_DELETED
Definition bsls_keyword.h:609
#define BSLS_KEYWORD_OVERRIDE
Definition bsls_keyword.h:653
Definition bdlde_base64alphabet.h:118
Definition bdlb_printmethods.h:283
Definition balxml_encoderoptions.h:68
Definition bslma_usesbslmaallocator.h:343
std::ptrdiff_t IntPtr
Definition bsls_types.h:130