LLVM  10.0.0svn
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::sys::fs::mapped_file_region Class Reference

This class represents a memory mapped file. More...

#include "llvm/Support/FileSystem.h"

Public Types

enum  mapmode { readonly, readwrite, priv }

Public Member Functions

 mapped_file_region ()=delete
 mapped_file_region (mapped_file_region &)=delete
mapped_file_regionoperator= (mapped_file_region &)=delete
 mapped_file_region (sys::fs::file_t fd, mapmode mode, size_t length, uint64_t offset, std::error_code &ec)
 ~mapped_file_region ()
size_t size () const
chardata () const
const charconst_data () const
 Get a const view of the data. More...

Static Public Member Functions

static int alignment ()

Detailed Description

This class represents a memory mapped file.

It is based on boost::iostreams::mapped_file.

Definition at line 1160 of file FileSystem.h.

Member Enumeration Documentation

◆ mapmode


May only access map via const_data as read only.


May access map via data and modify it. Written to path.


May modify via data, but changes are lost on destruction.

Definition at line 1162 of file FileSystem.h.

Constructor & Destructor Documentation

◆ mapped_file_region() [1/3]

llvm::sys::fs::mapped_file_region::mapped_file_region ( )

◆ mapped_file_region() [2/3]

llvm::sys::fs::mapped_file_region::mapped_file_region ( mapped_file_region )

◆ mapped_file_region() [3/3]

llvm::sys::fs::mapped_file_region::mapped_file_region ( sys::fs::file_t  fd,
mapmode  mode,
size_t  length,
uint64_t  offset,
std::error_code &  ec 
fdAn open file descriptor to map. Does not take ownership of fd.

◆ ~mapped_file_region()

llvm::sys::fs::mapped_file_region::~mapped_file_region ( )

Member Function Documentation

◆ alignment()

static int llvm::sys::fs::mapped_file_region::alignment ( )
The minimum alignment offset must be.

Referenced by llvm::MemoryBuffer::getFileSlice().

◆ const_data()

const char* llvm::sys::fs::mapped_file_region::const_data ( ) const

Get a const view of the data.

Modifying this memory has undefined behavior.

Referenced by llvm::MemoryBuffer::getFileSlice().

◆ data()

char* llvm::sys::fs::mapped_file_region::data ( ) const

◆ operator=()

mapped_file_region& llvm::sys::fs::mapped_file_region::operator= ( mapped_file_region )

◆ size()

size_t llvm::sys::fs::mapped_file_region::size ( ) const

The documentation for this class was generated from the following file: