    

 ## On this page

  

 

 # Project

 Last update: 16.07.2025 

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

<a id="l00002" name="l00002"></a> 2\#define CFFSDK\_PROJECT\_PROJECT\_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/Error.hpp"

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

<a id="l00008" name="l00008"></a> 8\#include "Project/ProjectStoragePolicy.hpp"

<a id="l00009" name="l00009"></a> 9\#include &lt;memory&gt;

<a id="l00010" name="l00010"></a> 10 

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

<a id="l00012" name="l00012"></a> 12namespace Project {

<a id="l00013" name="l00013"></a> 13 

<a id="l00014" name="l00014"></a> 14class PItem;

<a id="l00015" name="l00015"></a> 15class ProjectStorageManager;

<a id="l00016" name="l00016"></a> 16class ProjectStoragePolicy;

<a id="l00017" name="l00017"></a> 17class BaseCallback;

<a id="l00018" name="l00018"></a> 18class CallbackParams;

<a id="l00019" name="l00019"></a> 19class CheckProjectInfo;

<a id="l00020" name="l00020"></a> 20class MetadataConst;

<a id="l00021" name="l00021"></a> 21 

<a id="l00022" name="l00022"></a>[ 22](classansys_1_1_project_1_1_project.xhtml)class ANSYS_PROJECT_DLL [Project](classansys_1_1_project_1_1_project.xhtml) {

<a id="l00023" name="l00023"></a> 23public:

<a id="l00024" name="l00024"></a> 24 [Project](classansys_1_1_project_1_1_project.xhtml)();

<a id="l00025" name="l00025"></a> 25 virtual [~Project](classansys_1_1_project_1_1_project.xhtml)();

<a id="l00026" name="l00026"></a> 26 

<a id="l00027" name="l00027"></a> 27 // new/load/save and location

<a id="l00028" name="l00028"></a> 28 bool isLoaded() const;

<a id="l00029" name="l00029"></a> 29 virtual bool isProject(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pLocation);

<a id="l00030" name="l00030"></a> 30 virtual [Error](classansys_1_1_project_1_1_error.xhtml) newProject(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pLocation);

<a id="l00031" name="l00031"></a> 31 virtual [Error](classansys_1_1_project_1_1_error.xhtml) openProject(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pLocation,bool pReadOnly=false);

<a id="l00032" name="l00032"></a> 32 virtual [Error](classansys_1_1_project_1_1_error.xhtml) openProjectFromString(const std::string&amp; pData,

<a id="l00033" name="l00033"></a> 33 const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pProjectLocation,

<a id="l00034" name="l00034"></a> 34 bool pReadOnly=false);

<a id="l00035" name="l00035"></a> 35 [Error](classansys_1_1_project_1_1_error.xhtml) saveProject();

<a id="l00036" name="l00036"></a> 36 [Error](classansys_1_1_project_1_1_error.xhtml) saveProjectToString(std::string&amp; pString);

<a id="l00037" name="l00037"></a> 37 [Error](classansys_1_1_project_1_1_error.xhtml) saveAsProject(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pLocation,bool pFlagCopyFiles=false,bool pFlagCopyExternal=false);

<a id="l00038" name="l00038"></a> 38 

<a id="l00039" name="l00039"></a> 39 [Error](classansys_1_1_project_1_1_error.xhtml) exportProject(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pLocation,bool pFlagCopyExternal=true,bool pFlagEnforceStructure=false);

<a id="l00040" name="l00040"></a> 40 

<a id="l00041" name="l00041"></a> 41 [Error](classansys_1_1_project_1_1_error.xhtml) archiveProject(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pTargetArchive) const;

<a id="l00042" name="l00042"></a> 42 [Error](classansys_1_1_project_1_1_error.xhtml) archiveProject(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pTargetArchive,const std::vector&lt;std::string&gt;&amp; pListIgnore) const;

<a id="l00043" name="l00043"></a> 43 static [Error](classansys_1_1_project_1_1_error.xhtml) unarchiveProject(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; pTargetFolder);

<a id="l00044" name="l00044"></a> 44 

<a id="l00045" name="l00045"></a> 45 [Error](classansys_1_1_project_1_1_error.xhtml) forkProject([Iterator](classansys_1_1_project_1_1_iterator.xhtml)&amp; pIter,const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pNewProjectFilename,[Project](classansys_1_1_project_1_1_project.xhtml)*&amp; pProject);

<a id="l00046" name="l00046"></a> 46 bool isSubProject() const;

<a id="l00047" name="l00047"></a> 47 [Error](classansys_1_1_project_1_1_error.xhtml) loadSubProject([Iterator](classansys_1_1_project_1_1_iterator.xhtml)&amp; pIter);

<a id="l00048" name="l00048"></a> 48 std::vector&lt;Iterator&gt; getSubProjects();

<a id="l00049" name="l00049"></a> 49 [Error](classansys_1_1_project_1_1_error.xhtml) loadAllSubProjects();

<a id="l00050" name="l00050"></a> 50 [Error](classansys_1_1_project_1_1_error.xhtml) join([Iterator](classansys_1_1_project_1_1_iterator.xhtml) pIter);

<a id="l00051" name="l00051"></a> 51 

<a id="l00052" name="l00052"></a> 52 [Error](classansys_1_1_project_1_1_error.xhtml) getProjectLockInfo(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pLocation,std::string&amp; pLockInfo);

<a id="l00053" name="l00053"></a> 53 [Error](classansys_1_1_project_1_1_error.xhtml) eraseProjectLock(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pLocation);

<a id="l00054" name="l00054"></a> 54 

<a id="l00055" name="l00055"></a> 55 struct [CheckProjectInfo](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml);

<a id="l00056" name="l00056"></a> 56 virtual [Error](classansys_1_1_project_1_1_error.xhtml) checkProject([CheckProjectInfo](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml)&amp; pSettings) const;

<a id="l00057" name="l00057"></a> 57 virtual [Error](classansys_1_1_project_1_1_error.xhtml) upgradeProject();

<a id="l00058" name="l00058"></a> 58 

<a id="l00059" name="l00059"></a> 59 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) copyItemTo([Iterator](classansys_1_1_project_1_1_iterator.xhtml) pSource,[Project](classansys_1_1_project_1_1_project.xhtml)&amp; pTarget,[Iterator](classansys_1_1_project_1_1_iterator.xhtml) pTargetFolder=[Iterator](classansys_1_1_project_1_1_iterator.xhtml)(),bool pRecursive=false);

<a id="l00060" name="l00060"></a> 60 

<a id="l00061" name="l00061"></a> 61 [Error](classansys_1_1_project_1_1_error.xhtml) closeProject();

<a id="l00062" name="l00062"></a> 62 

<a id="l00063" name="l00063"></a> 63 const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; getProjectLocation() const;

<a id="l00064" name="l00064"></a> 64 [URL](classansys_1_1_project_1_1_u_r_l.xhtml) getProjectFolder() const;

<a id="l00065" name="l00065"></a> 65 [ProjectStoragePolicy](classansys_1_1_project_1_1_project_storage_policy.xhtml)&amp; getStoragePolicy();

<a id="l00066" name="l00066"></a> 66 const [ProjectStoragePolicy](classansys_1_1_project_1_1_project_storage_policy.xhtml)&amp; getStoragePolicy() const;

<a id="l00067" name="l00067"></a> 67 

<a id="l00068" name="l00068"></a> 68 bool isLocalToProject(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pURL) const;

<a id="l00069" name="l00069"></a> 69 bool isOwnedByProject(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pURL) const;

<a id="l00070" name="l00070"></a> 70 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) getIteratorForURL(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pURL) const;

