TextParser progress

This commit is contained in:
2025-09-02 12:48:18 -07:00
parent b98debb32c
commit d801f1e2ca
7 changed files with 90 additions and 34 deletions

View File

@@ -4,9 +4,10 @@
#include <rstl/string.hpp>
#include <types.h>
#include <Kyoto/Text/CTextColor.hpp>
#include <Kyoto/TToken.hpp>
#include "Kyoto/SObjectTag.hpp"
#include "Kyoto/Text/CFontImageDef.hpp"
#include <Kyoto/TToken.hpp>
#include <Kyoto/Text/CTextColor.hpp>
class IObjectStore;
class CRasterFont;
@@ -15,17 +16,22 @@ class CTextExecuteBuffer;
class CTextParser {
public:
CTextParser(IObjectStore& store);
void ParseText(CTextExecuteBuffer&, const wchar_t* str, int len, rstl::vector<rstl::pair<int, int> >& vec);
uint GetAssetIdFromString(const rstl::string& str);
void ParseText(CTextExecuteBuffer&, const wchar_t* str, int len,
rstl::vector< rstl::pair< CAssetId, CAssetId > >& vec);
static const CAssetId
GetAssetIdFromString(const rstl::string& str,
rstl::vector< rstl::pair< CAssetId, CAssetId > >* txtrMap);
TToken< CRasterFont > GetFont(const wchar_t* str, int len);
CFontImageDef GetImage(const wchar_t* str, int len, rstl::vector<rstl::pair<int, int> >& vec);
CFontImageDef GetImage(const wchar_t* str, int len,
rstl::vector< rstl::pair< CAssetId, CAssetId > >& vec);
uint HandleUserTag(CTextExecuteBuffer& buffer, const wchar_t* str, int len);
void ParseTag(CTextExecuteBuffer&, const wchar_t* str, int len, rstl::vector<rstl::pair<int, int> >& vec);
void ParseTag(CTextExecuteBuffer&, const wchar_t* str, int len,
rstl::vector< rstl::pair< CAssetId, CAssetId > >& vec);
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 int ParseInt(const wchar_t* str, int len, bool);
static int FromHex(wchar_t c);
static int GetColorValue(const wchar_t* str);
static const int GetColorValue(const wchar_t* str);
CTextColor ParseColor(const wchar_t* str, int len);
private: