1 | /* Copyright © 2005-2007 Roger Leigh <rleigh@debian.org> |
---|
2 | * |
---|
3 | * schroot is free software: you can redistribute it and/or modify it |
---|
4 | * under the terms of the GNU General Public License as published by |
---|
5 | * the Free Software Foundation, either version 3 of the License, or |
---|
6 | * (at your option) any later version. |
---|
7 | * |
---|
8 | * schroot is distributed in the hope that it will be useful, but |
---|
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
11 | * General Public License for more details. |
---|
12 | * |
---|
13 | * You should have received a copy of the GNU General Public License |
---|
14 | * along with this program. If not, see |
---|
15 | * <http://www.gnu.org/licenses/>. |
---|
16 | * |
---|
17 | *********************************************************************/ |
---|
18 | |
---|
19 | #ifndef SCHROOT_LISTMOUNTS_MAIN_H |
---|
20 | #define SCHROOT_LISTMOUNTS_MAIN_H |
---|
21 | |
---|
22 | #include <schroot-base/schroot-base-main.h> |
---|
23 | |
---|
24 | #include <schroot-listmounts/schroot-listmounts-options.h> |
---|
25 | |
---|
26 | #include <sbuild/sbuild-custom-error.h> |
---|
27 | |
---|
28 | namespace schroot_listmounts |
---|
29 | { |
---|
30 | |
---|
31 | /** |
---|
32 | * Frontend for schroot. This class is used to "run" schroot. |
---|
33 | */ |
---|
34 | class main : public schroot_base::main |
---|
35 | { |
---|
36 | public: |
---|
37 | /// Error codes. |
---|
38 | enum error_code |
---|
39 | { |
---|
40 | FIND ///< Failed to find file. |
---|
41 | }; |
---|
42 | |
---|
43 | /// Exception type. |
---|
44 | typedef sbuild::custom_error<error_code> error; |
---|
45 | |
---|
46 | /** |
---|
47 | * The constructor. |
---|
48 | * |
---|
49 | * @param options the command-line options to use. |
---|
50 | */ |
---|
51 | main (options::ptr& options); |
---|
52 | |
---|
53 | /// The destructor. |
---|
54 | virtual ~main (); |
---|
55 | |
---|
56 | private: |
---|
57 | /** |
---|
58 | * List mounts. |
---|
59 | */ |
---|
60 | virtual void |
---|
61 | action_listmounts (); |
---|
62 | |
---|
63 | protected: |
---|
64 | /** |
---|
65 | * Run the program. |
---|
66 | * |
---|
67 | * @returns 0 on success, 1 on failure or the exit status of the |
---|
68 | * chroot command. |
---|
69 | */ |
---|
70 | virtual int |
---|
71 | run_impl (); |
---|
72 | |
---|
73 | private: |
---|
74 | /// The program options. |
---|
75 | options::ptr opts; |
---|
76 | }; |
---|
77 | |
---|
78 | } |
---|
79 | |
---|
80 | #endif /* SCHROOT_LISTMOUNTS_MAIN_H */ |
---|
81 | |
---|
82 | /* |
---|
83 | * Local Variables: |
---|
84 | * mode:C++ |
---|
85 | * End: |
---|
86 | */ |
---|