LLVM 20.0.0git
Public Member Functions | List of all members
llvm::unittest::TempLink Class Reference

A RAII object that creates a link upon initialization and removes it upon destruction. More...

#include "llvm/Testing/Support/SupportHelpers.h"

Public Member Functions

 TempLink (StringRef Target, StringRef Link)
 Creates a managed link at path Link pointing to Target.
 
 ~TempLink ()
 
 TempLink (const TempLink &)=delete
 
TempLinkoperator= (const TempLink &)=delete
 
 TempLink (TempLink &&)=default
 
TempLinkoperator= (TempLink &&)=default
 
StringRef path () const
 The path to the link.
 

Detailed Description

A RAII object that creates a link upon initialization and removes it upon destruction.

The link may be a soft or a hard link, depending on the platform.

Definition at line 173 of file SupportHelpers.h.

Constructor & Destructor Documentation

◆ TempLink() [1/3]

llvm::unittest::TempLink::TempLink ( StringRef  Target,
StringRef  Link 
)
inline

Creates a managed link at path Link pointing to Target.

Definition at line 178 of file SupportHelpers.h.

References llvm::sys::fs::create_link().

◆ ~TempLink()

llvm::unittest::TempLink::~TempLink ( )
inline

Definition at line 185 of file SupportHelpers.h.

References llvm::sys::fs::remove().

◆ TempLink() [2/3]

llvm::unittest::TempLink::TempLink ( const TempLink )
delete

◆ TempLink() [3/3]

llvm::unittest::TempLink::TempLink ( TempLink &&  )
default

Member Function Documentation

◆ operator=() [1/2]

TempLink & llvm::unittest::TempLink::operator= ( const TempLink )
delete

◆ operator=() [2/2]

TempLink & llvm::unittest::TempLink::operator= ( TempLink &&  )
default

◆ path()

StringRef llvm::unittest::TempLink::path ( ) const
inline

The path to the link.

Definition at line 198 of file SupportHelpers.h.


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