    

 ## On this page

  

 

 # Iterator

 Last update: 16.07.2025 

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

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

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

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

<a id="l00008" name="l00008"></a> 8\#include &lt;memory&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> 13class PItem;

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

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

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

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

<a id="l00018" name="l00018"></a> 18enum PItemType { PIUndefined=0, PIFolder=1, PIFile=2, PILink=3, PIPropertyTree=4 };

<a id="l00019" name="l00019"></a> 19 

<a id="l00020" name="l00020"></a>[ 20](classansys_1_1_project_1_1_iterator.xhtml)class ANSYS_PROJECT_DLL [Iterator](classansys_1_1_project_1_1_iterator.xhtml) {

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

<a id="l00022" name="l00022"></a> 22 [Iterator](classansys_1_1_project_1_1_iterator.xhtml)();

<a id="l00023" name="l00023"></a> 23 [Iterator](classansys_1_1_project_1_1_iterator.xhtml)(const [Error](classansys_1_1_project_1_1_error.xhtml)&amp; pError);

<a id="l00024" name="l00024"></a> 24 [Iterator](classansys_1_1_project_1_1_iterator.xhtml)(const std::shared_ptr&lt;PItem&gt;&amp; pItem);

<a id="l00025" name="l00025"></a> 25 

<a id="l00026" name="l00026"></a> 26 bool ok() const;

<a id="l00027" name="l00027"></a> 27 void setError(const [Error](classansys_1_1_project_1_1_error.xhtml)&amp; pError);

<a id="l00028" name="l00028"></a> 28 const [Error](classansys_1_1_project_1_1_error.xhtml)&amp; getError() const;

<a id="l00029" name="l00029"></a> 29 

<a id="l00030" name="l00030"></a> 30 bool operator==(const [Iterator](classansys_1_1_project_1_1_iterator.xhtml)&amp; pObj) const;

<a id="l00031" name="l00031"></a> 31 bool operator!=(const [Iterator](classansys_1_1_project_1_1_iterator.xhtml)&amp; pObj) const {

<a id="l00032" name="l00032"></a> 32 return !(*this == pObj);

<a id="l00033" name="l00033"></a> 33 }

<a id="l00034" name="l00034"></a> 34 

<a id="l00035" name="l00035"></a> 35 //FileRef fileRef();

<a id="l00036" name="l00036"></a> 36 

<a id="l00037" name="l00037"></a> 37 PItemType getType() const;

<a id="l00038" name="l00038"></a> 38 std::string getTypeAsString() const ;

<a id="l00039" name="l00039"></a> 39 std::string getSubclass() const;

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

<a id="l00041" name="l00041"></a> 41 std::string getName() const;

<a id="l00042" name="l00042"></a> 42 [Error](classansys_1_1_project_1_1_error.xhtml) rename(const std::string&amp; pName);

<a id="l00043" name="l00043"></a> 43 

<a id="l00044" name="l00044"></a> 44 [Path](classansys_1_1_project_1_1_path.xhtml) getPath() const;

<a id="l00045" name="l00045"></a> 45 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) getParent() const;

<a id="l00046" name="l00046"></a> 46 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) getParentOfType(const std::string&amp; pType) const;

<a id="l00047" name="l00047"></a> 47 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) getParentOfSubclass(const std::string&amp; pSubclass) const;

<a id="l00048" name="l00048"></a> 48 void accept(Visitor&amp; pVisitor);

<a id="l00049" name="l00049"></a> 49 

<a id="l00050" name="l00050"></a> 50 int getProjectId() const;

<a id="l00051" name="l00051"></a> 51 bool isReadOnly() const;

<a id="l00052" name="l00052"></a> 52 

<a id="l00053" name="l00053"></a> 53 [Metadata](classansys_1_1_project_1_1_metadata.xhtml)&amp; getMeta();

<a id="l00054" name="l00054"></a> 54 const [Metadata](classansys_1_1_project_1_1_metadata.xhtml)&amp; getMeta() const;

<a id="l00055" name="l00055"></a> 55 

<a id="l00056" name="l00056"></a> 56 [Metadata](classansys_1_1_project_1_1_metadata.xhtml)&amp; getRuntimeMeta();

<a id="l00057" name="l00057"></a> 57 const [Metadata](classansys_1_1_project_1_1_metadata.xhtml)&amp; getRuntimeMeta() const;

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

<a id="l00059" name="l00059"></a> 59 std::vector&lt;Iterator&gt; find(const [Query](classansys_1_1_project_1_1_query.xhtml)&amp; pQuery,bool pFollowSymlink=false) const;

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

<a id="l00061" name="l00061"></a> 61 // Type actions

<a id="l00062" name="l00062"></a> 62 bool isFile() const;

<a id="l00063" name="l00063"></a> 63 bool isLink() const;

<a id="l00064" name="l00064"></a> 64 bool isFolder() const;

<a id="l00065" name="l00065"></a> 65 bool isPropertyTree() const;

<a id="l00066" name="l00066"></a> 66 PItem* asItem() const;

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

<a id="l00068" name="l00068"></a> 68 // Folder actions

<a id="l00069" name="l00069"></a> 69 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) newFolder(const std::string&amp; pName);

<a id="l00070" name="l00070"></a> 70 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) newFolder(const std::string&amp; pName,const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pURL);

<a id="l00071" name="l00071"></a> 71 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) newFile(const std::string&amp; pName);

<a id="l00072" name="l00072"></a> 72 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) newFile(const std::string&amp; pName,const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pURL,bool pImport=false);

