b311480e |
1 | // Created on: 2007-06-29 |
2 | // Created by: OCC Team |
973c2be1 |
3 | // Copyright (c) 2007-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 <Message_Messenger.hxx> |
17 | |
18 | //======================================================================= |
19 | //function : GetPrinters |
20 | //purpose : |
21 | //======================================================================= |
22 | |
23 | inline const Message_SequenceOfPrinters& Message_Messenger::Printers() const |
24 | { |
25 | return myPrinters; |
26 | } |
27 | |
28 | //======================================================================= |
29 | //function : GetPrinters |
30 | //purpose : |
31 | //======================================================================= |
32 | |
33 | inline Message_SequenceOfPrinters& Message_Messenger::ChangePrinters() |
34 | { |
35 | return myPrinters; |
36 | } |
37 | |
38 | //======================================================================= |
39 | //function : operator << |
40 | //purpose : |
41 | //======================================================================= |
42 | |
7fd59977 |
43 | #include <TCollection_HAsciiString.hxx> |
7fd59977 |
44 | #include <TCollection_HExtendedString.hxx> |
7fd59977 |
45 | |
46 | // CString |
47 | inline const Handle(Message_Messenger)& |
48 | operator << (const Handle(Message_Messenger)& theMessenger, |
49 | const Standard_CString theStr) |
50 | { |
51 | theMessenger->Send (theStr, Message_Info, Standard_False); |
52 | return theMessenger; |
53 | } |
54 | |
55 | // const char* (not the same as const CString which is char const*) |
56 | /* |
57 | inline const Handle(Message_Messenger)& |
58 | operator << (const Handle(Message_Messenger)& theMessenger, |
59 | const char* theStr) |
60 | { |
61 | theMessenger->Send ((Standard_CString)theStr, Message_Info, Standard_False); |
62 | return theMessenger; |
63 | } |
64 | */ |
65 | // AsciiString |
66 | inline const Handle(Message_Messenger)& |
67 | operator << (const Handle(Message_Messenger)& theMessenger, |
68 | const TCollection_AsciiString& theStr) |
69 | { |
70 | theMessenger->Send (theStr, Message_Info, Standard_False); |
71 | return theMessenger; |
72 | } |
73 | |
74 | // HAsciiString |
75 | inline const Handle(Message_Messenger)& |
76 | operator << (const Handle(Message_Messenger)& theMessenger, |
77 | const Handle(TCollection_HAsciiString)& theStr) |
78 | { |
79 | theMessenger->Send (theStr->String(), Message_Info, Standard_False); |
80 | return theMessenger; |
81 | } |
82 | |
83 | // ExtendedString |
84 | inline const Handle(Message_Messenger)& |
85 | operator << (const Handle(Message_Messenger)& theMessenger, |
86 | const TCollection_ExtendedString& theStr) |
87 | { |
88 | theMessenger->Send (theStr, Message_Info, Standard_False); |
89 | return theMessenger; |
90 | } |
91 | |
92 | // HExtendedString |
93 | inline const Handle(Message_Messenger)& |
94 | operator << (const Handle(Message_Messenger)& theMessenger, |
95 | const Handle(TCollection_HExtendedString)& theStr) |
96 | { |
97 | theMessenger->Send (theStr->String(), Message_Info, Standard_False); |
98 | return theMessenger; |
99 | } |
100 | |
101 | // Integer |
102 | inline const Handle(Message_Messenger)& |
103 | operator << (const Handle(Message_Messenger)& theMessenger, |
104 | const Standard_Integer theVal) |
105 | { |
106 | TCollection_AsciiString aStr (theVal); |
107 | theMessenger->Send (aStr, Message_Info, Standard_False); |
108 | return theMessenger; |
109 | } |
110 | |
111 | // Real |
112 | inline const Handle(Message_Messenger)& |
113 | operator << (const Handle(Message_Messenger)& theMessenger, |
114 | const Standard_Real theVal) |
115 | { |
116 | TCollection_AsciiString aStr (theVal); |
117 | theMessenger->Send (aStr, Message_Info, Standard_False); |
118 | return theMessenger; |
119 | } |
120 | |
121 | // Stream |
122 | inline const Handle(Message_Messenger)& |
123 | operator << (const Handle(Message_Messenger)& theMessenger, |
124 | const Standard_SStream& theStream) |
125 | { |
7fd59977 |
126 | theMessenger->Send (theStream.str().c_str(), Message_Info, Standard_False); |
7fd59977 |
127 | return theMessenger; |
128 | } |
129 | |
130 | // manipulators |
131 | inline const Handle(Message_Messenger)& |
132 | operator << (const Handle(Message_Messenger)& theMessenger, |
133 | const Handle(Message_Messenger)& (*pman) (const Handle(Message_Messenger)&)) |
134 | { |
135 | return pman (theMessenger); |
136 | } |
137 | |
138 | // endl |
139 | inline const Handle(Message_Messenger)& endl (const Handle(Message_Messenger)& theMessenger) |
140 | { |
141 | theMessenger->Send ("", Message_Info, Standard_True); |
142 | return theMessenger; |
143 | } |