| 64 | |
| 65 | struct StaticHitConfig { |
| 66 | explicit StaticHitConfig(const std::string &fileOrDir, const std::string &mimeType, bool exact) : mimeType(mimeType) |
| 67 | { |
| 68 | std::filesystem::path base_path{fileOrDir}; |
| 69 | |
| 70 | if (!base_path.is_absolute()) { |
| 71 | base_path = std::filesystem::path(TSConfigDirGet()) / base_path; |
| 72 | } |
| 73 | base_path = std::filesystem::weakly_canonical(base_path); |
| 74 | |
| 75 | if (std::filesystem::is_directory(base_path)) { |
| 76 | dirPath = std::move(base_path); |
| 77 | filePath = ""; |
| 78 | disableExact = true; |
| 79 | } else { |
| 80 | dirPath = ""; |
| 81 | filePath = std::move(base_path); |
| 82 | disableExact = exact; |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | ~StaticHitConfig() { TSContDestroy(cont); } |
| 87 |
nothing calls this directly
no test coverage detected