2
0

class_rawarray.rst 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_RawArray:
  4. RawArray
  5. ========
  6. **Category:** Built-In Types
  7. Brief Description
  8. -----------------
  9. Raw byte array.
  10. Member Functions
  11. ----------------
  12. +----------------------------------+----------------------------------------------------------------------------------------------------------+
  13. | :ref:`RawArray<class_rawarray>` | :ref:`RawArray<class_RawArray_RawArray>` **(** :ref:`Array<class_array>` from **)** |
  14. +----------------------------------+----------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`append<class_RawArray_append>` **(** :ref:`int<class_int>` byte **)** |
  16. +----------------------------------+----------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`append_array<class_RawArray_append_array>` **(** :ref:`RawArray<class_rawarray>` array **)** |
  18. +----------------------------------+----------------------------------------------------------------------------------------------------------+
  19. | :ref:`String<class_string>` | :ref:`get_string_from_ascii<class_RawArray_get_string_from_ascii>` **(** **)** |
  20. +----------------------------------+----------------------------------------------------------------------------------------------------------+
  21. | :ref:`String<class_string>` | :ref:`get_string_from_utf8<class_RawArray_get_string_from_utf8>` **(** **)** |
  22. +----------------------------------+----------------------------------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`insert<class_RawArray_insert>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` byte **)** |
  24. +----------------------------------+----------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`invert<class_RawArray_invert>` **(** **)** |
  26. +----------------------------------+----------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`push_back<class_RawArray_push_back>` **(** :ref:`int<class_int>` byte **)** |
  28. +----------------------------------+----------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`remove<class_RawArray_remove>` **(** :ref:`int<class_int>` idx **)** |
  30. +----------------------------------+----------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`resize<class_RawArray_resize>` **(** :ref:`int<class_int>` idx **)** |
  32. +----------------------------------+----------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`set<class_RawArray_set>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` byte **)** |
  34. +----------------------------------+----------------------------------------------------------------------------------------------------------+
  35. | :ref:`int<class_int>` | :ref:`size<class_RawArray_size>` **(** **)** |
  36. +----------------------------------+----------------------------------------------------------------------------------------------------------+
  37. Description
  38. -----------
  39. Raw byte array. Contains bytes. Optimized for memory usage, can't fragment the memory.
  40. Member Function Description
  41. ---------------------------
  42. .. _class_RawArray_RawArray:
  43. - :ref:`RawArray<class_rawarray>` **RawArray** **(** :ref:`Array<class_array>` from **)**
  44. Create from a generic array.
  45. .. _class_RawArray_append:
  46. - void **append** **(** :ref:`int<class_int>` byte **)**
  47. .. _class_RawArray_append_array:
  48. - void **append_array** **(** :ref:`RawArray<class_rawarray>` array **)**
  49. Append an :ref:`RawArray<class_rawarray>` at the end of this array.
  50. .. _class_RawArray_get_string_from_ascii:
  51. - :ref:`String<class_string>` **get_string_from_ascii** **(** **)**
  52. Returns a copy of the array's contents formatted as String. Fast alternative to get_string_from_utf8(), assuming the content is ASCII-only (unlike the UTF-8 function, this function maps every byte to a character in the string, so any multibyte sequence will be torn apart).
  53. .. _class_RawArray_get_string_from_utf8:
  54. - :ref:`String<class_string>` **get_string_from_utf8** **(** **)**
  55. Returns a copy of the array's contents formatted as String, assuming the array is formatted as UTF-8. Slower than get_string_from_ascii(), but works for UTF-8. Usually you should prefer this function over get_string_from_ascii() to support international input.
  56. .. _class_RawArray_insert:
  57. - :ref:`int<class_int>` **insert** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` byte **)**
  58. Insert a new element at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
  59. .. _class_RawArray_invert:
  60. - void **invert** **(** **)**
  61. Reverse the order of the elements in the array (so first element will now be the last).
  62. .. _class_RawArray_push_back:
  63. - void **push_back** **(** :ref:`int<class_int>` byte **)**
  64. Append an element at the end of the array.
  65. .. _class_RawArray_remove:
  66. - void **remove** **(** :ref:`int<class_int>` idx **)**
  67. Remove an element from the array by index.
  68. .. _class_RawArray_resize:
  69. - void **resize** **(** :ref:`int<class_int>` idx **)**
  70. Set the size of the :ref:`RawArray<class_rawarray>`. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
  71. .. _class_RawArray_set:
  72. - void **set** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` byte **)**
  73. Change the byte at the given index.
  74. .. _class_RawArray_size:
  75. - :ref:`int<class_int>` **size** **(** **)**
  76. Return the size of the array.