void ADLSearchManager::matchRecurse(DestDirList &aDestList, DirectoryListing::Directory* aDir, string &aPath) { for(DirectoryListing::Directory::Iter dirIt = aDir->directories.begin(); dirIt != aDir->directories.end(); ++dirIt) { string tmpPath = aPath + "\\" + (*dirIt)->getName(); MatchesDirectory(aDestList, *dirIt, tmpPath); matchRecurse(aDestList, *dirIt, tmpPath); } for(DirectoryListing::File::Iter fileIt = aDir->files.begin(); fileIt != aDir->files.end(); ++fileIt) { MatchesFile(aDestList, *fileIt, aPath); } StepUpDirectory(aDestList); }
void ADLSearchManager::matchRecurse(DestDirList &aDestList, DirectoryListing::Directory* aDir, string &aPath) { for(auto& dirIt: aDir->directories) { string tmpPath = aPath + "\\" + dirIt->getName(); matchesDirectory(aDestList, dirIt, tmpPath); matchRecurse(aDestList, dirIt, tmpPath); } for(auto& fileIt: aDir->files) { matchesFile(aDestList, fileIt, aPath); } stepUpDirectory(aDestList); }
void ADLSearchManager::matchRecurse(DestDirList &aDestList, DirectoryListing::Directory* aDir, const string &aPath) { for (auto dirIt = aDir->directories.cbegin(); dirIt != aDir->directories.cend(); ++dirIt) { string tmpPath = aPath + "\\" + (*dirIt)->getName(); matchesDirectory(aDestList, *dirIt, tmpPath); matchRecurse(aDestList, *dirIt, tmpPath); } for (auto fileIt = aDir->m_files.cbegin(); fileIt != aDir->m_files.cend(); ++fileIt) { matchesFile(aDestList, *fileIt, aPath); } stepUpDirectory(aDestList); }
void ADLSearchManager::matchListing(DirectoryListing& aDirList) throw() { StringMap params; params["userNI"] = ClientManager::getInstance()->getNicks(aDirList.getUser()->getCID())[0]; params["userCID"] = aDirList.getUser()->getCID().toBase32(); setUser(aDirList.getUser()); DestDirList destDirs; PrepareDestinationDirectories(destDirs, aDirList.getRoot(), params); setBreakOnFirst(BOOLSETTING(ADLS_BREAK_ON_FIRST)); string path(aDirList.getRoot()->getName()); matchRecurse(destDirs, aDirList.getRoot(), path); FinalizeDestinationDirectories(destDirs, aDirList.getRoot()); }
void ADLSearchManager::matchListing(DirectoryListing& aDirList) { StringMap params; params["userNI"] = ClientManager::getInstance()->getNicks(aDirList.getUser())[0]; params["userCID"] = aDirList.getUser().user->getCID().toBase32(); if (BOOLSETTING(USE_ADL_ONLY_OWN_LIST) && params["userCID"] != ClientManager::getInstance()->getMe()->getCID().toBase32()) return; setUser(aDirList.getUser()); const auto root = aDirList.getRoot(); DestDirList destDirs; prepareDestinationDirectories(destDirs, root, params); setBreakOnFirst(BOOLSETTING(ADLS_BREAK_ON_FIRST)); string path(root->getName()); matchRecurse(destDirs, root, path); finalizeDestinationDirectories(destDirs, root); }
void ADLSearchManager::matchListing(DirectoryListing& aDirList) noexcept { if (collection.empty()) return; StringMap params; if (aDirList.getUser()) { params["userNI"] = ClientManager::getNicks(aDirList.getUser()->getCID(), Util::emptyString)[0]; params["userCID"] = aDirList.getUser()->getCID().toBase32(); } setUser(aDirList.getUser()); setSentRaw(false); DestDirList destDirs; prepareDestinationDirectories(destDirs, aDirList.getRoot(), params); setBreakOnFirst(BOOLSETTING(ADLS_BREAK_ON_FIRST)); const string path(aDirList.getRoot()->getName()); matchRecurse(destDirs, aDirList.getRoot(), path); finalizeDestinationDirectories(destDirs, aDirList.getRoot()); }