1
// Copyright (c) 1994, 1997 James Clark
2
// See the file COPYING for copying permission.
4
#ifndef MessageFormatter_INCLUDED
5
#define MessageFormatter_INCLUDED 1
12
#include "MessageBuilder.h"
17
#include "OutputCharStream.h"
20
namespace SP_NAMESPACE {
23
class SP_API MessageFormatter {
26
void formatMessage(const MessageFragment &,
27
const Vector<CopyOwner<MessageArg> > &args,
29
void formatOpenElements(const Vector<OpenElementInfo> &openElementInfo,
30
OutputCharStream &os);
31
virtual Boolean getMessageText(const MessageFragment &, StringC &) = 0;
32
Boolean formatFragment(const MessageFragment &, OutputCharStream &);
34
MessageFormatter(const MessageFormatter &); // undefined
35
void operator=(const MessageFormatter &); // undefined
37
class Builder : public MessageBuilder {
39
Builder(MessageFormatter *formatter, OutputCharStream &os, bool b)
40
: formatter_(formatter), os_(&os), argIsCompleteMessage_(b) { }
41
void appendNumber(unsigned long);
42
void appendOrdinal(unsigned long);
43
void appendChars(const Char *, size_t);
44
void appendOther(const OtherMessageArg *);
45
void appendFragment(const MessageFragment &);
47
OutputCharStream &os() { return *os_; }
48
OutputCharStream *os_;
49
MessageFormatter *formatter_;
50
bool argIsCompleteMessage_;
58
#endif /* not MessageFormatter_INCLUDED */