فهرست منبع

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.
Andrew Kaster 4 سال پیش
والد
کامیت
b15fe2b926
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      Userland/Libraries/LibCore/ConfigFile.h

+ 2 - 0
Userland/Libraries/LibCore/ConfigFile.h

@@ -29,6 +29,8 @@ public:
     Vector<String> groups() const;
     Vector<String> 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;