BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdls::TempDirectoryGuard Class Reference

#include <bdls_tempdirectoryguard.h>

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (TempDirectoryGuard, bslma::UsesBslmaAllocator)
 
 TempDirectoryGuard (const bsl::string &prefix, bslma::Allocator *basicAllocator=0)
 
 ~TempDirectoryGuard ()
 
const bsl::stringgetTempDirName () const
 

Detailed Description

This class implements a scoped temporary directory guard. The guard tries to create a temporary directory in the system-wide temp directory and falls back to the current directory.

See bdls_tempdirectoryguard

Constructor & Destructor Documentation

◆ TempDirectoryGuard()

bdls::TempDirectoryGuard::TempDirectoryGuard ( const bsl::string prefix,
bslma::Allocator basicAllocator = 0 
)
explicit

Create temporary directory with the specified prefix in the system-wide temp or current directory. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ ~TempDirectoryGuard()

bdls::TempDirectoryGuard::~TempDirectoryGuard ( )

Destroy this object and remove the temporary directory (recursively) created at construction.

Member Function Documentation

◆ BSLMF_NESTED_TRAIT_DECLARATION()

bdls::TempDirectoryGuard::BSLMF_NESTED_TRAIT_DECLARATION ( TempDirectoryGuard  ,
bslma::UsesBslmaAllocator   
)

◆ getTempDirName()

const bsl::string & bdls::TempDirectoryGuard::getTempDirName ( ) const

Return a const reference to the name of the created temporary directory.


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