42cf5bc1 |
1 | // Created on: 1997-10-22 |
2 | // Created by: Jean-Louis Frenkel |
3 | // Copyright (c) 1997-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _CDM_MetaData_HeaderFile |
18 | #define _CDM_MetaData_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <Standard_Boolean.hxx> |
24 | #include <CDM_DocumentPointer.hxx> |
25 | #include <TCollection_ExtendedString.hxx> |
26 | #include <Standard_Integer.hxx> |
27 | #include <Standard_Transient.hxx> |
28 | #include <CDM_Document.hxx> |
29 | #include <CDM_Application.hxx> |
30 | #include <Standard_OStream.hxx> |
31 | #include <CDM_MetaDataLookUpTable.hxx> |
32 | class Standard_NoSuchObject; |
33 | class CDM_Reference; |
34 | class CDM_Document; |
35 | class TCollection_ExtendedString; |
36 | class CDM_Application; |
37 | |
38 | |
39 | class CDM_MetaData; |
40 | DEFINE_STANDARD_HANDLE(CDM_MetaData, Standard_Transient) |
41 | |
42 | |
43 | class CDM_MetaData : public Standard_Transient |
44 | { |
45 | |
46 | public: |
47 | |
48 | |
49 | Standard_EXPORT static Handle(CDM_MetaData) LookUp (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aPath, const TCollection_ExtendedString& aFileName, const Standard_Boolean ReadOnly); |
50 | |
51 | Standard_EXPORT static Handle(CDM_MetaData) LookUp (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aPath, const TCollection_ExtendedString& aVersion, const TCollection_ExtendedString& aFileName, const Standard_Boolean ReadOnly); |
52 | |
53 | Standard_EXPORT Standard_Boolean IsRetrieved() const; |
54 | |
55 | Standard_EXPORT Handle(CDM_Document) Document() const; |
56 | |
57 | //! returns the folder in which the meta-data has to be created |
58 | //! or has to be found. |
59 | Standard_EXPORT TCollection_ExtendedString Folder() const; |
60 | |
61 | //! returns the name under which the meta-data has to be created |
62 | //! or has to be found. |
63 | Standard_EXPORT TCollection_ExtendedString Name() const; |
64 | |
65 | //! returns the version under which the meta-data has to be found. |
66 | //! Warning: raises NoSuchObject from Standard if no Version has been defined |
67 | Standard_EXPORT TCollection_ExtendedString Version() const; |
68 | |
69 | //! indicates that the version has to be taken into account when |
70 | //! searching the corresponding meta-data. |
71 | Standard_EXPORT Standard_Boolean HasVersion() const; |
72 | |
73 | Standard_EXPORT TCollection_ExtendedString FileName() const; |
74 | |
75 | Standard_EXPORT Standard_OStream& Print (Standard_OStream& anOStream) const; |
76 | Standard_OStream& operator << (Standard_OStream& anOStream); |
77 | |
78 | Standard_EXPORT TCollection_ExtendedString Path() const; |
79 | |
80 | Standard_EXPORT void UnsetDocument(); |
81 | |
82 | Standard_EXPORT Standard_Boolean IsReadOnly() const; |
83 | |
84 | Standard_EXPORT void SetIsReadOnly(); |
85 | |
86 | Standard_EXPORT void UnsetIsReadOnly(); |
bc73b006 |
87 | |
88 | //! Dumps the content of me into the stream |
89 | Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const; |
42cf5bc1 |
90 | |
91 | |
92 | friend class CDM_Reference; |
93 | friend |
94 | //! associates database information to a document which |
95 | //! has been stored. The name of the document is now the |
96 | //! name which has beenused to store the data. |
97 | Standard_EXPORT void CDM_Document::SetMetaData (const Handle(CDM_MetaData)& aMetaData); |
98 | friend |
99 | Standard_EXPORT void CDM_Application::SetDocumentVersion (const Handle(CDM_Document)& aDocument, const Handle(CDM_MetaData)& aMetaData) const; |
100 | |
101 | |
92efcf78 |
102 | DEFINE_STANDARD_RTTIEXT(CDM_MetaData,Standard_Transient) |
42cf5bc1 |
103 | |
104 | protected: |
105 | |
106 | |
107 | |
108 | |
109 | private: |
110 | |
111 | |
112 | Standard_EXPORT CDM_MetaData(const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aPath, const TCollection_ExtendedString& aFileName, const Standard_Boolean ReadOnly); |
113 | |
114 | Standard_EXPORT CDM_MetaData(const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aPath, const TCollection_ExtendedString& aVersion, const TCollection_ExtendedString& aFileName, const Standard_Boolean ReadOnly); |
115 | |
116 | Standard_EXPORT void SetDocument (const Handle(CDM_Document)& aDocument); |
117 | |
118 | Standard_EXPORT static const CDM_MetaDataLookUpTable& LookUpTable(); |
119 | |
120 | Standard_EXPORT Standard_Integer DocumentVersion (const Handle(CDM_Application)& anApplication); |
121 | |
122 | Standard_Boolean myIsRetrieved; |
123 | CDM_DocumentPointer myDocument; |
124 | TCollection_ExtendedString myFolder; |
125 | TCollection_ExtendedString myName; |
126 | TCollection_ExtendedString myVersion; |
127 | Standard_Boolean myHasVersion; |
128 | TCollection_ExtendedString myFileName; |
129 | TCollection_ExtendedString myPath; |
130 | Standard_Integer myDocumentVersion; |
131 | Standard_Boolean myIsReadOnly; |
132 | |
133 | |
134 | }; |
135 | |
136 | |
137 | |
138 | |
139 | |
140 | |
141 | |
142 | #endif // _CDM_MetaData_HeaderFile |