42cf5bc1 |
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 |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
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. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _XmlObjMgt_HeaderFile |
17 | #define _XmlObjMgt_HeaderFile |
18 | |
19 | #include <Standard.hxx> |
20 | #include <Standard_DefineAlloc.hxx> |
21 | #include <Standard_Handle.hxx> |
22 | |
23 | #include <XmlObjMgt_DOMString.hxx> |
24 | #include <Standard_Boolean.hxx> |
25 | #include <XmlObjMgt_Element.hxx> |
42cf5bc1 |
26 | #include <Standard_CString.hxx> |
27 | #include <Standard_Real.hxx> |
28 | class TCollection_ExtendedString; |
29 | class TCollection_AsciiString; |
42cf5bc1 |
30 | |
31 | |
32 | //! This package defines services to manage the storage |
33 | //! grain of data produced by applications and those classes |
34 | //! to manage persistent extern reference. |
35 | class XmlObjMgt |
36 | { |
37 | public: |
38 | |
39 | DEFINE_STANDARD_ALLOC |
40 | |
41 | |
42 | //! Define the name of XMLattribute 'ID' (to be used everywhere) |
43 | Standard_EXPORT static const XmlObjMgt_DOMString& IdString(); |
44 | |
45 | //! Add attribute <theElement extstring="theString" ...> |
46 | Standard_EXPORT static Standard_Boolean SetExtendedString (XmlObjMgt_Element& theElement, const TCollection_ExtendedString& theString); |
47 | |
48 | //! Get attribute <theElement extstring="theString" ...> |
49 | Standard_EXPORT static Standard_Boolean GetExtendedString (const XmlObjMgt_Element& theElement, TCollection_ExtendedString& theString); |
50 | |
51 | //! Returns the first child text node |
52 | Standard_EXPORT static XmlObjMgt_DOMString GetStringValue (const XmlObjMgt_Element& theElement); |
53 | |
54 | //! Add theData as the last child text node to theElement |
55 | //! isClearText(True) avoids analysis of the string and replacement |
56 | //! of characters like '<' and '&' during XML file storage. |
57 | //! Do NEVER set isClearText unless you have a hell of a reason |
58 | Standard_EXPORT static void SetStringValue (XmlObjMgt_Element& theElement, const XmlObjMgt_DOMString& theData, const Standard_Boolean isClearText = Standard_False); |
59 | |
60 | //! Convert XPath expression (DOMString) into TagEntry string |
61 | //! returns False on Error |
62 | Standard_EXPORT static Standard_Boolean GetTagEntryString (const XmlObjMgt_DOMString& theTarget, TCollection_AsciiString& theTagEntry); |
63 | |
64 | //! Convert XPath expression (DOMString) into TagEntry string |
65 | //! returns False on Error |
66 | Standard_EXPORT static void SetTagEntryString (XmlObjMgt_DOMString& theSource, const TCollection_AsciiString& theTagEntry); |
67 | |
68 | Standard_EXPORT static XmlObjMgt_Element FindChildElement (const XmlObjMgt_Element& theSource, const Standard_Integer theObjId); |
69 | |
70 | Standard_EXPORT static XmlObjMgt_Element FindChildByRef (const XmlObjMgt_Element& theSource, const XmlObjMgt_DOMString& theRefName); |
71 | |
72 | Standard_EXPORT static XmlObjMgt_Element FindChildByName (const XmlObjMgt_Element& theSource, const XmlObjMgt_DOMString& theName); |
73 | |
74 | Standard_EXPORT static Standard_Boolean GetInteger (Standard_CString& theString, Standard_Integer& theValue); |
75 | |
76 | Standard_EXPORT static Standard_Boolean GetReal (Standard_CString& theString, Standard_Real& theValue); |
77 | |
78 | Standard_EXPORT static Standard_Boolean GetReal (const XmlObjMgt_DOMString& theString, Standard_Real& theValue); |
79 | |
42cf5bc1 |
80 | }; |
81 | |
42cf5bc1 |
82 | #endif // _XmlObjMgt_HeaderFile |