MCPcopy Create free account
hub / github.com/OpenBoardView/OpenBoardView / writeToConfig

Method writeToConfig

src/openboardview/PDFBridge/PDFFile.cpp:54–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void PDFFile::writeToConfig(const filesystem::path &filepath) {
55 if (filepath.empty()) // No destination file to save to
56 return;
57
58 std::error_code ec;
59 auto confparse = Confparse{};
60 confparse.Load(filepath);
61
62 auto configDir = filesystem::weakly_canonical(filepath).parent_path();
63
64 if (!path.empty()) {
65 auto pdfFilePath = filesystem::relative(path, configDir, ec);
66 if (ec) {
67 SDL_LogError(SDL_LOG_CATEGORY_ERROR, "Error writing PDF file path: %d - %s", ec.value(), ec.message().c_str());
68 } else {
69 confparse.WriteStr("PDFFilePath", pdfFilePath.string().c_str());
70 }
71 }
72}
73
74filesystem::path PDFFile::getPath() const {
75 return this->path;

Callers

nothing calls this directly

Calls 2

WriteStrMethod · 0.80
LoadMethod · 0.45

Tested by

no test coverage detected