class_json.rst 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. Member Functions
  13. ----------------
  14. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`JSONParseResult<class_jsonparseresult>` | :ref:`parse<class_JSON_parse>` **(** :ref:`String<class_string>` json **)** |
  16. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`String<class_string>` | :ref:`print<class_JSON_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. Member Function Description
  23. ---------------------------
  24. .. _class_JSON_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_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.