HString.generated.cs 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. public partial class LocString : ScriptObject
  18. {
  19. private LocString(bool __dummy0) { }
  20. /// <summary>
  21. /// Creates a new localized string with the specified identifier. If the identifier doesn't previously exist in the
  22. /// string table, identifier value will also be used for initializing the default language version of the string.
  23. /// </summary>
  24. /// <param name="identifier">String you can use for later referencing the localized string.</param>
  25. /// <param name="stringTableId">Unique identifier of the string table to retrieve the string from.</param>
  26. public LocString(string identifier, uint stringTableId = 0)
  27. {
  28. Internal_HString(this, identifier, stringTableId);
  29. }
  30. /// <summary>
  31. /// Creates a new localized string with the specified identifier and sets the default language version of the string. If
  32. /// a string with that identifier already exists default language string will be updated.
  33. /// </summary>
  34. /// <param name="identifier">String you can use for later referencing the localized string.</param>
  35. /// <param name="defaultString">
  36. /// Default string to assign to the specified identifier. Language to which it will be assigned depends on the
  37. /// StringTable::DEFAULT_LANGUAGE value.
  38. /// </param>
  39. /// <param name="stringTableId">Unique identifier of the string table to retrieve the string from.</param>
  40. public LocString(string identifier, string defaultString, uint stringTableId = 0)
  41. {
  42. Internal_HString0(this, identifier, defaultString, stringTableId);
  43. }
  44. /// <summary>Creates a new empty localized string.</summary>
  45. /// <param name="stringTableId">Unique identifier of the string table to retrieve the string from.</param>
  46. public LocString(uint stringTableId)
  47. {
  48. Internal_HString1(this, stringTableId);
  49. }
  50. /// <summary>Creates a new empty localized string.</summary>
  51. public LocString()
  52. {
  53. Internal_HString2(this);
  54. }
  55. /// <summary>
  56. /// Sets a value of a string parameter. Parameters are specified as bracketed values within the string itself (for
  57. /// example {0}, {1}) etc. Use ^ as an escape character.
  58. /// </summary>
  59. public void SetParameter(uint idx, string value)
  60. {
  61. Internal_setParameter(mCachedPtr, idx, value);
  62. }
  63. [MethodImpl(MethodImplOptions.InternalCall)]
  64. private static extern void Internal_HString(LocString managedInstance, string identifier, uint stringTableId);
  65. [MethodImpl(MethodImplOptions.InternalCall)]
  66. private static extern void Internal_HString0(LocString managedInstance, string identifier, string defaultString, uint stringTableId);
  67. [MethodImpl(MethodImplOptions.InternalCall)]
  68. private static extern void Internal_HString1(LocString managedInstance, uint stringTableId);
  69. [MethodImpl(MethodImplOptions.InternalCall)]
  70. private static extern void Internal_HString2(LocString managedInstance);
  71. [MethodImpl(MethodImplOptions.InternalCall)]
  72. private static extern string Internal_getValue(IntPtr thisPtr);
  73. [MethodImpl(MethodImplOptions.InternalCall)]
  74. private static extern void Internal_setParameter(IntPtr thisPtr, uint idx, string value);
  75. }
  76. /** @} */
  77. }