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 #ifndef ATLAS_FORMATTER_H 00006 #define ATLAS_FORMATTER_H 00007 00008 #include <Atlas/Bridge.h> 00009 00010 namespace Atlas { 00011 00021 class Formatter : public Bridge 00022 { 00023 public: 00024 00025 Formatter(std::iostream & s, Atlas::Bridge & b); 00026 00027 virtual void streamBegin(); 00028 virtual void streamMessage(); 00029 virtual void streamEnd(); 00030 00031 virtual void mapMapItem(const std::string& name); 00032 virtual void mapListItem(const std::string& name); 00033 virtual void mapIntItem(const std::string& name, long); 00034 virtual void mapFloatItem(const std::string& name, double); 00035 virtual void mapStringItem(const std::string& name, const std::string&); 00036 virtual void mapEnd(); 00037 00038 virtual void listMapItem(); 00039 virtual void listListItem(); 00040 virtual void listIntItem(long); 00041 virtual void listFloatItem(double); 00042 virtual void listStringItem(const std::string&); 00043 virtual void listEnd(); 00044 00045 void setSpacing(int s) { 00046 m_spacing = s; 00047 } 00048 00049 protected: 00050 00051 std::iostream & m_stream; 00052 Bridge & m_bridge; 00053 int m_indent; 00054 int m_spacing; 00055 }; 00056 00057 } // Atlas namespace 00058 00059 #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.