| 128 | //========================================================================== |
| 129 | |
| 130 | void D_AddWildFile(std::vector<std::string>& wadfiles, const char* value, const char *extension, FConfigFile* config) |
| 131 | { |
| 132 | if (value == nullptr || *value == '\0') |
| 133 | { |
| 134 | return; |
| 135 | } |
| 136 | const char* wadfile = BaseFileSearch(value, extension, false, config); |
| 137 | |
| 138 | if (wadfile != nullptr) |
| 139 | { |
| 140 | D_AddFile(wadfiles, wadfile, true, -1, config); |
| 141 | } |
| 142 | else |
| 143 | { |
| 144 | // Try pattern matching |
| 145 | FileSys::FileList list; |
| 146 | auto path = ExtractFilePath(value); |
| 147 | auto name = ExtractFileBase(value, true); |
| 148 | if (path.IsEmpty()) path = "."; |
| 149 | if (FileSys::ScanDirectory(list, path.GetChars(), name.GetChars(), true)) |
| 150 | { |
| 151 | for(auto& entry : list) |
| 152 | { |
| 153 | D_AddFile(wadfiles, entry.FilePath.c_str(), true, -1, config); |
| 154 | } |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | //========================================================================== |
| 160 | // |
no test coverage detected