SPH
Public Member Functions | List of all members
RandomPathManager Class Reference

Generates random file names. More...

#include <FileManager.h>

Inheritance diagram for RandomPathManager:
Noncopyable

Public Member Functions

 RandomPathManager ()
 
Path getPath (const std::string extension="")
 Generates a new random path. More...
 
- Public Member Functions inherited from Noncopyable
 Noncopyable ()=default
 
 Noncopyable (const Noncopyable &)=delete
 
 Noncopyable (Noncopyable &&)=default
 
Noncopyableoperator= (const Noncopyable &)=delete
 
Noncopyableoperator= (Noncopyable &&)=default
 

Detailed Description

Generates random file names.

Object generates random paths, given a parent directory. It has no seed, so each constructed object generates a different sequence of random paths. This does not create the file, only returns a usable path; it is guaranteed that no file with returned path exist, provided no other thread or process is creating random file names at the same time.

Todo:
TESTS!

Definition at line 34 of file FileManager.h.

Constructor & Destructor Documentation

◆ RandomPathManager()

RandomPathManager::RandomPathManager ( )
inline

Definition at line 41 of file FileManager.h.

Member Function Documentation

◆ getPath()

Path RandomPathManager::getPath ( const std::string  extension = "")

Generates a new random path.

Parameters
extensionOptional extension of the generated path. If empty, the path has no extension.

Definition at line 49 of file FileManager.cpp.


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