ansys::Project::Storage Class Reference
Last update: 19.05.2025Base class for file storage management module. More...
#include "Storage.hpp"

Public Types | |
| enum | EraseOptions { EraseFolderOnly , EraseFolderAndFiles , EraseRecursively } |
Public Member Functions | |
| Storage (const std::string &pTypename) | |
| Constructor. More... | |
| virtual | ~Storage () |
| Destructor. More... | |
| virtual Error | createFolder (const URL &pParentPath, const Path &pFolderPath)=0 |
| Create a folder in the specified URL, using the specified name. More... | |
| virtual bool | isFolder (const URL &pPath)=0 |
| Indicates if a folder exists at the specified URL. More... | |
| virtual bool | isFile (const URL &pPath)=0 |
| Indicates if a file exists at the specified URL. More... | |
| virtual Error | copyFile (const std::string &pSource, const std::string &pTarget)=0 |
| Copy file from source to location, can be two different URL types. More... | |
| virtual Error | getFileTimestamp (const URL &pFile, int &pTime)=0 |
| Compute a timestamp for the specified file. More... | |
| virtual Error | getFileChecksum (const URL &pFile, std::string &pChecksum)=0 |
| Compute a checksum for the specified file. More... | |
| virtual Error | eraseFile (const URL &pFile)=0 |
| Erase the file at the specified location. More... | |
| virtual Error | eraseFolder (const URL &pFile, EraseOptions pRecursive)=0 |
| Erase the folder and content at the specified location. More... | |
| virtual Error | moveFile (const URL &pSource, const URL &pTarget)=0 |
| Rename the file or folder. More... | |
| virtual Error | matchFiles (const URL &pPath, std::string pWildcard, std::vector< URL > &pMatchFiles)=0 |
| File query by wildcard pattern in the specified URL. More... | |
| virtual std::string | getFileCompressionSuffix () const =0 |
| Returns the required file suffix for compressFile API. More... | |
| virtual Error | compressFiles (const URL &pRootFolder, std::vector< URL > &pSourceFiles, const URL &pTargetArchive)=0 |
| Compress a list of files into a new zipped archive. More... | |
| virtual Error | extractFile (const URL &pArchive, const URL &pTargetLocation)=0 |
| Extract a zipped archive to the specified location. More... | |
Static Public Member Functions | |
| static void | registerInterface (const std::string &pType, Storage *pInterface) |
| Register a Storage object to work with a specific URL type. More... | |
| static Storage * | getInterface (const std::string &pType) |
| Retrieve the Storage object to use with a specific URL type. More... | |
Detailed Description
Base class for file storage management module.
The Project framework only access files on disk through the Storage interface, StorageFilesystem is used to access local files ( URL with no type, or of type file:// ). Additional storage frameworks can be defined, and bound to URL types. See registerInterface()
Member Enumeration Documentation
◆ EraseOptions
Constructor & Destructor Documentation
◆ Storage()
| ansys::Project::Storage::Storage | ( | const std::string & | pTypename | ) |
◆ ~Storage()
|
virtual |
Destructor.
Member Function Documentation
◆ compressFiles()
|
pure virtual |
Compress a list of files into a new zipped archive.
Implemented in ansys::Project::StorageFilesystem.
◆ copyFile()
|
pure virtual |
Copy file from source to location, can be two different URL types.
Implemented in ansys::Project::StorageFilesystem.
◆ createFolder()
|
pure virtual |
Create a folder in the specified URL, using the specified name.
Implemented in ansys::Project::StorageFilesystem.
◆ eraseFile()
Erase the file at the specified location.
Implemented in ansys::Project::StorageFilesystem.
◆ eraseFolder()
|
pure virtual |
Erase the folder and content at the specified location.
- Parameters
-
pRecursive Indicate if should erase folder only (assumed empty), folder and its files, or folder and any number of subfolders.
Implemented in ansys::Project::StorageFilesystem.
◆ extractFile()
|
pure virtual |
Extract a zipped archive to the specified location.
Implemented in ansys::Project::StorageFilesystem.
◆ getFileChecksum()
|
pure virtual |
Compute a checksum for the specified file.
Implemented in ansys::Project::StorageFilesystem.
◆ getFileCompressionSuffix()
|
pure virtual |
Returns the required file suffix for compressFile API.
Implemented in ansys::Project::StorageFilesystem.
◆ getFileTimestamp()
|
pure virtual |
Compute a timestamp for the specified file.
Implemented in ansys::Project::StorageFilesystem.
◆ getInterface()
|
static |
◆ isFile()
|
pure virtual |
Indicates if a file exists at the specified URL.
Implemented in ansys::Project::StorageFilesystem.
◆ isFolder()
|
pure virtual |
Indicates if a folder exists at the specified URL.
Implemented in ansys::Project::StorageFilesystem.
◆ matchFiles()
|
pure virtual |
File query by wildcard pattern in the specified URL.
Implemented in ansys::Project::StorageFilesystem.
◆ moveFile()
|
pure virtual |
Rename the file or folder.
Implemented in ansys::Project::StorageFilesystem.