Browse Source

Added Config::removeSection

release/1.0.1
Jessica James 4 years ago
parent
commit
84455254c6
  1. 5
      src/common/Config.cpp
  2. 8
      src/include/Jupiter/Config.h

5
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;

8
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

Loading…
Cancel
Save