2017-01-14 20:53:20 +01:00
|
|
|
#ifndef GUARD_STRING_UTIL_H
|
|
|
|
#define GUARD_STRING_UTIL_H
|
|
|
|
|
2021-04-01 08:35:14 +02:00
|
|
|
extern u8 gStringVar1[0x100];
|
|
|
|
extern u8 gStringVar2[0x100];
|
|
|
|
extern u8 gStringVar3[0x100];
|
|
|
|
extern u8 gStringVar4[0x3E8];
|
2018-11-19 17:16:01 +01:00
|
|
|
|
2017-01-14 20:53:20 +01:00
|
|
|
enum StringConvertMode
|
|
|
|
{
|
|
|
|
STR_CONV_MODE_LEFT_ALIGN,
|
|
|
|
STR_CONV_MODE_RIGHT_ALIGN,
|
|
|
|
STR_CONV_MODE_LEADING_ZEROS
|
|
|
|
};
|
|
|
|
|
2021-11-18 04:11:03 +01:00
|
|
|
u8 *StringCopy_Nickname(u8 *dest, const u8 *src);
|
|
|
|
u8 *StringGet_Nickname(u8 *str);
|
|
|
|
u8 *StringCopy_PlayerName(u8 *dest, const u8 *src);
|
2017-01-14 20:53:20 +01:00
|
|
|
u8 *StringCopy(u8 *dest, const u8 *src);
|
|
|
|
u8 *StringAppend(u8 *dest, const u8 *src);
|
|
|
|
u8 *StringCopyN(u8 *dest, const u8 *src, u8 n);
|
|
|
|
u8 *StringAppendN(u8 *dest, const u8 *src, u8 n);
|
|
|
|
u16 StringLength(const u8 *str);
|
|
|
|
s32 StringCompare(const u8 *str1, const u8 *str2);
|
|
|
|
s32 StringCompareN(const u8 *str1, const u8 *str2, u32 n);
|
2017-01-15 00:17:51 +01:00
|
|
|
bool8 IsStringLengthAtLeast(const u8 *str, s32 n);
|
2017-01-14 20:53:20 +01:00
|
|
|
u8 *ConvertIntToDecimalStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n);
|
2017-01-15 00:17:51 +01:00
|
|
|
u8 *ConvertUIntToDecimalStringN(u8 *dest, u32 value, enum StringConvertMode mode, u8 n);
|
2017-01-14 20:53:20 +01:00
|
|
|
u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n);
|
|
|
|
u8 *StringExpandPlaceholders(u8 *dest, const u8 *src);
|
|
|
|
u8 *StringBraille(u8 *dest, const u8 *src);
|
2018-10-14 15:04:25 +02:00
|
|
|
const u8 *GetExpandedPlaceholder(u32 id);
|
2017-01-14 20:53:20 +01:00
|
|
|
u8 *StringFill(u8 *dest, u8 c, u16 n);
|
|
|
|
u8 *StringCopyPadded(u8 *dest, const u8 *src, u8 c, u16 n);
|
|
|
|
u8 *StringFillWithTerminator(u8 *dest, u16 n);
|
2017-01-15 00:17:51 +01:00
|
|
|
u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n);
|
2019-01-26 20:56:06 +01:00
|
|
|
u32 StringLength_Multibyte(const u8 *str);
|
2017-01-15 00:17:51 +01:00
|
|
|
u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color);
|
2017-10-13 17:09:36 +02:00
|
|
|
bool32 IsStringJapanese(u8 *str);
|
2021-09-24 20:30:15 +02:00
|
|
|
bool32 IsStringNJapanese(u8 *str, s32 n);
|
2017-01-15 00:17:51 +01:00
|
|
|
u8 GetExtCtrlCodeLength(u8 code);
|
|
|
|
s32 StringCompareWithoutExtCtrlCodes(const u8 *str1, const u8 *str2);
|
|
|
|
void ConvertInternationalString(u8 *s, u8 language);
|
|
|
|
void StripExtCtrlCodes(u8 *str);
|
2017-01-14 20:53:20 +01:00
|
|
|
|
|
|
|
#endif // GUARD_STRING_UTIL_H
|