HString.generated.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Localization
  7. * @{
  8. */
  9. /// <summary>
  10. /// String handle. Provides a wrapper around an Unicode string, primarily for localization purposes.
  11. ///
  12. /// Actual value for this string is looked up in a global string table based on the provided identifier string and
  13. /// currently active language. If such value doesn't exist then the identifier is used as is.
  14. ///
  15. /// Use {0}, {1}, etc. in the string value for values that might change dynamically.
  16. /// </summary>
  17. [ShowInInspector]
  18. public partial class LocString : ScriptObject
  19. {
  20. private LocString(bool __dummy0) { }
  21. /// <summary>
  22. /// Creates a new localized string with the specified identifier. If the identifier doesn't previously exist in the
  23. /// string table, identifier value will also be used for initializing the default language version of the string.
  24. /// </summary>
  25. /// <param name="identifier">String you can use for later referencing the localized string.</param>
  26. /// <param name="stringTableId">Unique identifier of the string table to retrieve the string from.</param>
  27. public LocString(string identifier, uint stringTableId = 0)
  28. {
  29. Internal_HString(this, identifier, stringTableId);
  30. }
  31. /// <summary>
  32. /// Creates a new localized string with the specified identifier and sets the default language version of the string. If
  33. /// a string with that identifier already exists default language string will be updated.
  34. /// </summary>
  35. /// <param name="identifier">String you can use for later referencing the localized string.</param>
  36. /// <param name="defaultString">
  37. /// Default string to assign to the specified identifier. Language to which it will be assigned depends on the
  38. /// StringTable::DEFAULT_LANGUAGE value.
  39. /// </param>
  40. /// <param name="stringTableId">Unique identifier of the string table to retrieve the string from.</param>
  41. public LocString(string identifier, string defaultString, uint stringTableId = 0)
  42. {
  43. Internal_HString0(this, identifier, defaultString, stringTableId);
  44. }
  45. /// <summary>Creates a new empty localized string.</summary>
  46. /// <param name="stringTableId">Unique identifier of the string table to retrieve the string from.</param>
  47. public LocString(uint stringTableId)
  48. {
  49. Internal_HString1(this, stringTableId);
  50. }
  51. /// <summary>Creates a new empty localized string.</summary>
  52. public LocString()
  53. {
  54. Internal_HString2(this);
  55. }
  56. /// <summary>
  57. /// Sets a value of a string parameter. Parameters are specified as bracketed values within the string itself (for
  58. /// example {0}, {1}) etc. Use ^ as an escape character.
  59. /// </summary>
  60. public void SetParameter(uint idx, string value)
  61. {
  62. Internal_setParameter(mCachedPtr, idx, value);
  63. }
  64. [MethodImpl(MethodImplOptions.InternalCall)]
  65. private static extern void Internal_HString(LocString managedInstance, string identifier, uint stringTableId);
  66. [MethodImpl(MethodImplOptions.InternalCall)]
  67. private static extern void Internal_HString0(LocString managedInstance, string identifier, string defaultString, uint stringTableId);
  68. [MethodImpl(MethodImplOptions.InternalCall)]
  69. private static extern void Internal_HString1(LocString managedInstance, uint stringTableId);
  70. [MethodImpl(MethodImplOptions.InternalCall)]
  71. private static extern void Internal_HString2(LocString managedInstance);
  72. [MethodImpl(MethodImplOptions.InternalCall)]
  73. private static extern string Internal_getValue(IntPtr thisPtr);
  74. [MethodImpl(MethodImplOptions.InternalCall)]
  75. private static extern void Internal_setParameter(IntPtr thisPtr, uint idx, string value);
  76. }
  77. /** @} */
  78. }