2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: MessageReporter.h /main/1 1996/07/29 16:57:36 cde-hp $ */
24 // Copyright (c) 1994 James Clark
25 // See the file COPYING for copying permission.
27 #ifndef MessageReporter_INCLUDED
28 #define MessageReporter_INCLUDED 1
35 #include "MessageBuilder.h"
37 #include "OutputCharStream.h"
43 namespace SP_NAMESPACE {
46 class SP_API MessageReporter : private MessageBuilder, public Messenger {
53 // The OutputCharStream will be deleted by the MessageReporter
54 MessageReporter(OutputCharStream *);
56 void setMessageStream(OutputCharStream *);
57 OutputCharStream *releaseMessageStream();
58 void dispatchMessage(const Message &);
59 void dispatchMessage(Message &);
60 virtual Boolean getMessageText(const MessageFragment &, StringC &);
61 void addOption(Option);
62 void setProgramName(const StringC &);
63 void formatMessage(const MessageFragment &,
64 const Vector<CopyOwner<MessageArg> > &args);
66 MessageReporter(const MessageReporter &); // undefined
67 void operator=(const MessageReporter &); // undefined
69 void appendNumber(unsigned long);
70 void appendOrdinal(unsigned long);
71 void appendChars(const Char *, size_t);
72 void appendOther(const OtherMessageArg *);
73 void appendFragment(const MessageFragment &);
74 const ExternalInfo *locationHeader(const Location &loc, Offset &off);
75 void printLocation(const ExternalInfo *info, Offset off);
76 OutputCharStream &os();
78 OutputCharStream *os_;
84 OutputCharStream &MessageReporter::os()
90 void MessageReporter::setProgramName(const StringC &programName)
92 programName_ = programName;
96 OutputCharStream *MessageReporter::releaseMessageStream()
98 OutputCharStream *tem = os_;
107 #endif /* not MessageReporter_INCLUDED */