BsStringTableManager.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #include "BsModule.h"
  6. #include "BsStringTable.h"
  7. namespace BansheeEngine
  8. {
  9. /** @addtogroup Localization
  10. * @{
  11. */
  12. /**
  13. * Manages string tables used for localizing text. Allows you to add and remove different tables and change the active
  14. * language.
  15. */
  16. class BS_CORE_EXPORT StringTableManager : public Module<StringTableManager>
  17. {
  18. public:
  19. StringTableManager();
  20. /** Gets the currently active language. */
  21. Language getActiveLanguage() const { return mActiveLanguage; }
  22. /** Changes the currently active language. Any newly created strings will use this value. */
  23. void setActiveLanguage(Language language);
  24. /** Returns the string table with the specified id. If the table doesn't exist new one is created. */
  25. HStringTable getTable(UINT32 id);
  26. /** Removes the string table with the specified id. */
  27. void removeTable(UINT32 id);
  28. /** Registers a new string table or replaces an old one at the specified id. */
  29. void setTable(UINT32 id, HStringTable table);
  30. private:
  31. Language mActiveLanguage;
  32. UnorderedMap<UINT32, HStringTable> mTables;
  33. };
  34. /** @} */
  35. }