[#BloombergLP-bdls-TempDirectoryGuard] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::TempDirectoryGuard :relfileprefix: ../../ :mrdocs: 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. == Synopsis Declared in `<bdls_tempdirectoryguard.h>` [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‐wide temp or current directory. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. | xref:BloombergLP/bdls/TempDirectoryGuard/2destructor.adoc[`~TempDirectoryGuard`] [.small]#[destructor]# | Destroy this object and remove the temporary directory (recursively) created at construction. | 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. | 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. Calling `release` on a guard that has previously been released has no effect. | xref:BloombergLP/bdls/TempDirectoryGuard/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<TempDirectoryGuard, UsesBslmaAllocator>`] | |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#