[#BloombergLP-bdls-TempDirectoryGuard]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::TempDirectoryGuard
:relfileprefix: ../../
:mrdocs:

This class implements a scoped temporary directory guard&period; The guard tries to create a temporary directory in the system&hyphen;wide temp directory and falls back to the current directory&period;

== Synopsis

Declared in `&lt;bdls&lowbar;tempdirectoryguard&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class TempDirectoryGuard;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdls/TempDirectoryGuard/2constructor.adoc[`TempDirectoryGuard`]         [.small]#[constructor]#
| Create temporary directory with the specified `prefix` in the system&hyphen;wide temp or current directory&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period;
| xref:BloombergLP/bdls/TempDirectoryGuard/2destructor.adoc[`&#126;TempDirectoryGuard`] [.small]#[destructor]#
| Destroy this object and remove the temporary directory (recursively) created at construction&period;
| xref:BloombergLP/bdls/TempDirectoryGuard/getTempDirName.adoc[`getTempDirName`] 
| Return a `const` reference to the name of the created temporary directory, or an empty string if the directory was released from management&period;
| xref:BloombergLP/bdls/TempDirectoryGuard/release.adoc[`release`] 
| Remove the created temporary directory from management so that, upon this guards destruction, the created directory is not removed&period; Calling `release` on a guard that has previously been released has no effect&period;
| xref:BloombergLP/bdls/TempDirectoryGuard/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;TempDirectoryGuard, UsesBslmaAllocator&gt;`] 
| 
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
