|
Android-cuttlefish cvd tool
|
#include <mapped_file.h>
Public Member Functions | |
| ~MappedFile () | |
| MappedFile (MappedFile &&other) | |
| MappedFile & | operator= (MappedFile &&other) |
| char * | data () const |
| size_t | size () const |
Static Public Member Functions | |
| static std::unique_ptr< MappedFile > | FromFd (borrowed_fd fd, off64_t offset, size_t length, int prot) |
| static std::unique_ptr< MappedFile > | FromOsHandle (os_handle h, off64_t offset, size_t length, int prot) |
Private Member Functions | |
| DISALLOW_IMPLICIT_CONSTRUCTORS (MappedFile) | |
| void | Close () |
| MappedFile (char *base, size_t size, size_t offset) | |
Private Attributes | |
| char * | base_ |
| size_t | size_ |
| size_t | offset_ |
A region of a file mapped into memory (for grepping: also known as MmapFile or file mapping).
| android::base::MappedFile::~MappedFile | ( | ) |
Removes the mapping.
| android::base::MappedFile::MappedFile | ( | MappedFile && | other | ) |
Not copyable but movable.
|
inlineprivate |
|
private |
|
inline |
|
private |
|
static |
Creates a new mapping of the file pointed to by fd. Unlike the underlying OS primitives, offset does not need to be page-aligned. If PROT_WRITE is set in prot, the mapping will be writable, otherwise it will be read-only. Mappings are always MAP_SHARED.
|
static |
Same thing, but using the raw OS file handle instead of a CRT wrapper.
| MappedFile & android::base::MappedFile::operator= | ( | MappedFile && | other | ) |
|
inline |
|
private |
|
private |
|
private |