LLVM 22.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::CachedFileStream Class Reference

This class wraps an output stream for a file. More...

#include "llvm/Support/Caching.h"

Public Member Functions

 CachedFileStream (std::unique_ptr< raw_pwrite_stream > OS, std::string OSPath="")
 
virtual Error commit ()
 Must be called exactly once after the writes to OS have been completed but before the CachedFileStream object is destroyed.
 
virtual ~CachedFileStream ()
 

Public Attributes

bool Committed = false
 
std::unique_ptr< raw_pwrite_streamOS
 
std::string ObjectPathName
 

Detailed Description

This class wraps an output stream for a file.

Most clients should just be able to return an instance of this base class from the stream callback, but if a client needs to perform some action after the stream is written to, that can be done by deriving from this class and overriding the destructor or the commit() method.

Definition at line 30 of file Caching.h.

Constructor & Destructor Documentation

◆ CachedFileStream()

llvm::CachedFileStream::CachedFileStream ( std::unique_ptr< raw_pwrite_stream OS,
std::string  OSPath = "" 
)
inline

Definition at line 32 of file Caching.h.

◆ ~CachedFileStream()

virtual llvm::CachedFileStream::~CachedFileStream ( )
inlinevirtual

Definition at line 50 of file Caching.h.

References Committed, and llvm::report_fatal_error().

Member Function Documentation

◆ commit()

virtual Error llvm::CachedFileStream::commit ( )
inlinevirtual

Must be called exactly once after the writes to OS have been completed but before the CachedFileStream object is destroyed.

Definition at line 38 of file Caching.h.

References Committed, llvm::createStringError(), llvm::make_error_code(), and llvm::Error::success().

Referenced by llvm::localCache().

Member Data Documentation

◆ Committed

bool llvm::CachedFileStream::Committed = false

Definition at line 47 of file Caching.h.

Referenced by commit(), and ~CachedFileStream().

◆ ObjectPathName

std::string llvm::CachedFileStream::ObjectPathName

Definition at line 49 of file Caching.h.

◆ OS

std::unique_ptr<raw_pwrite_stream> llvm::CachedFileStream::OS

Definition at line 48 of file Caching.h.


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