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

Object generating unique paths. More...

#include <FileManager.h>

Inheritance diagram for UniquePathManager:
Noncopyable

Public Member Functions

Path getPath (const Path &expected)
 Generates a unique path, based on given input 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

Object generating unique paths.

Unique paths are generated by appending _001, _002, etc. to the file name. In case more than 999 unique paths are requested from given path, it throws an exception.

Definition at line 13 of file FileManager.h.

Member Function Documentation

◆ getPath()

Path UniquePathManager::getPath ( const Path expected)

Generates a unique path, based on given input path.

The generated file may or may not exist on filesystem, the function only ensures it returns a different path every time. If more multiple manager objects are used, they may generate equal paths. The function is NOT thread safe, it has to be explicitly synchronized.

Definition at line 15 of file FileManager.cpp.


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