[#BloombergLP-bslim-FuzzUtil-consumeRandomLengthAsciiString-00]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslim.adoc[bslim]::xref:BloombergLP/bslim/FuzzUtil.adoc[FuzzUtil]::consumeRandomLengthAsciiString
:relfileprefix: ../../../
:mrdocs:

Load into `output` a printable ASCII string of length at most `maxLength`&period;

== Synopsis

Declared in `&lt;bslim&lowbar;fuzzutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
consumeRandomLengthAsciiString(
    xref:bsl/string.adoc[bsl::string]* output,
    xref:BloombergLP/bslim/FuzzDataView.adoc[FuzzDataView]* fuzzDataView,
    std::size&lowbar;t maxLength);
----

== Description

Load into the specified `output` a string consisting of printable ASCII characters of length from 0 to the specified `maxLength`&period; If the specified `fuzzDataView` has fewer bytes than `maxLength`, load at most `fuzzDataView&hyphen;&gt;length()` bytes into `output`&period; If the buffer in `fuzzDataView` contains two successive backslash characters, then in `output` they will be converted to a single backslash () character&semi; if a single backslash character is encountered, the consumption of bytes is terminated&period; Note that because double backslashes are mapped to single backslashes, more than `maxLength` bytes may be consumed from the buffer to produce the `output`&period; Also note that the generated string is also a valid UTF&hyphen;8 string&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *output*
| destination for the generated string
| *fuzzDataView*
| view providing fuzz input bytes
| *maxLength*
| maximum number of characters to load into `output`
|===


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