Tab completion functional.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@357 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-03-17 01:07:54 +00:00
parent 8090d4db26
commit cefa2b584d
13 changed files with 275 additions and 17 deletions
+5 -3
View File
@@ -31,7 +31,7 @@
namespace utils {
void
bool
Directory::update() {
if (m_path.empty())
throw std::logic_error("Directory::update() tried to open an empty path");
@@ -39,19 +39,21 @@ Directory::update() {
DIR* d = opendir(m_path.c_str());
if (d == NULL)
throw std::runtime_error("Directory::update() could not open directory");
return false;
struct dirent* ent;
while ((ent = readdir(d)) != NULL) {
std::string de(ent->d_name);
if (de != "." && de != "..")
if (!de.empty() && de[0] != '.')
Base::push_back(ent->d_name);
}
closedir(d);
Base::sort(std::less<std::string>());
return true;
}
Directory::Base