Skip to content
Snippets Groups Projects
Commit e75974d4 authored by Norihiro Watanabe's avatar Norihiro Watanabe
Browse files

take initializer_list in FileFinder constructor

parent b0d057e4
No related branches found
No related tags found
No related merge requests found
......@@ -27,10 +27,11 @@ FileFinder::FileFinder()
addDirectory(".");
}
FileFinder::FileFinder(std::string const& dir)
FileFinder::FileFinder(std::initializer_list<std::string> dirs)
{
addDirectory(".");
addDirectory(dir);
for (auto const& dir : dirs)
addDirectory(dir);
}
void FileFinder::addDirectory(std::string const& dir)
......
......@@ -15,6 +15,7 @@
#ifndef FILEFINDER_H
#define FILEFINDER_H
#include <initializer_list>
#include <string>
#include <vector>
......@@ -29,15 +30,15 @@ namespace BaseLib
class FileFinder
{
public:
/// Constructor having current directory as the search-space
/// Constructor having current directory (.) as the search-space
FileFinder();
/**
* Construct with the given directory paths in addition to current directory
* Construct with the given directory paths in addition to current directory (.)
*
* @param dirs a vector of directory paths to the search-space
* @param dirs an initializer list of additional directory paths to the search-space
*/
explicit FileFinder(std::string const& dir);
FileFinder(std::initializer_list<std::string> dirs);
/**
* \brief Adds another directory to the search-space.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment