7fd59977 |
1 | // File: XmlMDF_ADriver.cxx |
2 | // Created: Mon Jul 9 12:29:49 MSK DST 2001 |
3 | // Author: Julia DOROVSKIKH |
4 | // Copyright: Matra Datavision 2001 |
5 | |
6 | #include <XmlMDF_ADriver.ixx> |
7 | |
8 | //======================================================================= |
9 | //function : XmlMDF_ADriver |
10 | //purpose : Constructor |
11 | //======================================================================= |
12 | |
13 | XmlMDF_ADriver::XmlMDF_ADriver (const Handle(CDM_MessageDriver)& theMsgDriver, |
14 | const Standard_CString theNS, |
15 | const Standard_CString theName) |
16 | : myMessageDriver (theMsgDriver) |
17 | { |
18 | if (theNS != NULL) |
19 | if (theNS[0] != '\0') { |
20 | myTypeName = theNS; |
21 | myTypeName += ':'; |
22 | } |
23 | if (theName != NULL) |
24 | myTypeName += theName; |
25 | } |
26 | |
27 | //======================================================================= |
28 | //function : VersionNumber |
29 | //purpose : default version number from which the driver is available |
30 | //======================================================================= |
31 | |
32 | Standard_Integer XmlMDF_ADriver::VersionNumber () const |
33 | { |
34 | return 0; |
35 | } |
36 | |
37 | //======================================================================= |
38 | //function : SourceType |
39 | //purpose : |
40 | //======================================================================= |
41 | |
42 | Handle(Standard_Type) XmlMDF_ADriver::SourceType () const |
43 | { |
44 | return NewEmpty() -> DynamicType(); |
45 | } |
46 | |
47 | //======================================================================= |
48 | //function : TypeName |
49 | //purpose : |
50 | //======================================================================= |
51 | |
52 | const TCollection_AsciiString& XmlMDF_ADriver::TypeName () const |
53 | { |
54 | const Standard_CString aString = myTypeName.ToCString(); |
55 | if (myTypeName.Length() == 0 || aString [myTypeName.Length() - 1] == ':') |
56 | (TCollection_AsciiString&)myTypeName += SourceType() -> Name(); |
57 | return myTypeName; |
58 | } |
59 | |
60 | //======================================================================= |
61 | //function : WriteMessage |
62 | //purpose : |
63 | //======================================================================= |
64 | |
65 | void XmlMDF_ADriver::WriteMessage |
66 | (const TCollection_ExtendedString& aMessage) const |
67 | { |
68 | myMessageDriver -> Write (aMessage.ToExtString()); |
69 | } |