Chromium Embedded Framework (CEF)  131.2.1+ge081753+chromium-131.0.6778.13
CefScopedTempDir Class Reference

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
 
CefScopedTempDiroperator= (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 CefStringGetPath () 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CefScopedTempDir() [1/2]

CefScopedTempDir::CefScopedTempDir ( )

No directory is owned/created initially.

◆ CefScopedTempDir() [2/2]

CefScopedTempDir::CefScopedTempDir ( const CefScopedTempDir )
delete

◆ ~CefScopedTempDir()

CefScopedTempDir::~CefScopedTempDir ( )

Recursively delete path.

Member Function Documentation

◆ CreateUniqueTempDir()

bool CefScopedTempDir::CreateUniqueTempDir ( )

Creates a unique directory in TempPath, and takes ownership of it.

See file_util::CreateNewTemporaryDirectory.

◆ CreateUniqueTempDirUnderPath()

bool CefScopedTempDir::CreateUniqueTempDirUnderPath ( const CefString path)

Creates a unique directory under a given path, and takes ownership of it.

◆ Delete()

bool CefScopedTempDir::Delete ( )

Deletes the temporary directory wrapped by this object.

◆ GetPath()

const CefString& CefScopedTempDir::GetPath ( ) const

Returns the path to the created directory.

Call one of the CreateUniqueTempDir* methods before getting the path.

◆ IsEmpty()

bool CefScopedTempDir::IsEmpty ( ) const

Returns true if path_ is empty.

◆ IsValid()

bool CefScopedTempDir::IsValid ( ) const

Returns true if path_ is non-empty and exists.

◆ operator=()

CefScopedTempDir& CefScopedTempDir::operator= ( const CefScopedTempDir )
delete

◆ Set()

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.

◆ Take()

CefString CefScopedTempDir::Take ( )

Caller takes ownership of the temporary directory so it won't be destroyed when this object goes out of scope.


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