82 |
|
|
83 |
std::string Path::toLscp() const { |
std::string Path::toLscp() const { |
84 |
std::string result; |
std::string result; |
85 |
|
#if WIN32 |
86 |
|
if(drive) { |
87 |
|
result.assign(&drive,1); |
88 |
|
result += ":"; |
89 |
|
} |
90 |
|
#endif |
91 |
for (int iElement = 0; iElement < elements.size(); iElement++) { |
for (int iElement = 0; iElement < elements.size(); iElement++) { |
92 |
// replace "special characters" by LSCP escape sequences |
// replace "special characters" by LSCP escape sequences |
93 |
std::string e = elements[iElement]; |
std::string e = elements[iElement]; |
121 |
|
|
122 |
std::string Path::toWindows() const { |
std::string Path::toWindows() const { |
123 |
std::stringstream result; |
std::stringstream result; |
124 |
result << |
const char cDrive = |
125 |
((drive >= 'A' && drive <= 'Z') || (drive >= 'a' && drive <= 'z')) |
((drive >= 'A' && drive <= 'Z') || (drive >= 'a' && drive <= 'z')) |
126 |
? drive : '?'; |
? drive : '?'; |
127 |
|
result << cDrive; |
128 |
result << ':'; |
result << ':'; |
129 |
for (int iElement = 0; iElement < elements.size(); iElement++) { |
for (int iElement = 0; iElement < elements.size(); iElement++) { |
130 |
// append encoded node to full encoded path |
// append encoded node to full encoded path |
213 |
return result; |
return result; |
214 |
} |
} |
215 |
|
|
216 |
Path Path::fromWindowsPath(std::string path) { |
Path Path::fromWindows(std::string path) { |
217 |
Path result; |
Path result; |
218 |
|
|
219 |
int nodeEnd = 0; |
int nodeEnd = 0; |