Explorar o código

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

Kolja Strohm %!s(int64=5) %!d(string=hai) anos
pai
achega
303fe782b9
Modificáronse 2 ficheiros con 6 adicións e 0 borrados
  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;
         };