PluginScript.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_PLUGINSCRIPT_H
00013 #define ZYPP_PLUGINSCRIPT_H
00014 
00015 #include <iosfwd>
00016 #include <string>
00017 #include <vector>
00018 
00019 #include "zypp/base/PtrTypes.h"
00020 #include "zypp/Pathname.h"
00021 
00022 #include "zypp/PluginFrame.h"
00023 #include "zypp/PluginScriptException.h"
00024 
00026 namespace zypp
00027 { 
00028 
00062   class PluginScript
00063   {
00064     friend std::ostream & operator<<( std::ostream & str, const PluginScript & obj );
00065 
00066     public:
00068       typedef std::vector<std::string> Arguments;
00069 
00071       static const pid_t NotConnected;
00072 
00073     public:
00075       PluginScript();
00076 
00078       PluginScript( const Pathname & script_r );
00079 
00081       PluginScript( const Pathname & script_r, const Arguments & args_r );
00082 
00083     public:
00085       const Pathname & script() const;
00086 
00088       const Arguments & args() const;
00089 
00091       bool isOpen() const;
00092 
00094       pid_t getPid() const;
00095 
00097       int lastReturn() const;
00098 
00102       const std::string & lastExecError() const;
00103 
00104     public:
00110       void open();
00111 
00113       void open( const Pathname & script_r );
00114 
00116       void open( const Pathname & script_r, const Arguments & args_r );
00117 
00119       int close();
00120 
00121     public:
00129       void send( const PluginFrame & frame_r ) const;
00130 
00137       PluginFrame receive() const;
00138 
00139     public:
00141       class Impl;
00142     private:
00144       RW_pointer<Impl> _pimpl;
00145   };
00146 
00148   std::ostream & operator<<( std::ostream & str, const PluginScript & obj );
00149 
00151 } // namespace zypp
00153 #endif // ZYPP_PLUGINSCRIPT_H

doxygen