3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/deps/core/debug/log/LogArea.h"
7#include "mc/deps/core/utility/NumberConversionResult.h"
8#include "mc/deps/core/utility/buffer_span.h"
9#include "mc/platform/brstd/flat_set.h"
10#include "mc/util/BidirectionalUnorderedMap.h"
18namespace Json {
class Value; }
26MCNAPI
void _breakIntoWordsAndFindProfanity(
27 ::std::string_view str,
28 ::std::vector<::std::pair<int, int>>
const& originalStrIndexes,
29 ::brstd::flat_set<
char, ::std::less<char>, ::std::vector<char>>
const& escapeChars,
30 ::std::set<::std::pair<int, int>>& profanityLocations,
31 ::std::unordered_map<::std::string,
int, ::Util::string_hash, ::std::equal_to<void>>
const& exactMap,
32 ::std::unordered_set<::std::string, ::Util::string_hash, ::std::equal_to<void>>
const& containsSet
35MCNAPI
void _recordProfanityLocationInWord(
36 ::std::string_view word,
37 ::std::vector<::std::pair<int, int>>
const& originalStrIndexes,
40 ::std::set<::std::pair<int, int>>& profanityLocations,
41 ::std::unordered_map<::std::string,
int, ::Util::string_hash, ::std::equal_to<void>>
const& exactMap,
42 ::std::unordered_set<::std::string, ::Util::string_hash, ::std::equal_to<void>>
const& containsSet
46MCNAPI ::std::string base64_decode(::std::string
const& encoded_string);
48MCNAPI ::std::string base64_encode(uchar
const* bytes_to_encode, uint64 in_len,
bool pad);
50MCNAPI ::std::string base64url_decode(::std::string encoded);
52MCNAPI ::std::string base64url_encode(::std::string str);
54MCNAPI ::std::string caseFold(::std::string_view str);
57MCNAPI ::std::string commaSeparatedListFromVector(::std::vector<::std::string>
const& stringVector);
61MCNAPI
bool containsUnicodeChar(::std::string
const& str);
63MCNAPI uint64 createObfuscated64BitIntegerFromXboxLiveID(::std::string
const& input);
66MCNAPI ::std::string ensureNamespace(::std::string
const&
id, ::std::string_view defaultNamespace);
69MCNAPI
bool equalIgnoreCase(::std::string_view lhs, ::std::string_view rhs);
71MCNAPI ::std::string filterProfanityFromString(
72 ::std::string_view inputStr,
73 ::std::unordered_map<::std::string,
int, ::Util::string_hash, ::std::equal_to<void>>
const& profanityExactMap,
74 ::std::unordered_set<::std::string, ::Util::string_hash, ::std::equal_to<void>>
const& profanityContainsSet
77MCNAPI ::std::string findLastColorCode(::std::string_view s,
bool includeResetCode);
79MCNAPI ::std::set<::std::pair<int, int>> findProfanityInString(
80 ::std::string_view inputStr,
81 ::std::unordered_map<::std::string,
int, ::Util::string_hash, ::std::equal_to<void>>
const& exactMap,
82 ::std::unordered_set<::std::string, ::Util::string_hash, ::std::equal_to<void>>
const& containsSet
86MCNAPI ::std::string formatTickDuration(
int ticks);
88MCNAPI ::std::string fromHex(::std::string_view input);
90MCNAPI ::BidirectionalUnorderedMap<int, uint64> generateHashMapFromListTag(::ListTag
const& enumValues);
92MCNAPI ::std::string generateRandomId(
int modifier);
95MCNAPI ::std::string getActiveFormattingCodes(::std::string
const& str);
97MCNAPI ::std::string getFilesizeString(uint64 filesize);
99MCNAPI ::std::string getFilesizeString(uint64 filesize, ::I18n& loc);
101MCNAPI ::std::string getLocalizedStoreDisplayName(::std::string
const& storeId);
104MCNAPI ::std::string_view getNameWithoutNamespace(::std::string_view name);
107MCNAPI ::std::string getPackDataDownloadProgressString(
108 uint64 downloadedDataSize,
109 uint64 totalDownloadDataSize,
110 ::std::string (*getFileSizeString)(uint64)
113MCNAPI ::std::string getPackDownloadProgressString(uint64 downloadedPacks, uint64 packsToDownload);
115MCNAPI ::std::string getVirtualCurrencyStringTTS(uint amount);
118MCNAPI
bool isValidNamespaceFormat(::std::string_view name);
120MCNAPI
bool isValidUTF8(::std::string_view content);
122MCNAPI
bool isVanillaNamespace(::std::string
const& identifier);
125MCNAPI
void loadGameVersion(::GameVersion& version, ::Json::Value
const& versionNode);
128MCNAPI
void loadGameVersion(::SemVersion& version, ::Json::Value
const& versionNode);
130MCNAPI
void normalizeLineEndings(::std::string& str);
132MCNAPI ::std::string removeChars(::std::string str, ::std::string
const& characters);
134MCNAPI ::std::string removeFormattingAndColorCodes(::std::string
const& input,
bool redactObfuscatedText);
136MCNAPI ::std::string removeIllegalChars(::std::string str);
139MCNAPI ::std::string removeTrailingSpaces(::std::string
const& str);
143MCNAPI
void replaceUtf8CharactersWithAscii(
144 ::std::string& target,
145 ::std::vector<::std::pair<::std::string, char>>
const& translateMap
149MCNAPI ::std::istream& safeGetline(::std::istream& inputStream, ::std::string& outString);
152MCNAPI ::std::string safeString(
char const* text);
154MCNAPI ::std::string simpleFormat(::std::string
const& format, ::std::vector<::std::string>
const& parameters);
157MCNAPI ::std::vector<::std::string> split(::std::string_view view,
char delim);
159MCNAPI ::std::vector<::std::string> splitAndDiscardEmpty(::std::string_view str,
char delim);
162MCNAPI ::std::vector<::std::string> splitAndDiscardEmpty(
163 ::std::string
const& str,
164 ::std::vector<::std::string>
const& delims,
165 bool includeDelimCharsInResult
168MCNAPI ::std::vector<::std::string>
169splitLines(::std::string
const& content, ::std::istream& (*fnGetline)(::std::istream&, ::std::string&));
172MCNAPI ::std::vector<::std::string> splitLines(
173 ::std::string
const& str,
174 ::std::vector<::std::string>
const& delims,
175 bool includeDelimCharsInResult,
176 bool includeEmptyLines,
177 ::std::istream& (*fnGetline)(::std::istream&, ::std::string&)
180MCNAPI ::std::vector<::std::string>& splitString(::std::string_view s,
char delim, ::std::vector<::std::string>& elems);
182MCNAPI ::std::vector<::std::string_view>&
183splitStringAsViews(::std::string_view s,
char delim, ::std::vector<::std::string_view>& elems);
185MCNAPI ::std::vector<::std::string_view> splitToViews(::std::string_view view,
char delim);
187MCNAPI
bool startsWith(::std::string_view str, ::std::string_view starts);
189MCNAPI
bool stringContains(::std::string
const& s,
char character);
192MCNAPI
bool stringIsInVector(::std::vector<::std::string>
const& stringVector, ::std::string
const& searchString);
195stringReplace(::std::string str, ::buffer_span<::std::pair<::std::string_view, ::std::string_view>> replacements);
198MCNAPI ::std::string& stringReplace(::std::string& s, ::std::string
const& src, ::std::string
const& dst,
int maxCount);
201stringReplaceCopy(::std::string
const& s, ::std::string
const& src, ::std::string
const& dst,
int maxCount);
203MCNAPI ::std::string stringTrim(::std::string
const& s);
205MCNAPI ::std::string stringTrim(::std::string
const& s, ::std::string
const& chars);
207MCNAPI
bool toBool(::std::string
const& input,
bool& destination);
209MCNAPI ::std::string toCamelCase(::std::string
const& src,
char delimiter);
211MCNAPI ::std::string toHex(::std::string_view input);
213MCNAPI ::Util::NumberConversionResult toIntWithMinMax(::std::string_view inputStr,
int& destination,
int min,
int max);
216MCNAPI ::std::string toLocalizedString(
float f,
int precision);
218MCNAPI ::std::string toLocalizedString(
221 ::std::string
const& digitGroupSeparator,
222 ::std::string
const& decimalSeparator
225MCNAPI ::std::string toLower(
char const* inString);
228MCNAPI ::std::string toLower(::std::string_view inString);
231MCNAPI
bool toSafeNumber(::std::string
const& str, uint& output);
233MCNAPI ::std::string toString(::std::basic_string_view<
wchar_t, ::std::char_traits<wchar_t>> inputStr);
236MCNAPI ::std::string toStringWithPaddedZeroes(uint number, uchar digitCount);
238MCNAPI
int utf8len(::std::string_view str);
240MCNAPI ::std::string utf8substring(::std::string
const& str,
int startIndex,
int endIndex);
243MCNAPI ::std::vector<::std::string> utf8substringCharacters(::std::string
const& str,
int startIndex,
int endIndex);
246MCNAPI
bool validateIdentifier(
247 ::std::string
const&
id,
249 bool allowMinecraftNamespace,
250 ::std::pair<::std::string, ::std::string>* idNameOut
253MCNAPI
bool validateIdentifierChunk(::std::string
const& chunk, ::LogArea logArea);
258MCNAPI ::std::string
const& EMPTY_GUID();
260MCNAPI ::std::string
const& EMPTY_STRING();
262MCNAPI ::std::string
const& HEX_CHARS();
264MCNAPI ::std::string
const& NEW_LINE();
Definition GameVersion.h:10
Definition SemVersion.h:15
Definition string_hash.h:7