[#BloombergLP-balst-Resolver_FileHelper]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balst.adoc[balst]::Resolver&lowbar;FileHelper
:relfileprefix: ../../
:mrdocs:

This class provides a low&hyphen;level file utility functions for `Resolver&lt;Elf&gt;`&period; This class contains the file descriptor of current object file&period; Note that the file is opened readonly, and all reads specify the offset, so the offset of the file descriptor is not considered part of the state of this object&period;

== Synopsis

Declared in `&lt;balst&lowbar;resolver&lowbar;filehelper&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class Resolver&lowbar;FileHelper;
----

== Type Aliases

[cols="1"]
|===
| Name
| xref:BloombergLP/balst/Resolver_FileHelper/Offset.adoc[`Offset`] 
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balst/Resolver_FileHelper/_04enum.adoc[`Unnamed enum`] 
| length in bytes of d&lowbar;buffer&lowbar;p&semi; 32K minus a little so we don&apos;t waste a page
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balst/Resolver_FileHelper/2constructor.adoc[`Resolver&lowbar;FileHelper`]         [.small]#[constructor]#
| Create a file helper object in an invalid state&period;
| xref:BloombergLP/balst/Resolver_FileHelper/fileSize.adoc[`fileSize`] 
| The size of the open file or mapped segment&period;
| xref:BloombergLP/balst/Resolver_FileHelper/loadString.adoc[`loadString`] 
| Read a null&hyphen;terminated string from `offset` in the file or mapped file into `writeSpan` and return a `string&lowbar;view` to the string&period; If we run out of room in `writeSpan`, reach end of file, or reach end of mapped area, return a non&hyphen;null&hyphen;terminated `string&lowbar;view`&period; The behavior is undefined unless `!outSpan&period;empty()` and `offset &gt;&equals; 0`&period; Note that the returned `string&lowbar;view` never contains the terminating `0`&period;
| xref:BloombergLP/balst/Resolver_FileHelper/openFile.adoc[`openFile`] 
| Open the file referred to by the specified `fileName` for read&hyphen;only access, and if it opens successfully, set `d&lowbar;reader` to a `FileReader` type and bind it to the opened file&period; Return 0 on success and a non&hyphen;zero value otherwise&period;
| xref:BloombergLP/balst/Resolver_FileHelper/openMappedFile.adoc[`openMappedFile`] 
| Open this object to access the memory referred to by the specified `mappedFile` as if it were a disk file&period; Return 0 on success and a non&hyphen;zero value otherwise&period;
| xref:BloombergLP/balst/Resolver_FileHelper/readBytes.adoc[`readBytes`] 
| Read into the specified `outSpan` up to the specified `outSpan&period;size()` of data starting at the specified `offset` in the current ELF file&period; Return a span referring to the section of `outSpan` containing, which can be empty&period; The behavior is undefined unless `!outSpan&period;empty()` and `offset &gt;&equals; 0`&period;
| xref:BloombergLP/balst/Resolver_FileHelper/readExact.adoc[`readExact`] 
| Read into the specified `outSpan` exactly the specified `outSpan&period;size()` bytes of data starting at the specified `offset` in the current ELF file&period; Return 0 on success, or a negative value otherwise&period; The behavior is undefined unless `!outSpan&period;empty()` and `offset &gt;&equals; 0`&period;
|===



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