Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LO21_Pin_Noir_Boucher_Bouri_Detree
CellulutLO21
Commits
75fd9aa8
Unverified
Commit
75fd9aa8
authored
May 11, 2021
by
Merwane Bouri
Browse files
Ajout de propertyvisitorsException
parent
9e423f63
Pipeline
#77807
passed with stages
in 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/propertyvisitors.hpp
View file @
75fd9aa8
...
...
@@ -19,11 +19,25 @@ Fichier contenant diverses classes filles de PropertyVisitor permettant l'affich
#include
"property.hpp"
class
propertyvisitorsException
:
public
std
::
exception
{
std
::
string
_msg
;
public:
propertyvisitorsException
(
const
std
::
string
&
msg
)
:
_msg
(
msg
){}
virtual
const
char
*
what
()
const
noexcept
override
{
return
_msg
.
c_str
();
}
};
/**
\class UIBuilderVisitor
Cette classe permet de remplir un widget fourni en argument avec une représentation interactive de Property.
**/
class
UIBuilderVisitor
:
public
PropertyVisitor
{
public:
...
...
src/propertyvisitors.cpp
View file @
75fd9aa8
...
...
@@ -352,7 +352,7 @@ void PropertyLoaderVisitor::visit(IntegerProperty &prop)
if
(
prop
.
val
>
prop
.
prop_max
||
prop
.
val
<
prop
.
prop_min
)
{
// TODO
throw
"Invalid property value"
;
throw
propertyvisitorsException
(
"Invalid property value"
)
;
}
}
}
...
...
@@ -377,7 +377,7 @@ void PropertyLoaderVisitor::visit(PropertyList &prop)
// TODO
if
(
!
prop
.
dynamic
&&
val
.
toArray
().
size
()
!=
(
int
)
prop
.
contents
.
size
())
throw
"Invalid array size"
;
throw
propertyvisitorsException
(
"Invalid array size"
)
;
prop
.
clear
();
for
(
int
i
=
0
;
i
<
val
.
toArray
().
size
();
++
i
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment