- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

gexecutableprocessor.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2001-2013 Graeme Walker <graeme_walker@users.sourceforge.net>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 // ===
20
21 #ifndef G_SMTP_EXECUTABLE_PROCESSOR_H
22 #define G_SMTP_EXECUTABLE_PROCESSOR_H
23
24 #include "gdef.h"
25 #include "gsmtp.h"
26 #include "gexecutable.h"
27 #include "gprocessor.h"
28
30 namespace GSmtp
31 {
32 class ExecutableProcessor ;
33 }
34
39 class GSmtp::ExecutableProcessor : public GSmtp::Processor
40 {
41 public:
42 explicit ExecutableProcessor( const G::Executable & ) ;
44
45 virtual ~ExecutableProcessor() ;
47
48 virtual G::Signal1<bool> & doneSignal() ;
50
51 virtual void start( const std::string & path ) ;
53
54 virtual void abort() ;
56
57 virtual std::string text() const ;
61
62 virtual bool cancelled() const ;
64
65 virtual bool repoll() const ;
67
68 private:
69 ExecutableProcessor( const ExecutableProcessor & ) ; // not implemented
70 void operator=( const ExecutableProcessor & ) ; // not implemented
71 int preprocessCore( const G::Path & ) ;
72 std::string parseOutput( std::string ) const ;
73 bool process( const std::string & path ) ;
74 static std::string execErrorHandler( int error ) ;
75
76 private:
77 G::Signal1<bool> m_done_signal ;
78 G::Executable m_exe ;
79 std::string m_text ;
80 bool m_ok ;
81 bool m_cancelled ;
82 bool m_repoll ;
83 } ;
84
85 #endif
GSmtp::ExecutableProcessor::ExecutableProcessor
ExecutableProcessor(const G::Executable &)
Constructor.
Definition: gexecutableprocessor.cpp:30
GSmtp::ExecutableProcessor::start
virtual void start(const std::string &path)
Final override from from GSmtp::Processor.
Definition: gexecutableprocessor.cpp:153
GSmtp
SMTP and message-store classes.
GSmtp::Processor
An interface for processing message files.
Definition: gprocessor.h:51
G::Executable
A structure representing an external program, holding a path and a set of arguments.
Definition: gexecutable.h:43
G::Signal1< bool >
gexecutable.h
GSmtp::ExecutableProcessor::text
virtual std::string text() const
Final override from from GSmtp::Processor.
Definition: gexecutableprocessor.cpp:52
GSmtp::ExecutableProcessor::abort
virtual void abort()
Final override from from GSmtp::Processor.
Definition: gexecutableprocessor.cpp:148
GSmtp::ExecutableProcessor::~ExecutableProcessor
virtual ~ExecutableProcessor()
Destructor.
Definition: gexecutableprocessor.cpp:38
GSmtp::ExecutableProcessor
A Processor class that processes message files using an external preprocessor program.
Definition: gexecutableprocessor.h:39
GSmtp::ExecutableProcessor::cancelled
virtual bool cancelled() const
Final override from from GSmtp::Processor.
Definition: gexecutableprocessor.cpp:42
gprocessor.h
gsmtp.h
GSmtp::ExecutableProcessor::doneSignal
virtual G::Signal1< bool > & doneSignal()
Final override from from GSmtp::Processor.
Definition: gexecutableprocessor.cpp:143
GSmtp::ExecutableProcessor::repoll
virtual bool repoll() const
Final override from from GSmtp::Processor.
Definition: gexecutableprocessor.cpp:47
G::Path
A Path object represents a file system path.
Definition: gpath.h:44