forked from aymara/lima
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmlConfigurationFileExceptions.h
150 lines (129 loc) · 6.46 KB
/
xmlConfigurationFileExceptions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/*
Copyright 2002-2021 CEA LIST
This file is part of LIMA.
LIMA is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
LIMA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with LIMA. If not, see <http://www.gnu.org/licenses/>
*/
/**
* @file xmlConfigurationFileExceptions.h
* @brief launch exception related to the configuration file parsing
* @date begin Mon Oct, 13 2003 (lun oct 21 2002)
* @author Gael de Chalendar <[email protected]>
* copyright (C) 2002-2003 by CEA
*/
#ifndef XMLCONFIGURATIONFILEEXCEPTIONS_H
#define XMLCONFIGURATIONFILEEXCEPTIONS_H
#include "common/LimaCommon.h"
#include <string>
#include <iostream>
namespace Lima {
namespace Common {
namespace XMLConfigurationFiles
{
//! @brief exception related to the configuration file parsing
class LIMA_XMLCONFIGURATIONFILES_EXPORT XMLConfigurationFileException : public LimaException
{
public:
//! @brief defaut constructor
//! @brief constructor with the error message
explicit XMLConfigurationFileException ( const std::string &mess = "") : LimaException ( mess ) {}
XMLConfigurationFileException& operator=(const XMLConfigurationFileException&) = delete;
XMLConfigurationFileException(const XMLConfigurationFileException&) = default;
};
//! @brief return a message when a 'module' is not found
class LIMA_XMLCONFIGURATIONFILES_EXPORT NoSuchModule : public XMLConfigurationFileException
{
public:
//! @brief constructor (send a message was default)
//! @param name the <i>module</i> that was not found
explicit NoSuchModule ( const std::string &name ) : XMLConfigurationFileException ( "No such module " + name ), moduleName ( name ) {}
//! @brief destructor (throw the exception)
NoSuchModule& operator=(const NoSuchModule&) = delete;
NoSuchModule(const NoSuchModule&) = default;
virtual ~NoSuchModule() throw() = default;
private:
//! @brief the name of the <i>module</i> that was not found
const std::string moduleName;
};
//! @brief return a message when a 'group' was not found
class LIMA_XMLCONFIGURATIONFILES_EXPORT NoSuchGroup : public XMLConfigurationFileException
{
public:
//! @brief constructor (send a message was default)
//! @param name the <i>group</i> that was not found
NoSuchGroup ( const std::string &name ) : XMLConfigurationFileException ( "No such group " + name ),groupName ( name ) {/*std::cout << "No such group " << name << std::endl;*/}
virtual ~NoSuchGroup() throw() = default;
NoSuchGroup(const NoSuchGroup&) = default;
NoSuchGroup& operator=(const NoSuchGroup&) = delete;
private:
//! @brief the name of the <i>group</i> that was not found
const std::string groupName;
};
//! @brief return a message when an 'attribute' was not found
class LIMA_XMLCONFIGURATIONFILES_EXPORT NoSuchAttribute : public XMLConfigurationFileException
{
public:
//! @brief constructor (send a message was default)
//! @param name the <i>attribute</i> that was not found
NoSuchAttribute ( const std::string &name ) : XMLConfigurationFileException ( "No such attribute " + name ),attName ( name ) {/*std::cout << "No such attribute " << name << std::endl;*/}
NoSuchAttribute(const NoSuchAttribute&) = default;
NoSuchAttribute& operator=(const NoSuchAttribute&) = delete;
virtual ~NoSuchAttribute() throw() {}
private:
//! @brief the name of the <i>attribute</i> that was not found
const std::string attName;
};
//! @brief return a message when a 'param' was not found
class LIMA_XMLCONFIGURATIONFILES_EXPORT NoSuchParam : public XMLConfigurationFileException
{
public:
//! @brief constructor (send a message was default)
//! @param name the <i>param</i> that was not found
NoSuchParam ( const std::string &name ) : XMLConfigurationFileException ( "No such param '" + name + "'" ),paramName ( name ) {/*std::cout << "No such param " << name << std::endl;*/}
NoSuchParam(const NoSuchParam&) = default;
NoSuchParam& operator=(const NoSuchParam&) = delete;
virtual ~NoSuchParam() throw() {}
private:
//! @brief the name of the <i>param</i> that was not found
const std::string paramName;
};
//! @brief return a message when a 'list' was not found
class LIMA_XMLCONFIGURATIONFILES_EXPORT NoSuchList : public XMLConfigurationFileException
{
public:
//! @brief constructor (send a message was default)
//! @param name the <i>list</i> that was not found
NoSuchList ( const std::string &name ) : XMLConfigurationFileException ( "No such list " + name ),listName ( name ) {/*std::cout << "No such list " << name << std::endl;*/}
NoSuchList(const NoSuchList&) = default;
NoSuchList& operator=(const NoSuchList&) = delete;
virtual ~NoSuchList() throw() {}
private:
//! @brief the name of the <i>list</i> that was not found
const std::string listName;
};
//! @brief return a message when a 'map' was not found
class LIMA_XMLCONFIGURATIONFILES_EXPORT NoSuchMap : public XMLConfigurationFileException
{
public:
//! @brief constructor (send a message was default)
//! @param name the <i>map</i> that was not found
NoSuchMap ( const std::string &name ) : XMLConfigurationFileException ( "No such map " + name ),mapName ( name ) {/*std::cout << "No such map " << name << std::endl;*/}
NoSuchMap(const NoSuchMap&) = default;
NoSuchMap& operator=(const NoSuchMap&) = delete;
virtual ~NoSuchMap() throw() {}
private:
//! @brief the name of the <i>map</i> that was not found
const std::string mapName;
};
} // closing namespace Lima
} // closing namespace Common
} // closing namespace XMLConfigurationFiles
#endif