| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
| 3 | #pragma once |
| 4 | |
| 5 | namespace bs |
| 6 | { |
| 7 | /** @addtogroup Utility-Engine |
| 8 | * @{ |
| 9 | */ |
| 10 | |
| 11 | /** |
| 12 | * Helper class used for constructing HString%s that references the engine string table. Engine string table is just |
| 13 | * a separate string table so it doesn't conflict with the game string table. |
| 14 | */ |
| 15 | class BS_EXPORT HEString |
| 16 | { |
| 17 | public: |
| 18 | /** |
| 19 | * Creates a new localized string with the specified identifier in the engine string table. If the identifier |
| 20 | * doesn't previously exist in the string table, identifier value will also be used for initializing the default |
| 21 | * language version of the string. |
| 22 | * |
| 23 | * @param[in] identifier String you can use for later referencing the localized string. |
| 24 | */ |
| 25 | HEString(const String& identifier); |
| 26 | |
| 27 | /** |
| 28 | * Creates a new localized string with the specified identifier in the engine string table and sets the default |
| 29 | * language version of the string. If a string with that identifier already exists default language string will be |
| 30 | * updated. |
| 31 | * |
| 32 | * @param[in] identifier String you can use for later referencing the localized string. |
| 33 | * @param[in] defaultString Default string to assign to the specified identifier. Language to which it |
| 34 | * will be assigned depends on the StringTable::DEFAULT_LANGUAGE value. |
| 35 | */ |
| 36 | HEString(const String& identifier, const String& defaultString); |
| 37 | |
| 38 | /** Creates a new empty localized string in the engine string table. */ |
| 39 | HEString(); |
| 40 | |
| 41 | /** Implicitly casts the editor string type to a generic string type. */ |
| 42 | operator HString() const; |
| 43 | |
| 44 | private: |
| 45 | static const UINT32 ENGINE_STRING_TABLE_ID; |
| 46 | |
| 47 | HString mInternal; |
| 48 | }; |
| 49 | |
| 50 | /** @} */ |
| 51 | } |