cadMousePro-daemon/src/CLIException.h
author František Kučera <franta-hg@frantovo.cz>
Mon, 19 Aug 2019 17:27:19 +0200
branchv_0
changeset 8 465572518625
parent 7 src/CLIException.h@148f8dd077e8
child 12 cf77c218b0b1
permissions -rw-r--r--
move sources to a sub-project folder
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
/**
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
 * cadMousePro
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
 * Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
 *
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
 * This program is free software: you can redistribute it and/or modify
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
 * the Free Software Foundation, either version 3 of the License, or
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
 * (at your option) any later version.
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
 *
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
 * GNU General Public License for more details.
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
 *
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
 */
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
#pragma once
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
#include <string>
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
#include "CLI.h"
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
class CLIException {
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
private:
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
	std::wstring message;
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
	int exitCode = CLI::EXIT_CODE_UNEXPECTED_ERROR;
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
public:
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
	CLIException(std::wstring message, int exitCode) : message(message), exitCode(exitCode) {
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
	}
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
	
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
	std::wstring getMessge() const {
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
		return message;
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
	}
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
	int getExitCode() const {
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
		return exitCode;
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
	}
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
148f8dd077e8 CLI options and parser of configuration parameters instead of hardcoded values
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
};