LeviLamina
Loading...
Searching...
No Matches
Localization.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated forward declare list
6// clang-format off
9struct OptionalString;
10// clang-format on
11
13public:
14 // Localization inner types define
15 using Map = ::std::map<::std::string, ::std::string>;
16
17 using StoreLocMap = ::std::unordered_multimap<::std::string, ::std::pair<::std::string, ::std::string>>;
18
19public:
20 // member variables
21 // NOLINTBEGIN
22 ::ll::TypedStorage<1, 1, bool const> mCommaSeperator;
23 ::ll::TypedStorage<8, 32, ::std::string const> mDigitGroupSeparator;
24 ::ll::TypedStorage<8, 32, ::std::string const> mCode;
25 ::ll::TypedStorage<8, 16, ::std::map<::std::string, ::std::string>> mStrings;
26 ::ll::TypedStorage<8, 16, ::std::map<::std::string, ::std::string>> mCaseSensitiveCache;
27 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::std::shared_mutex>> mCaseSensitiveCacheMutex;
28 ::ll::TypedStorage<1, 1, bool> mMayContainIdentifier;
29 // NOLINTEND
30
31public:
32 // prevent constructor by default
33 Localization& operator=(Localization const&);
35
36public:
37 // member functions
38 // NOLINTBEGIN
40
41 MCAPI explicit Localization(::std::string const& code);
42
43 MCAPI Localization(::Localization const& rhs);
44
45 MCAPI Localization(::std::string const& code, ::Localization const* fallbackLocale);
46
47 MCAPI ::OptionalString _get(::std::string const& id, ::std::vector<::std::string> const& params) const;
48
49 MCAPI ::OptionalString _getSimple(::std::string const& id) const;
50
51 MCAPI ::OptionalString _parseFormattedString(::std::string const& id) const;
52
53 MCAPI void _replaceTokens(::std::string& string, ::std::vector<::std::string> const& params) const;
54
55 MCAPI void
56 _replaceUTCDateTimeIdentifier(::std::string& strToParse, ::std::optional<::std::locale> const& locale) const;
57
58 MCAPI void addKeys(::Localization&& from);
59
60 MCAPI void appendTranslations(
61 ::std::unordered_multimap<::std::string, ::std::pair<::std::string, ::std::string>> const& locStrings
62 );
63
64 MCAPI void appendTranslations(::Localization const& other);
65
66 MCAPI void appendTranslations(
67 ::std::string const& fileContent,
68 ::std::vector<::std::string> const& blockedKeys,
69 ::std::vector<::std::string> const& allowedKeys,
70 ::std::string const& keyPrefix
71 );
72
73 MCAPI void loadFromPack(
74 ::std::string const& keyPrefix,
75 ::PackAccessStrategy const& accessStrategy,
76 ::std::vector<::std::string> const& allowedKeys
77 );
78
79 MCAPI void loadFromResourcePackManager(
80 ::ResourcePackManager& resourcePackManager,
81 ::std::vector<::std::string> const& blockedKeys
82 );
83
84 MCAPI void replaceIdentifiers();
85
86 MCAPI ~Localization();
87 // NOLINTEND
88
89public:
90 // static functions
91 // NOLINTBEGIN
92 MCAPI static ::std::string _getDigitGroupSeparator(::std::string const& langCode);
93
94 MCAPI static bool _isCommaSeperatedLanguage(::std::string const& langCode);
95 // NOLINTEND
96
97public:
98 // constructor thunks
99 // NOLINTBEGIN
100 MCAPI void* $ctor(::Localization&&);
101
102 MCAPI void* $ctor(::std::string const& code);
103
104 MCAPI void* $ctor(::Localization const& rhs);
105
106 MCAPI void* $ctor(::std::string const& code, ::Localization const* fallbackLocale);
107 // NOLINTEND
108
109public:
110 // destructor thunk
111 // NOLINTBEGIN
112 MCAPI void $dtor();
113 // NOLINTEND
114};
Definition Localization.h:12
Definition PackAccessStrategy.h:20
Definition ResourcePackManager.h:24
Definition OptionalString.h:5
Definition code.h:5