1 // Created on: 2001-07-17
2 // Created by: Julia DOROVSKIKH <jfa@hotdox.nnov.matra-dtv.fr>
3 // Copyright (c) 2001-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _XmlObjMgt_HeaderFile
17 #define _XmlObjMgt_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
23 #include <XmlObjMgt_DOMString.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <XmlObjMgt_Element.hxx>
26 #include <Standard_Integer.hxx>
27 #include <Standard_CString.hxx>
28 #include <Standard_Real.hxx>
29 class TCollection_ExtendedString;
30 class TCollection_AsciiString;
31 class XmlObjMgt_Persistent;
33 class XmlObjMgt_Array1;
36 //! This package defines services to manage the storage
37 //! grain of data produced by applications and those classes
38 //! to manage persistent extern reference.
46 //! Define the name of XMLattribute 'ID' (to be used everywhere)
47 Standard_EXPORT static const XmlObjMgt_DOMString& IdString();
49 //! Add attribute <theElement extstring="theString" ...>
50 Standard_EXPORT static Standard_Boolean SetExtendedString (XmlObjMgt_Element& theElement, const TCollection_ExtendedString& theString);
52 //! Get attribute <theElement extstring="theString" ...>
53 Standard_EXPORT static Standard_Boolean GetExtendedString (const XmlObjMgt_Element& theElement, TCollection_ExtendedString& theString);
55 //! Returns the first child text node
56 Standard_EXPORT static XmlObjMgt_DOMString GetStringValue (const XmlObjMgt_Element& theElement);
58 //! Add theData as the last child text node to theElement
59 //! isClearText(True) avoids analysis of the string and replacement
60 //! of characters like '<' and '&' during XML file storage.
61 //! Do NEVER set isClearText unless you have a hell of a reason
62 Standard_EXPORT static void SetStringValue (XmlObjMgt_Element& theElement, const XmlObjMgt_DOMString& theData, const Standard_Boolean isClearText = Standard_False);
64 //! Convert XPath expression (DOMString) into TagEntry string
65 //! returns False on Error
66 Standard_EXPORT static Standard_Boolean GetTagEntryString (const XmlObjMgt_DOMString& theTarget, TCollection_AsciiString& theTagEntry);
68 //! Convert XPath expression (DOMString) into TagEntry string
69 //! returns False on Error
70 Standard_EXPORT static void SetTagEntryString (XmlObjMgt_DOMString& theSource, const TCollection_AsciiString& theTagEntry);
72 Standard_EXPORT static XmlObjMgt_Element FindChildElement (const XmlObjMgt_Element& theSource, const Standard_Integer theObjId);
74 Standard_EXPORT static XmlObjMgt_Element FindChildByRef (const XmlObjMgt_Element& theSource, const XmlObjMgt_DOMString& theRefName);
76 Standard_EXPORT static XmlObjMgt_Element FindChildByName (const XmlObjMgt_Element& theSource, const XmlObjMgt_DOMString& theName);
78 Standard_EXPORT static Standard_Boolean GetInteger (Standard_CString& theString, Standard_Integer& theValue);
80 Standard_EXPORT static Standard_Boolean GetReal (Standard_CString& theString, Standard_Real& theValue);
82 Standard_EXPORT static Standard_Boolean GetReal (const XmlObjMgt_DOMString& theString, Standard_Real& theValue);
98 friend class XmlObjMgt_Persistent;
99 friend class XmlObjMgt_GP;
100 friend class XmlObjMgt_Array1;
110 #endif // _XmlObjMgt_HeaderFile