From 2a9f262e6db5906db445d465e500d7ba8c90fab3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 5 May 2021 09:44:50 -0400 Subject: Implemented additional commands --- src/utils.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/utils.h') diff --git a/src/utils.h b/src/utils.h index 2a66101..bf789e1 100644 --- a/src/utils.h +++ b/src/utils.h @@ -17,8 +17,14 @@ namespace utils { // looks up directory in settings. Returns element matching name. nlohmann::json loadJson(const std::string& type, const std::string& name); + // goes through the available types and searches for the one matching name. + nlohmann::json findByName(const std::string& name); + void saveJson(const nlohmann::json& data, const std::string& path); + // converts in-place + std::string lower(std::string& in); + template std::shared_ptr loadDFromJson(const nlohmann::json& data) { try { return std::shared_ptr(new D(loadJson(data["type"], data["name"]), data)); -- cgit v1.2.3