| 2696 | } |
| 2697 | |
| 2698 | bool ApiWrap::writePreloadedFile( |
| 2699 | Data::File &file, |
| 2700 | const Data::FileOrigin &origin) { |
| 2701 | Expects(_settings != nullptr); |
| 2702 | |
| 2703 | using namespace Output; |
| 2704 | |
| 2705 | if (const auto path = _fileCache->find(file.location)) { |
| 2706 | file.relativePath = *path; |
| 2707 | return true; |
| 2708 | } else if (!file.content.isEmpty()) { |
| 2709 | const auto process = prepareFileProcess(file, origin); |
| 2710 | if (const auto result = process->file.writeBlock(file.content)) { |
| 2711 | file.relativePath = process->relativePath; |
| 2712 | _fileCache->save(file.location, file.relativePath); |
| 2713 | } else { |
| 2714 | ioError(result); |
| 2715 | } |
| 2716 | return true; |
| 2717 | } |
| 2718 | return false; |
| 2719 | } |
| 2720 | |
| 2721 | void ApiWrap::loadFile( |
| 2722 | const Data::File &file, |
nothing calls this directly
no test coverage detected