MCPcopy Create free account
hub / github.com/ZDoom/gzdoom / D_AddWildFile

Function D_AddWildFile

src/common/utility/findfile.cpp:130–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128//==========================================================================
129
130void 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//

Callers 2

GetCmdLineFilesFunction · 0.85
D_AddConfigFilesFunction · 0.85

Calls 8

BaseFileSearchFunction · 0.85
D_AddFileFunction · 0.85
ExtractFilePathFunction · 0.85
ExtractFileBaseFunction · 0.85
ScanDirectoryFunction · 0.85
c_strMethod · 0.80
IsEmptyMethod · 0.45
GetCharsMethod · 0.45

Tested by

no test coverage detected