00001 #if !defined(__MCSTRINGSTREAM_H_) 00002 #define __MCSTRINGSTREAM_H_ 00003 00004 #ident "@(#)$Id: MCStringStream.h,v 1.7 2004/12/02 07:05:20 mike Exp $" 00005 00006 /* 00007 * Copyright Miba Consulting Ltd. (c) 2000-2003 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Lesser General Public 00011 * License as published by the Free Software Foundation; either 00012 * version 2.1 of the License, or (at your option) any later version. 00013 * 00014 * This library is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * Lesser General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public 00020 * License along with this library; if not, write to the Free Software 00021 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 * 00023 */ 00024 00025 #include "mcllib/MCTypes.h" 00026 #include "mcllib/MCBase.h" 00027 #include "mcllib/MCString.h" 00028 00029 namespace mcllib 00030 { 00031 class MCMsg; 00032 class MCSrcMsg; 00033 00043 class MCStringStream : public MCBase 00044 { 00045 public: 00047 MCStringStream(); 00049 ~MCStringStream(); 00051 operator MCString() const; 00053 MCString getString() const; 00054 00055 // Declare operator for the standard types 00057 MCStringStream& operator<<(const char* d); 00059 MCStringStream& operator<<(const MCString& d); 00061 MCStringStream& operator<<(const MCMsg& d); 00063 MCStringStream& operator<<(const MCSrcMsg& d); 00065 MCStringStream& operator<<(char d); 00067 MCStringStream& operator<<(mcint8 d); 00069 MCStringStream& operator<<(mcuint8 d); 00071 MCStringStream& operator<<(mcint16 d); 00073 MCStringStream& operator<<(mcuint16 d); 00075 MCStringStream& operator<<(mcint32 d); 00077 MCStringStream& operator<<(mcuint32 d); 00079 MCStringStream& operator<<(const mcint64& d); 00081 MCStringStream& operator<<(const mcuint64& d); 00083 MCStringStream& operator<<(mcfloat32 d); 00085 MCStringStream& operator<<(const mcfloat64& d); 00086 00087 // Get from stream 00089 MCStringStream& operator>>(MCString& d); 00091 MCStringStream& operator>>(mcint8& d); 00093 MCStringStream& operator>>(mcuint8& d); 00095 MCStringStream& operator>>(mcint16& d); 00097 MCStringStream& operator>>(mcuint16& d); 00099 MCStringStream& operator>>(mcint32& d); 00101 MCStringStream& operator>>(mcuint32& d); 00103 MCStringStream& operator>>(mcuint64& d); 00105 MCStringStream& operator>>(mcint64& d); 00107 MCStringStream& operator>>(mcfloat32& d); 00109 MCStringStream& operator>>(mcfloat64& d); 00110 private: 00111 }; 00112 00113 }; 00114 00115 #endif