mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-20 09:22:13 +00:00
ENH: support extension tool; support check extension tool
JIRA: [STUDIO-14122] [STUDIO-14162] Change-Id: I147d335420fcc7c9a190f570863e38e138cdadcf (cherry picked from commit db83b9fb6c6399d917b27b74cc573d668737c705)
This commit is contained in:
@@ -37,6 +37,22 @@ public:
|
||||
class DevJsonValParser
|
||||
{
|
||||
public:
|
||||
template<typename T>
|
||||
static T GetVal(const nlohmann::json& j, const std::string& key, const T& default_val = T())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (j.contains(key)) { return j[key].get<T>(); }
|
||||
}
|
||||
catch (const nlohmann::json::exception& e)
|
||||
{
|
||||
assert(0 && __FUNCTION__);
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": " << e.what();
|
||||
}
|
||||
|
||||
return default_val;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void ParseVal(const nlohmann::json& j, const std::string& key, T& val)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user