class MappedVmoFile
Defined at line 23 of file ../../src/lib/elfldltl/include/lib/elfldltl/mapped-vmo-file.h
elfldltl::MappedVmoFile provides the File and Memory APIs and most other
features of elfldltl::DirectMemory (see
<lib
/elfldltl/memory.h>), but on
a read-only mapping of a VMO's entire contents as the file contents.
The object is default-constructible and move-only. The Init() function uses
an unowned VMO handle to set up the mapping but does not need the handle
thereafter. The mapping will be removed on the object's destruction.
Public Methods
zx::result<> Init (zx::unowned_vmo vmo, zx::unowned_vmar vmar)
This initializes for read-only access to the whole VMO.
The Memory API considers the start of the VMO to be address zero.
Defined at line 13 of file ../../src/lib/elfldltl/mapped-vmo-file.cc
void MappedVmoFile ()
Defined at line 25 of file ../../src/lib/elfldltl/include/lib/elfldltl/mapped-vmo-file.h
void MappedVmoFile (const MappedVmoFile & )
Defined at line 27 of file ../../src/lib/elfldltl/include/lib/elfldltl/mapped-vmo-file.h
void MappedVmoFile (MappedVmoFile && other)
Defined at line 29 of file ../../src/lib/elfldltl/include/lib/elfldltl/mapped-vmo-file.h
zx::result<> InitMutable (zx::unowned_vmo vmo, size_t size, uintptr_t base, zx::unowned_vmar vmar)
This initializes for read-write access to the VMO of the given size. The
base address for the Memory API to assign the beginning of the VMO can be
set with the optional third argument.
Defined at line 35 of file ../../src/lib/elfldltl/mapped-vmo-file.cc
MappedVmoFile & operator= (MappedVmoFile && other)
Defined at line 37 of file ../../src/lib/elfldltl/include/lib/elfldltl/mapped-vmo-file.h
void ~MappedVmoFile ()
Defined at line 48 of file ../../src/lib/elfldltl/mapped-vmo-file.cc
template <typename T>
auto ReadFromFile (size_t offset)
The DirectMemory methods are non-const so that things tested with
DirectMemory don't assume const-ness that the Memory API doesn't require.
But they actually have const-safe behavior, and it's convenient for
MappedVmoFile to be usable as const.
Defined at line 64 of file ../../src/lib/elfldltl/include/lib/elfldltl/mapped-vmo-file.h
template <typename T, typename Allocator>
auto ReadArrayFromFile (size_t offset, Allocator && allocator, size_t count)
Defined at line 69 of file ../../src/lib/elfldltl/include/lib/elfldltl/mapped-vmo-file.h
template <typename T>
auto ReadArray (uintptr_t ptr, size_t count)
Defined at line 75 of file ../../src/lib/elfldltl/include/lib/elfldltl/mapped-vmo-file.h
template <typename T>
auto ReadArray (uintptr_t ptr)
Defined at line 80 of file ../../src/lib/elfldltl/include/lib/elfldltl/mapped-vmo-file.h