> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ansys::Project::Storage Class Reference

Base class for file storage management module.

`#include "Storage.hpp"`

Inheritance diagram for ansys::Project::Storage:

![](https://mintcdn.com/synopsys-00a47cbc/Srh1_f--TdKCLyqD/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.png?fit=max\&auto=format\&n=Srh1_f--TdKCLyqD\&q=85\&s=0133555d0de59eef49d7ffeb0aaecdef)

## Public Types

| Type | Name |
| - | - |
| enum | [EraseOptions](#a7a0ea834ae0902dfa37762ef350e727f) \{ [EraseFolderOnly](#a7a0ea834ae0902dfa37762ef350e727fa0a93151649911c33b4432bdeafc4f9aa) , [EraseFolderAndFiles](#a7a0ea834ae0902dfa37762ef350e727fabe6d6df4e50d365a3d6c3e0d3d36ef4c) , [EraseRecursively](#a7a0ea834ae0902dfa37762ef350e727fabf7a9bc30546a00063f135d272445fd7) } |

## Public Member Functions

| Type | Name |
| - | - |
| | [Storage](#a2374cab30c3fe446708866f0c24351cc) (const std::string \&pTypename) Constructor. |
| virtual | [\~Storage](#a0a620fa8087cbd638207d4cab5c541bd) () Destructor. |
| virtual [Error](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_error.md) | [createFolder](#a5425696f2817236f5886b54dc3cd1ac9) (const [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) \&pParentPath, const [Path](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_path.md) \&pFolderPath)=0 Create a folder in the specified [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md), using the specified name. |
| virtual bool | [isFolder](#a5809221b3618eb84e4eebaf0357af195) (const [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) \&pPath)=0 Indicates if a folder exists at the specified [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md). |
| virtual bool | [isFile](#a8b8642b9831aa539f231897e48cf3298) (const [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) \&pPath)=0 Indicates if a file exists at the specified [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md). |
| virtual [Error](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_error.md) | [copyFile](#ad95b9bf3b4c5dba9ab6768f70d1ebbc5) (const std::string \&pSource, const std::string \&pTarget)=0 Copy file from source to location, can be two different [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) types. |
| virtual [Error](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_error.md) | [getFileTimestamp](#ad6d0085c5c82a3e811ebeab6a6aeede8) (const [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) \&pFile, int \&pTime)=0 Compute a timestamp for the specified file. |
| virtual [Error](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_error.md) | [getFileChecksum](#a0ad50007b1ad077038e823eb3bb21b7d) (const [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) \&pFile, std::string \&pChecksum)=0 Compute a checksum for the specified file. |
| virtual [Error](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_error.md) | [eraseFile](#ab2f8205ecdd044f7718cea9881c94dfc) (const [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) \&pFile)=0 Erase the file at the specified location. |
| virtual [Error](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_error.md) | [eraseFolder](#ae3c62e8ea9637b802eebe488e4a62fe4) (const [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) \&pFile, [EraseOptions](#a7a0ea834ae0902dfa37762ef350e727f) pRecursive)=0 Erase the folder and content at the specified location. |
| virtual [Error](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_error.md) | [moveFile](#a1eb6dbf782620c41e87dda556d3989b8) (const [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) \&pSource, const [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) \&pTarget)=0 Rename the file or folder. |
| virtual [Error](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_error.md) | [matchFiles](#a6069a427195a8247e9f78803d4ff520f) (const [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) \&pPath, std::string pWildcard, std::vector\< [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) > \&pMatchFiles)=0 File query by wildcard pattern in the specified [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md). |
| virtual std::string | [getFileCompressionSuffix](#affb5603e8c05d4fb8b24c9d8547ef356) () const =0 Returns the required file suffix for compressFile API. |
| virtual [Error](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_error.md) | [compressFiles](#a4c42b21f9f607bbff1940ad3dbbcf6d9) (const [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) \&pRootFolder, std::vector\< [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) > \&pSourceFiles, const [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) \&pTargetArchive)=0 Compress a list of files into a new zipped archive. |
| virtual [Error](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_error.md) | [extractFile](#abe1ec2924e9c518adc1a9207a65f5dd0) (const [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) \&pArchive, const [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) \&pTargetLocation)=0 Extract a zipped archive to the specified location. |

## Static Public Member Functions

| Type | Name |
| - | - |
| static void | [registerInterface](#a3f9f604fc9b1d14b05acd8ee3ff7b98e) (const std::string \&pType, [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) \*pInterface) Register a [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) object to work with a specific [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) type. |
| static [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) \* | [getInterface](#abdef10f9ae138161ef673d5cc516f83b) (const std::string \&pType) Retrieve the [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) object to use with a specific [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) type. |

## Detailed Description

Base class for file storage management module.

The [Project](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_project) framework only access files on disk through the [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) interface, [StorageFilesystem](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage_filesystem.md) is used to access local files ( [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) with no type, or of type [file://](file://) ). Additional storage frameworks can be defined, and bound to [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) types. See [registerInterface()](#a3f9f604fc9b1d14b05acd8ee3ff7b98e)

## Member Enumeration Documentation

### EraseOptions

```cpp theme={null}
enum ansys::Project::Storage::EraseOptions
```

| Enumerator | |
| - | - |
| EraseFolderOnly | |
| EraseFolderAndFiles | |
| EraseRecursively | |

## Constructor & Destructor Documentation

### Storage()

```cpp theme={null}
ansys::Project::Storage::Storage(const std::string & pTypename)
```

Constructor.

**Parameters**

| Name | Description |
| - | - |
| pTypename | Type of [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) handled by this [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) |

### \~Storage()

```cpp theme={null}
ansys::Project::Storage::~Storage()
```

`virtual`

Destructor.

## Member Function Documentation

### compressFiles()

```cpp theme={null}
virtual Error ansys::Project::Storage::compressFiles(
    const URL & pRootFolder,
    std::vector< URL > & pSourceFiles,
    const URL & pTargetArchive
)
```

`pure virtual`

Compress a list of files into a new zipped archive.

Implemented in [ansys::Project::StorageFilesystem](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage_filesystem.md#a330746e96245fb171a6508fb7bb52ac5).

### copyFile()

```cpp theme={null}
virtual Error ansys::Project::Storage::copyFile(
    const std::string & pSource,
    const std::string & pTarget
)
```

`pure virtual`

Copy file from source to location, can be two different [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) types.

Implemented in [ansys::Project::StorageFilesystem](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage_filesystem.md#a384d3752e0537b2f74d684bf890f1e67).

### createFolder()

```cpp theme={null}
virtual Error ansys::Project::Storage::createFolder(
    const URL & pParentPath,
    const Path & pFolderPath
)
```

`pure virtual`

Create a folder in the specified [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md), using the specified name.

Implemented in [ansys::Project::StorageFilesystem](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage_filesystem.md#a123e1a2a831423afe21b4332e6ce0236).

### eraseFile()

```cpp theme={null}
virtual Error ansys::Project::Storage::eraseFile(const URL & pFile)
```

`pure virtual`

Erase the file at the specified location.

Implemented in [ansys::Project::StorageFilesystem](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage_filesystem.md#ab42176b62556669397ba33e1a5238a12).

### eraseFolder()

```cpp theme={null}
virtual Error ansys::Project::Storage::eraseFolder(
    const URL & pFile,
    EraseOptions pRecursive
)
```

`pure virtual`

Erase the folder and content at the specified location.

**Parameters**

| Name | Description |
| - | - |
| 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](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage_filesystem.md#aece46fb1eab83d340f92bfeaff6b9569).

### extractFile()

```cpp theme={null}
virtual Error ansys::Project::Storage::extractFile(
    const URL & pArchive,
    const URL & pTargetLocation
)
```

`pure virtual`

Extract a zipped archive to the specified location.

Implemented in [ansys::Project::StorageFilesystem](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage_filesystem.md#ad9efc72d9decce9ba776d778f6d09e1c).

### getFileChecksum()

```cpp theme={null}
virtual Error ansys::Project::Storage::getFileChecksum(
    const URL & pFile,
    std::string & pChecksum
)
```

`pure virtual`

Compute a checksum for the specified file.

Implemented in [ansys::Project::StorageFilesystem](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage_filesystem.md#a039595fe58e424d1d2fa26b65c61bc89).

### getFileCompressionSuffix()

```cpp theme={null}
virtual std::string ansys::Project::Storage::getFileCompressionSuffix() const
```

`pure virtual`

Returns the required file suffix for compressFile API.

Implemented in [ansys::Project::StorageFilesystem](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage_filesystem.md#a1be30dbb6aac0f0a9f66df7313608810).

### getFileTimestamp()

```cpp theme={null}
virtual Error ansys::Project::Storage::getFileTimestamp(
    const URL & pFile,
    int & pTime
)
```

`pure virtual`

Compute a timestamp for the specified file.

Implemented in [ansys::Project::StorageFilesystem](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage_filesystem.md#acf398f76d7b193aaf9dac8e636d3ffb9).

### getInterface()

```cpp theme={null}
Storage * ansys::Project::Storage::getInterface(const std::string & pType)
```

`static`

Retrieve the [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) object to use with a specific [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) type.

### isFile()

```cpp theme={null}
virtual bool ansys::Project::Storage::isFile(const URL & pPath)
```

`pure virtual`

Indicates if a file exists at the specified [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md).

Implemented in [ansys::Project::StorageFilesystem](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage_filesystem.md#a1c20950181bd70ba4cc45e539288e09f).

### isFolder()

```cpp theme={null}
virtual bool ansys::Project::Storage::isFolder(const URL & pPath)
```

`pure virtual`

Indicates if a folder exists at the specified [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md).

Implemented in [ansys::Project::StorageFilesystem](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage_filesystem.md#aeae85eee1f1895be16cc074c2f210be4).

### matchFiles()

```cpp theme={null}
virtual Error ansys::Project::Storage::matchFiles(
    const URL & pPath,
    std::string pWildcard,
    std::vector< URL > & pMatchFiles
)
```

`pure virtual`

File query by wildcard pattern in the specified [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md).

Implemented in [ansys::Project::StorageFilesystem](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage_filesystem.md#a577705e0cfe27c0f9b58ec0f95c280dd).

### moveFile()

```cpp theme={null}
virtual Error ansys::Project::Storage::moveFile(
    const URL & pSource,
    const URL & pTarget
)
```

`pure virtual`

Rename the file or folder.

Implemented in [ansys::Project::StorageFilesystem](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage_filesystem.md#afbb37c05fcf05d79db86bfb4b3cba4ec).

### registerInterface()

```cpp theme={null}
void ansys::Project::Storage::registerInterface(
    const std::string & pType,
    Storage * pInterface
)
```

`static`

Register a [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) object to work with a specific [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) type.

This function takes ownership of the provided [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) pointer. The registered [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) object will be automatically deleted when it is replaced, unregistered, or when the program terminates. The caller must not delete the pointer after passing it to this function.

**Parameters**

| Name | Description |
| - | - |
| pType | The [URL](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_u_r_l.md) type to associate with this [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) interface |
| pInterface | Raw pointer to a [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) object allocated with 'new'. Ownership is transferred to the [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) registry. |

> [!WARNING]
>
> Do not delete pInterface after calling this function. The [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) registry manages its lifetime.

> [!WARNING]
>
> If a [Storage](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/classansys_1_1_project_1_1_storage.md) interface for pType already exists, a warning is printed and the old interface is replaced (and automatically deleted).
