metaforce/Runtime/GuiSys/CTextParser.hpp

32 lines
1.2 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2016-03-19 00:07:31 +00:00
2016-03-21 00:25:53 +00:00
#include "CGuiTextSupport.hpp"
2018-12-08 05:30:43 +00:00
namespace urde {
2016-03-21 00:25:53 +00:00
class CTextExecuteBuffer;
class CFontImageDef;
2016-03-19 00:07:31 +00:00
2018-12-08 05:30:43 +00:00
class CTextParser {
IObjectStore& x0_store;
2016-03-21 00:25:53 +00:00
2018-12-08 05:30:43 +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);
static CAssetId GetAssetIdFromString(const char16_t* str, int len,
const std::vector<std::pair<CAssetId, CAssetId>>* txtrMap);
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);
void ParseTag(CTextExecuteBuffer& out, const char16_t* str, int len,
const std::vector<std::pair<CAssetId, CAssetId>>* txtrMap);
CFontImageDef GetImage(const char16_t* str, int len, const std::vector<std::pair<CAssetId, CAssetId>>* txtrMap);
TToken<CRasterFont> GetFont(const char16_t* str, int len);
2016-03-21 00:25:53 +00:00
public:
2018-12-08 05:30:43 +00:00
CTextParser(IObjectStore& store) : x0_store(store) {}
void ParseText(CTextExecuteBuffer& out, const char16_t* str, int len,
const std::vector<std::pair<CAssetId, CAssetId>>* txtrMap);
2016-03-19 00:07:31 +00:00
};
2018-12-08 05:30:43 +00:00
} // namespace urde