From b15fe2b9268cf6185ef259d67fbb724910e81fa5 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sun, 27 Jun 2021 20:04:11 -0600 Subject: [PATCH] LibCore: Add getter for how many groups exist in a Core::ConfigFile This can be used by an application to find out if any config sections were loaded from the file after a reparse. --- Userland/Libraries/LibCore/ConfigFile.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibCore/ConfigFile.h b/Userland/Libraries/LibCore/ConfigFile.h index 0610f39e0c..7c90087ad5 100644 --- a/Userland/Libraries/LibCore/ConfigFile.h +++ b/Userland/Libraries/LibCore/ConfigFile.h @@ -29,6 +29,8 @@ public: Vector groups() const; Vector keys(const String& group) const; + size_t num_groups() const { return m_groups.size(); } + String read_entry(const String& group, const String& key, const String& default_value = String()) const; int read_num_entry(const String& group, const String& key, int default_value = 0) const; bool read_bool_entry(const String& group, const String& key, bool default_value = false) const;