Atlas-C++
Formatter.h
1 // This file may be redistributed and modified only under the terms of
2 // the GNU Lesser General Public License (See COPYING for details).
3 // Copyright (C) 2004 Alistair Riddoch
4 
5 // $Id$
6 
7 #ifndef ATLAS_FORMATTER_H
8 #define ATLAS_FORMATTER_H
9 
10 #include <Atlas/Bridge.h>
11 
12 namespace Atlas {
13 
23 class Formatter : public Bridge
24 {
25  public:
26 
27  Formatter(std::iostream & s, Atlas::Bridge & b);
28 
29  virtual void streamBegin();
30  virtual void streamMessage();
31  virtual void streamEnd();
32 
33  virtual void mapMapItem(const std::string& name);
34  virtual void mapListItem(const std::string& name);
35  virtual void mapIntItem(const std::string& name, long);
36  virtual void mapFloatItem(const std::string& name, double);
37  virtual void mapStringItem(const std::string& name, const std::string&);
38  virtual void mapEnd();
39 
40  virtual void listMapItem();
41  virtual void listListItem();
42  virtual void listIntItem(long);
43  virtual void listFloatItem(double);
44  virtual void listStringItem(const std::string&);
45  virtual void listEnd();
46 
47  void setSpacing(int s) {
48  m_spacing = s;
49  }
50 
51  protected:
52 
53  std::iostream & m_stream;
54  Bridge & m_bridge;
55  int m_indent;
56  int m_spacing;
57 };
58 
59 } // Atlas namespace
60 
61 #endif // ATLAS_FORMATTER_H

Copyright 2000-2004 the respective authors.

This document can be licensed under the terms of the GNU Free Documentation License or the GNU General Public License and may be freely distributed under the terms given by one of these licenses.