class_marshalls.rst 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Marshalls.xml.
  6. .. _class_Marshalls:
  7. Marshalls
  8. =========
  9. **Inherits:** :ref:`Object<class_Object>`
  10. Data transformation (marshaling) and encoding helpers.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Provides data transformation and encoding utility functions.
  15. .. rst-class:: classref-reftable-group
  16. Methods
  17. -------
  18. .. table::
  19. :widths: auto
  20. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`base64_to_raw<class_Marshalls_method_base64_to_raw>`\ (\ base64_str\: :ref:`String<class_String>`\ ) |
  22. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`String<class_String>` | :ref:`base64_to_utf8<class_Marshalls_method_base64_to_utf8>`\ (\ base64_str\: :ref:`String<class_String>`\ ) |
  24. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Variant<class_Variant>` | :ref:`base64_to_variant<class_Marshalls_method_base64_to_variant>`\ (\ base64_str\: :ref:`String<class_String>`, allow_objects\: :ref:`bool<class_bool>` = false\ ) |
  26. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`String<class_String>` | :ref:`raw_to_base64<class_Marshalls_method_raw_to_base64>`\ (\ array\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
  28. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`String<class_String>` | :ref:`utf8_to_base64<class_Marshalls_method_utf8_to_base64>`\ (\ utf8_str\: :ref:`String<class_String>`\ ) |
  30. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`String<class_String>` | :ref:`variant_to_base64<class_Marshalls_method_variant_to_base64>`\ (\ variant\: :ref:`Variant<class_Variant>`, full_objects\: :ref:`bool<class_bool>` = false\ ) |
  32. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. .. rst-class:: classref-section-separator
  34. ----
  35. .. rst-class:: classref-descriptions-group
  36. Method Descriptions
  37. -------------------
  38. .. _class_Marshalls_method_base64_to_raw:
  39. .. rst-class:: classref-method
  40. :ref:`PackedByteArray<class_PackedByteArray>` **base64_to_raw**\ (\ base64_str\: :ref:`String<class_String>`\ ) :ref:`🔗<class_Marshalls_method_base64_to_raw>`
  41. Returns a decoded :ref:`PackedByteArray<class_PackedByteArray>` corresponding to the Base64-encoded string ``base64_str``.
  42. .. rst-class:: classref-item-separator
  43. ----
  44. .. _class_Marshalls_method_base64_to_utf8:
  45. .. rst-class:: classref-method
  46. :ref:`String<class_String>` **base64_to_utf8**\ (\ base64_str\: :ref:`String<class_String>`\ ) :ref:`🔗<class_Marshalls_method_base64_to_utf8>`
  47. Returns a decoded string corresponding to the Base64-encoded string ``base64_str``.
  48. .. rst-class:: classref-item-separator
  49. ----
  50. .. _class_Marshalls_method_base64_to_variant:
  51. .. rst-class:: classref-method
  52. :ref:`Variant<class_Variant>` **base64_to_variant**\ (\ base64_str\: :ref:`String<class_String>`, allow_objects\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Marshalls_method_base64_to_variant>`
  53. Returns a decoded :ref:`Variant<class_Variant>` corresponding to the Base64-encoded string ``base64_str``. If ``allow_objects`` is ``true``, decoding objects is allowed.
  54. Internally, this uses the same decoding mechanism as the :ref:`@GlobalScope.bytes_to_var<class_@GlobalScope_method_bytes_to_var>` method.
  55. \ **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution.
  56. .. rst-class:: classref-item-separator
  57. ----
  58. .. _class_Marshalls_method_raw_to_base64:
  59. .. rst-class:: classref-method
  60. :ref:`String<class_String>` **raw_to_base64**\ (\ array\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Marshalls_method_raw_to_base64>`
  61. Returns a Base64-encoded string of a given :ref:`PackedByteArray<class_PackedByteArray>`.
  62. .. rst-class:: classref-item-separator
  63. ----
  64. .. _class_Marshalls_method_utf8_to_base64:
  65. .. rst-class:: classref-method
  66. :ref:`String<class_String>` **utf8_to_base64**\ (\ utf8_str\: :ref:`String<class_String>`\ ) :ref:`🔗<class_Marshalls_method_utf8_to_base64>`
  67. Returns a Base64-encoded string of the UTF-8 string ``utf8_str``.
  68. .. rst-class:: classref-item-separator
  69. ----
  70. .. _class_Marshalls_method_variant_to_base64:
  71. .. rst-class:: classref-method
  72. :ref:`String<class_String>` **variant_to_base64**\ (\ variant\: :ref:`Variant<class_Variant>`, full_objects\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Marshalls_method_variant_to_base64>`
  73. Returns a Base64-encoded string of the :ref:`Variant<class_Variant>` ``variant``. If ``full_objects`` is ``true``, encoding objects is allowed (and can potentially include code).
  74. Internally, this uses the same encoding mechanism as the :ref:`@GlobalScope.var_to_bytes<class_@GlobalScope_method_var_to_bytes>` method.
  75. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  76. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  77. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  78. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  79. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  80. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  81. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  82. .. |void| replace:: :abbr:`void (No return value.)`