some PIFile functionality
PIBinaryLog::close fix
This commit is contained in:
@@ -160,6 +160,16 @@ PIDir & PIDir::cleanPath() {
|
||||
PIString PIDir::relative(const PIString & path) const {
|
||||
PIDir td(path);
|
||||
PIStringList dl(absolutePath().split(separator)), pl(td.absolutePath().split(separator)), rl;
|
||||
auto checkPath = [](PIStringList & path) {
|
||||
if (path.isEmpty()) return;
|
||||
if (path[0].size() >= 2) {
|
||||
if (path[0][0].isAlpha() && path[0][1] == ':') {
|
||||
path[0][0] = path[0][0].toUpper();
|
||||
}
|
||||
}
|
||||
};
|
||||
checkPath(dl);
|
||||
checkPath(pl);
|
||||
// piCout << pl << "rel to" << dl;
|
||||
while (!dl.isEmpty() && !pl.isEmpty()) {
|
||||
if (dl.front() != pl.front()) break;
|
||||
|
||||
Reference in New Issue
Block a user