AnCH Framework 0.1
Another C++ Hack Framework
Loading...
Searching...
No Matches
confError.hpp
1/*
2 ANCH Framework: ANother C++ Hack is a C++ framework based on C++11 standard
3 Copyright (C) 2012 Vincent Lachenal
4
5 This file is part of ANCH Framework.
6
7 ANCH Framework is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 ANCH Framework is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with ANCH Framework. If not, see <http://www.gnu.org/licenses/>.
19*/
20#pragma once
21
22#include <exception>
23#include <string>
24
25namespace anch::conf {
26
27 /*!*
28 * Parse error exception
29 *
30 * \author Vincent Lachenal
31 *
32 * \since 0.1
33 */
34 class ConfError: public std::exception {
35
36 public:
37 /*!*
38 * \ref ConfError error code definition
39 *
40 * \author Vincent Lachenal
41 *
42 * \since 0.1
43 */
77
78 // Attributes +
79 private:
81 ErrorCode _code;
82
84 std::string _msg;
85 // Attributes -
86
87 // Constructors +
88 public:
92 ConfError() = delete;
93
100 ConfError(const std::string& msg, ConfError::ErrorCode code = ErrorCode::UNKNOWN);
101 // Constructors -
102
103 // Destructor +
104 public:
108 virtual ~ConfError() noexcept;
109 // Destructor -
110
111 // Methods +
112 public:
118 virtual const char* what() const noexcept;
119
126 // Methods -
127
128 };
129
130}
131
132#include "conf/impl/confError.hpp"
ConfError(const std::string &msg, ConfError::ErrorCode code=ErrorCode::UNKNOWN)
virtual const char * what() const noexcept
virtual ~ConfError() noexcept
ErrorCode
Definition confError.hpp:44
@ RES_PROTECTED
Definition confError.hpp:62
@ PARSER_NOT_FOUND
Definition confError.hpp:68
@ RES_NOT_FOUND
Definition confError.hpp:59
@ PARSER_PROTECTED
Definition confError.hpp:71
@ CONF_NOT_FOUND
Definition confError.hpp:56
@ PARSING_ERROR
Definition confError.hpp:53
@ NOT_LOADED
Definition confError.hpp:74
@ UNKNOWN
Definition confError.hpp:47
@ NOT_READABLE
Definition confError.hpp:50
@ NOT_RES
Definition confError.hpp:65
ConfError::ErrorCode getErrorCode() const noexcept