author | František Kučera <franta-hg@frantovo.cz> |
Sat, 24 Oct 2020 00:08:17 +0200 | |
branch | v_0 |
changeset 25 | 5802f79da18f |
parent 20 | 45d60cf711e1 |
child 26 | b3a3a241337a |
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 |
|
20
45d60cf711e1
fix license version: GNU GPLv3
František Kučera <franta-hg@frantovo.cz>
parents:
12
diff
changeset
|
7 |
* the Free Software Foundation, version 3 of the License. |
6 | 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 |
*/ |
|
3
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
17 |
#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
|
18 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
19 |
#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
|
20 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
21 |
#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
|
22 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
23 |
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
|
24 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
25 |
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
|
26 |
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
|
27 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
28 |
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
|
29 |
private: |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
30 |
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
|
31 |
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
|
32 |
public: |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
33 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
34 |
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
|
35 |
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
|
36 |
} |
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 |
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
|
39 |
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
|
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 |
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
|
43 |
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
|
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 |
}; |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
47 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
48 |
} |
12 | 49 |
} |