X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FLauncher%2FLauncher_XML_Persistence.hxx;h=57e464cd65ee4b05d5e30ae92517c48a482707f9;hb=463b7bde63a727ea30995123dc820d5a4e421924;hp=772b1e9d34db53d78c7cc2eb613ffaa4e1322a78;hpb=53dbc52658003957cb4483086acac6af3906088a;p=modules%2Fkernel.git diff --git a/src/Launcher/Launcher_XML_Persistence.hxx b/src/Launcher/Launcher_XML_Persistence.hxx index 772b1e9d3..57e464cd6 100644 --- a/src/Launcher/Launcher_XML_Persistence.hxx +++ b/src/Launcher/Launcher_XML_Persistence.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -30,6 +30,10 @@ namespace Launcher { + typedef struct _xmlNode xmlNode; + typedef xmlNode *xmlNodePtr; + typedef unsigned char xmlChar; + class LAUNCHER_EXPORT XML_Persistence { public: @@ -48,6 +52,26 @@ namespace Launcher // This class is static only, not instanciable XML_Persistence() {} + static void addJobToXmlDocument(xmlNodePtr root_node, const Job & job); + static Job * createJobFromXmlNode(xmlNodePtr job_node); + static void parseUserNode(Job * new_job, xmlNodePtr user_node); + static void parseRunNode(Job * new_job, xmlNodePtr run_node); + static void parseResourceNode(Job * new_job, xmlNodePtr res_node); + + + // Useful wrappers around libxml2 functions + + // Return the value of the attribute, or an empty string if it is not defined + static std::string getAttrValue(xmlNodePtr node, const std::string & attrName); + static inline std::string xmlStrToString(const xmlChar * xmlStr); + static std::string getNodeContent(xmlNodePtr node); + template static T getNumericalNodeContent(xmlNodePtr node); + static xmlNodePtr addNode(xmlNodePtr father, const std::string & name, + const std::string & content); + template static xmlNodePtr addNumericalNode(xmlNodePtr father, + const std::string & name, + T content); + static void addAttr(xmlNodePtr node, const std::string & name, const std::string & value); }; }