class_json.rst 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Helper class for parsing JSON data.
  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. Description
  21. -----------
  22. Helper class for parsing JSON data. For usage example and other important hints, see :ref:`JSONParseResult<class_JSONParseResult>`.
  23. Method Descriptions
  24. -------------------
  25. .. _class_JSON_method_parse:
  26. - :ref:`JSONParseResult<class_JSONParseResult>` **parse** **(** :ref:`String<class_String>` json **)**
  27. Parses a JSON encoded string and returns a :ref:`JSONParseResult<class_JSONParseResult>` containing the result.
  28. ----
  29. .. _class_JSON_method_print:
  30. - :ref:`String<class_String>` **print** **(** :ref:`Variant<class_Variant>` value, :ref:`String<class_String>` indent="", :ref:`bool<class_bool>` sort_keys=false **)**
  31. Converts a Variant var to JSON text and returns the result. Useful for serializing data to store or send over the network.