TimerPool fixoutManipulator
git-svn-id: svn://db.shs.com.ru/pip@78 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -282,7 +282,29 @@ PIVector<PIFile::FileInfo> PIDir::entries() {
|
||||
|
||||
|
||||
PIVector<PIFile::FileInfo> PIDir::allEntries() {
|
||||
return allEntries(absolutePath());
|
||||
PIVector<PIFile::FileInfo> ret;
|
||||
PIVector<PIFile::FileInfo> dirs;
|
||||
PIStringList cdirs, ndirs;
|
||||
cdirs << path();
|
||||
while (!cdirs.isEmpty()) {
|
||||
piForeachC (PIString & d, cdirs) {
|
||||
scan_ = d;
|
||||
PIVector<PIFile::FileInfo> el = PIDir(d).entries();
|
||||
piForeachC (PIFile::FileInfo & de, el) {
|
||||
if (de.name() == "." || de.name() == "..") continue;
|
||||
if (de.isSymbolicLink()) continue; /// TODO: resolve symlinks
|
||||
if (de.isDir()) {
|
||||
dirs.push_front(de);
|
||||
ndirs << de.path;
|
||||
} else ret << de;
|
||||
}
|
||||
}
|
||||
cdirs = ndirs;
|
||||
ndirs.clear();
|
||||
}
|
||||
ret.insert(0, dirs);
|
||||
scan_.clear();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -363,26 +385,7 @@ PIDir PIDir::temporary() {
|
||||
|
||||
|
||||
PIVector<PIFile::FileInfo> PIDir::allEntries(const PIString &path) {
|
||||
PIVector<PIFile::FileInfo> ret;
|
||||
PIVector<PIFile::FileInfo> dirs;
|
||||
PIDir root;
|
||||
root.setDir(path);
|
||||
PIVector<PIFile::FileInfo> cds = root.entries();
|
||||
piForeachC (PIFile::FileInfo & de, cds) {
|
||||
//piCout << " open" << de.name();
|
||||
if (de.name() == "." || de.name() == "..") continue;
|
||||
if (de.isSymbolicLink()) continue; /// TODO: resolve symlinks
|
||||
if (de.isDir()) {
|
||||
dirs.push_front(de);
|
||||
PIVector<PIFile::FileInfo> td = PIDir(de.path).allEntries();
|
||||
for (int i = 0; i < td.size_s(); i++) {
|
||||
if (td[i].isDir()) dirs.push_front(td[i]);
|
||||
else ret << td[i];
|
||||
}
|
||||
} else ret << de;
|
||||
}
|
||||
ret.insert(0, dirs);
|
||||
return ret;
|
||||
return PIDir(path).allEntries();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user