Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef SG_PROCESS_H
00006 #define SG_PROCESS_H
00007
00008
00009 #ifndef WIN32
00010
00011 #include <ext/stdio_filebuf.h>
00012 #include <iosfwd>
00013 #include <memory>
00014
00015
00016
00017
00018
00019
00020
00021
00022 class SgProcess
00023 {
00024 public:
00025
00026
00027 SgProcess(const std::string& command);
00028
00029 ~SgProcess();
00030
00031 std::istream& Input();
00032
00033 std::ostream& Output();
00034
00035 private:
00036 std::auto_ptr<__gnu_cxx::stdio_filebuf<char> > m_bufIn;
00037
00038 std::auto_ptr<__gnu_cxx::stdio_filebuf<char> > m_bufOut;
00039
00040 std::auto_ptr<std::istream> m_in;
00041
00042 std::auto_ptr<std::ostream> m_out;
00043 };
00044
00045 inline std::istream& SgProcess::Input()
00046 {
00047 return *m_in;
00048 }
00049
00050 inline std::ostream& SgProcess::Output()
00051 {
00052 return *m_out;
00053 }
00054
00055
00056
00057 #endif // ifndef WIN32
00058
00059 #endif // SG_PROCESS_H