Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

istreambase.hpp

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 __i_stream_base_hpp
00021 #define __i_stream_base_hpp
00022 
00023 #include <string>
00024 #include <map>
00025 #include <list>
00026 #include <vector>
00027 
00028 #include <stdexcept>
00029 
00030 #include <mynahsa/exceptionbase.hpp>
00031 
00032 namespace MynahSA { 
00035   class IStreamReadError : public ExceptionBase { 
00036   public:
00042     IStreamReadError(const std::string& c);
00047     ~IStreamReadError() throw();
00048   };
00049   
00050   
00055   class IStreamEOF {
00056   public:
00058     IStreamEOF();
00059   
00061     ~IStreamEOF();
00062   };
00063   
00064   
00065   
00071   class IStreamBase { 
00072   public:
00073   
00075     IStreamBase();
00076     
00078     virtual ~IStreamBase();
00079     
00081     virtual IStreamBase& operator>>(char&) = 0;
00082     
00084     virtual IStreamBase& operator>>(unsigned char&) = 0;
00085     
00087     virtual IStreamBase& operator>>(short&) = 0;
00088     
00090     virtual IStreamBase& operator>>(unsigned short&) = 0;
00091     
00093     virtual IStreamBase& operator>>(bool&) = 0;
00094     
00096     virtual IStreamBase& operator>>(int&) = 0;
00097     
00099     virtual IStreamBase& operator>>(unsigned int&) = 0;
00100     
00102     virtual IStreamBase& operator>>(long long&) = 0;
00103     
00105     virtual IStreamBase& operator>>(unsigned long long&) = 0;
00106     
00108     virtual IStreamBase& operator>>(double&) = 0;
00109     
00111     virtual IStreamBase& operator>>(float&) = 0;
00112     
00114     virtual IStreamBase& operator>>(std::string& s);
00115     
00116     
00118     virtual void get(char& c) = 0;
00119   
00120   };
00121 };
00122 
00123 
00124 
00125 
00126 #endif