diff --git a/src/graph_manager.cpp b/src/graph_manager.cpp index f99d4ed..af79551 100644 --- a/src/graph_manager.cpp +++ b/src/graph_manager.cpp @@ -1,6 +1,5 @@ #include "graph_manager.h" -#include #include #include #include @@ -12,11 +11,6 @@ #include #include -#if __has_include() -#include -namespace fs = std::filesystem; -#endif - #include "utils/config_expand.h" #include "utils/config_schema.h" #include "utils/logger.h" @@ -74,41 +68,6 @@ std::string AffinityKey(std::vector cpus) { return oss.str(); } -bool WriteTextFile(const std::string& path, const std::string& content, std::string& err) { - std::ofstream ofs(path, std::ios::binary | std::ios::trunc); - if (!ofs.is_open()) { - err = "Failed to open file for write: " + path; - return false; - } - ofs.write(content.data(), static_cast(content.size())); - if (!ofs.good()) { - err = "Failed to write file: " + path; - return false; - } - return true; -} - -bool WriteTextFileAtomic(const std::string& path, const std::string& content, std::string& err) { - err.clear(); -#if __has_include() - const std::string tmp = path + ".tmp"; - if (!WriteTextFile(tmp, content, err)) return false; - std::error_code ec; - fs::remove(path, ec); // best-effort (Windows rename requires target missing) - ec.clear(); - fs::rename(tmp, path, ec); - if (ec) { - err = "rename failed: " + ec.message(); - std::error_code ec2; - fs::remove(tmp, ec2); - return false; - } - return true; -#else - return WriteTextFile(path, content, err); -#endif -} - QueueDropStrategy ParseDropStrategy(const std::string& s, QueueDropStrategy def) { if (s == "drop_oldest") return QueueDropStrategy::DropOldest; if (s == "drop_newest") return QueueDropStrategy::DropNewest;