2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CTEXTPARSER
|
|
|
|
#define _CTEXTPARSER
|
2022-09-30 04:24:13 +00:00
|
|
|
|
|
|
|
#include <rstl/string.hpp>
|
2022-10-09 05:13:17 +00:00
|
|
|
#include <types.h>
|
2022-09-30 04:24:13 +00:00
|
|
|
|
|
|
|
#include <Kyoto/Text/CTextColor.hpp>
|
2024-10-22 23:12:41 +00:00
|
|
|
#include <Kyoto/TToken.hpp>
|
2022-09-30 04:24:13 +00:00
|
|
|
|
|
|
|
class IObjectStore;
|
2024-10-22 23:12:41 +00:00
|
|
|
class CRasterFont;
|
2022-09-30 04:24:13 +00:00
|
|
|
class CTextExecuteBuffer;
|
2022-10-09 05:13:17 +00:00
|
|
|
|
2022-09-30 04:24:13 +00:00
|
|
|
class CTextParser {
|
|
|
|
public:
|
2022-10-09 05:13:17 +00:00
|
|
|
CTextParser(IObjectStore& store);
|
|
|
|
void ParseText(CTextExecuteBuffer&, const wchar_t* str, int len);
|
|
|
|
uint GetAssetIdFromString(const rstl::string& str);
|
2024-10-22 23:12:41 +00:00
|
|
|
TToken< CRasterFont > GetFont(const wchar_t* str, int len);
|
2022-10-09 05:13:17 +00:00
|
|
|
uint GetImage(const wchar_t* str, int len);
|
|
|
|
uint HandleUserTag(CTextExecuteBuffer& buffer, const wchar_t* str, int len);
|
|
|
|
void ParseTag(CTextExecuteBuffer&, const wchar_t* str, int len);
|
|
|
|
static bool BeginsWith(const wchar_t* str1, int len, const wchar_t* str2);
|
|
|
|
static bool Equals(const wchar_t* str1, int len, const wchar_t* str2);
|
|
|
|
static uint ParseInt(const wchar_t* str, int len, bool);
|
|
|
|
static uint FromHex(wchar_t c);
|
|
|
|
static uint GetColorValue(const wchar_t* str);
|
|
|
|
CTextColor ParseColor(const wchar_t* str, int len);
|
|
|
|
|
2022-09-30 04:24:13 +00:00
|
|
|
private:
|
2022-10-09 05:13:17 +00:00
|
|
|
IObjectStore& mObjectStore;
|
2022-09-30 04:24:13 +00:00
|
|
|
};
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CTEXTPARSER
|