Browse Source

Option zum abfragen von der anzahl der attribute eines json objektes hinzugefügt

Kolja Strohm 5 years ago
parent
commit
303fe782b9
2 changed files with 6 additions and 0 deletions
  1. 5 0
      JSON.cpp
  2. 1 0
      JSON.h

+ 5 - 0
JSON.cpp

@@ -281,6 +281,11 @@ Iterator< JSONValue* > JSONObject::getValues()
     return values->getIterator();
 }
 
+int JSONObject::getFieldCount() const
+{
+    return fields->getEintragAnzahl();
+}
+
 Text JSONObject::toString() const
 {
     Text str = "{";

+ 1 - 0
JSON.h

@@ -114,6 +114,7 @@ namespace Framework
             __declspec( dllexport ) JSONValue *getValue( Text field );
             __declspec( dllexport ) Iterator< Text > getFields();
             __declspec( dllexport ) Iterator< JSONValue* > getValues();
+            __declspec( dllexport ) int getFieldCount() const;
 
             __declspec( dllexport ) Text toString() const override;
         };