• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ibrcommon/ibrcommon/appstreambuf.h

Go to the documentation of this file.
00001 /*
00002  * appstreambuf.h
00003  *
00004  *  Created on: 20.11.2009
00005  *      Author: morgenro
00006  */
00007 
00008 #ifndef IBRCOMMON_APPSTREAMBUF_H_
00009 #define IBRCOMMON_APPSTREAMBUF_H_
00010 
00011 #include <streambuf>
00012 #include <vector>
00013 #include <string>
00014 #include <stdio.h>
00015 
00016 namespace ibrcommon
00017 {
00029         class appstreambuf : public std::streambuf
00030         {
00031         public:
00032                 enum { BUF_SIZE = 512 };
00033 
00034                 enum Mode
00035                 {
00036                         MODE_READ = 0,
00037                         MODE_WRITE = 1
00038                 };
00039 
00045                 appstreambuf(std::string command, appstreambuf::Mode mode);
00046                 virtual ~appstreambuf();
00047 
00048         protected:
00049                 virtual int underflow();
00050                 virtual int sync();
00051                 virtual std::char_traits<char>::int_type overflow( std::char_traits<char>::int_type m = traits_type::eof() );
00052 
00053         private:
00054                 std::vector< char_type > m_buf;
00055                 FILE *_handle;
00056         };
00057 }
00058 
00059 #endif /* APPSTREAMBUF_H_ */

Generated on Wed Mar 30 2011 11:11:49 for IBR-DTNSuite by  doxygen 1.7.1