LibCT 2.0

Include/OutputStream.h

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