    

 ## On this page

  

 

 # Storage

 Last update: 16.07.2025 

<a id="l00001" name="l00001"></a> 1\#ifndef CFFSDK\_PROJECT\_STORAGE\_H

<a id="l00002" name="l00002"></a> 2\#define CFFSDK\_PROJECT\_STORAGE\_H

<a id="l00003" name="l00003"></a> 3 

<a id="l00004" name="l00004"></a> 4\#include "Project/LibraryType.hpp"

<a id="l00005" name="l00005"></a> 5\#include "Project/URL.hpp"

<a id="l00006" name="l00006"></a> 6\#include "Project/Path.hpp"

<a id="l00007" name="l00007"></a> 7\#include "Project/Error.hpp"

<a id="l00008" name="l00008"></a> 8\#include &lt;string&gt;

<a id="l00009" name="l00009"></a> 9 

<a id="l00010" name="l00010"></a> 10namespace [ansys](namespaceansys.xhtml) {

<a id="l00011" name="l00011"></a> 11namespace Project {

<a id="l00012" name="l00012"></a> 12 

<a id="l00013" name="l00013"></a>[ 13](classansys_1_1_project_1_1_storage.xhtml)class ANSYS_PROJECT_DLL [Storage](classansys_1_1_project_1_1_storage.xhtml) {

<a id="l00014" name="l00014"></a> 14public:

<a id="l00015" name="l00015"></a> 15 [Storage](classansys_1_1_project_1_1_storage.xhtml)(const std::string&amp; pTypename);

<a id="l00016" name="l00016"></a> 16 virtual [~Storage](classansys_1_1_project_1_1_storage.xhtml)();

<a id="l00017" name="l00017"></a> 17 

<a id="l00018" name="l00018"></a> 18 // Virtual API

<a id="l00022" name="l00022"></a>[ 22](classansys_1_1_project_1_1_storage.xhtml#a5425696f2817236f5886b54dc3cd1ac9) virtual [Error](classansys_1_1_project_1_1_error.xhtml) [createFolder](classansys_1_1_project_1_1_storage.xhtml#a5425696f2817236f5886b54dc3cd1ac9)(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pParentPath,

<a id="l00023" name="l00023"></a> 23 const [Path](classansys_1_1_project_1_1_path.xhtml)&amp; pFolderPath) = 0;

<a id="l00027" name="l00027"></a>[ 27](classansys_1_1_project_1_1_storage.xhtml#a5809221b3618eb84e4eebaf0357af195) virtual bool [isFolder](classansys_1_1_project_1_1_storage.xhtml#a5809221b3618eb84e4eebaf0357af195)(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pPath) = 0;

<a id="l00031" name="l00031"></a>[ 31](classansys_1_1_project_1_1_storage.xhtml#a8b8642b9831aa539f231897e48cf3298) virtual bool [isFile](classansys_1_1_project_1_1_storage.xhtml#a8b8642b9831aa539f231897e48cf3298)(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pPath) = 0;

<a id="l00032" name="l00032"></a> 32 

<a id="l00036" name="l00036"></a>[ 36](classansys_1_1_project_1_1_storage.xhtml#ad95b9bf3b4c5dba9ab6768f70d1ebbc5) virtual [Error](classansys_1_1_project_1_1_error.xhtml) [copyFile](classansys_1_1_project_1_1_storage.xhtml#ad95b9bf3b4c5dba9ab6768f70d1ebbc5)(const std::string&amp; pSource,const std::string&amp; pTarget) = 0;

<a id="l00040" name="l00040"></a>[ 40](classansys_1_1_project_1_1_storage.xhtml#ad6d0085c5c82a3e811ebeab6a6aeede8) virtual [Error](classansys_1_1_project_1_1_error.xhtml) [getFileTimestamp](classansys_1_1_project_1_1_storage.xhtml#ad6d0085c5c82a3e811ebeab6a6aeede8)(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pFile,int&amp; pTime) = 0;

<a id="l00044" name="l00044"></a>[ 44](classansys_1_1_project_1_1_storage.xhtml#a0ad50007b1ad077038e823eb3bb21b7d) virtual [Error](classansys_1_1_project_1_1_error.xhtml) [getFileChecksum](classansys_1_1_project_1_1_storage.xhtml#a0ad50007b1ad077038e823eb3bb21b7d)(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pFile,std::string&amp; pChecksum) = 0;

<a id="l00048" name="l00048"></a>[ 48](classansys_1_1_project_1_1_storage.xhtml#ab2f8205ecdd044f7718cea9881c94dfc) virtual [Error](classansys_1_1_project_1_1_error.xhtml) [eraseFile](classansys_1_1_project_1_1_storage.xhtml#ab2f8205ecdd044f7718cea9881c94dfc)(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pFile) = 0;

<a id="l00049" name="l00049"></a> 49 enum EraseOptions { EraseFolderOnly, EraseFolderAndFiles, EraseRecursively };

<a id="l00055" name="l00055"></a>[ 55](classansys_1_1_project_1_1_storage.xhtml#ae3c62e8ea9637b802eebe488e4a62fe4) 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; 

<a id="l00059" name="l00059"></a>[ 59](classansys_1_1_project_1_1_storage.xhtml#a1eb6dbf782620c41e87dda556d3989b8) virtual [Error](classansys_1_1_project_1_1_error.xhtml) [moveFile](classansys_1_1_project_1_1_storage.xhtml#a1eb6dbf782620c41e87dda556d3989b8)(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;

<a id="l00063" name="l00063"></a>[ 63](classansys_1_1_project_1_1_storage.xhtml#a6069a427195a8247e9f78803d4ff520f) virtual [Error](classansys_1_1_project_1_1_error.xhtml) [matchFiles](classansys_1_1_project_1_1_storage.xhtml#a6069a427195a8247e9f78803d4ff520f)(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pPath,std::string pWildcard,std::vector&lt;URL&gt;&amp; pMatchFiles) = 0;

<a id="l00064" name="l00064"></a> 64 

<a id="l00068" name="l00068"></a>[ 68](classansys_1_1_project_1_1_storage.xhtml#affb5603e8c05d4fb8b24c9d8547ef356) virtual std::string [getFileCompressionSuffix](classansys_1_1_project_1_1_storage.xhtml#affb5603e8c05d4fb8b24c9d8547ef356)() const = 0;

<a id="l00072" name="l00072"></a>[ 72](classansys_1_1_project_1_1_storage.xhtml#a4c42b21f9f607bbff1940ad3dbbcf6d9) virtual [Error](classansys_1_1_project_1_1_error.xhtml) [compressFiles](classansys_1_1_project_1_1_storage.xhtml#a4c42b21f9f607bbff1940ad3dbbcf6d9)(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pRootFolder,std::vector&lt;URL&gt;&amp; pSourceFiles,const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pTargetArchive) = 0;

<a id="l00076" name="l00076"></a>[ 76](classansys_1_1_project_1_1_storage.xhtml#abe1ec2924e9c518adc1a9207a65f5dd0) virtual [Error](classansys_1_1_project_1_1_error.xhtml) [extractFile](classansys_1_1_project_1_1_storage.xhtml#abe1ec2924e9c518adc1a9207a65f5dd0)(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;

<a id="l00077" name="l00077"></a> 77 

<a id="l00078" name="l00078"></a> 78 // Static API

<a id="l00079" name="l00079"></a> 79 static void registerInterface(const std::string&amp; pType,

<a id="l00080" name="l00080"></a> 80 [Storage](classansys_1_1_project_1_1_storage.xhtml)* pInterface);

<a id="l00081" name="l00081"></a> 81 static [Storage](classansys_1_1_project_1_1_storage.xhtml)* getInterface(const std::string&amp; pType);

<a id="l00082" name="l00082"></a> 82 

<a id="l00083" name="l00083"></a> 83private:

<a id="l00084" name="l00084"></a> 84 std::string aTypename;

<a id="l00085" name="l00085"></a> 85};

<a id="l00086" name="l00086"></a> 86 

<a id="l00087" name="l00087"></a> 87}

<a id="l00088" name="l00088"></a> 88}

<a id="l00089" name="l00089"></a> 89 

<a id="l00090" name="l00090"></a> 90 

<a id="l00091" name="l00091"></a> 91\#endif // CFFSDK\_PROJECT\_STORAGE\_H

[ansys::Project::Error](classansys_1_1_project_1_1_error.xhtml)

The return state / error value of a Project function call.

**Definition:** Error.hpp:11



[ansys::Project::Path](classansys_1_1_project_1_1_path.xhtml)

Paths used for internal Project filesystem.

**Definition:** Path.hpp:11



[ansys::Project::Storage](classansys_1_1_project_1_1_storage.xhtml)

Base class for file storage management module.

**Definition:** Storage.hpp:13



[ansys::Project::Storage::getFileChecksum](classansys_1_1_project_1_1_storage.xhtml#a0ad50007b1ad077038e823eb3bb21b7d)

virtual Error getFileChecksum(const URL &amp;pFile, std::string &amp;pChecksum)=0

Compute a checksum for the specified file.



[ansys::Project::Storage::moveFile](classansys_1_1_project_1_1_storage.xhtml#a1eb6dbf782620c41e87dda556d3989b8)

virtual Error moveFile(const URL &amp;pSource, const URL &amp;pTarget)=0

Rename the file or folder.



[ansys::Project::Storage::compressFiles](classansys_1_1_project_1_1_storage.xhtml#a4c42b21f9f607bbff1940ad3dbbcf6d9)

virtual Error compressFiles(const URL &amp;pRootFolder, std::vector&lt; URL &gt; &amp;pSourceFiles, const URL &amp;pTargetArchive)=0

Compress a list of files into a new zipped archive.



[ansys::Project::Storage::createFolder](classansys_1_1_project_1_1_storage.xhtml#a5425696f2817236f5886b54dc3cd1ac9)

virtual Error createFolder(const URL &amp;pParentPath, const Path &amp;pFolderPath)=0

Create a folder in the specified URL, using the specified name.



[ansys::Project::Storage::isFolder](classansys_1_1_project_1_1_storage.xhtml#a5809221b3618eb84e4eebaf0357af195)

virtual bool isFolder(const URL &amp;pPath)=0

Indicates if a folder exists at the specified URL.



[ansys::Project::Storage::matchFiles](classansys_1_1_project_1_1_storage.xhtml#a6069a427195a8247e9f78803d4ff520f)

virtual Error matchFiles(const URL &amp;pPath, std::string pWildcard, std::vector&lt; URL &gt; &amp;pMatchFiles)=0

File query by wildcard pattern in the specified URL.



[ansys::Project::Storage::isFile](classansys_1_1_project_1_1_storage.xhtml#a8b8642b9831aa539f231897e48cf3298)

virtual bool isFile(const URL &amp;pPath)=0

Indicates if a file exists at the specified URL.



[ansys::Project::Storage::eraseFile](classansys_1_1_project_1_1_storage.xhtml#ab2f8205ecdd044f7718cea9881c94dfc)

virtual Error eraseFile(const URL &amp;pFile)=0

Erase the file at the specified location.



[ansys::Project::Storage::extractFile](classansys_1_1_project_1_1_storage.xhtml#abe1ec2924e9c518adc1a9207a65f5dd0)

virtual Error extractFile(const URL &amp;pArchive, const URL &amp;pTargetLocation)=0

Extract a zipped archive to the specified location.



[ansys::Project::Storage::getFileTimestamp](classansys_1_1_project_1_1_storage.xhtml#ad6d0085c5c82a3e811ebeab6a6aeede8)

virtual Error getFileTimestamp(const URL &amp;pFile, int &amp;pTime)=0

Compute a timestamp for the specified file.



[ansys::Project::Storage::copyFile](classansys_1_1_project_1_1_storage.xhtml#ad95b9bf3b4c5dba9ab6768f70d1ebbc5)

virtual Error copyFile(const std::string &amp;pSource, const std::string &amp;pTarget)=0

Copy file from source to location, can be two different URL types.



[ansys::Project::Storage::eraseFolder](classansys_1_1_project_1_1_storage.xhtml#ae3c62e8ea9637b802eebe488e4a62fe4)

virtual Error eraseFolder(const URL &amp;pFile, EraseOptions pRecursive)=0

Erase the folder and content at the specified location.



[ansys::Project::Storage::getFileCompressionSuffix](classansys_1_1_project_1_1_storage.xhtml#affb5603e8c05d4fb8b24c9d8547ef356)

virtual std::string getFileCompressionSuffix() const =0

Returns the required file suffix for compressFile API.



[ansys::Project::URL](classansys_1_1_project_1_1_u_r_l.xhtml)

The address of a local or remote file, using the URI format.

**Definition:** URL.hpp:12



[ansys](namespaceansys.xhtml)

**Definition:** API.dox:1