2016-03-19 00:07:31 +00:00
|
|
|
#ifndef __URDE_CTEXTPARSER_HPP__
|
|
|
|
#define __URDE_CTEXTPARSER_HPP__
|
|
|
|
|
2016-03-21 00:25:53 +00:00
|
|
|
#include "CGuiTextSupport.hpp"
|
|
|
|
|
2016-03-19 00:07:31 +00:00
|
|
|
namespace urde
|
|
|
|
{
|
2016-03-21 00:25:53 +00:00
|
|
|
class CTextExecuteBuffer;
|
|
|
|
class CFontImageDef;
|
2016-03-19 00:07:31 +00:00
|
|
|
|
|
|
|
class CTextParser
|
|
|
|
{
|
2016-03-21 00:25:53 +00:00
|
|
|
IObjectStore& x0_store;
|
|
|
|
|
|
|
|
static CTextColor ParseColor(const wchar_t* str, int len);
|
|
|
|
static u8 GetColorValue(const wchar_t* str);
|
|
|
|
static u32 FromHex(wchar_t ch);
|
|
|
|
static s32 ParseInt(const wchar_t* str, int len, bool signVal);
|
|
|
|
static TResId GetAssetIdFromString(const wchar_t* str);
|
|
|
|
static bool Equals(const wchar_t* str, int len, const wchar_t* other);
|
|
|
|
static bool BeginsWith(const wchar_t* str, int len, const wchar_t* other);
|
|
|
|
void ParseTag(CTextExecuteBuffer& out, const wchar_t* str, int len);
|
|
|
|
CFontImageDef GetImage(const wchar_t* str, int len);
|
|
|
|
TToken<CRasterFont> GetFont(const wchar_t* str, int len);
|
|
|
|
|
|
|
|
public:
|
|
|
|
CTextParser(IObjectStore& store) : x0_store(store) {}
|
|
|
|
void ParseText(CTextExecuteBuffer& out, const wchar_t* str, int len);
|
2016-03-19 00:07:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CTEXTPARSER_HPP__
|