<a id="l00071" name="l00071"></a> 71 [URL](classansys_1_1_project_1_1_u_r_l.xhtml) getRelativePathToFile(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pURL) const;

<a id="l00072" name="l00072"></a> 72 

<a id="l00073" name="l00073"></a> 73 bool registerCallback(const std::string&amp; pOwner,

<a id="l00074" name="l00074"></a> 74 const std::string&amp; pCallbackName,

<a id="l00075" name="l00075"></a> 75 BaseCallback* pCallback);

<a id="l00076" name="l00076"></a> 76 [Error](classansys_1_1_project_1_1_error.xhtml) executeCallback(const std::string&amp; pCallbackName,

<a id="l00077" name="l00077"></a> 77 CallbackParams&amp; pParams);

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

<a id="l00079" name="l00079"></a> 79 virtual [Error](classansys_1_1_project_1_1_error.xhtml) copyMetadata(const [Iterator](classansys_1_1_project_1_1_iterator.xhtml)&amp; pSource,

<a id="l00080" name="l00080"></a> 80 [Iterator](classansys_1_1_project_1_1_iterator.xhtml)&amp; pTarget) const;

<a id="l00081" name="l00081"></a> 81 virtual [Error](classansys_1_1_project_1_1_error.xhtml) copyRuntimeMetadata(const [Iterator](classansys_1_1_project_1_1_iterator.xhtml)&amp; pSource,

<a id="l00082" name="l00082"></a> 82 [Iterator](classansys_1_1_project_1_1_iterator.xhtml)&amp; pTarget) const;

