b311480e |
1 | // Created on: 2007-06-29 |
2 | // Created by: OCC Team |
3 | // Copyright (c) 2007-2012 OPEN CASCADE SAS |
4 | // |
5 | // The content of this file is subject to the Open CASCADE Technology Public |
6 | // License Version 6.5 (the "License"). You may not use the content of this file |
7 | // except in compliance with the License. Please obtain a copy of the License |
8 | // at http://www.opencascade.org and read it completely before using this file. |
9 | // |
10 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | // |
13 | // The Original Code and all software distributed under the License is |
14 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | // Initial Developer hereby disclaims all such warranties, including without |
16 | // limitation, any warranties of merchantability, fitness for a particular |
17 | // purpose or non-infringement. Please see the License for the specific terms |
18 | // and conditions governing the rights and limitations under the License. |
19 | |
7fd59977 |
20 | |
21 | #include <Message_Messenger.hxx> |
22 | |
23 | //======================================================================= |
24 | //function : GetPrinters |
25 | //purpose : |
26 | //======================================================================= |
27 | |
28 | inline const Message_SequenceOfPrinters& Message_Messenger::Printers() const |
29 | { |
30 | return myPrinters; |
31 | } |
32 | |
33 | //======================================================================= |
34 | //function : GetPrinters |
35 | //purpose : |
36 | //======================================================================= |
37 | |
38 | inline Message_SequenceOfPrinters& Message_Messenger::ChangePrinters() |
39 | { |
40 | return myPrinters; |
41 | } |
42 | |
43 | //======================================================================= |
44 | //function : operator << |
45 | //purpose : |
46 | //======================================================================= |
47 | |
48 | #ifndef _TCollection_HAsciiString_HeaderFile |
49 | #include <TCollection_HAsciiString.hxx> |
50 | #endif |
51 | #ifndef _TCollection_HExtendedString_HeaderFile |
52 | #include <TCollection_HExtendedString.hxx> |
53 | #endif |
54 | |
55 | // CString |
56 | inline const Handle(Message_Messenger)& |
57 | operator << (const Handle(Message_Messenger)& theMessenger, |
58 | const Standard_CString theStr) |
59 | { |
60 | theMessenger->Send (theStr, Message_Info, Standard_False); |
61 | return theMessenger; |
62 | } |
63 | |
64 | // const char* (not the same as const CString which is char const*) |
65 | /* |
66 | inline const Handle(Message_Messenger)& |
67 | operator << (const Handle(Message_Messenger)& theMessenger, |
68 | const char* theStr) |
69 | { |
70 | theMessenger->Send ((Standard_CString)theStr, Message_Info, Standard_False); |
71 | return theMessenger; |
72 | } |
73 | */ |
74 | // AsciiString |
75 | inline const Handle(Message_Messenger)& |
76 | operator << (const Handle(Message_Messenger)& theMessenger, |
77 | const TCollection_AsciiString& theStr) |
78 | { |
79 | theMessenger->Send (theStr, Message_Info, Standard_False); |
80 | return theMessenger; |
81 | } |
82 | |
83 | // HAsciiString |
84 | inline const Handle(Message_Messenger)& |
85 | operator << (const Handle(Message_Messenger)& theMessenger, |
86 | const Handle(TCollection_HAsciiString)& theStr) |
87 | { |
88 | theMessenger->Send (theStr->String(), Message_Info, Standard_False); |
89 | return theMessenger; |
90 | } |
91 | |
92 | // ExtendedString |
93 | inline const Handle(Message_Messenger)& |
94 | operator << (const Handle(Message_Messenger)& theMessenger, |
95 | const TCollection_ExtendedString& theStr) |
96 | { |
97 | theMessenger->Send (theStr, Message_Info, Standard_False); |
98 | return theMessenger; |
99 | } |
100 | |
101 | // HExtendedString |
102 | inline const Handle(Message_Messenger)& |
103 | operator << (const Handle(Message_Messenger)& theMessenger, |
104 | const Handle(TCollection_HExtendedString)& theStr) |
105 | { |
106 | theMessenger->Send (theStr->String(), Message_Info, Standard_False); |
107 | return theMessenger; |
108 | } |
109 | |
110 | // Integer |
111 | inline const Handle(Message_Messenger)& |
112 | operator << (const Handle(Message_Messenger)& theMessenger, |
113 | const Standard_Integer theVal) |
114 | { |
115 | TCollection_AsciiString aStr (theVal); |
116 | theMessenger->Send (aStr, Message_Info, Standard_False); |
117 | return theMessenger; |
118 | } |
119 | |
120 | // Real |
121 | inline const Handle(Message_Messenger)& |
122 | operator << (const Handle(Message_Messenger)& theMessenger, |
123 | const Standard_Real theVal) |
124 | { |
125 | TCollection_AsciiString aStr (theVal); |
126 | theMessenger->Send (aStr, Message_Info, Standard_False); |
127 | return theMessenger; |
128 | } |
129 | |
130 | // Stream |
131 | inline const Handle(Message_Messenger)& |
132 | operator << (const Handle(Message_Messenger)& theMessenger, |
133 | const Standard_SStream& theStream) |
134 | { |
135 | #ifdef USE_STL_STREAM |
136 | theMessenger->Send (theStream.str().c_str(), Message_Info, Standard_False); |
137 | #else |
138 | // Note: use dirty tricks -- unavoidable with old streams |
139 | TCollection_AsciiString aStr (((Standard_SStream&)theStream).str(), theStream.pcount()); |
140 | theMessenger->Send (aStr, Message_Info, Standard_False); |
141 | ((Standard_SStream&)theStream).freeze (false); |
142 | #endif |
143 | return theMessenger; |
144 | } |
145 | |
146 | // manipulators |
147 | inline const Handle(Message_Messenger)& |
148 | operator << (const Handle(Message_Messenger)& theMessenger, |
149 | const Handle(Message_Messenger)& (*pman) (const Handle(Message_Messenger)&)) |
150 | { |
151 | return pman (theMessenger); |
152 | } |
153 | |
154 | // endl |
155 | inline const Handle(Message_Messenger)& endl (const Handle(Message_Messenger)& theMessenger) |
156 | { |
157 | theMessenger->Send ("", Message_Info, Standard_True); |
158 | return theMessenger; |
159 | } |