<a id="l00073" name="l00073"></a> 73 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) newLink(const std::string&amp; pName,const [Iterator](classansys_1_1_project_1_1_iterator.xhtml)&amp; pTarget);

<a id="l00074" name="l00074"></a> 74 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) newPropertyTree(const std::string&amp; pName);

<a id="l00075" name="l00075"></a> 75 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) getChild(const std::string&amp; pName) const;

<a id="l00076" name="l00076"></a> 76 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) get(const [Path](classansys_1_1_project_1_1_path.xhtml)&amp; pName) const;

<a id="l00077" name="l00077"></a> 77 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) getByURL(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pRelativeURL) const;

<a id="l00078" name="l00078"></a> 78 std::vector&lt;std::string&gt; getChildNames() const;

<a id="l00079" name="l00079"></a> 79 std::vector&lt;Iterator&gt; getChildList() const;

<a id="l00080" name="l00080"></a> 80 std::vector&lt;Iterator&gt; getChildListOfSubclass(std::string pSubclass) const;

<a id="l00081" name="l00081"></a> 81 std::vector&lt;std::string&gt; getFolderOtherURLSubItems(bool pFolders) const;

<a id="l00082" name="l00082"></a> 82 [Error](classansys_1_1_project_1_1_error.xhtml) removeItem(const std::string&amp; pName,bool pFlagRecursive=false);

<a id="l00083" name="l00083"></a> 83 [Error](classansys_1_1_project_1_1_error.xhtml) moveTo([Iterator](classansys_1_1_project_1_1_iterator.xhtml) pTargetFolder);

<a id="l00084" name="l00084"></a> 84 

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

<a id="l00086" name="l00086"></a> 86 void setURL(const [URL](classansys_1_1_project_1_1_u_r_l.xhtml)&amp; pURL);

<a id="l00087" name="l00087"></a> 87 [URL](classansys_1_1_project_1_1_u_r_l.xhtml) getURL() const;

<a id="l00088" name="l00088"></a> 88 [URL](classansys_1_1_project_1_1_u_r_l.xhtml) getURLFromRoot() const;

<a id="l00089" name="l00089"></a> 89 [URL](classansys_1_1_project_1_1_u_r_l.xhtml) getFullURL() const;

<a id="l00090" name="l00090"></a> 90 bool urlExists() const;

<a id="l00091" name="l00091"></a> 91 bool isURLEditable() const;

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

<a id="l00093" name="l00093"></a> 93 void clearChecksum();

<a id="l00094" name="l00094"></a> 94 [Error](classansys_1_1_project_1_1_error.xhtml) computeChecksum(std::string&amp; pChecksum,bool pFlagStore);

<a id="l00095" name="l00095"></a> 95 [Error](classansys_1_1_project_1_1_error.xhtml) getStoredChecksum(std::string&amp; pChecksum) const;

<a id="l00096" name="l00096"></a> 96 

<a id="l00097" name="l00097"></a> 97 // Link actions

<a id="l00098" name="l00098"></a> 98 [Iterator](classansys_1_1_project_1_1_iterator.xhtml) getTarget() const;

<a id="l00099" name="l00099"></a> 99 std::string getTargetStr() const;

<a id="l00100" name="l00100"></a> 100 void setTarget(const [Iterator](classansys_1_1_project_1_1_iterator.xhtml)&amp; pIter);

<a id="l00101" name="l00101"></a> 101 bool isSubProject() const;

<a id="l00102" name="l00102"></a> 102 

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

<a id="l00104" name="l00104"></a> 104 bool operator&lt;(const [Iterator](classansys_1_1_project_1_1_iterator.xhtml)&amp; pObj) const {

<a id="l00105" name="l00105"></a> 105 return getPath().[str](classansys_1_1_project_1_1_path.xhtml#a23c3a774abe504500c5719c91bffae1d)() &lt; pObj.[getPath](classansys_1_1_project_1_1_iterator.xhtml#a6a65a49f2fdfec22ab034b593599aa7f)().[str](classansys_1_1_project_1_1_path.xhtml#a23c3a774abe504500c5719c91bffae1d)();

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

<a id="l00107" name="l00107"></a> 107 

<a id="l00108" name="l00108"></a> 108protected:

<a id="l00109" name="l00109"></a> 109 std::weak_ptr&lt;PItem&gt; aRef;

<a id="l00110" name="l00110"></a> 110 [Error](classansys_1_1_project_1_1_error.xhtml) aError;

<a id="l00111" name="l00111"></a> 111};

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

<a id="l00113" name="l00113"></a> 113}

<a id="l00114" name="l00114"></a> 114}

<a id="l00115" name="l00115"></a> 115 

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

Path getPath() const

Return the item full Path in the project.

**Definition:** Iterator.cpp:251



[ansys::Project::Metadata](classansys_1_1_project_1_1_metadata.xhtml)

Dictionary of values associated with an Iterator.

**Definition:** Metadata.hpp:19



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

Paths used for internal Project filesystem.

**Definition:** Path.hpp:11



[ansys::Project::Path::str](classansys_1_1_project_1_1_path.xhtml#a23c3a774abe504500c5719c91bffae1d)

const std::string &amp; str() const

Return as string.

**Definition:** Path.cpp:181



[ansys::Project::Query](classansys_1_1_project_1_1_query.xhtml)

Set of conditions used in search within the Project. See Iterator::find()

**Definition:** Query.hpp:13



[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