00001 /************************************************************************************ 00002 * This file is part of the MynahSA streaming and archiving toolkit * 00003 * Copyright (C) 2006 Mynah-Software Ltd. All Rights Reserved. * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License, version 2 * 00007 * as published by the Free Software Foundation. * 00008 * * 00009 * This program is distributed in the hope that it will be useful, * 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00012 * GNU General Public License for more details. * 00013 * * 00014 * You should have received a copy of the GNU General Public License along * 00015 * with this program; if not, write to the Free Software Foundation, Inc., * 00016 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 00017 * * 00018 ************************************************************************************/ 00019 00020 #ifndef __o_binary_stream_hpp 00021 #define __o_binary_stream_hpp 00022 00023 #include <iostream> 00024 00025 #include "ostreambase.hpp" 00026 00027 namespace MynahSA { 00030 class OBinaryStream : public OStreamBase { 00031 public: 00033 OBinaryStream(std::ostream& os); 00034 00036 OBinaryStream(const OBinaryStream& os); 00037 00039 virtual ~OBinaryStream(); 00040 00042 virtual OStreamBase& operator<<(const char); 00043 00045 virtual OStreamBase& operator<<(const unsigned char); 00046 00048 virtual OStreamBase& operator<<(const short); 00049 00051 virtual OStreamBase& operator<<(const unsigned short); 00052 00054 virtual OStreamBase& operator<<(const bool); 00055 00057 virtual OStreamBase& operator<<(const int); 00058 00060 virtual OStreamBase& operator<<(const unsigned int); 00061 00063 virtual OStreamBase& operator<<(const long long); 00064 00066 virtual OStreamBase& operator<<(const unsigned long long); 00067 00069 virtual OStreamBase& operator<<(const double); 00070 00072 virtual OStreamBase& operator<<(const float); 00073 00074 // using statement is required to allow base class methods to be used 00075 using OStreamBase::operator<<; 00076 00077 private: 00079 std::ostream& _os; 00080 00081 }; 00082 00083 }; 00084 00085 #endif