161 |
return result; |
return result; |
162 |
} |
} |
163 |
|
|
164 |
|
Path Path::fromDbPath(std::string path) { |
165 |
|
Path result; |
166 |
|
// first split the nodes |
167 |
|
{ |
168 |
|
int nodeEnd; |
169 |
|
for ( |
170 |
|
int nodeBegin = path.find_first_not_of('/'); |
171 |
|
nodeBegin != std::string::npos; |
172 |
|
nodeBegin = path.find_first_not_of('/', nodeEnd) |
173 |
|
) { |
174 |
|
nodeEnd = path.find_first_of('/', nodeBegin); |
175 |
|
|
176 |
|
std::string s = (nodeEnd != std::string::npos) ? |
177 |
|
path.substr(nodeBegin, nodeEnd - nodeBegin) : |
178 |
|
path.substr(nodeBegin); |
179 |
|
|
180 |
|
for (int i = 0; i < s.length(); i++) if (s.at(i) == '\0') s.at(i) = '/'; |
181 |
|
result.appendNode(s); |
182 |
|
} |
183 |
|
} |
184 |
|
return result; |
185 |
|
} |
186 |
|
|
187 |
} // namespace LinuxSampler |
} // namespace LinuxSampler |