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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <CDM_Application.hxx>
19 #include <CDM_Document.hxx>
20 #include <CDM_MessageDriver.hxx>
21 #include <CDM_MetaData.hxx>
22 #include <CDM_NullMessageDriver.hxx>
23 #include <CDM_Reference.hxx>
24 #include <Resource_Manager.hxx>
25 #include <Standard_Type.hxx>
26 #include <TCollection_ExtendedString.hxx>
28 IMPLEMENT_STANDARD_RTTIEXT(CDM_Application,Standard_Transient)
30 //=======================================================================
31 //function : SetDocumentVersion
33 //=======================================================================
34 void CDM_Application::SetDocumentVersion
35 (const Handle(CDM_Document)& aDocument,
36 const Handle(CDM_MetaData)& aMetaData) const
38 aDocument->SetModifications(aMetaData->DocumentVersion(this));
41 //=======================================================================
42 //function : SetReferenceCounter
44 //=======================================================================
46 void CDM_Application::SetReferenceCounter
47 (const Handle(CDM_Document)& aDocument,
48 const Standard_Integer aReferenceCounter)
50 aDocument->SetReferenceCounter(aReferenceCounter);
53 //=======================================================================
54 //function : MessageDriver
56 //=======================================================================
58 Handle(CDM_MessageDriver) CDM_Application::MessageDriver()
60 static Handle(CDM_NullMessageDriver) theMessageDriver
61 =new CDM_NullMessageDriver;
62 return theMessageDriver;
65 //=======================================================================
68 //=======================================================================
70 void CDM_Application::Write(const Standard_ExtString aString)
72 MessageDriver()->Write(aString);
75 //=======================================================================
76 //function : BeginOfUpdate
78 //=======================================================================
80 void CDM_Application::BeginOfUpdate (const Handle(CDM_Document)& aDocument)
82 TCollection_ExtendedString updating("Updating:");
83 updating+=aDocument->Presentation();
84 Write(updating.ToExtString());
87 //=======================================================================
88 //function : EndOfUpdate
90 //=======================================================================
92 void CDM_Application::EndOfUpdate
93 (const Handle(CDM_Document)& aDocument,
94 const Standard_Boolean theStatus,
95 const TCollection_ExtendedString& /*ErrorString*/)
97 TCollection_ExtendedString message;
101 message="Error during updating:";
103 message+=aDocument->Presentation();
104 Write(message.ToExtString());
107 //=======================================================================
109 //purpose : returns the application name
110 //=======================================================================
112 TCollection_ExtendedString CDM_Application::Name() const
115 return TCollection_ExtendedString();
118 //=======================================================================
120 //purpose : returns the application version
121 //=======================================================================
123 TCollection_AsciiString CDM_Application::Version() const
126 return TCollection_AsciiString();