#include <DirectoryRegister.h>
|
bool | createDir (const fs::path &dir, bool checkExisting=false) |
|
bool | removeDir (const fs::path &dir) |
|
|
std::unordered_set< std::string > | dirs {} |
|
unsigned long | currID = 0 |
|
std::mutex | mut |
|
This class manages the lifetime of (temporary) directories. All registered directories are deleted on deletion of the register
◆ DirectoryRegister()
◆ ~DirectoryRegister()
joda::filesystem::DirectoryRegister::~DirectoryRegister |
( |
| ) |
|
|
virtual |
Deletes all directories on deletion of the Register
◆ createDir()
bool joda::filesystem::DirectoryRegister::createDir |
( |
const fs::path & |
dir, |
|
|
bool |
checkExisting = false |
|
) |
| |
|
protected |
◆ getInstance()
◆ getTMPDir()
boost::optional< std::string > joda::filesystem::DirectoryRegister::getTMPDir |
( |
const std::string & |
name | ) |
|
Creates a new named directory in the configured temporary directory
- Parameters
-
name | The name of the directory to be created |
- Returns
- The path to the directory if successful; Nothing else
◆ getUniqueDir()
std::string joda::filesystem::DirectoryRegister::getUniqueDir |
( |
| ) |
|
Returns an arbitrary unique directory path. This directory is not yet registered or created. The uniqueness is only ensured per system run.
- Returns
- A path to a unique directory.
◆ operator=()
◆ registerDirectory() [1/2]
bool joda::filesystem::DirectoryRegister::registerDirectory |
( |
const fs::path & |
dir, |
|
|
bool |
checkDuplicate = true |
|
) |
| |
Creates and registers a directory
- Parameters
-
dir | The path to the directory |
checkDuplicate | If true, the function fails if the chosen directory was already created |
- Returns
- False if a duplicate was found and checkDuplicate is True or another error occurs; True else
◆ registerDirectory() [2/2]
bool joda::filesystem::DirectoryRegister::registerDirectory |
( |
const std::string & |
dir, |
|
|
bool |
checkDuplicate |
|
) |
| |
Creates and registers a directory
- Parameters
-
dir | The path to the directory |
checkDuplicate | If true, the function fails if the chosen directory was already created |
- Returns
- False if a duplicate was found and checkDuplicate is True or another error occurs; True else
◆ removeDir()
bool joda::filesystem::DirectoryRegister::removeDir |
( |
const fs::path & |
dir | ) |
|
|
protected |
◆ removeDirectory() [1/2]
bool joda::filesystem::DirectoryRegister::removeDirectory |
( |
const fs::path & |
dir | ) |
|
Deletes a registered directory
- Parameters
-
dir | The directory to delete |
- Returns
- True if the directory was successfully deleted; False if an error occured
◆ removeDirectory() [2/2]
bool joda::filesystem::DirectoryRegister::removeDirectory |
( |
const std::string & |
dir | ) |
|
Deletes a registered directory
- Parameters
-
dir | The directory to delete |
- Returns
- True if the directory was successfully deleted; False if an error occured
◆ currID
unsigned long joda::filesystem::DirectoryRegister::currID = 0 |
|
protected |
◆ dirs
std::unordered_set<std::string> joda::filesystem::DirectoryRegister::dirs {} |
|
protected |
◆ mut
std::mutex joda::filesystem::DirectoryRegister::mut |
|
protected |
The documentation for this class was generated from the following files:
- /home/nico/joda_tmp/tmp-joda-dirs/JODA-gh/libs/joda/core/modules/filesystem/include/joda/fs/DirectoryRegister.h
- /home/nico/joda_tmp/tmp-joda-dirs/JODA-gh/libs/joda/core/modules/filesystem/src/DirectoryRegister.cpp