Atlas-C++
|
00001 // This file may be redistributed and modified only under the terms of 00002 // the GNU Lesser General Public License (See COPYING for details). 00003 // Copyright (C) 2004 Alistair Riddoch 00004 00005 // $Id$ 00006 00007 #ifndef ATLAS_FORMATTER_H 00008 #define ATLAS_FORMATTER_H 00009 00010 #include <Atlas/Bridge.h> 00011 00012 namespace Atlas { 00013 00023 class Formatter : public Bridge 00024 { 00025 public: 00026 00027 Formatter(std::iostream & s, Atlas::Bridge & b); 00028 00029 virtual void streamBegin(); 00030 virtual void streamMessage(); 00031 virtual void streamEnd(); 00032 00033 virtual void mapMapItem(const std::string& name); 00034 virtual void mapListItem(const std::string& name); 00035 virtual void mapIntItem(const std::string& name, long); 00036 virtual void mapFloatItem(const std::string& name, double); 00037 virtual void mapStringItem(const std::string& name, const std::string&); 00038 virtual void mapEnd(); 00039 00040 virtual void listMapItem(); 00041 virtual void listListItem(); 00042 virtual void listIntItem(long); 00043 virtual void listFloatItem(double); 00044 virtual void listStringItem(const std::string&); 00045 virtual void listEnd(); 00046 00047 void setSpacing(int s) { 00048 m_spacing = s; 00049 } 00050 00051 protected: 00052 00053 std::iostream & m_stream; 00054 Bridge & m_bridge; 00055 int m_indent; 00056 int m_spacing; 00057 }; 00058 00059 } // Atlas namespace 00060 00061 #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.