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

Public Member Functions | |
| Storage (const std::string &pTypename) | |
| Constructor. More... | |
| virtual | ~Storage () |
| Destructor. | |
| virtual Error | createFolder (const URL &pParentPath, const Path &pFolderPath)=0 |
| Create a folder in the specified URL, using the specified name. | |
| virtual bool | isFolder (const URL &pPath)=0 |
| Indicates if a folder exists at the specified URL. | |
| virtual bool | isFile (const URL &pPath)=0 |
| Indicates if a file exists at the specified URL. | |
| virtual Error | copyFile (const std::string &pSource, const std::string &pTarget)=0 |
| Copy file from source to location, can be two different URL types. | |
| virtual Error | getFileTimestamp (const URL &pFile, int &pTime)=0 |
| Compute a timestamp for the specified file. | |
| virtual Error | getFileChecksum (const URL &pFile, std::string &pChecksum)=0 |
| Compute a checksum for the specified file. | |
| virtual Error | eraseFile (const URL &pFile)=0 |
| Erase the file at the specified location. | |
| 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. | |
| virtual Error | matchFiles (const URL &pPath, std::string pWildcard, std::vector< URL > &pMatchFiles)=0 |
| File query by wildcard pattern in the specified URL. | |
| virtual std::string | getFileCompressionSuffix () const =0 |
| Returns the required file suffix for compressFile API. | |
| virtual Error | compressFiles (const URL &pRootFolder, std::vector< URL > &pSourceFiles, const URL &pTargetArchive)=0 |
| Compress a list of files into a new zipped archive. | |
| virtual Error | extractFile (const URL &pArchive, const URL &pTargetLocation)=0 |
| Extract a zipped archive to the specified location. | |
Static Public Member Functions | |
| static void | registerInterface (const std::string &pType, Storage *pInterface) |
| Register a Storage object to work with a specific URL type. | |
| static Storage * | getInterface (const std::string &pType) |
| Retrieve the Storage object to use with a specific URL type. | |
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()
Constructor & Destructor Documentation
◆ Storage()
| ansys::Project::Storage::Storage | ( | const std::string & | pTypename | ) |
Member Function Documentation
◆ 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.