author | František Kučera <franta-hg@frantovo.cz> |
Thu, 29 Nov 2018 22:30:11 +0100 | |
branch | v_0 |
changeset 6 | 114521cca04a |
parent 3 | 88e1bb50d00c |
child 12 | dca712844ba9 |
permissions | -rw-r--r-- |
6 | 1 |
/** |
2 |
* Relational pipes |
|
3 |
* Copyright © 2018 František Kučera (Frantovo.cz, GlobalCode.info) |
|
4 |
* |
|
5 |
* This program is free software: you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation, either version 3 of the License, or |
|
8 |
* (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
3
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
18 |
#pragma once |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
19 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
20 |
#include <string> |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
21 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
22 |
#include <relpipe/cli/CLI.h> |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
23 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
24 |
using namespace std; |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
25 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
26 |
namespace relpipe { |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
27 |
namespace cli { |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
28 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
29 |
/** |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
30 |
* TODO: move to relpipe-lib-cli (a common header-only library) |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
31 |
*/ |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
32 |
class RelpipeCLIException { |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
33 |
private: |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
34 |
wstring message; |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
35 |
int exitCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
36 |
public: |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
37 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
38 |
RelpipeCLIException(wstring message, int exitCode) : |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
39 |
message(message), exitCode(exitCode) { |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
40 |
} |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
41 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
42 |
wstring getMessge() { |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
43 |
return message; |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
44 |
} |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
45 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
46 |
int getExitCode() { |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
47 |
return exitCode; |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
48 |
} |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
49 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
50 |
}; |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
51 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
52 |
} |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
53 |
} |