Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:20

0001 // Created on: 1997-10-22
0002 // Created by: Jean-Louis Frenkel
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _CDM_MetaData_HeaderFile
0018 #define _CDM_MetaData_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <CDM_DocumentPointer.hxx>
0024 #include <TCollection_ExtendedString.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <Standard_Transient.hxx>
0027 #include <CDM_Document.hxx>
0028 #include <CDM_Application.hxx>
0029 #include <Standard_OStream.hxx>
0030 #include <CDM_MetaDataLookUpTable.hxx>
0031 
0032 
0033 class CDM_MetaData;
0034 DEFINE_STANDARD_HANDLE(CDM_MetaData, Standard_Transient)
0035 
0036 
0037 class CDM_MetaData : public Standard_Transient
0038 {
0039 
0040 public:
0041 
0042   Standard_EXPORT static Handle(CDM_MetaData) LookUp (CDM_MetaDataLookUpTable& theLookUpTable,
0043                                                       const TCollection_ExtendedString& aFolder,
0044                                                       const TCollection_ExtendedString& aName,
0045                                                       const TCollection_ExtendedString& aPath,
0046                                                       const TCollection_ExtendedString& aFileName,
0047                                                       const Standard_Boolean ReadOnly);
0048 
0049   Standard_EXPORT static Handle(CDM_MetaData) LookUp (CDM_MetaDataLookUpTable& theLookUpTable,
0050                                                       const TCollection_ExtendedString& aFolder,
0051                                                       const TCollection_ExtendedString& aName,
0052                                                       const TCollection_ExtendedString& aPath,
0053                                                       const TCollection_ExtendedString& aVersion,
0054                                                       const TCollection_ExtendedString& aFileName,
0055                                                       const Standard_Boolean ReadOnly);
0056 
0057   Standard_EXPORT Standard_Boolean IsRetrieved() const;
0058   
0059   Standard_EXPORT Handle(CDM_Document) Document() const;
0060   
0061   //! returns the folder in which the meta-data has to be created
0062   //! or has to be found.
0063   Standard_EXPORT TCollection_ExtendedString Folder() const;
0064   
0065   //! returns the name under which the meta-data has to be created
0066   //! or has to be found.
0067   Standard_EXPORT TCollection_ExtendedString Name() const;
0068   
0069   //! returns the version under which the meta-data has to be found.
0070   //! Warning: raises NoSuchObject from Standard if no Version has been defined
0071   Standard_EXPORT TCollection_ExtendedString Version() const;
0072   
0073   //! indicates that the version has to be taken into account when
0074   //! searching the corresponding meta-data.
0075   Standard_EXPORT Standard_Boolean HasVersion() const;
0076   
0077   Standard_EXPORT TCollection_ExtendedString FileName() const;
0078   
0079   Standard_EXPORT Standard_OStream& Print (Standard_OStream& anOStream) const;
0080 Standard_OStream& operator << (Standard_OStream& anOStream);
0081   
0082   Standard_EXPORT TCollection_ExtendedString Path() const;
0083   
0084   Standard_EXPORT void UnsetDocument();
0085   
0086   Standard_EXPORT Standard_Boolean IsReadOnly() const;
0087   
0088   Standard_EXPORT void SetIsReadOnly();
0089   
0090   Standard_EXPORT void UnsetIsReadOnly();
0091   
0092   //! Dumps the content of me into the stream
0093   Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0094 
0095 
0096 friend class CDM_Reference;
0097 friend   
0098   //! associates database  information to  a document which
0099   //! has been stored.  The name of the  document is now the
0100   //! name which has beenused to store the data.
0101   Standard_EXPORT void CDM_Document::SetMetaData (const Handle(CDM_MetaData)& aMetaData);
0102 friend   
0103   Standard_EXPORT void CDM_Application::SetDocumentVersion (const Handle(CDM_Document)& aDocument, const Handle(CDM_MetaData)& aMetaData) const;
0104 
0105 
0106   DEFINE_STANDARD_RTTIEXT(CDM_MetaData,Standard_Transient)
0107 
0108 private:
0109 
0110   CDM_MetaData (const TCollection_ExtendedString& aFolder,
0111                 const TCollection_ExtendedString& aName,
0112                 const TCollection_ExtendedString& aPath,
0113                 const TCollection_ExtendedString& aFileName,
0114                 const Standard_Boolean ReadOnly);
0115 
0116   CDM_MetaData (const TCollection_ExtendedString& aFolder,
0117                 const TCollection_ExtendedString& aName,
0118                 const TCollection_ExtendedString& aPath,
0119                 const TCollection_ExtendedString& aVersion,
0120                 const TCollection_ExtendedString& aFileName,
0121                 const Standard_Boolean ReadOnly);
0122 
0123   void SetDocument (const Handle(CDM_Document)& aDocument);
0124 
0125   Standard_Integer DocumentVersion (const Handle(CDM_Application)& anApplication);
0126 
0127 private:
0128 
0129   Standard_Boolean myIsRetrieved;
0130   CDM_DocumentPointer myDocument;
0131   TCollection_ExtendedString myFolder;
0132   TCollection_ExtendedString myName;
0133   TCollection_ExtendedString myVersion;
0134   Standard_Boolean myHasVersion;
0135   TCollection_ExtendedString myFileName;
0136   TCollection_ExtendedString myPath;
0137   Standard_Integer myDocumentVersion;
0138   Standard_Boolean myIsReadOnly;
0139 
0140 
0141 };
0142 
0143 
0144 
0145 
0146 
0147 
0148 
0149 #endif // _CDM_MetaData_HeaderFile