class_stringname.rst 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the StringName.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_StringName:
  6. StringName
  7. ==========
  8. An optimized string type for unique names.
  9. Description
  10. -----------
  11. ``StringName``\ s are immutable strings designed for general-purpose representation of unique names. ``StringName`` ensures that only one instance of a given name exists (so two ``StringName``\ s with the same value are the same object). Comparing them is much faster than with regular :ref:`String<class_String>`\ s, because only the pointers are compared, not the whole strings.
  12. Constructors
  13. ------------
  14. +-------------------------------------+-----------------------------------------------------------------------------------------------------------------+
  15. | :ref:`StringName<class_StringName>` | :ref:`StringName<class_StringName_constructor_StringName>` **(** **)** |
  16. +-------------------------------------+-----------------------------------------------------------------------------------------------------------------+
  17. | :ref:`StringName<class_StringName>` | :ref:`StringName<class_StringName_constructor_StringName>` **(** :ref:`StringName<class_StringName>` from **)** |
  18. +-------------------------------------+-----------------------------------------------------------------------------------------------------------------+
  19. | :ref:`StringName<class_StringName>` | :ref:`StringName<class_StringName_constructor_StringName>` **(** :ref:`String<class_String>` from **)** |
  20. +-------------------------------------+-----------------------------------------------------------------------------------------------------------------+
  21. Operators
  22. ---------
  23. +-------------------------+--------------------------------------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`operator !=<class_StringName_operator_neq_bool>` **(** **)** |
  25. +-------------------------+--------------------------------------------------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`operator !=<class_StringName_operator_neq_bool>` **(** :ref:`String<class_String>` right **)** |
  27. +-------------------------+--------------------------------------------------------------------------------------------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`operator !=<class_StringName_operator_neq_bool>` **(** :ref:`StringName<class_StringName>` right **)** |
  29. +-------------------------+--------------------------------------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`operator ==<class_StringName_operator_eq_bool>` **(** **)** |
  31. +-------------------------+--------------------------------------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`operator ==<class_StringName_operator_eq_bool>` **(** :ref:`String<class_String>` right **)** |
  33. +-------------------------+--------------------------------------------------------------------------------------------------------------+
  34. | :ref:`bool<class_bool>` | :ref:`operator ==<class_StringName_operator_eq_bool>` **(** :ref:`StringName<class_StringName>` right **)** |
  35. +-------------------------+--------------------------------------------------------------------------------------------------------------+
  36. Constructor Descriptions
  37. ------------------------
  38. .. _class_StringName_constructor_StringName:
  39. - :ref:`StringName<class_StringName>` **StringName** **(** **)**
  40. Constructs an empty ``StringName``.
  41. ----
  42. - :ref:`StringName<class_StringName>` **StringName** **(** :ref:`StringName<class_StringName>` from **)**
  43. Constructs a ``StringName`` as a copy of the given ``StringName``.
  44. ----
  45. - :ref:`StringName<class_StringName>` **StringName** **(** :ref:`String<class_String>` from **)**
  46. Creates a new ``StringName`` from the given :ref:`String<class_String>`.
  47. Operator Descriptions
  48. ---------------------
  49. .. _class_StringName_operator_neq_bool:
  50. - :ref:`bool<class_bool>` **operator !=** **(** **)**
  51. ----
  52. - :ref:`bool<class_bool>` **operator !=** **(** :ref:`String<class_String>` right **)**
  53. ----
  54. - :ref:`bool<class_bool>` **operator !=** **(** :ref:`StringName<class_StringName>` right **)**
  55. ----
  56. .. _class_StringName_operator_eq_bool:
  57. - :ref:`bool<class_bool>` **operator ==** **(** **)**
  58. ----
  59. - :ref:`bool<class_bool>` **operator ==** **(** :ref:`String<class_String>` right **)**
  60. ----
  61. - :ref:`bool<class_bool>` **operator ==** **(** :ref:`StringName<class_StringName>` right **)**
  62. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  63. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  64. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  65. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  66. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  67. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`