Updated hazelnupp

This commit is contained in:
Leonetienne
2022-03-13 19:48:29 +01:00
parent 6e13a5196a
commit cdad33c738
2 changed files with 394 additions and 358 deletions

View File

@@ -1,6 +1,17 @@
/*
* Copyright (c) 2021, Leon Etienne
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "Hazelnupp.h"
/*** ../Hazelnupp/CmdArgsInterface.cpp ***/
/*** ./../Hazelnupp/CmdArgsInterface.cpp ***/
#include <iostream>
#include <cstdlib>
@@ -67,7 +78,7 @@ void CmdArgsInterface::Parse(const int argc, const char* const* argv)
{
std::cout << GenerateDocumentation() << std::endl << std::endl;
std::cerr << "Parameter error: " << exc.What() << std::endl;
quick_exit(-1000);
exit(-1000);
}
else
throw exc; // yeet
@@ -78,7 +89,7 @@ void CmdArgsInterface::Parse(const int argc, const char* const* argv)
{
std::cout << GenerateDocumentation() << std::endl << std::endl;
std::cerr << "Parameter error: " << exc.What() << std::endl;
quick_exit(-1001);
exit(-1001);
}
else
throw exc; // yeet
@@ -89,7 +100,7 @@ void CmdArgsInterface::Parse(const int argc, const char* const* argv)
{
std::cout << GenerateDocumentation() << std::endl << std::endl;
std::cerr << "Parameter error: " << exc.What() << std::endl;
quick_exit(-1002);
exit(-1002);
}
else
throw exc; // yeet
@@ -100,7 +111,7 @@ void CmdArgsInterface::Parse(const int argc, const char* const* argv)
{
std::cout << GenerateDocumentation() << std::endl << std::endl;
std::cerr << "Parameter error: " << exc.What() << std::endl;
quick_exit(-1003);
exit(-1003);
}
else
throw exc; // yeet
@@ -111,7 +122,7 @@ void CmdArgsInterface::Parse(const int argc, const char* const* argv)
{
std::cout << GenerateDocumentation() << std::endl << std::endl;
std::cerr << "Parameter error: " << exc.What() << std::endl;
quick_exit(-1004);
exit(-1004);
}
else
throw exc; // yeet
@@ -121,7 +132,7 @@ void CmdArgsInterface::Parse(const int argc, const char* const* argv)
if ((catchHelp) && (HasParam("--help")))
{
std::cout << GenerateDocumentation() << std::endl;
quick_exit(0);
exit(0);
}
return;
@@ -589,7 +600,7 @@ void CmdArgsInterface::ApplyConstraints()
// Is ANY parameter present listed as incompatible with our current one?
for (const std::string& incompatibility : pc.second.incompatibleParameters)
for (const std::pair<std::string, Parameter*>& otherParam : parameters)
for (const auto& otherParam : parameters)
{
if (otherParam.first == incompatibility)
throw HazelnuppConstraintIncompatibleParameters(pc.second.key, incompatibility);
@@ -685,7 +696,7 @@ const ParamConstraint* CmdArgsInterface::GetConstraintForKey(const std::string&
}
/*** ../Hazelnupp/FloatValue.cpp ***/
/*** ./../Hazelnupp/FloatValue.cpp ***/
#include <sstream>
@@ -762,7 +773,7 @@ const std::vector<Value*>& FloatValue::GetList() const
}
/*** ../Hazelnupp/IntValue.cpp ***/
/*** ./../Hazelnupp/IntValue.cpp ***/
#include <sstream>
@@ -839,7 +850,7 @@ const std::vector<Value*>& IntValue::GetList() const
}
/*** ../Hazelnupp/ListValue.cpp ***/
/*** ./../Hazelnupp/ListValue.cpp ***/
#include <sstream>
@@ -938,7 +949,7 @@ const std::vector<Value*>& ListValue::GetList() const
}
/*** ../Hazelnupp/Parameter.cpp ***/
/*** ./../Hazelnupp/Parameter.cpp ***/
using namespace Hazelnp;
@@ -970,7 +981,7 @@ const ::Value* Parameter::GetValue() const
}
/*** ../Hazelnupp/StringTools.cpp ***/
/*** ./../Hazelnupp/StringTools.cpp ***/
using namespace Hazelnp;
@@ -1159,7 +1170,7 @@ std::string Internal::StringTools::ToLower(const std::string& str)
}
/*** ../Hazelnupp/StringValue.cpp ***/
/*** ./../Hazelnupp/StringValue.cpp ***/
#include <sstream>
@@ -1228,7 +1239,7 @@ const std::vector<Value*>& StringValue::GetList() const
}
/*** ../Hazelnupp/Value.cpp ***/
/*** ./../Hazelnupp/Value.cpp ***/
using namespace Hazelnp;
@@ -1246,7 +1257,7 @@ DATA_TYPE Value::GetDataType() const
}
/*** ../Hazelnupp/VoidValue.cpp ***/
/*** ./../Hazelnupp/VoidValue.cpp ***/
using namespace Hazelnp;