17 std::list<std::string>::const_iterator iter = list.begin();
18 while(iter != list.end()) {
42 std::list<std::string> flist =
GetList(option);
43 return std::vector<std::string> (flist.begin(),flist.end());
48 std::list<std::string>::const_iterator filesListIter;
49 std::ofstream
of(fileListPath.c_str());
51 of<<
"START"<<std::endl;
52 for(filesListIter =
fFileList.begin(); filesListIter !=
fFileList.end(); filesListIter++)
53 of<<(*filesListIter)<<std::endl;
59 void QFileList::Write(
const std::string& fileListFile,
const std::list<std::string>& fileList,
const std::string& filesPath)
62 qFileList.
Add(fileList);
64 qFileList.
Write(fileListFile);
69 std::ifstream inputFileList (fileListPath.c_str());
70 if (inputFileList.is_open()) {
71 bool startFound =
false;
74 while (! inputFileList.eof() ) {
75 getline(inputFileList,line);
77 if(line ==
"")
continue;
78 else if(line.at(0) ==
'#')
continue;
79 else if(line ==
"END")
break;
80 else if(line ==
"START") startFound =
true;
81 else if(line.substr(0,8) ==
"DATAPATH") {
82 int valStart = line.find_first_not_of(
' ', 8);
83 int valEnd = line.find_first_of(
' ', valStart);
84 if(valStart - valEnd > 0)
85 dataPath = line.substr(valStart,valEnd - valStart);
91 && line.rfind(
".list") != std::string::npos
92 && line.rfind(
".list") == line.size() - 5) {
96 this->
Read(dataPath +
"/" + line);
99 fFileList.push_back(dataPath +
"/" + line);
106 inputFileList.close();
110 std::list<std::string>
QFileList::Read(
const std::string& fileListFile,
const std::string& option)
113 qFileList.
Read(fileListFile);
114 return qFileList.
GetList(option);
QOptimumFilter of(ap, an,-1, false)
void Write(const std::string &fileListPath) const
std::vector< std::string > GetListVec(const std::string &option="")
void Read(const std::string &fileListPath)
void SetFilesPath(const std::string &path)
void Add(const std::string &file)
std::list< std::string > fFileList
std::list< std::string > GetList(const std::string &option="")