1 // Created on: 2001-07-09
2 // Created by: Julia DOROVSKIKH
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 #include <XmlMDF_ADriver.ixx>
18 //=======================================================================
19 //function : XmlMDF_ADriver
20 //purpose : Constructor
21 //=======================================================================
23 XmlMDF_ADriver::XmlMDF_ADriver (const Handle(CDM_MessageDriver)& theMsgDriver,
24 const Standard_CString theNS,
25 const Standard_CString theName)
26 : myMessageDriver (theMsgDriver)
29 if (theNS[0] != '\0') {
34 myTypeName += theName;
37 //=======================================================================
38 //function : VersionNumber
39 //purpose : default version number from which the driver is available
40 //=======================================================================
42 Standard_Integer XmlMDF_ADriver::VersionNumber () const
47 //=======================================================================
48 //function : SourceType
50 //=======================================================================
52 Handle(Standard_Type) XmlMDF_ADriver::SourceType () const
54 return NewEmpty() -> DynamicType();
57 //=======================================================================
60 //=======================================================================
62 const TCollection_AsciiString& XmlMDF_ADriver::TypeName () const
64 const Standard_CString aString = myTypeName.ToCString();
65 if (myTypeName.Length() == 0 || aString [myTypeName.Length() - 1] == ':')
66 (TCollection_AsciiString&)myTypeName += SourceType() -> Name();
70 //=======================================================================
71 //function : WriteMessage
73 //=======================================================================
75 void XmlMDF_ADriver::WriteMessage
76 (const TCollection_ExtendedString& aMessage) const
78 myMessageDriver -> Write (aMessage.ToExtString());