diff --git a/code/nel/tools/pipeline/service/metadata_storage.cpp b/code/nel/tools/pipeline/service/metadata_storage.cpp index 3a5595bde..30b499937 100644 --- a/code/nel/tools/pipeline/service/metadata_storage.cpp +++ b/code/nel/tools/pipeline/service/metadata_storage.cpp @@ -153,9 +153,24 @@ std::string CMetadataStorage::getResultPath(const std::string &projectName, cons void CMetadataStorage::readProcessResult(CProcessResult &result, const std::string &path) { - // TODO - result.clear(); - // TODO + if (!NLMISC::CFile::fileExists(path)) + { + nlwarning("Process running for the first time, this may take a long time"); + result.clear(); + return; + } + + NLMISC::CIFile is(path, false); + result.serial(is); + is.close(); +} + +void CMetadataStorage::writeProcessResult(const CProcessResult &result, const std::string &path) +{ + NLMISC::COFile os(path, false, false, true); + const_cast(result).serial(os); + os.flush(); + os.close(); } /////////////////////////////////////////////////////////////////////// diff --git a/code/nel/tools/pipeline/service/metadata_storage.h b/code/nel/tools/pipeline/service/metadata_storage.h index 9729a19b1..0c63abb52 100644 --- a/code/nel/tools/pipeline/service/metadata_storage.h +++ b/code/nel/tools/pipeline/service/metadata_storage.h @@ -155,6 +155,7 @@ public: // Pathname for result metadata is like .../project.projectname.meta/pluginname.result static std::string getResultPath(const std::string &projectName, const std::string &pluginName); static void readProcessResult(CProcessResult &result, const std::string &path); + static void writeProcessResult(const CProcessResult &result, const std::string &path); }; /* class CMetadataStorage */