Unverified Commit 75fd9aa8 authored by Merwane Bouri's avatar Merwane Bouri
Browse files

Ajout de propertyvisitorsException

parent 9e423f63
Pipeline #77807 passed with stages
in 16 seconds
......@@ -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:
......
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment