BsHEString.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Utility-Engine
  7. * @{
  8. */
  9. /**
  10. * Helper class used for constructing HString%s that references the engine string table. Engine string table is just
  11. * a separate string table so it doesn't conflict with the game string table.
  12. */
  13. class BS_EXPORT HEString
  14. {
  15. public:
  16. /**
  17. * Creates a new localized string with the specified identifier in the engine string table. If the identifier
  18. * doesn't previously exist in the string table, identifier value will also be used for initializing the default
  19. * language version of the string.
  20. *
  21. * @param[in] identifier String you can use for later referencing the localized string.
  22. */
  23. HEString(const WString& identifier);
  24. /**
  25. * Creates a new localized string with the specified identifier in the engine string table and sets the default
  26. * language version of the string. If a string with that identifier already exists default language string will be
  27. * updated.
  28. *
  29. * @param[in] identifier String you can use for later referencing the localized string.
  30. * @param[in] default Default string to assign to the specified identifier. Language to which it
  31. * will be assigned depends on the StringTable::DEFAULT_LANGUAGE value.
  32. */
  33. HEString(const WString& identifier, const WString& default);
  34. /** Creates a new empty localized string in the engine string table. */
  35. HEString();
  36. /** Implicitly casts the editor string type to a generic string type. */
  37. operator HString() const;
  38. private:
  39. static const UINT32 ENGINE_STRING_TABLE_ID;
  40. HString mInternal;
  41. };
  42. /** @} */
  43. }