|
LLVM 24.0.0git
|
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 after the writes to OS have been completed successfully but before the CachedFileStream object is destroyed. | |
| virtual Error | commit (std::unique_ptr< MemoryBuffer > MemBuf) |
| virtual Error | abort () |
| Must be called if the file was not committed before its destroyed (for example if some writes didn't complete). | |
| virtual | ~CachedFileStream () |
Public Attributes | |
| bool | Committed = false |
| bool | Aborted = false |
| std::unique_ptr< raw_pwrite_stream > | OS |
| std::string | ObjectPathName |
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. Before destruction of this class, either commit() or abort() must be called.
|
inline |
Definition at line 32 of file Caching.h.
References llvm::move(), ObjectPathName, and OS.
Referenced by llvm::localCache().
|
inlinevirtual |
Definition at line 70 of file Caching.h.
References Aborted, Committed, and llvm::report_fatal_error().
|
inlinevirtual |
Must be called if the file was not committed before its destroyed (for example if some writes didn't complete).
Definition at line 56 of file Caching.h.
References Aborted, Committed, llvm::createStringError(), llvm::make_error_code(), OS, and llvm::Error::success().
Referenced by llvm::localCache().
|
inlinevirtual |
Must be called after the writes to OS have been completed successfully but before the CachedFileStream object is destroyed.
Definition at line 38 of file Caching.h.
References Aborted, Committed, llvm::createStringError(), llvm::make_error_code(), and llvm::Error::success().
Referenced by commit(), and llvm::localCache().
|
inlinevirtual |
| bool llvm::CachedFileStream::Aborted = false |
Definition at line 67 of file Caching.h.
Referenced by abort(), commit(), and ~CachedFileStream().
| bool llvm::CachedFileStream::Committed = false |
Definition at line 66 of file Caching.h.
Referenced by abort(), commit(), and ~CachedFileStream().
| std::string llvm::CachedFileStream::ObjectPathName |
Definition at line 69 of file Caching.h.
Referenced by CachedFileStream().
| std::unique_ptr<raw_pwrite_stream> llvm::CachedFileStream::OS |
Definition at line 68 of file Caching.h.
Referenced by abort(), and CachedFileStream().