[#ReadBinaryFile]
= ReadBinaryFile
:mrdocs:

Read full contents of a file and return them in a std&colon;&colon;string&period;

== Synopsis

Declared in `&lt;util&sol;readwritefile&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::pair&lt;bool, std::string&gt;
ReadBinaryFile(
    xref:fs/path.adoc[fs::path] const& filename,
    size&lowbar;t maxsize = std&colon;&colon;numeric&lowbar;limits&lt;size&lowbar;t&gt;&colon;&colon;max());
----

== Return Value

A pair &lt;status, string&gt;&period; If an error occurred, status is false&semi; otherwise status is true and the file contents are returned in the string&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *filename*
| Path of the file to read&period;
| *maxsize*
| Puts a maximum size limit on the file that is read&period; If the file is larger than this, truncated data (with len &gt; maxsize) will be returned&period;
|===


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