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
Atlas::Formatter::mapEnd
virtual void mapEnd()
Ends the currently streamed map.
Atlas::Formatter::mapMapItem
virtual void mapMapItem(const std::string &name)
Starts a map object to the currently streamed map.
Atlas::Bridge
Atlas stream bridge.
Definition: Bridge.h:36
Atlas::Formatter::mapFloatItem
virtual void mapFloatItem(const std::string &name, double)
Adds a float to the currently streamed map.
Atlas::Formatter::streamMessage
virtual void streamMessage()
Start a message in an Atlas stream.
Atlas::Formatter::streamBegin
virtual void streamBegin()
Begin an Atlas stream.
Atlas::Formatter::listEnd
virtual void listEnd()
Ends the currently streamed list.
Atlas::Formatter::mapListItem
virtual void mapListItem(const std::string &name)
Starts a list object to the currently streamed map.
Atlas::Formatter::listIntItem
virtual void listIntItem(long)
Adds an integer to the currently streames list.
Atlas::Formatter::listStringItem
virtual void listStringItem(const std::string &)
Adds a string to the currently streamed list.
Atlas::Formatter::listListItem
virtual void listListItem()
Starts a list object in the currently streamed list.
Atlas::Formatter::mapIntItem
virtual void mapIntItem(const std::string &name, long)
Adds an integer to the currently streames map.
Atlas::Formatter::mapStringItem
virtual void mapStringItem(const std::string &name, const std::string &)
Adds a string to the currently streamed map.
Atlas::Formatter::streamEnd
virtual void streamEnd()
Ends the Atlas stream.
Atlas::Formatter::listFloatItem
virtual void listFloatItem(double)
Adds a float to the currently streamed list.
Atlas::Formatter
Atlas stream formatter.
Definition: Formatter.h:24
Atlas
The Atlas namespace.
Definition: Bridge.h:20
Atlas::Formatter::listMapItem
virtual void listMapItem()
Starts a map object in the currently streamed list.

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.