ansys::CffFileIO Class Reference
Last update: 19.05.2025Base class that provides common function used in File providers such as ansys::CffFileProvider. More...
#include "CffInterface/CffFileIO.hpp"

Public Member Functions | |
| CffFileIO () | |
| virtual | ~CffFileIO () |
| virtual void | setFile (const std::string &file, DataClass dataClass) |
| virtual bool | getFileVersion (DataClass dataClass, std::string &version) const |
| virtual bool | getFileVersion (DataClass dataClass, int &major, int &minor, int &patch) const |
Protected Member Functions | |
| std::vector< DataClass > | getDataClasses () const |
| std::string | getFile (DataClass source) const |
| virtual void | setFileVersion (DataClass dataClass, const std::string &version) |
Detailed Description
Base class that provides common function used in File providers such as ansys::CffFileProvider.
Functions such as ansys::CffFileIO::setFile need to be called prior to the call to ansys::CffProvider::startReading or ansys::CffConsumer::startWriting
A typical workflow would be:
Constructor & Destructor Documentation
◆ CffFileIO()
|
inline |
◆ ~CffFileIO()
|
inlinevirtual |
Member Function Documentation
◆ getDataClasses()
|
protected |
Get all classes of data for which file names have been set.
- Returns
- - all data classes that have had files set.
◆ getFile()
|
protected |
Get the file name of the file associated ith the class of data.
- Parameters
-
[in] dataClass - Data class to which file is associated.
- Returns
- - Associated filename.
◆ getFileVersion() [1/2]
|
virtual |
Get the version number of API the file was written with as three integers representing the major, minor and patch numbers.
- Parameters
-
[in] dataClass - Data class associated with the file from which to read the version. [out] major - Major version number. [out] minor - Minor version number. [out] patch - Patch version number.
- Returns
- - true if successful, false if invalid.
◆ getFileVersion() [2/2]
|
virtual |
Get the version number of API the file was written with as a string.
- Parameters
-
dataClass [in] - Data class identifying the file from which to read the version. version [out] - e.g. Maj.Min[.Patch]
- Returns
- - true if successful, false if invalid.
◆ setFile()
|
virtual |
Set the file name of the file associated with a class of data.
- Parameters
-
[in] file - Filename to associate with the data class. [in] dataClass - Data class to which file is associated.
◆ setFileVersion()
|
protectedvirtual |
Set the version of the API the file, of the the provided data class, is written against.
Should be called at time of reading of the file by the CffConsumer.
- Parameters
-
[in] dataClass - file in which data in the source is read/written. [in] fileVersion - version string of the form Maj.Min[.Patch].