--------------------------------------------------------------------------------------- */
| 454 | } |
| 455 | /* --------------------------------------------------------------------------------------- */ |
| 456 | Errata |
| 457 | Cache::loadSpan(swoc::file::path const &path) |
| 458 | { |
| 459 | Errata zret; |
| 460 | std::error_code ec; |
| 461 | auto fs = swoc::file::status(path, ec); |
| 462 | |
| 463 | if (path.empty()) { |
| 464 | zret = Errata(make_errno_code(EINVAL), "A span file specified by --spans is required"); |
| 465 | } else if (!swoc::file::is_readable(path)) { |
| 466 | zret = Errata(make_errno_code(EPERM), R"("{}" is not readable.)", path); |
| 467 | } else if (swoc::file::is_regular_file(fs)) { |
| 468 | zret = this->loadSpanConfig(path); |
| 469 | } else { |
| 470 | zret = this->loadSpanDirect(path); |
| 471 | } |
| 472 | return zret; |
| 473 | } |
| 474 | |
| 475 | Errata |
| 476 | Cache::loadSpanDirect(swoc::file::path const &path, int vol_idx, [[maybe_unused]] const Bytes &size) |
no test coverage detected