AnCH Framework 0.1
Another C++ Hack Framework
Loading...
Searching...
No Matches
parserError.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::ini {
26
27 /*!*
28 * Parse error exception
29 *
30 * \author Vincent Lachenal
31 *
32 * \since 0.1
33 */
34 class ParserError: public std::exception {
35
36 public:
37 /*!*
38 * \ref ParserError error code definition
39 *
40 * \author Vincent Lachenal
41 *
42 * \since 0.1
43 */
44 enum class ErrorCode {
45
48
51
54
57
58 };
59
60 // Attributes +
61 private:
63 ErrorCode _code;
64
66 std::string _msg;
67 // Attributes -
68
69 // Constructors +
70 public:
74 ParserError() = delete;
75
82 ParserError(const std::string& msg, ParserError::ErrorCode code = ErrorCode::UNKNOWN);
83 // Constructors -
84
85 // Destructor +
86 public:
90 virtual ~ParserError() noexcept;
91 // Destructor -
92
93 // Methods +
94 public:
100 virtual const char* what() const noexcept;
101
108 // Methods -
109
110 };
111
112}
113
114#include "ini/impl/parserError.hpp"
ErrorCode
Definition parserError.hpp:44
@ PARSING_ERROR
Definition parserError.hpp:53
@ UNKNOWN
Definition parserError.hpp:47
@ NOT_READABLE
Definition parserError.hpp:50
@ BAD_CAST
Definition parserError.hpp:56
ParserError::ErrorCode getErrorCode() const noexcept
virtual ~ParserError() noexcept
virtual const char * what() const noexcept
ParserError(const std::string &msg, ParserError::ErrorCode code=ErrorCode::UNKNOWN)