- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

gexecutable.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_EXE_H
22 #define G_EXE_H
23
24 #include "gdef.h"
25 #include "gpath.h"
26 #include "gstrings.h"
27 #include <string>
28
30 namespace G
31 {
32 class Executable ;
33 }
34
43 class G::Executable
44 {
45 public:
46 explicit Executable( const std::string & command_line = std::string() ) ;
50
51 Path exe() const ;
53
54 Strings args() const ;
56
57 std::string displayString() const ;
59
60 private:
61 bool osNativelyRunnable() const ;
62 void osAddWrapper() ;
63
64 private:
65 G::Path m_exe ;
66 G::Strings m_args ;
67 } ;
68
69 #endif
70
gstrings.h
G::Strings
std::list< std::string > Strings
A std::list of std::strings.
Definition: gstrings.h:39
G::Executable
A structure representing an external program, holding a path and a set of arguments.
Definition: gexecutable.h:43
G::Executable::args
Strings args() const
Returns the command-line arguments.
Definition: gexecutable.cpp:67
G
Low-level classes.
gpath.h
G::Executable::Executable
Executable(const std::string &command_line=std::string())
Constructor taking a complete command-line.
Definition: gexecutable.cpp:25
G::Executable::displayString
std::string displayString() const
Returns a printable representation for logging and diagnostics.
Definition: gexecutable.cpp:72
G::Path
A Path object represents a file system path.
Definition: gpath.h:44
G::Executable::exe
Path exe() const
Returns the executable.
Definition: gexecutable.cpp:62