    

 ## On this page

  

 

 # ansys::Project::Storage Class Reference

 Last update: 16.07.2025 

Base class for file storage management module. [More...](classansys_1_1_project_1_1_storage.xhtml#details)

`#include "Storage.hpp"`

Inheritance diagram for ansys::Project::Storage:

 ![](/sites/default/files/migrate-content/common_fluids_format_2024_r2/classansys_1_1_project_1_1_storage.png)



## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

 [Storage](classansys_1_1_project_1_1_storage.xhtml#a2374cab30c3fe446708866f0c24351cc) (const std::string &amp;pTypename) Constructor. [More...](classansys_1_1_project_1_1_storage.xhtml#a2374cab30c3fe446708866f0c24351cc)  
 <a id="a0a620fa8087cbd638207d4cab5c541bd" name="a0a620fa8087cbd638207d4cab5c541bd"></a>virtual **~Storage** () Destructor.   
 <a id="a5425696f2817236f5886b54dc3cd1ac9" name="a5425696f2817236f5886b54dc3cd1ac9"></a>virtual [Error](classansys_1_1_project_1_1_error.xhtml) **createFolder** (const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;pParentPath, const [Path](classansys_1_1_project_1_1_path.xhtml) &amp;pFolderPath)=0 Create a folder in the specified [URL](classansys_1_1_project_1_1_u_r_l.xhtml "The address of a local or remote file, using the URI format."), using the specified name.   
 <a id="a5809221b3618eb84e4eebaf0357af195" name="a5809221b3618eb84e4eebaf0357af195"></a>virtual bool **isFolder** (const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;pPath)=0 Indicates if a folder exists at the specified [URL](classansys_1_1_project_1_1_u_r_l.xhtml "The address of a local or remote file, using the URI format.").   
 <a id="a8b8642b9831aa539f231897e48cf3298" name="a8b8642b9831aa539f231897e48cf3298"></a>virtual bool **isFile** (const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;pPath)=0 Indicates if a file exists at the specified [URL](classansys_1_1_project_1_1_u_r_l.xhtml "The address of a local or remote file, using the URI format.").   
 <a id="ad95b9bf3b4c5dba9ab6768f70d1ebbc5" name="ad95b9bf3b4c5dba9ab6768f70d1ebbc5"></a>virtual [Error](classansys_1_1_project_1_1_error.xhtml) **copyFile** (const std::string &amp;pSource, const std::string &amp;pTarget)=0 Copy file from source to location, can be two different [URL](classansys_1_1_project_1_1_u_r_l.xhtml "The address of a local or remote file, using the URI format.") types.   
 <a id="ad6d0085c5c82a3e811ebeab6a6aeede8" name="ad6d0085c5c82a3e811ebeab6a6aeede8"></a>virtual [Error](classansys_1_1_project_1_1_error.xhtml) **getFileTimestamp** (const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;pFile, int &amp;pTime)=0 Compute a timestamp for the specified file.   
 <a id="a0ad50007b1ad077038e823eb3bb21b7d" name="a0ad50007b1ad077038e823eb3bb21b7d"></a>virtual [Error](classansys_1_1_project_1_1_error.xhtml) **getFileChecksum** (const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;pFile, std::string &amp;pChecksum)=0 Compute a checksum for the specified file.   
 <a id="ab2f8205ecdd044f7718cea9881c94dfc" name="ab2f8205ecdd044f7718cea9881c94dfc"></a>virtual [Error](classansys_1_1_project_1_1_error.xhtml) **eraseFile** (const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;pFile)=0 Erase the file at the specified location.   
 virtual [Error](classansys_1_1_project_1_1_error.xhtml) [eraseFolder](classansys_1_1_project_1_1_storage.xhtml#ae3c62e8ea9637b802eebe488e4a62fe4) (const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;pFile, EraseOptions pRecursive)=0 Erase the folder and content at the specified location. [More...](classansys_1_1_project_1_1_storage.xhtml#ae3c62e8ea9637b802eebe488e4a62fe4)  
 <a id="a1eb6dbf782620c41e87dda556d3989b8" name="a1eb6dbf782620c41e87dda556d3989b8"></a>virtual [Error](classansys_1_1_project_1_1_error.xhtml) **moveFile** (const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;pSource, const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;pTarget)=0 Rename the file or folder.   
 <a id="a6069a427195a8247e9f78803d4ff520f" name="a6069a427195a8247e9f78803d4ff520f"></a>virtual [Error](classansys_1_1_project_1_1_error.xhtml) **matchFiles** (const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;pPath, std::string pWildcard, std::vector&lt; [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &gt; &amp;pMatchFiles)=0 File query by wildcard pattern in the specified [URL](classansys_1_1_project_1_1_u_r_l.xhtml "The address of a local or remote file, using the URI format.").   
 <a id="affb5603e8c05d4fb8b24c9d8547ef356" name="affb5603e8c05d4fb8b24c9d8547ef356"></a>virtual std::string **getFileCompressionSuffix** () const =0 Returns the required file suffix for compressFile API.   
 <a id="a4c42b21f9f607bbff1940ad3dbbcf6d9" name="a4c42b21f9f607bbff1940ad3dbbcf6d9"></a>virtual [Error](classansys_1_1_project_1_1_error.xhtml) **compressFiles** (const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;pRootFolder, std::vector&lt; [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &gt; &amp;pSourceFiles, const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;pTargetArchive)=0 Compress a list of files into a new zipped archive.   
 <a id="abe1ec2924e9c518adc1a9207a65f5dd0" name="abe1ec2924e9c518adc1a9207a65f5dd0"></a>virtual [Error](classansys_1_1_project_1_1_error.xhtml) **extractFile** (const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;pArchive, const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;pTargetLocation)=0 Extract a zipped archive to the specified location.   
 ## <a id="pub-static-methods" name="pub-static-methods"></a>Static Public Member Functions

<a id="a3f9f604fc9b1d14b05acd8ee3ff7b98e" name="a3f9f604fc9b1d14b05acd8ee3ff7b98e"></a>static void **registerInterface** (const std::string &amp;pType, [Storage](classansys_1_1_project_1_1_storage.xhtml) \*pInterface) Register a [Storage](classansys_1_1_project_1_1_storage.xhtml "Base class for file storage management module.") object to work with a specific [URL](classansys_1_1_project_1_1_u_r_l.xhtml "The address of a local or remote file, using the URI format.") type.   
 <a id="abdef10f9ae138161ef673d5cc516f83b" name="abdef10f9ae138161ef673d5cc516f83b"></a>static [Storage](classansys_1_1_project_1_1_storage.xhtml) \* **getInterface** (const std::string &amp;pType) Retrieve the [Storage](classansys_1_1_project_1_1_storage.xhtml "Base class for file storage management module.") object to use with a specific [URL](classansys_1_1_project_1_1_u_r_l.xhtml "The address of a local or remote file, using the URI format.") type.   
 <a id="details" name="details"></a>## Detailed Description

Base class for file storage management module.

The [Project](classansys_1_1_project_1_1_project.xhtml "Base class for Project API, also see SimProject.") framework only access files on disk through the [Storage](classansys_1_1_project_1_1_storage.xhtml "Base class for file storage management module.") interface, [StorageFilesystem](classansys_1_1_project_1_1_storage_filesystem.xhtml "Class for Storage on standard filesystem, for file:// URL.") is used to access local files ( [URL](classansys_1_1_project_1_1_u_r_l.xhtml "The address of a local or remote file, using the URI format.") with no type, or of type <file://> ). Additional storage frameworks can be defined, and bound to [URL](classansys_1_1_project_1_1_u_r_l.xhtml "The address of a local or remote file, using the URI format.") types. See [registerInterface()](classansys_1_1_project_1_1_storage.xhtml#a3f9f604fc9b1d14b05acd8ee3ff7b98e "Register a Storage object to work with a specific URL type.")



## Constructor &amp; Destructor Documentation

<a id="a2374cab30c3fe446708866f0c24351cc" name="a2374cab30c3fe446708866f0c24351cc"></a>## [◆ ](#a2374cab30c3fe446708866f0c24351cc)Storage()

 ansys::Project::Storage::Storage  ( const std::string &amp;  *pTypename*) 

Constructor.

Parameters pTypenameType of [URL](classansys_1_1_project_1_1_u_r_l.xhtml "The address of a local or remote file, using the URI format.") handled by this [Storage](classansys_1_1_project_1_1_storage.xhtml "Base class for file storage management module.") 



## Member Function Documentation

<a id="ae3c62e8ea9637b802eebe488e4a62fe4" name="ae3c62e8ea9637b802eebe488e4a62fe4"></a>## [◆ ](#ae3c62e8ea9637b802eebe488e4a62fe4)eraseFolder()

 virtual [Error](classansys_1_1_project_1_1_error.xhtml) ansys::Project::Storage::eraseFolder  ( const [URL](classansys_1_1_project_1_1_u_r_l.xhtml) &amp;  *pFile*,    EraseOptions  *pRecursive*   )   pure virtual 

Erase the folder and content at the specified location.

Parameters pRecursiveIndicate if should erase folder only (assumed empty), folder and its files, or folder and any number of subfolders. Implemented in [ansys::Project::StorageFilesystem](classansys_1_1_project_1_1_storage_filesystem.xhtml#aece46fb1eab83d340f92bfeaff6b9569).