CARDS 2.4.87
Package manager for the NuTyX GNU/Linux distribution
process.h
1 //
2 // process.h
3 //
4 // AUTHORS: Johannes Winkelmann, jw@tks6.net
5 // Output redirection by Logan Ingalls, log@plutor.org
6 // Copyright (c) 2013-2017 by NuTyX team (http://nutyx.org)
7 //
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
21 // USA.
22 //
23 
24 #ifndef PROCESS_H
25 #define PROCESS_H
26 
27 #include "string_utils.h"
28 
29 #include <list>
30 #include <cassert>
31 #include <cstddef>
32 #include <cstdlib>
33 #include <cstdio>
34 
35 #include <unistd.h>
36 #include <fcntl.h>
37 #include <sys/types.h>
38 #include <sys/wait.h>
39 
40 
49 class process
50 {
51 public:
52  process();
53  process( const std::string& app, const std::string& args, int fileDescriptorLog=0 );
54 
55  void execute(const std::string& app, const std::string& arguments, int fileDescriptorLog=0 );
56 
61  int execute();
62 
67  int executeShell();
68 
72  std::string name();
73 
77  std::string args();
78 
79 private:
80 
81  int exec(const int argc, char** argv);
82  int execLog(const int argc, char** argv);
83 
84  int execShell(const char* shell);
85  int execShellLog(const char* shell);
86 
87  std::string m_application;
88  std::string m_arguments;
89  int m_fileDescriptorLog;
90 };
91 
92 #endif /* _PROCESS_H_ */
93 // vim:set ts=2 :
std::string args()
Definition: process.cxx:55
int execute()
Definition: process.cxx:59
int executeShell()
Definition: process.cxx:175
Definition: libcards.h:1310
std::string name()
Definition: process.cxx:51