OpenMS
Loading...
Searching...
No Matches
File::TempDir Class Reference

Class representing a temporary directory. More...

#include <OpenMS/SYSTEM/File.h>

Collaboration diagram for File::TempDir:
[legend]

Public Member Functions

 TempDir (bool keep_dir=false)
 
 TempDir (const String &base_dir, bool keep_dir=false)
 
 ~TempDir ()
 Destroy temporary folder (can be prohibited in Constructor)
 
 TempDir (const TempDir &)=delete
 delete all means to copy or move a TempDir
 
TempDiroperator= (const TempDir &)=delete
 
 TempDir (TempDir &&)=delete
 
TempDiroperator= (TempDir &&)=delete
 
const StringgetPath () const
 Return path to temporary folder.
 

Private Attributes

String temp_dir_
 
bool keep_dir_
 

Detailed Description

Class representing a temporary directory.

Constructor & Destructor Documentation

◆ TempDir() [1/4]

TempDir ( bool  keep_dir = false)

Construct temporary folder under system temp directory If keep_dir is set to true, the folder will not be deleted on destruction of the object.

◆ TempDir() [2/4]

TempDir ( const String base_dir,
bool  keep_dir = false 
)

Construct temporary folder under a custom base directory Creates a unique subdirectory with a generated name under base_dir. If keep_dir is set to true, the folder will not be deleted on destruction of the object.

Parameters
base_dirThe base directory under which to create the temp folder (e.g., user-specified temp path)
keep_dirIf true, the folder will not be deleted on destruction

◆ ~TempDir()

~TempDir ( )

Destroy temporary folder (can be prohibited in Constructor)

◆ TempDir() [3/4]

TempDir ( const TempDir )
delete

delete all means to copy or move a TempDir

◆ TempDir() [4/4]

TempDir ( TempDir &&  )
delete

Member Function Documentation

◆ getPath()

const String & getPath ( ) const

Return path to temporary folder.

◆ operator=() [1/2]

TempDir & operator= ( const TempDir )
delete

◆ operator=() [2/2]

TempDir & operator= ( TempDir &&  )
delete

Member Data Documentation

◆ keep_dir_

bool keep_dir_
private

◆ temp_dir_

String temp_dir_
private