llvm::FileOutputBuffer

In-memory buffer that is written to a file when committed.

Synopsis

Declared in <llvm/Support/FileOutputBuffer.h>

class FileOutputBuffer;

Description

During the lifetime of these objects, the content or existence of the specified file is undefined. That is, creating an OutputBuffer for a file may immediately remove the file. If the FileOutputBuffer is committed, the target file's content will become the buffer content at the time of the commit. If the FileOutputBuffer is not committed, the file will be deleted in the FileOutputBuffer destructor.

Enums

NameDescription
Unnamed enum Flags controlling FileOutputBuffer::create behavior.

Member Functions

NameDescription
~FileOutputBuffer [destructor] [virtual]Destroy this buffer, omitting the file if it was never committed.
commit [virtual]Flush the buffer to its file and deallocate it.
discard [virtual]This removes the temporary file (unless it already was committed) but keeps the memory mapping alive.
getBufferEnd [virtual]Returns a pointer to the end of the buffer.
getBufferSize [virtual]Returns size of the buffer.
getBufferStart [virtual]Returns a pointer to the start of the buffer.
getPath Returns path where file will show up if buffer is committed.

Static Member Functions

NameDescription
create Create a FileOutputBuffer for a read/write buffer of the given size.

Protected Member Functions

NameDescription
FileOutputBuffer [constructor]Construct a FileOutputBuffer that will write to Path when committed.

Protected Data Members

NameDescription
FinalPath Path where the file will appear if the buffer is committed.