Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:36

0001 // Created on: 2001-07-17
0002 // Created by: Julia DOROVSKIKH <jfa@hotdox.nnov.matra-dtv.fr>
0003 // Copyright (c) 2001-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _XmlObjMgt_HeaderFile
0017 #define _XmlObjMgt_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <XmlObjMgt_DOMString.hxx>
0024 #include <Standard_Boolean.hxx>
0025 #include <XmlObjMgt_Element.hxx>
0026 #include <Standard_CString.hxx>
0027 #include <Standard_Real.hxx>
0028 class TCollection_ExtendedString;
0029 class TCollection_AsciiString;
0030 
0031 
0032 //! This package defines services to manage the storage
0033 //! grain of data produced by applications and those classes
0034 //! to manage persistent extern reference.
0035 class XmlObjMgt 
0036 {
0037 public:
0038 
0039   DEFINE_STANDARD_ALLOC
0040 
0041   
0042   //! Define the name of XMLattribute 'ID' (to be used everywhere)
0043   Standard_EXPORT static const XmlObjMgt_DOMString& IdString();
0044   
0045   //! Add attribute <theElement extstring="theString" ...>
0046   Standard_EXPORT static Standard_Boolean SetExtendedString (XmlObjMgt_Element& theElement, const TCollection_ExtendedString& theString);
0047   
0048   //! Get attribute <theElement extstring="theString" ...>
0049   Standard_EXPORT static Standard_Boolean GetExtendedString (const XmlObjMgt_Element& theElement, TCollection_ExtendedString& theString);
0050   
0051   //! Returns the first child text node
0052   Standard_EXPORT static XmlObjMgt_DOMString GetStringValue (const XmlObjMgt_Element& theElement);
0053   
0054   //! Add theData as the last child text node to theElement
0055   //! isClearText(True) avoids analysis of the string and replacement
0056   //! of characters like '<' and '&' during XML file storage.
0057   //! Do NEVER set isClearText unless you have a hell of a reason
0058   Standard_EXPORT static void SetStringValue (XmlObjMgt_Element& theElement, const XmlObjMgt_DOMString& theData, const Standard_Boolean isClearText = Standard_False);
0059   
0060   //! Convert XPath expression (DOMString) into TagEntry string
0061   //! returns False on Error
0062   Standard_EXPORT static Standard_Boolean GetTagEntryString (const XmlObjMgt_DOMString& theTarget, TCollection_AsciiString& theTagEntry);
0063   
0064   //! Convert XPath expression (DOMString) into TagEntry string
0065   //! returns False on Error
0066   Standard_EXPORT static void SetTagEntryString (XmlObjMgt_DOMString& theSource, const TCollection_AsciiString& theTagEntry);
0067   
0068   Standard_EXPORT static XmlObjMgt_Element FindChildElement (const XmlObjMgt_Element& theSource, const Standard_Integer theObjId);
0069   
0070   Standard_EXPORT static XmlObjMgt_Element FindChildByRef (const XmlObjMgt_Element& theSource, const XmlObjMgt_DOMString& theRefName);
0071   
0072   Standard_EXPORT static XmlObjMgt_Element FindChildByName (const XmlObjMgt_Element& theSource, const XmlObjMgt_DOMString& theName);
0073   
0074   Standard_EXPORT static Standard_Boolean GetInteger (Standard_CString& theString, Standard_Integer& theValue);
0075   
0076   Standard_EXPORT static Standard_Boolean GetReal (Standard_CString& theString, Standard_Real& theValue);
0077   
0078   Standard_EXPORT static Standard_Boolean GetReal (const XmlObjMgt_DOMString& theString, Standard_Real& theValue);
0079 
0080 };
0081 
0082 #endif // _XmlObjMgt_HeaderFile