LLVM  6.0.0svn
Public Member Functions | List of all members
OnDiskBuffer Class Reference
Inheritance diagram for OnDiskBuffer:
Inheritance graph
[legend]
Collaboration diagram for OnDiskBuffer:
Collaboration graph
[legend]

Public Member Functions

 OnDiskBuffer (StringRef Path, fs::TempFile Temp, std::unique_ptr< fs::mapped_file_region > Buf)
 
uint8_t * getBufferStart () const override
 Returns a pointer to the start of the buffer. More...
 
uint8_t * getBufferEnd () const override
 Returns a pointer to the end of the buffer. More...
 
size_t getBufferSize () const override
 Returns size of the buffer. More...
 
Error commit () override
 Flushes the content of the buffer to its file and deallocates the buffer. More...
 
 ~OnDiskBuffer () override
 
- Public Member Functions inherited from llvm::FileOutputBuffer
StringRef getPath () const
 Returns path where file will show up if buffer is committed. More...
 
virtual ~FileOutputBuffer ()
 If this object was previously committed, the destructor just deletes this object. More...
 

Additional Inherited Members

- Public Types inherited from llvm::FileOutputBuffer
enum  { F_executable = 1 }
 
- Static Public Member Functions inherited from llvm::FileOutputBuffer
static Expected< std::unique_ptr< FileOutputBuffer > > create (StringRef FilePath, size_t Size, unsigned Flags=0)
 Factory method to create an OutputBuffer object which manages a read/write buffer of the specified size. More...
 
- Protected Member Functions inherited from llvm::FileOutputBuffer
 FileOutputBuffer (StringRef Path)
 
- Protected Attributes inherited from llvm::FileOutputBuffer
std::string FinalPath
 

Detailed Description

Definition at line 34 of file FileOutputBuffer.cpp.

Constructor & Destructor Documentation

◆ OnDiskBuffer()

OnDiskBuffer::OnDiskBuffer ( StringRef  Path,
fs::TempFile  Temp,
std::unique_ptr< fs::mapped_file_region Buf 
)
inline

Definition at line 36 of file FileOutputBuffer.cpp.

◆ ~OnDiskBuffer()

OnDiskBuffer::~OnDiskBuffer ( )
inlineoverride

Definition at line 56 of file FileOutputBuffer.cpp.

References llvm::consumeError().

Member Function Documentation

◆ commit()

Error OnDiskBuffer::commit ( )
inlineoverridevirtual

Flushes the content of the buffer to its file and deallocates the buffer.

If commit() is not called before this object's destructor is called, the file is deleted in the destructor. The optional parameter is used if it turns out you want the file size to be smaller than initially requested.

Implements llvm::FileOutputBuffer.

Definition at line 48 of file FileOutputBuffer.cpp.

◆ getBufferEnd()

uint8_t* OnDiskBuffer::getBufferEnd ( ) const
inlineoverridevirtual

Returns a pointer to the end of the buffer.

Implements llvm::FileOutputBuffer.

Definition at line 42 of file FileOutputBuffer.cpp.

◆ getBufferSize()

size_t OnDiskBuffer::getBufferSize ( ) const
inlineoverridevirtual

Returns size of the buffer.

Implements llvm::FileOutputBuffer.

Definition at line 46 of file FileOutputBuffer.cpp.

◆ getBufferStart()

uint8_t* OnDiskBuffer::getBufferStart ( ) const
inlineoverridevirtual

Returns a pointer to the start of the buffer.

Implements llvm::FileOutputBuffer.

Definition at line 40 of file FileOutputBuffer.cpp.


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