0024644: Draw_Printer - provide the way to control messages gravity filter
[occt.git] / src / Message / Message_Messenger.lxx
CommitLineData
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
23inline const Message_SequenceOfPrinters& Message_Messenger::Printers() const
24{
25 return myPrinters;
26}
27
28//=======================================================================
29//function : GetPrinters
30//purpose :
31//=======================================================================
32
33inline Message_SequenceOfPrinters& Message_Messenger::ChangePrinters()
34{
35 return myPrinters;
36}
37
38//=======================================================================
39//function : operator <<
40//purpose :
41//=======================================================================
42
43#ifndef _TCollection_HAsciiString_HeaderFile
44#include <TCollection_HAsciiString.hxx>
45#endif
46#ifndef _TCollection_HExtendedString_HeaderFile
47#include <TCollection_HExtendedString.hxx>
48#endif
49
50// CString
51inline const Handle(Message_Messenger)&
52 operator << (const Handle(Message_Messenger)& theMessenger,
53 const Standard_CString theStr)
54{
55 theMessenger->Send (theStr, Message_Info, Standard_False);
56 return theMessenger;
57}
58
59// const char* (not the same as const CString which is char const*)
60/*
61inline const Handle(Message_Messenger)&
62 operator << (const Handle(Message_Messenger)& theMessenger,
63 const char* theStr)
64{
65 theMessenger->Send ((Standard_CString)theStr, Message_Info, Standard_False);
66 return theMessenger;
67}
68*/
69// AsciiString
70inline const Handle(Message_Messenger)&
71 operator << (const Handle(Message_Messenger)& theMessenger,
72 const TCollection_AsciiString& theStr)
73{
74 theMessenger->Send (theStr, Message_Info, Standard_False);
75 return theMessenger;
76}
77
78// HAsciiString
79inline const Handle(Message_Messenger)&
80 operator << (const Handle(Message_Messenger)& theMessenger,
81 const Handle(TCollection_HAsciiString)& theStr)
82{
83 theMessenger->Send (theStr->String(), Message_Info, Standard_False);
84 return theMessenger;
85}
86
87// ExtendedString
88inline const Handle(Message_Messenger)&
89 operator << (const Handle(Message_Messenger)& theMessenger,
90 const TCollection_ExtendedString& theStr)
91{
92 theMessenger->Send (theStr, Message_Info, Standard_False);
93 return theMessenger;
94}
95
96// HExtendedString
97inline const Handle(Message_Messenger)&
98 operator << (const Handle(Message_Messenger)& theMessenger,
99 const Handle(TCollection_HExtendedString)& theStr)
100{
101 theMessenger->Send (theStr->String(), Message_Info, Standard_False);
102 return theMessenger;
103}
104
105// Integer
106inline const Handle(Message_Messenger)&
107 operator << (const Handle(Message_Messenger)& theMessenger,
108 const Standard_Integer theVal)
109{
110 TCollection_AsciiString aStr (theVal);
111 theMessenger->Send (aStr, Message_Info, Standard_False);
112 return theMessenger;
113}
114
115// Real
116inline const Handle(Message_Messenger)&
117 operator << (const Handle(Message_Messenger)& theMessenger,
118 const Standard_Real theVal)
119{
120 TCollection_AsciiString aStr (theVal);
121 theMessenger->Send (aStr, Message_Info, Standard_False);
122 return theMessenger;
123}
124
125// Stream
126inline const Handle(Message_Messenger)&
127 operator << (const Handle(Message_Messenger)& theMessenger,
128 const Standard_SStream& theStream)
129{
130#ifdef USE_STL_STREAM
131 theMessenger->Send (theStream.str().c_str(), Message_Info, Standard_False);
132#else
133 // Note: use dirty tricks -- unavoidable with old streams
134 TCollection_AsciiString aStr (((Standard_SStream&)theStream).str(), theStream.pcount());
135 theMessenger->Send (aStr, Message_Info, Standard_False);
136 ((Standard_SStream&)theStream).freeze (false);
137#endif
138 return theMessenger;
139}
140
141// manipulators
142inline const Handle(Message_Messenger)&
143 operator << (const Handle(Message_Messenger)& theMessenger,
144 const Handle(Message_Messenger)& (*pman) (const Handle(Message_Messenger)&))
145{
146 return pman (theMessenger);
147}
148
149// endl
150inline const Handle(Message_Messenger)& endl (const Handle(Message_Messenger)& theMessenger)
151{
152 theMessenger->Send ("", Message_Info, Standard_True);
153 return theMessenger;
154}