b311480e |
1 | // Created on: 2001-07-09 |
2 | // Created by: Julia DOROVSKIKH |
973c2be1 |
3 | // Copyright (c) 2001-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
7fd59977 |
15 | |
16 | #include <XmlMDF_ADriver.ixx> |
17 | |
18 | //======================================================================= |
19 | //function : XmlMDF_ADriver |
20 | //purpose : Constructor |
21 | //======================================================================= |
22 | |
23 | XmlMDF_ADriver::XmlMDF_ADriver (const Handle(CDM_MessageDriver)& theMsgDriver, |
24 | const Standard_CString theNS, |
25 | const Standard_CString theName) |
26 | : myMessageDriver (theMsgDriver) |
27 | { |
28 | if (theNS != NULL) |
29 | if (theNS[0] != '\0') { |
30 | myTypeName = theNS; |
31 | myTypeName += ':'; |
32 | } |
33 | if (theName != NULL) |
34 | myTypeName += theName; |
35 | } |
36 | |
37 | //======================================================================= |
38 | //function : VersionNumber |
39 | //purpose : default version number from which the driver is available |
40 | //======================================================================= |
41 | |
42 | Standard_Integer XmlMDF_ADriver::VersionNumber () const |
43 | { |
44 | return 0; |
45 | } |
46 | |
47 | //======================================================================= |
48 | //function : SourceType |
49 | //purpose : |
50 | //======================================================================= |
51 | |
52 | Handle(Standard_Type) XmlMDF_ADriver::SourceType () const |
53 | { |
54 | return NewEmpty() -> DynamicType(); |
55 | } |
56 | |
57 | //======================================================================= |
58 | //function : TypeName |
59 | //purpose : |
60 | //======================================================================= |
61 | |
62 | const TCollection_AsciiString& XmlMDF_ADriver::TypeName () const |
63 | { |
64 | const Standard_CString aString = myTypeName.ToCString(); |
65 | if (myTypeName.Length() == 0 || aString [myTypeName.Length() - 1] == ':') |
66 | (TCollection_AsciiString&)myTypeName += SourceType() -> Name(); |
67 | return myTypeName; |
68 | } |
69 | |
70 | //======================================================================= |
71 | //function : WriteMessage |
72 | //purpose : |
73 | //======================================================================= |
74 | |
75 | void XmlMDF_ADriver::WriteMessage |
76 | (const TCollection_ExtendedString& aMessage) const |
77 | { |
78 | myMessageDriver -> Write (aMessage.ToExtString()); |
79 | } |