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;
|
|
|
|
|
2017-01-24 07:41:33 +00:00
|
|
|
static CTextColor ParseColor(const char16_t* str, int len);
|
|
|
|
static u8 GetColorValue(const char16_t* str);
|
|
|
|
static u32 FromHex(char16_t ch);
|
|
|
|
static s32 ParseInt(const char16_t* str, int len, bool signVal);
|
2017-07-07 12:23:20 +00:00
|
|
|
static ResId GetAssetIdFromString(const char16_t* str, int len,
|
2017-05-31 21:26:50 +00:00
|
|
|
const std::vector<std::pair<ResId, ResId>>* txtrMap);
|
2017-01-24 07:41:33 +00:00
|
|
|
static bool Equals(const char16_t* str, int len, const char16_t* other);
|
|
|
|
static bool BeginsWith(const char16_t* str, int len, const char16_t* other);
|
2017-05-31 21:26:50 +00:00
|
|
|
void ParseTag(CTextExecuteBuffer& out, const char16_t* str, int len,
|
|
|
|
const std::vector<std::pair<ResId, ResId>>* txtrMap);
|
|
|
|
CFontImageDef GetImage(const char16_t* str, int len,
|
|
|
|
const std::vector<std::pair<ResId, ResId>>* txtrMap);
|
2017-01-24 07:41:33 +00:00
|
|
|
TToken<CRasterFont> GetFont(const char16_t* str, int len);
|
2016-03-21 00:25:53 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
CTextParser(IObjectStore& store) : x0_store(store) {}
|
2017-05-31 21:26:50 +00:00
|
|
|
void ParseText(CTextExecuteBuffer& out, const char16_t* str, int len,
|
|
|
|
const std::vector<std::pair<ResId, ResId>>* txtrMap);
|
2016-03-19 00:07:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CTEXTPARSER_HPP__
|