|
BDE 4.39.x Production Release
|
#include <bdls_tempdirectoryguard.h>
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.
Public Member Functions | |
| BSLMF_NESTED_TRAIT_DECLARATION (TempDirectoryGuard, bslma::UsesBslmaAllocator) | |
| TempDirectoryGuard (const bsl::string_view &prefix, bslma::Allocator *basicAllocator=0) | |
| ~TempDirectoryGuard () | |
| void | release () |
| const bsl::string & | getTempDirName () const |
|
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.
| bdls::TempDirectoryGuard::~TempDirectoryGuard | ( | ) |
Destroy this object and remove the temporary directory (recursively) created at construction.
| bdls::TempDirectoryGuard::BSLMF_NESTED_TRAIT_DECLARATION | ( | TempDirectoryGuard | , |
| bslma::UsesBslmaAllocator | |||
| ) |
| const bsl::string & bdls::TempDirectoryGuard::getTempDirName | ( | ) | const |
Return a const reference to the name of the created temporary directory, or an empty string if the directory was released from management.
| void bdls::TempDirectoryGuard::release | ( | ) |
Remove the created temporary directory from management so that, upon this guards destruction, the created directory is not removed. Calling release on a guard that has previously been released has no effect.