[#BloombergLP-bdlde-Utf8CheckingInStreamBufWrapper]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlde.adoc[bdlde]::Utf8CheckingInStreamBufWrapper
:relfileprefix: ../../
:mrdocs:

Streambuf wrapper that forwards input and validates UTF&hyphen;8&period;

== Synopsis

Declared in `&lt;bdlde&lowbar;utf8checkinginstreambufwrapper&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class Utf8CheckingInStreamBufWrapper
    : public std::streambuf
----

== Description

This `class` inherits from `bsl&colon;&colon;streambuf`, and holds and wraps another `streambuf`&period; It forwards input through the held streambuf, and checks for invalid UTF&hyphen;8&period; The wrapping object does not support ouput, only input&period; If the held `streambuf` supports seeking, seeks are supported, though not forward seeks, and `pubseekoff(0, bsl&colon;&colon;ios&lowbar;base&colon;&colon;cur)` is supported whether the wrapped `streambuf` supports seeking or not&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `std::streambuf`
| 
|===

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/_04enum.adoc[`Unnamed enum`] 
| Error status values for seek failures&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/2constructor-059.adoc[`Utf8CheckingInStreamBufWrapper`]         [.small]#[constructor]#
| Create a UTF&hyphen;8 checking streambuf wrapper with no associated streambuf&period;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/2constructor-0d.adoc[`Utf8CheckingInStreamBufWrapper`]         [.small]#[constructor]#
| Create an empty UTF&hyphen;8 checking streambuf wrapper using the specified `basicAllocator` to supply memory&period;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/2constructor-05f.adoc[`Utf8CheckingInStreamBufWrapper`]         [.small]#[constructor]#
| Create a UTF&hyphen;8 checking streambuf wrapper associated with `streamBuf`&period;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/2destructor.adoc[`&#126;Utf8CheckingInStreamBufWrapper`] [.small]#[destructor]# [.small]#[virtual]#
| Destroy this object&period;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/errorStatus.adoc[`errorStatus`] 
| Return the current error status of this object&period;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/isValid.adoc[`isValid`] 
| Return `true` if this wrapper currently holds a `streambuf` and is not in a failed seek state&period;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/reset.adoc[`reset`] 
| Associate this object with the specified `streamBuf`, releasing any previously held `streambuf`&period;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;Utf8CheckingInStreamBufWrapper, UsesBslmaAllocator&gt;`] 
| `Utf8CheckingInStreamBufWrapper` uses a `bslma` allocator&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/toAscii.adoc[`toAscii`] 
| Return a human&hyphen;readable description of the specified error status&period;
|===


== Protected Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/imbue.adoc[`imbue`]  [.small]#[virtual]#
| Propagate the specified locale to the held streambuf, if any&period;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/overflow.adoc[`overflow`]  [.small]#[virtual]#
| Unconditionally return `traits&lowbar;type&colon;&colon;eof()`&period;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/pbackfail.adoc[`pbackfail`]  [.small]#[virtual]#
| Put back one byte of input, optionally substituting a character&period;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/seekoff.adoc[`seekoff`]  [.small]#[virtual]#
| Move the position associated with this object according to the specified `offset` and `whence`&colon;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/seekpos.adoc[`seekpos`]  [.small]#[virtual]#
| Set the position of this object to the specified absolute offset&period;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/showmanyc.adoc[`showmanyc`]  [.small]#[virtual]#
| Return how many bytes can be read before underflow may return eof&period;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/underflow.adoc[`underflow`]  [.small]#[virtual]#
| Replenish the input buffer and return the next input byte&period;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/xsgetn.adoc[`xsgetn`]  [.small]#[virtual]#
| Read up to the specified number of characters into the buffer&period;
| xref:BloombergLP/bdlde/Utf8CheckingInStreamBufWrapper/xsputn.adoc[`xsputn`]  [.small]#[virtual]#
| Attempt to write characters&semi; always fails in this input&hyphen;only wrapper&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
