diff --git a/src/common/Config.cpp b/src/common/Config.cpp index d5fd65b..6d0fe29 100644 --- a/src/common/Config.cpp +++ b/src/common/Config.cpp @@ -76,6 +76,11 @@ bool Jupiter::Config::remove(const Jupiter::ReadableString &in_key) return m_table.erase(in_key) > 0; } +bool Jupiter::Config::removeSection(const Jupiter::ReadableString &in_key) +{ + return m_sections != nullptr && m_sections->erase(in_key) > 0; +} + const std::string &Jupiter::Config::getName() const { return m_name; diff --git a/src/include/Jupiter/Config.h b/src/include/Jupiter/Config.h index e19a0ab..33b8fcd 100644 --- a/src/include/Jupiter/Config.h +++ b/src/include/Jupiter/Config.h @@ -109,6 +109,14 @@ namespace Jupiter */ bool remove(const Jupiter::ReadableString &in_key); + /** + * @brief Removes a section from the table + * + * @param in_key Key of the section to remove + * @return True if an entry was removed, false otherwise + */ + bool removeSection(const Jupiter::ReadableString &in_key); + /** * @brief Fetches the name of this config section * Note: This is the filename on the root node