Skip to main content

Common Fluids Format 2023 R2

Path

Last update: 16.07.2025
1#ifndef CFFSDK_PROJECT_PATH_H
2#define CFFSDK_PROJECT_PATH_H
3
4#include "Project/LibraryType.hpp"
5#include <vector>
6#include <string>
7
8namespace ansys {
9namespace Project {
10
11class ANSYS_PROJECT_DLL Path {
12public:
13 Path();
14 Path(const std::string& pPath);
15 Path(const char* pPath);
16
17 bool isNull() const;
18 std::vector<std::string> getPathComponents() const;
19 bool isFolderPath() const;
20 Path getParentPath() const;
21 std::string getFilename() const;
22 std::string getFolderName() const;
23 Path getRelativePathTo(const Path& pTarget) const;
24
25 const std::string& str() const;
26 const char* c_str() const { return str().c_str(); };
27 bool operator==(const Path& pPath) const;
28 bool operator==(const std::string& pPathStr) const;
29 bool operator==(const char* pPathStr) const {
30 return *this == std::string(pPathStr);
31 }
32 bool operator!=(const Path& pPath) const {
33 return !(*this == pPath);
34 }
35 bool operator!=(const std::string& pPathStr) const {
36 return !(*this == pPathStr);
37 }
38 void operator+=(const std::string& pPathStr);
39
40 static bool isValidFilename(const std::string& pStr);
41 static bool isValidPath(const std::string& pStr);
42
43 static std::string formatPath(const std::string& pPath,
44 bool pFilenameOnly=false);
45
46private:
47 std::string aPath;
48
49};
50
51}
52}
53
54#endif // CFFSDK_PROJECT_PATH_H
Paths used for internal Project filesystem.
Definition: Path.hpp:11
Definition: API.dox:1

Connect with Ansys