Skip to main content

Common Fluids Format 2023 R2

URL

Last update: 16.07.2025
1#ifndef CFFSDK_PROJECT_URL_H
2#define CFFSDK_PROJECT_URL_H
3
4#include "Project/LibraryType.hpp"
5#include <string>
6#include <vector>
7namespace ansys {
8namespace Project {
9
10typedef std::string URLType;
11
12class ANSYS_PROJECT_DLL URL {
13public:
14 URL();
15 URL(const std::string& pStr);
16 URL(const std::string& pType,const std::string& pStr);
17 URL(const char* pStr);
18 ~URL();
19
20 std::string getFilename() const;
21 std::string getItemName() const;
22 std::string getFilenameRoot() const;
23 std::string getFilenamePath() const;
24 std::string getURLString() const;
25 std::vector<std::string> getURLComponents() const;
26 URL getURLSubset(int pComponentStart,int pEnd = -1) const;
27
28 bool isValid() const;
29 bool isNull() const;
30 bool isLocalPath() const;
31 bool isRelativePath() const;
32 bool isGlobalPath() const;
33 bool isInside(const URL& pURL) const;
34
35 URLType getType() const;
36 const std::string& str() const;
37 const char* c_str() const { return str().c_str(); };
38
39 void toGlobal(const URL& pRootPath);
40 void toRelative(const URL& pRefDir);
41 void simplifyURL();
42
43 bool operator!=(const URL& pURL) const;
44 bool operator==(const URL& pURL) const;
45 bool operator==(const std::string& pURLString) const;
46
47 URL operator+(const URL& p2) const;
48 URL& operator+=(const URL& p2);
49
50 bool normalizeToFolder();
51private:
52 void computeType();
53 void normalizeURL();
54 bool isWindowsShare() const;
55
56 std::string aURL;
57 URLType aType;
58};
59
60}
61}
62
63#endif // CFFSDK_PROJECT_URL_H
The address of a local or remote file, using the URI format.
Definition: URL.hpp:12
Definition: API.dox:1

Connect with Ansys