Solution to issue #6

This commit is contained in:
amazing-username
2017-08-12 17:02:43 -05:00
parent c1d17799cd
commit 353a1dfef1
10 changed files with 186 additions and 48 deletions
+10 -2
View File
@@ -6,6 +6,7 @@
FileNameRetrieval::FileNameRetrieval() { }
std::vector<std::string> FileNameRetrieval::fileNameContainer() const { return fileNames; }
std::vector<std::string> FileNameRetrieval::passwordNameContainer() const { return passwordNames; }
void FileNameRetrieval::retrieveFileNames()
{
boost::filesystem::path directory(FolderStructure::keyDirectory);
@@ -14,6 +15,13 @@ void FileNameRetrieval::retrieveFileNames()
for (; beg!=end; ++beg)
if (beg->path().extension()==".txt")
fileNames.push_back(beg->path().filename().string());
for (auto fl: fileNames)
std::cout<< fl<<std::endl;
}
void FileNameRetrieval::retrievePasswordNames()
{
boost::filesystem::path directory(FolderStructure::passwordDirectory);
boost::filesystem::directory_iterator beg(directory), end;
for (; beg!=end; ++beg)
if (beg->path().extension()==".txt")
passwordNames.push_back(beg->path().filename().string());
}