| 190 | static std::atomic<uint64_t> g_tempFileCounter{0}; |
| 191 | |
| 192 | static std::string WriteTempFile(const std::string& data, const std::string& extension) |
| 193 | { |
| 194 | auto tmpDir = std::filesystem::temp_directory_path(); |
| 195 | uint64_t id = g_tempFileCounter.fetch_add(1); |
| 196 | auto tmpPath = tmpDir / ("poseidon-scan-" + std::to_string(id) + extension); |
| 197 | std::ofstream out(tmpPath, std::ios::binary); |
| 198 | if (!out) |
| 199 | return {}; |
| 200 | out.write(data.data(), static_cast<std::streamsize>(data.size())); |
| 201 | out.close(); |
| 202 | return tmpPath.string(); |
| 203 | } |
| 204 | |
| 205 | static ScanResult AnalyzeItem(const ScanItem& item) |
| 206 | { |
no test coverage detected