Chromium Embedded Framework (CEF)
122.1.5+gf09a9bc+chromium-122.0.6261.29
|
An object representing a temporary / scratch directory that should be cleaned up (recursively) when this object goes out of scope. More...
#include "include/wrapper/cef_scoped_temp_dir.h"
Public Member Functions | |
CefScopedTempDir () | |
No directory is owned/created initially. More... | |
CefScopedTempDir (const CefScopedTempDir &)=delete | |
CefScopedTempDir & | operator= (const CefScopedTempDir &)=delete |
~CefScopedTempDir () | |
Recursively delete path. More... | |
bool | CreateUniqueTempDir () |
Creates a unique directory in TempPath, and takes ownership of it. More... | |
bool | CreateUniqueTempDirUnderPath (const CefString &path) |
Creates a unique directory under a given path, and takes ownership of it. More... | |
bool | Set (const CefString &path) |
Takes ownership of directory at |path|, creating it if necessary. More... | |
bool | Delete () |
Deletes the temporary directory wrapped by this object. More... | |
CefString | Take () |
Caller takes ownership of the temporary directory so it won't be destroyed when this object goes out of scope. More... | |
const CefString & | GetPath () const |
Returns the path to the created directory. More... | |
bool | IsEmpty () const |
Returns true if path_ is empty. More... | |
bool | IsValid () const |
Returns true if path_ is non-empty and exists. More... | |
An object representing a temporary / scratch directory that should be cleaned up (recursively) when this object goes out of scope.
Note that since deletion occurs during the destructor, no further error handling is possible if the directory fails to be deleted. As a result, deletion is not guaranteed by this class.
Multiple calls to the methods which establish a temporary directory (CreateUniqueTempDir, CreateUniqueTempDirUnderPath, and Set) must have intervening calls to Delete or Take, or the calls will fail.
CefScopedTempDir::CefScopedTempDir | ( | ) |
No directory is owned/created initially.
|
delete |
CefScopedTempDir::~CefScopedTempDir | ( | ) |
Recursively delete path.
bool CefScopedTempDir::CreateUniqueTempDir | ( | ) |
Creates a unique directory in TempPath, and takes ownership of it.
See file_util::CreateNewTemporaryDirectory.
bool CefScopedTempDir::CreateUniqueTempDirUnderPath | ( | const CefString & | path | ) |
Creates a unique directory under a given path, and takes ownership of it.
bool CefScopedTempDir::Delete | ( | ) |
Deletes the temporary directory wrapped by this object.
const CefString& CefScopedTempDir::GetPath | ( | ) | const |
Returns the path to the created directory.
Call one of the CreateUniqueTempDir* methods before getting the path.
bool CefScopedTempDir::IsEmpty | ( | ) | const |
Returns true if path_ is empty.
bool CefScopedTempDir::IsValid | ( | ) | const |
Returns true if path_ is non-empty and exists.
|
delete |
bool CefScopedTempDir::Set | ( | const CefString & | path | ) |
Takes ownership of directory at |path|, creating it if necessary.
Don't call multiple times unless Take() has been called first.
CefString CefScopedTempDir::Take | ( | ) |
Caller takes ownership of the temporary directory so it won't be destroyed when this object goes out of scope.