MCPcopy Create free account
hub / github.com/beefytech/Beef / QueuePath

Method QueuePath

BeefFuzz/FuzzApp.cpp:138–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138bool FuzzApp::QueuePath(const StringImpl& path)
139{
140 if (DirectoryExists(path))
141 {
142 for (auto& fileEntry : FileEnumerator(path, FileEnumerator::Flags_Files))
143 {
144 String filePath = fileEntry.GetFilePath();
145
146 String fileName;
147 fileName = GetFileName(filePath);
148
149 String ext;
150 ext = GetFileExtension(filePath);
151
152 if ((ext.Equals(".bf", StringImpl::CompareKind_OrdinalIgnoreCase)) ||
153 (ext.Equals(".cs", StringImpl::CompareKind_OrdinalIgnoreCase)))
154 {
155 int len;
156 const char* data = LoadTextData(filePath, &len);
157 if (data != NULL)
158 {
159 bool success = QueueFile(data, len);
160 delete[] data;
161
162 if (!success)
163 return false;
164 }
165 }
166 }
167
168 for (auto& fileEntry : FileEnumerator(path, FileEnumerator::Flags_Directories))
169 {
170 String childPath = fileEntry.GetFilePath();
171 String dirName;
172 dirName = GetFileName(childPath);
173
174 if (dirName == "build")
175 continue;
176
177 if (!QueuePath(childPath))
178 return false;
179 }
180
181 return true;
182 }
183
184 return false;
185}
186
187bool FuzzApp::CopyFile(const StringImpl& srcPath, const StringImpl& destPath)
188{

Callers

nothing calls this directly

Calls 3

FileEnumeratorClass · 0.85
GetFilePathMethod · 0.45
EqualsMethod · 0.45

Tested by

no test coverage detected