class_json.rst 2.2 KB

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