LLVM 22.0.0git
llvm::vfs::OnDiskOutputBackend Class Reference

An output backend that creates files on disk, wrapping APIs in sys::fs. More...

#include "llvm/Support/VirtualOutputBackends.h"

Inheritance diagram for llvm::vfs::OnDiskOutputBackend:
[legend]

Classes

struct  OutputSettings
 On disk output settings. More...

Public Member Functions

Error makeAbsolute (SmallVectorImpl< char > &Path) const
 Resolve an absolute path.
IntrusiveRefCntPtr< OnDiskOutputBackendclone () const
 OnDiskOutputBackend ()=default
Public Member Functions inherited from llvm::vfs::OutputBackend
IntrusiveRefCntPtr< OutputBackendclone () const
 Get a backend that points to the same destination as this one but that has independent settings.
Expected< OutputFilecreateFile (const Twine &Path, std::optional< OutputConfig > Config=std::nullopt)
 Create a file.
virtual ~OutputBackend ()=default
Public Member Functions inherited from llvm::RefCountedBase< OutputBackend >
unsigned UseCount () const
void Retain () const
void Release () const

Public Attributes

OutputSettings Settings
 Settings for this backend.

Protected Member Functions

IntrusiveRefCntPtr< OutputBackendcloneImpl () const override
 Must be thread-safe.
Expected< std::unique_ptr< OutputFileImpl > > createFileImpl (StringRef Path, std::optional< OutputConfig > Config) override
 Create a file for Path.
Protected Member Functions inherited from llvm::vfs::OutputBackend
 OutputBackend ()=default
Protected Member Functions inherited from llvm::RefCountedBase< OutputBackend >
 RefCountedBase ()=default
RefCountedBaseoperator= (const RefCountedBase &)=delete
 ~RefCountedBase ()

Detailed Description

An output backend that creates files on disk, wrapping APIs in sys::fs.

Definition at line 79 of file VirtualOutputBackends.h.

Constructor & Destructor Documentation

◆ OnDiskOutputBackend()

llvm::vfs::OnDiskOutputBackend::OnDiskOutputBackend ( )
default

Member Function Documentation

◆ clone()

IntrusiveRefCntPtr< OnDiskOutputBackend > llvm::vfs::OnDiskOutputBackend::clone ( ) const
inline

Definition at line 108 of file VirtualOutputBackends.h.

References llvm::makeIntrusiveRefCnt(), and Settings.

Referenced by cloneImpl().

◆ cloneImpl()

IntrusiveRefCntPtr< OutputBackend > llvm::vfs::OnDiskOutputBackend::cloneImpl ( ) const
inlineoverrideprotectedvirtual

Must be thread-safe.

Virtual function has a different name than clone() so that implementations can override the return value.

Implements llvm::vfs::OutputBackend.

Definition at line 83 of file VirtualOutputBackends.h.

References clone().

◆ createFileImpl()

Expected< std::unique_ptr< OutputFileImpl > > OnDiskOutputBackend::createFileImpl ( StringRef Path,
std::optional< OutputConfig > Config )
overrideprotectedvirtual

Create a file for Path.

Must be thread-safe.

Precondition
Config is valid or std::nullopt.

Implements llvm::vfs::OutputBackend.

Definition at line 583 of file VirtualOutputBackends.cpp.

References makeAbsolute(), and Settings.

◆ makeAbsolute()

Error OnDiskOutputBackend::makeAbsolute ( SmallVectorImpl< char > & Path) const

Resolve an absolute path.

Definition at line 577 of file VirtualOutputBackends.cpp.

References llvm::vfs::convertToOutputError(), and llvm::sys::fs::make_absolute().

Referenced by createFileImpl().

Member Data Documentation

◆ Settings

OutputSettings llvm::vfs::OnDiskOutputBackend::Settings

Settings for this backend.

Access is not thread-safe.

Definition at line 119 of file VirtualOutputBackends.h.

Referenced by clone(), and createFileImpl().


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