libfilezilla
process.hpp
Go to the documentation of this file.
00001 #ifndef LIBFILEZILLA_PROCESS_HEADER
00002 #define LIBFILEZILLA_PROCESS_HEADER
00003 
00004 #include "libfilezilla.hpp"
00005 
00010 #include <vector>
00011 
00012 namespace fz {
00013 
00021 class FZ_PUBLIC_SYMBOL process final
00022 {
00023 public:
00024     process();
00025     ~process();
00026 
00027     process(process const&) = delete;
00028     process& operator=(process const&) = delete;
00029 
00041     bool spawn(native_string const& cmd, std::vector<native_string> const& args = std::vector<native_string>());
00042 
00049     void kill();
00050 
00059     int read(char* buffer, unsigned int len);
00060 
00068     bool write(char const* buffer, unsigned int len);
00069 
00070     inline bool write(std::string const& s) {
00071         return write(s.c_str(), static_cast<unsigned int>(s.size()));
00072     }
00073 
00074 private:
00075     class impl;
00076     impl* impl_;
00077 };
00078 
00079 }
00080 
00081 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines