| 138 | } |
| 139 | |
| 140 | std::vector<FileData*> FolderData::getFiles(bool onlyFiles) const |
| 141 | { |
| 142 | std::vector<FileData*> temp; |
| 143 | //now check if a child is a folder and get those children in turn |
| 144 | std::vector<FileData*>::const_iterator fdit = mFileVector.cbegin(); |
| 145 | while(fdit != mFileVector.cend()) { |
| 146 | //dynamically try to cast to FolderData type |
| 147 | FolderData * folder = dynamic_cast<FolderData*>(*fdit); |
| 148 | if (folder != nullptr) { |
| 149 | //add this only when user wanted it |
| 150 | if (!onlyFiles) { |
| 151 | temp.push_back(*fdit); |
| 152 | } |
| 153 | } |
| 154 | else { |
| 155 | temp.push_back(*fdit); |
| 156 | } |
| 157 | ++fdit; |
| 158 | } |
| 159 | return temp; |
| 160 | } |
| 161 | |
| 162 | std::vector<FileData*> FolderData::getFilesRecursive(bool onlyFiles) const |
| 163 | { |