<metaname="description"content="PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.">
<!-- iframe showing the search results (closed by default) -->
<divid="MSearchResultsWindow">
<iframesrc="javascript:void(0)"frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<divclass="header">
<divclass="headertitle">
<divclass="title">fileSystem.hpp</div></div>
</div><!--header-->
<divclass="contents">
<ahref="fileSystem_8hpp.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">/*------------------------------- phasicFlow ---------------------------------</span></div>
<divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment"> O C enter of</span></div>
<divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment"> O O E ngineering and</span></div>
<divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment"> O O M ultiscale modeling of</span></div>
<divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment"> OOOOOOO F luid flow </span></div>
<divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment"> This file is part of phasicFlow code. It is a free software for simulating </span></div>
<divclass="line"><aname="l00012"></a><spanclass="lineno"> 12</span> <spanclass="comment"> granular and multiphase flows. You can redistribute it and/or modify it under</span></div>
<divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> <spanclass="comment"> the terms of GNU General Public License v3 or any other later versions. </span></div>
<divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="comment"> phasicFlow is distributed to help others in their research in the field of </span></div>
<divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="comment"> granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the</span></div>
<divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment"> implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</span></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_ae314be4455ae76c73ce660e840d0e5cb"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#ae314be4455ae76c73ce660e840d0e5cb">pFlow::fileSystem::canonical</a></div><divclass="ttdeci">fileSystem canonical() const</div><divclass="ttdoc">Canonical path of this (it should exist)</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00149">fileSystem.cpp:149</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_a39940fd65d47ee21b31888a9ae6597ac"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#a39940fd65d47ee21b31888a9ae6597ac">pFlow::fileSystem::operator/</a></div><divclass="ttdeci">friend fileSystem operator/(const fileSystem &fs1, const fileSystem &fs2)</div><divclass="ttdoc">Create a dir path from dir path of fs1 and fas2 in the form of fs1/fs2</div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_a06b8851f8e2610ba100d6dbe7c28e42a"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#a06b8851f8e2610ba100d6dbe7c28e42a">pFlow::fileSystem::fileName</a></div><divclass="ttdeci">word fileName() const</div><divclass="ttdoc">File name part of the path (if any)</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00105">fileSystem.cpp:105</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_a50adcf11cea516a2e8756eadafab8da3"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#a50adcf11cea516a2e8756eadafab8da3">pFlow::fileSystem::dirExist</a></div><divclass="ttdeci">bool dirExist() const</div><divclass="ttdoc">Only operate on dir path Check if the dir path exists.</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00176">fileSystem.cpp:176</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_ae786060b60772fb23941d9f391bf6835"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#ae786060b60772fb23941d9f391bf6835">pFlow::fileSystem::CWD</a></div><divclass="ttdeci">static fileSystem CWD()</div><divclass="ttdoc">return current working directory</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8hpp_source.html#l00101">fileSystem.hpp:101</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_a549f0056414942b1ff25b23cdeac92ea"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#a549f0056414942b1ff25b23cdeac92ea">pFlow::fileSystem::exist</a></div><divclass="ttdeci">bool exist() const</div><divclass="ttdoc">Check if the path exists.</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00192">fileSystem.cpp:192</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_a68e72d3af85bf1d216834e8e5c616072"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#a68e72d3af85bf1d216834e8e5c616072">pFlow::fileSystem::operator/=</a></div><divclass="ttdeci">void operator/=(const fileSystem &fs)</div><divclass="ttdoc">It operates on dir path only Add the dir path of fs to this</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00265">fileSystem.cpp:265</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_ad5a6ed25a46487bf8b9c148769ad9ead"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#ad5a6ed25a46487bf8b9c148769ad9ead">pFlow::fileSystem::operator+=</a></div><divclass="ttdeci">void operator+=(const word &fileName)</div><divclass="ttdoc">If this is dir path, add the filename to dir path if it is file path, replace the file name</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00245">fileSystem.cpp:245</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_a867f8148e9b99b53b87b79fe200acff4"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#a867f8148e9b99b53b87b79fe200acff4">pFlow::fileSystem::operator()</a></div><divclass="ttdeci">fileSystem operator()(bool retDir=true) const</div><divclass="ttdoc">Return the dir path of this.</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00235">fileSystem.cpp:235</a></div></div>
<divclass="ttc"id="anamespacepFlow_html_a79c4a81c7fb0a27aabdb1b4a73c750d8"><divclass="ttname"><ahref="namespacepFlow.html#a79c4a81c7fb0a27aabdb1b4a73c750d8">pFlow::containingFiles</a></div><divclass="ttdeci">fileSystemList containingFiles(const fileSystem &path)</div><divclass="ttdoc">A list of file paths that exist in the path.</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00359">fileSystem.cpp:359</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_a665273dc06598e5f2a675e4ea9464770"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#a665273dc06598e5f2a675e4ea9464770">pFlow::fileSystem::isDir_</a></div><divclass="ttdeci">bool isDir_</div><divclass="ttdoc">Is this a directory path?</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8hpp_source.html#l00083">fileSystem.hpp:83</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_ac70cdfb2ab420c22c655079fd17407b3"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#ac70cdfb2ab420c22c655079fd17407b3">pFlow::fileSystem::operator=</a></div><divclass="ttdeci">fileSystem & operator=(const fileSystem &)=default</div><divclass="ttdoc">Copy assignment.</div></div>
<divclass="ttc"id="anamespacepFlow_html_ac8a2c4dd123ea5ac20d0a98d5076e510"><divclass="ttname"><ahref="namespacepFlow.html#ac8a2c4dd123ea5ac20d0a98d5076e510">pFlow::isRegularFile</a></div><divclass="ttdeci">bool isRegularFile(const fileSystem &path)</div><divclass="ttdoc">free function to check if the path is regular file</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00331">fileSystem.cpp:331</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html">pFlow::fileSystem</a></div><divclass="ttdoc">Manages file pathes, manupulate and combines them.</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8hpp_source.html#l00071">fileSystem.hpp:71</a></div></div>
<divclass="ttc"id="anamespacepFlow_html_ae21b012a6bc672b99ddbb629f4ecce09"><divclass="ttname"><ahref="namespacepFlow.html#ae21b012a6bc672b99ddbb629f4ecce09">pFlow::subDirectories</a></div><divclass="ttdeci">fileSystemList subDirectories(const fileSystem &path)</div><divclass="ttdoc">A list of sub-directories that exist in path.</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00337">fileSystem.cpp:337</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_adc6d0ca8012efebb617c63f6b406324a"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#adc6d0ca8012efebb617c63f6b406324a">pFlow::fileSystem::notPermittedCharsFile</a></div><divclass="ttdeci">static word notPermittedCharsFile</div><divclass="ttdoc">Not premitted chars in file name</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8hpp_source.html#l00087">fileSystem.hpp:87</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_a30e927ab97f8b741ec1b4ed94d111115"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#a30e927ab97f8b741ec1b4ed94d111115">pFlow::fileSystem::path</a></div><divclass="ttdeci">const pathType & path() const</div><divclass="ttdoc">Const access to path.</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8hpp_source.html#l00154">fileSystem.hpp:154</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_aa38071b32f7e36ac484ba59b2c0b0eec"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#aa38071b32f7e36ac484ba59b2c0b0eec">pFlow::fileSystem::dirPath</a></div><divclass="ttdeci">fileSystem dirPath() const</div><divclass="ttdoc">Dir part of the path.</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00091">fileSystem.cpp:91</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_aa9e274fd12c0a39372fda20495055141"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#aa9e274fd12c0a39372fda20495055141">pFlow::fileSystem::operator<<</a></div><divclass="ttdeci">friend iOstream & operator<<(iOstream &os, const fileSystem &fs)</div></div>
<divclass="ttc"id="anamespacepFlow_html_a646799ea535c7800d608f750bed76a1e"><divclass="ttname"><ahref="namespacepFlow.html#a646799ea535c7800d608f750bed76a1e">pFlow::isDirectory</a></div><divclass="ttdeci">bool isDirectory(const fileSystem &path)</div><divclass="ttdoc">Free function to check if the path is dir path.</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00324">fileSystem.cpp:324</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_af60e3745d0ba90eaec6169d2fedf3672"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#af60e3745d0ba90eaec6169d2fedf3672">pFlow::fileSystem::absolute</a></div><divclass="ttdeci">fileSystem absolute() const</div><divclass="ttdoc">Absolute path of this.</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00125">fileSystem.cpp:125</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_a42d00f7345430ad04ae025feab49bc18"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#a42d00f7345430ad04ae025feab49bc18">pFlow::fileSystem::validFileName</a></div><divclass="ttdeci">static bool validFileName(const word &name)</div><divclass="ttdoc">Is name is valid for a file?</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8hpp_source.html#l00090">fileSystem.hpp:90</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_abeb262ada284c78abee69fd64c1700f6"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#abeb262ada284c78abee69fd64c1700f6">pFlow::fileSystem::checkFileName</a></div><divclass="ttdeci">static bool checkFileName(const word &name)</div><divclass="ttdoc">Is a valid file name?</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00027">fileSystem.cpp:27</a></div></div>
<divclass="ttc"id="anamespacepFlow_html_a869d7b21ba981c374dcf8542f4ce2144"><divclass="ttname"><ahref="namespacepFlow.html#a869d7b21ba981c374dcf8542f4ce2144">pFlow::CWD</a></div><divclass="ttdeci">fileSystem CWD()</div><divclass="ttdoc">Free function to reture current working directory.</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8hpp_source.html#l00221">fileSystem.hpp:221</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_a1757a6d2024caf9854f3bce10f713c5c"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#a1757a6d2024caf9854f3bce10f713c5c">pFlow::fileSystem::relative</a></div><divclass="ttdeci">fileSystem relative(const fileSystem &base) const</div><divclass="ttdoc">relative path of this this with respect to base</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00170">fileSystem.cpp:170</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_ad7cad1b82e1afeea66c2f0649de5d93f"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#ad7cad1b82e1afeea66c2f0649de5d93f">pFlow::fileSystem::wordPath</a></div><divclass="ttdeci">word wordPath() const</div><divclass="ttdoc">Path in word type.</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8hpp_source.html#l00160">fileSystem.hpp:160</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1fileSystem_html_a7f33187e671f9c2fc6f189bf7005e067"><divclass="ttname"><ahref="classpFlow_1_1fileSystem.html#a7f33187e671f9c2fc6f189bf7005e067">pFlow::fileSystem::createDirs</a></div><divclass="ttdeci">fileSystem createDirs() const</div><divclass="ttdoc">Operate on dir path only Create dir based on the path and returns the canonical path.</div><divclass="ttdef"><b>Definition:</b><ahref="fileSystem_8cpp_source.html#l00208">fileSystem.cpp:208</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1iOstream_html"><divclass="ttname"><ahref="classpFlow_1_1iOstream.html">pFlow::iOstream</a></div><divclass="ttdoc">Interface class for any output stream.</div><divclass="ttdef"><b>Definition:</b><ahref="iOstream_8hpp_source.html#l00059">iOstream.hpp:59</a></div></div>