LLVM API Documentation
#include <FileSystem.h>
Public Types | |
enum | mapmode { readonly, readwrite, priv } |
typedef char | char_type |
Public Member Functions | |
mapped_file_region (mapped_file_region &&) | |
mapped_file_region & | operator= (mapped_file_region &&) |
mapped_file_region (const Twine &path, mapmode mode, uint64_t length, uint64_t offset, std::error_code &ec) | |
mapped_file_region (int fd, bool closefd, mapmode mode, uint64_t length, uint64_t offset, std::error_code &ec) | |
~mapped_file_region () | |
mapmode | flags () const |
uint64_t | size () const |
char * | data () const |
const char * | const_data () const |
Static Public Member Functions | |
static int | alignment () |
This class represents a memory mapped file. It is based on boost::iostreams::mapped_file.
Definition at line 621 of file FileSystem.h.
typedef char llvm::sys::fs::mapped_file_region::char_type |
Definition at line 647 of file FileSystem.h.
readonly |
May only access map via const_data as read only. |
readwrite |
May access map via data and modify it. Written to path. |
priv |
May modify via data, but changes are lost on destruction. |
Definition at line 627 of file FileSystem.h.
llvm::sys::fs::mapped_file_region::mapped_file_region | ( | mapped_file_region && | ) |
llvm::sys::fs::mapped_file_region::mapped_file_region | ( | const Twine & | path, |
mapmode | mode, | ||
uint64_t | length, | ||
uint64_t | offset, | ||
std::error_code & | ec | ||
) |
Construct a mapped_file_region at path starting at offset of length length and with access mode.
path | Path to the file to map. If it does not exist it will be created. |
mode | How to map the memory. |
length | Number of bytes to map in starting at offset. If the file is shorter than this, it will be extended. If length is 0, the entire file will be mapped. |
offset | Byte offset from the beginning of the file where the map should begin. Must be a multiple of mapped_file_region::alignment(). |
ec | This is set to errc::success if the map was constructed successfully. Otherwise it is set to a platform dependent error. |
llvm::sys::fs::mapped_file_region::mapped_file_region | ( | int | fd, |
bool | closefd, | ||
mapmode | mode, | ||
uint64_t | length, | ||
uint64_t | offset, | ||
std::error_code & | ec | ||
) |
fd | An open file descriptor to map. mapped_file_region takes ownership if closefd is true. It must have been opended in the correct mode. |
static int llvm::sys::fs::mapped_file_region::alignment | ( | ) | [static] |
const char* llvm::sys::fs::mapped_file_region::const_data | ( | ) | const |
Get a const view of the data. Modifying this memory has undefined behavior.
char* llvm::sys::fs::mapped_file_region::data | ( | ) | const |
mapped_file_region& llvm::sys::fs::mapped_file_region::operator= | ( | mapped_file_region && | ) |
uint64_t llvm::sys::fs::mapped_file_region::size | ( | ) | const |