44 |
*/ |
*/ |
45 |
class Path { |
class Path { |
46 |
public: |
public: |
47 |
|
Path(); |
48 |
|
|
49 |
/** |
/** |
50 |
* Concatenate exactly one path node or filename to the end of this Path |
* Concatenate exactly one path node or filename to the end of this Path |
51 |
* object. This can be used to build up a full qualified path, directory |
* object. This can be used to build up a full qualified path, directory |
57 |
void appendNode(std::string Name); |
void appendNode(std::string Name); |
58 |
|
|
59 |
/** |
/** |
60 |
|
* Sets the hardware drive of the path, for systems that use the concept |
61 |
|
* of drives in absolute pathes (i.e. Windows). |
62 |
|
*/ |
63 |
|
void setDrive(const char& Drive); |
64 |
|
|
65 |
|
/** |
66 |
* Convert this Path into the correct encoding as expected by POSIX |
* Convert this Path into the correct encoding as expected by POSIX |
67 |
* compliant system calls. |
* compliant system calls. |
68 |
*/ |
*/ |
69 |
std::string toPosix(); |
std::string toPosix() const; |
70 |
|
|
71 |
/** |
/** |
72 |
* Convert this Path into the correct encoding as expected |
* Convert this Path into the correct encoding as expected |
73 |
* by the instruments database implementation. |
* by the instruments database implementation. |
74 |
*/ |
*/ |
75 |
std::string toDbPath(); |
std::string toDbPath() const; |
76 |
|
|
77 |
/** |
/** |
78 |
* Convert this Path into the correct encoding as expected and needed |
* Convert this Path into the correct encoding as expected and needed |
79 |
* for LSCP responses. |
* for LSCP responses. |
80 |
*/ |
*/ |
81 |
std::string toLscp(); |
std::string toLscp() const; |
82 |
|
|
83 |
|
/** |
84 |
|
* Convert this Path into the correct encoding as expected by Windows |
85 |
|
* operating systems. |
86 |
|
*/ |
87 |
|
std::string toWindows() const; |
88 |
|
|
89 |
/** |
/** |
90 |
* Concatenate two paths. |
* Concatenate two paths. |
106 |
*/ |
*/ |
107 |
static Path fromDbPath(std::string path); |
static Path fromDbPath(std::string path); |
108 |
|
|
109 |
|
/** |
110 |
|
* Create a Path object from a Windows path / filename string. |
111 |
|
*/ |
112 |
|
static Path fromWindowsPath(std::string path); |
113 |
|
|
114 |
private: |
private: |
115 |
std::vector<std::string> elements; ///< stores the path names raw = unencoded, each element is one node of the path |
std::vector<std::string> elements; ///< stores the path names raw = unencoded, each element is one node of the path |
116 |
|
char drive; |
117 |
}; |
}; |
118 |
|
|
119 |
} // namespace LinuxSampler |
} // namespace LinuxSampler |