author | František Kučera <franta-hg@frantovo.cz> |
Mon, 13 Aug 2018 20:31:09 +0200 | |
branch | v_0 |
changeset 20 | a18b6964d300 |
parent 19 | 22f493401ac0 |
permissions | -rw-r--r-- |
14
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
1 |
#pragma once |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
2 |
|
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
3 |
#include <string> |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
4 |
|
19
22f493401ac0
move CLI.h to a common header-only library
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
5 |
#include <relpipe/cli/CLI.h> |
14
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
6 |
|
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
7 |
using namespace std; |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
8 |
|
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
9 |
namespace relpipe { |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
10 |
namespace cli { |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
11 |
|
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
12 |
/** |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
13 |
* TODO: move to relpipe-lib-cli (a common header-only library) |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
14 |
*/ |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
15 |
class RelpipeCLIException { |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
16 |
private: |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
17 |
wstring message; |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
18 |
int exitCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
19 |
public: |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
20 |
|
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
21 |
RelpipeCLIException(wstring message, int exitCode) : |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
22 |
message(message), exitCode(exitCode) { |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
23 |
} |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
24 |
|
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
25 |
wstring getMessge() { |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
26 |
return message; |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
27 |
} |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
28 |
|
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
29 |
int getExitCode() { |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
30 |
return exitCode; |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
31 |
} |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
32 |
|
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
33 |
}; |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
34 |
|
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
35 |
} |
cfed80d11caa
introduce and use RelpipeCLIException
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
36 |
} |