class_json.rst 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the JSON.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_JSON:
  5. JSON
  6. ====
  7. **Inherits:** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Helper class for parsing JSON data.
  12. Methods
  13. -------
  14. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`JSONParseResult<class_JSONParseResult>` | :ref:`parse<class_JSON_method_parse>` **(** :ref:`String<class_String>` json **)** |
  16. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`String<class_String>` | :ref:`print<class_JSON_method_print>` **(** :ref:`Variant<class_Variant>` value, :ref:`String<class_String>` indent="", :ref:`bool<class_bool>` sort_keys=false **)** |
  18. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. Description
  20. -----------
  21. Helper class for parsing JSON data. For usage example and other important hints, see :ref:`JSONParseResult<class_JSONParseResult>`.
  22. Method Descriptions
  23. -------------------
  24. .. _class_JSON_method_parse:
  25. - :ref:`JSONParseResult<class_JSONParseResult>` **parse** **(** :ref:`String<class_String>` json **)**
  26. Parses a JSON encoded string and returns a :ref:`JSONParseResult<class_JSONParseResult>` containing the result.
  27. .. _class_JSON_method_print:
  28. - :ref:`String<class_String>` **print** **(** :ref:`Variant<class_Variant>` value, :ref:`String<class_String>` indent="", :ref:`bool<class_bool>` sort_keys=false **)**
  29. Converts a Variant var to JSON text and returns the result. Useful for serializing data to store or send over the network.