~ubuntu-branches/ubuntu/trusty/openjade1.3/trusty

« back to all changes in this revision

Viewing changes to include/MessageFormatter.h

  • Committer: Bazaar Package Importer
  • Author(s): Yann Dirson
  • Date: 2002-04-09 00:01:50 UTC
  • Revision ID: james.westby@ubuntu.com-20020409000150-r9rkyalxlhvf9ba3
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) 1994, 1997 James Clark
 
2
// See the file COPYING for copying permission.
 
3
 
 
4
#ifndef MessageFormatter_INCLUDED
 
5
#define MessageFormatter_INCLUDED 1
 
6
 
 
7
#ifdef __GNUG__
 
8
#pragma interface
 
9
#endif
 
10
 
 
11
#include "types.h"
 
12
#include "MessageBuilder.h"
 
13
#include "Boolean.h"
 
14
#include "Message.h"
 
15
#include "Location.h"
 
16
#include "StringC.h"
 
17
#include "OutputCharStream.h"
 
18
 
 
19
#ifdef SP_NAMESPACE
 
20
namespace SP_NAMESPACE {
 
21
#endif
 
22
 
 
23
class SP_API MessageFormatter {
 
24
public:
 
25
  MessageFormatter();
 
26
  void formatMessage(const MessageFragment &,
 
27
                     const Vector<CopyOwner<MessageArg> > &args,
 
28
                     OutputCharStream &);
 
29
  void formatOpenElements(const Vector<OpenElementInfo> &openElementInfo,
 
30
                          OutputCharStream &os);
 
31
  virtual Boolean getMessageText(const MessageFragment &, StringC &) = 0;
 
32
  Boolean formatFragment(const MessageFragment &, OutputCharStream &);
 
33
private:
 
34
  MessageFormatter(const MessageFormatter &); // undefined
 
35
  void operator=(const MessageFormatter &);  // undefined
 
36
 
 
37
  class Builder : public MessageBuilder {
 
38
  public:
 
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 &);
 
46
  private:
 
47
    OutputCharStream &os() { return *os_; }
 
48
    OutputCharStream *os_;
 
49
    MessageFormatter *formatter_;
 
50
    bool argIsCompleteMessage_;
 
51
  };
 
52
};
 
53
 
 
54
#ifdef SP_NAMESPACE
 
55
}
 
56
#endif
 
57
 
 
58
#endif /* not MessageFormatter_INCLUDED */