LibCT 2.0

Include/InputStream.h

Go to the documentation of this file.
00001 // ------------------------------------------------------------------
00012 #ifndef _LIBCT_INPUTSTREAM_H
00013 #define _LIBCT_INPUTSTREAM_H
00014 
00015 #include <string>
00016 
00017 namespace LibCT
00018 {
00020         class InputStream
00021         {
00022         public:
00024                 InputStream();
00025 
00027                 ~InputStream();
00028 
00031                 template<typename T>
00032                 size_t Read(
00033                         T& data         
00034                         )
00035                 {
00036                         return Read((void*)&data, sizeof(T));
00037                 }
00038 
00041                 size_t Read(
00042                         std::string& data       
00043                         );
00044 
00047                 size_t Read(
00048                         char* pString,  
00049                         size_t size             
00050                         );
00051 
00052         protected:
00055                 virtual size_t Read(
00056                         void* pData,    
00057                         size_t size             
00058                         ) = 0;
00059         };
00060 }
00061 
00062 #endif // _LIBCT_INPUTSTREAM_H