<a id="l00083" name="l00083"></a> 83 virtual [Error](classansys_1_1_project_1_1_error.xhtml) getInheritedMetadata(const [Iterator](classansys_1_1_project_1_1_iterator.xhtml)&amp; pIter,

<a id="l00084" name="l00084"></a> 84 [MetadataConst](classansys_1_1_project_1_1_metadata_const.xhtml)&amp; pMeta);

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

<a id="l00086" name="l00086"></a> 86 // file access through iterators

<a id="l00087" name="l00087"></a> 87 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) getDir();

<a id="l00088" name="l00088"></a> 88 bool setDir([Iterator](classansys_1_1_project_1_1_iterator.xhtml)&amp; pDir);

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

<a id="l00090" name="l00090"></a> 90 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) root() const;

<a id="l00091" name="l00091"></a> 91 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) get(const [Path](classansys_1_1_project_1_1_path.xhtml)&amp; pPath) const;

<a id="l00092" name="l00092"></a> 92 

<a id="l00093" name="l00093"></a> 93 int getProjectId() const;

<a id="l00094" name="l00094"></a> 94 

<a id="l00098" name="l00098"></a>[ 98](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml) struct [CheckProjectInfo](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml){

<a id="l00099" name="l00099"></a> 99 // Behavior flags

<a id="l00100" name="l00100"></a> 100 bool aCheckCore; 

<a id="l00101" name="l00101"></a>[ 101](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#aeef038218f80ef6dbfe2888abfa4c2b8) bool [aCheckInternalURLs](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#aeef038218f80ef6dbfe2888abfa4c2b8); 

<a id="l00102" name="l00102"></a>[ 102](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#acbea8bc71859fd4eb85624acacbf2689) bool [aCheckExternalURLs](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#acbea8bc71859fd4eb85624acacbf2689); 

<a id="l00103" name="l00103"></a> 103 

<a id="l00104" name="l00104"></a>[ 104](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a525f0899d75d109084a13dd160917d74) bool [aStrictMode](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a525f0899d75d109084a13dd160917d74); 

<a id="l00105" name="l00105"></a> 105 

<a id="l00106" name="l00106"></a> 106 // Counters

<a id="l00107" name="l00107"></a>[ 107](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#acc46d4468432447c18453cba007725f8) std::vector&lt;Iterator&gt; [aVectBadLinks](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#acc46d4468432447c18453cba007725f8); 

<a id="l00108" name="l00108"></a>[ 108](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a98dd135aae40ec348b3c87208f4f9a59) std::vector&lt;Iterator&gt; [aVectBadInternalFolders](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a98dd135aae40ec348b3c87208f4f9a59); 

<a id="l00109" name="l00109"></a>[ 109](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#aca4600d5080c72545eb5ac4daf1d22fa) std::vector&lt;Iterator&gt; [aVectBadInternalFiles](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#aca4600d5080c72545eb5ac4daf1d22fa); 

<a id="l00110" name="l00110"></a>[ 110](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a39efaa5dc59cead0f9b46c0edb910200) std::vector&lt;Iterator&gt; [aVectBadExternalFolders](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a39efaa5dc59cead0f9b46c0edb910200); 

<a id="l00111" name="l00111"></a>[ 111](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a4a9f41d1056be1b3df65258dd3794947) std::vector&lt;Iterator&gt; [aVectBadExternalFiles](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a4a9f41d1056be1b3df65258dd3794947); 

<a id="l00112" name="l00112"></a> 112 

<a id="l00114" name="l00114"></a>[ 114](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a1228f47a6c73cd190e78011816920a67) [CheckProjectInfo](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a1228f47a6c73cd190e78011816920a67)(bool pFlagStrict)

<a id="l00115" name="l00115"></a> 115 :aCheckCore(true),

<a id="l00116" name="l00116"></a> 116 aCheckInternalURLs(true),

<a id="l00117" name="l00117"></a> 117 aCheckExternalURLs(false),

<a id="l00118" name="l00118"></a> 118 aStrictMode(pFlagStrict) {

<a id="l00119" name="l00119"></a> 119 };

<a id="l00120" name="l00120"></a> 120 };

<a id="l00121" name="l00121"></a> 121protected:

<a id="l00122" name="l00122"></a> 122 virtual [Error](classansys_1_1_project_1_1_error.xhtml) updateFromPolicy() { return [Error](classansys_1_1_project_1_1_error.xhtml)(); };

<a id="l00123" name="l00123"></a> 123 virtual Error setupNewProject();

<a id="l00124" name="l00124"></a> 124 virtual Project* projectObjectFactory() const;

<a id="l00125" name="l00125"></a> 125 virtual Error copyProjectContent(Iterator pFolder,const URL&amp; pSourceFolder,const URL&amp; pTargetFolder,

<a id="l00126" name="l00126"></a> 126 std::map&lt;Iterator,URL&gt;&amp; pURLChanges,

<a id="l00127" name="l00127"></a> 127 bool pCopyExternalFiles,bool pEnforceStructure);

<a id="l00128" name="l00128"></a> 128 

<a id="l00129" name="l00129"></a> 129 static int sFormatVersion;

<a id="l00130" name="l00130"></a> 130 static std::string getReleaseId();

<a id="l00131" name="l00131"></a> 131private:

<a id="l00132" name="l00132"></a> 132 

<a id="l00133" name="l00133"></a> 133 Error clearData();

<a id="l00134" name="l00134"></a> 134 Error setProjectLockInfo();

<a id="l00135" name="l00135"></a> 135 Error migrateIterator(Iterator&amp; pIter, Project&amp; pNewProject);

<a id="l00136" name="l00136"></a> 136 

<a id="l00137" name="l00137"></a> 137 enum ProjectState { PSUndefined, PSLoaded };

<a id="l00138" name="l00138"></a> 138 ProjectState aProjectState;

<a id="l00139" name="l00139"></a> 139 URL aLocation;

<a id="l00140" name="l00140"></a> 140 

<a id="l00141" name="l00141"></a> 141 Iterator aCWD;

<a id="l00142" name="l00142"></a> 142 std::shared_ptr&lt;PItem&gt; aRoot;

<a id="l00143" name="l00143"></a> 143 bool aIsSubProject;

<a id="l00144" name="l00144"></a> 144 

<a id="l00145" name="l00145"></a> 145 ProjectStoragePolicy aPolicy;

<a id="l00146" name="l00146"></a> 146 std::shared_ptr&lt;ProjectStorageManager&gt; aFileManager;

<a id="l00147" name="l00147"></a> 147 

<a id="l00148" name="l00148"></a> 148 std::vector&lt;Project*&gt; aSubprojects;

<a id="l00149" name="l00149"></a> 149 

<a id="l00150" name="l00150"></a> 150 int aProjectId;

<a id="l00151" name="l00151"></a> 151 static int sProjectId;

<a id="l00152" name="l00152"></a> 152};

<a id="l00153" name="l00153"></a> 153 

<a id="l00154" name="l00154"></a> 154}

<a id="l00155" name="l00155"></a> 155}

<a id="l00156" name="l00156"></a> 156 

<a id="l00157" name="l00157"></a> 157\#endif // CFFSDK\_PROJECT\_PROJECT\_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::Iterator](classansys_1_1_project_1_1_iterator.xhtml)

Pointer to a project location.

**Definition:** Iterator.hpp:20



[ansys::Project::MetadataConst](classansys_1_1_project_1_1_metadata_const.xhtml)

Constant (read-only) value of Metadata.

**Definition:** MetadataConst.hpp:23



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

Paths used for internal Project filesystem.

**Definition:** Path.hpp:11



[ansys::Project::ProjectStoragePolicy](classansys_1_1_project_1_1_project_storage_policy.xhtml)

Project storage settings, control folder management, folder names, etc.

**Definition:** ProjectStoragePolicy.hpp:15



[ansys::Project::Project](classansys_1_1_project_1_1_project.xhtml)

Base class for Project API, also see SimProject.

**Definition:** Project.hpp:22



[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



[ansys::Project::Project::CheckProjectInfo](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml)

Utility structure for VisitorCheckProject project checking action.

**Definition:** Project.hpp:98



[ansys::Project::Project::CheckProjectInfo::CheckProjectInfo](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a1228f47a6c73cd190e78011816920a67)

CheckProjectInfo(bool pFlagStrict)

Return value - list of missing files referenced by the project.

**Definition:** Project.hpp:114



[ansys::Project::Project::CheckProjectInfo::aVectBadExternalFolders](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a39efaa5dc59cead0f9b46c0edb910200)

std::vector&lt; Iterator &gt; aVectBadExternalFolders

Return value - list of missing files in the project.

**Definition:** Project.hpp:110



[ansys::Project::Project::CheckProjectInfo::aVectBadExternalFiles](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a4a9f41d1056be1b3df65258dd3794947)

std::vector&lt; Iterator &gt; aVectBadExternalFiles

Return value - list of missing folders referenced by the project.

**Definition:** Project.hpp:111



[ansys::Project::Project::CheckProjectInfo::aStrictMode](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a525f0899d75d109084a13dd160917d74)

bool aStrictMode

Enable to check if all files referenced outside the project actually exist.

**Definition:** Project.hpp:104



[ansys::Project::Project::CheckProjectInfo::aVectBadInternalFolders](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#a98dd135aae40ec348b3c87208f4f9a59)

std::vector&lt; Iterator &gt; aVectBadInternalFolders

Return value - list of invalid links in the project.

**Definition:** Project.hpp:108



[ansys::Project::Project::CheckProjectInfo::aVectBadInternalFiles](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#aca4600d5080c72545eb5ac4daf1d22fa)

std::vector&lt; Iterator &gt; aVectBadInternalFiles

Return value - list of missing folders in the project.

**Definition:** Project.hpp:109



[ansys::Project::Project::CheckProjectInfo::aCheckExternalURLs](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#acbea8bc71859fd4eb85624acacbf2689)

bool aCheckExternalURLs

Enable to check if all files stored in the project actually exist.

**Definition:** Project.hpp:102



[ansys::Project::Project::CheckProjectInfo::aVectBadLinks](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#acc46d4468432447c18453cba007725f8)

std::vector&lt; Iterator &gt; aVectBadLinks

Error mode flag. (error vs warning in output)

**Definition:** Project.hpp:107



[ansys::Project::Project::CheckProjectInfo::aCheckInternalURLs](structansys_1_1_project_1_1_project_1_1_check_project_info.xhtml#aeef038218f80ef6dbfe2888abfa4c2b8)

bool aCheckInternalURLs

Enable to check the project basic settings.

**Definition:** Project.hpp:101