author | František Kučera <franta-hg@frantovo.cz> |
Mon, 13 Aug 2018 20:38:41 +0200 | |
branch | v_0 |
changeset 3 | 88e1bb50d00c |
child 6 | 114521cca04a |
permissions | -rw-r--r-- |
3
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
1 |
#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
|
2 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
3 |
#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
|
4 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
5 |
#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
|
6 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
7 |
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
|
8 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
9 |
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
|
10 |
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
|
11 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
12 |
/** |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
13 |
* 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
|
14 |
*/ |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
15 |
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
|
16 |
private: |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
17 |
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
|
18 |
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
|
19 |
public: |
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 |
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
|
22 |
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
|
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 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
25 |
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
|
26 |
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
|
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 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
29 |
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
|
30 |
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
|
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 |
|
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 |
|
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
35 |
} |
88e1bb50d00c
move RelpipeCLIException.h from relpipe-in-cli to relpipe-lib-cli
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
36 |
} |