diff --git a/source/RobotAPI/libraries/aron/core/data/rw/reader/nlohmannJSON/NlohmannJSONReaderWithoutTypeCheck.cpp b/source/RobotAPI/libraries/aron/core/data/rw/reader/nlohmannJSON/NlohmannJSONReaderWithoutTypeCheck.cpp index e773c517d9ceee0c8c166f327b639a2c8f799f6b..adebe071119ad34b1c64e7d6446b316a02cbbefc 100644 --- a/source/RobotAPI/libraries/aron/core/data/rw/reader/nlohmannJSON/NlohmannJSONReaderWithoutTypeCheck.cpp +++ b/source/RobotAPI/libraries/aron/core/data/rw/reader/nlohmannJSON/NlohmannJSONReaderWithoutTypeCheck.cpp @@ -104,4 +104,17 @@ namespace armarx::aron::data::reader { i = input; } + bool + NlohmannJSONReaderWithoutTypeCheck::readNull(InputType& input) // defaulted implementation + { + try + { + const std::string e = input; + return e == "nullopt"; + } + catch (...) + { + return false; + } + } } // namespace armarx::aron::data::reader diff --git a/source/RobotAPI/libraries/aron/core/data/rw/reader/nlohmannJSON/NlohmannJSONReaderWithoutTypeCheck.h b/source/RobotAPI/libraries/aron/core/data/rw/reader/nlohmannJSON/NlohmannJSONReaderWithoutTypeCheck.h index e0bed7b71869e2abc074484fe3fb9774e0ef6730..f109fa279ce83e1285ee8328be9a98ad5f8ce197 100644 --- a/source/RobotAPI/libraries/aron/core/data/rw/reader/nlohmannJSON/NlohmannJSONReaderWithoutTypeCheck.h +++ b/source/RobotAPI/libraries/aron/core/data/rw/reader/nlohmannJSON/NlohmannJSONReaderWithoutTypeCheck.h @@ -69,5 +69,7 @@ namespace armarx::aron::data::reader void readDouble(InputType& input, double& i, Path& p) override; void readString(InputType& input, std::string& i, Path& p) override; void readBool(InputType& input, bool& i, Path& p) override; + + bool readNull(InputType& input) override; }; } // namespace armarx::aron::data::reader