| Christopher Meis | 59ef1e7 | 2025-04-16 08:53:25 +0200 | [diff] [blame] | 1 | #pragma once | 
 | 2 |  | 
 | 3 | #include <boost/asio/io_context.hpp> | 
 | 4 | #include <boost/container/flat_map.hpp> | 
 | 5 | #include <nlohmann/json.hpp> | 
 | 6 | #include <sdbusplus/asio/connection.hpp> | 
 | 7 |  | 
| Christopher Meis | 59ef1e7 | 2025-04-16 08:53:25 +0200 | [diff] [blame] | 8 | using DBusValueVariant = | 
 | 9 |     std::variant<std::string, int64_t, uint64_t, double, int32_t, uint32_t, | 
 | 10 |                  int16_t, uint16_t, uint8_t, bool, std::vector<uint8_t>>; | 
 | 11 | using DBusInterface = boost::container::flat_map<std::string, DBusValueVariant>; | 
 | 12 | using DBusObject = boost::container::flat_map<std::string, DBusInterface>; | 
 | 13 |  | 
 | 14 | constexpr const char* configurationOutDir = "/var/configuration/"; | 
 | 15 | constexpr const char* versionHashFile = "/var/configuration/version"; | 
 | 16 | constexpr const char* versionFile = "/etc/os-release"; | 
 | 17 |  | 
 | 18 | namespace em_utils | 
 | 19 | { | 
 | 20 |  | 
 | 21 | namespace properties | 
 | 22 | { | 
 | 23 | constexpr const char* interface = "org.freedesktop.DBus.Properties"; | 
 | 24 | constexpr const char* get = "Get"; | 
 | 25 | } // namespace properties | 
 | 26 |  | 
| Christopher Meis | 59ef1e7 | 2025-04-16 08:53:25 +0200 | [diff] [blame] | 27 | bool fwVersionIsSame(); | 
 | 28 |  | 
| Chau Ly | 7962944 | 2025-08-20 10:27:20 +0000 | [diff] [blame] | 29 | void handleLeftOverTemplateVars(nlohmann::json::iterator& keyPair); | 
 | 30 |  | 
| Christopher Meis | 59ef1e7 | 2025-04-16 08:53:25 +0200 | [diff] [blame] | 31 | std::optional<std::string> templateCharReplace( | 
 | 32 |     nlohmann::json::iterator& keyPair, const DBusObject& object, size_t index, | 
| Chau Ly | 8ee4369 | 2025-10-09 07:22:08 +0000 | [diff] [blame^] | 33 |     const std::optional<std::string>& replaceStr = std::nullopt, | 
 | 34 |     bool handleLeftOver = true); | 
| Christopher Meis | 59ef1e7 | 2025-04-16 08:53:25 +0200 | [diff] [blame] | 35 |  | 
 | 36 | std::optional<std::string> templateCharReplace( | 
 | 37 |     nlohmann::json::iterator& keyPair, const DBusInterface& interface, | 
 | 38 |     size_t index, const std::optional<std::string>& replaceStr = std::nullopt); | 
 | 39 |  | 
| Christopher Meis | 811160e | 2025-08-08 08:48:37 +0200 | [diff] [blame] | 40 | std::string buildInventorySystemPath(std::string& boardName, | 
 | 41 |                                      const std::string& boardType); | 
 | 42 |  | 
| Christopher Meis | 59ef1e7 | 2025-04-16 08:53:25 +0200 | [diff] [blame] | 43 | } // namespace em_utils |