mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-27 21:01:37 +00:00
Fix string symbol definitions.
This commit is contained in:
parent
685fe7285d
commit
888ca67d79
2 changed files with 5 additions and 26 deletions
|
|
@ -4,34 +4,23 @@
|
|||
|
||||
namespace Hedgehog::Base
|
||||
{
|
||||
struct SSymbolNode
|
||||
{
|
||||
xpointer<SSymbolNode> pPrev;
|
||||
xpointer<SSymbolNode> pNext;
|
||||
be<uint32_t> Hash;
|
||||
|
||||
const char* GetValue() const;
|
||||
};
|
||||
|
||||
class CSharedString;
|
||||
|
||||
class CStringSymbol
|
||||
{
|
||||
public:
|
||||
xpointer<SSymbolNode> m_pSymbolNode;
|
||||
be<uint32_t> m_Index;
|
||||
|
||||
CStringSymbol();
|
||||
CStringSymbol(const char* in_pName);
|
||||
CStringSymbol(const CSharedString& in_rName);
|
||||
|
||||
const char* GetValue() const;
|
||||
|
||||
bool operator==(const CStringSymbol& in_rOther) const;
|
||||
bool operator!=(const CStringSymbol& in_rOther) const;
|
||||
bool operator<(const CStringSymbol& in_rOther) const;
|
||||
};
|
||||
|
||||
SWA_ASSERT_OFFSETOF(CStringSymbol, m_pSymbolNode, 0);
|
||||
SWA_ASSERT_OFFSETOF(CStringSymbol, m_Index, 0);
|
||||
SWA_ASSERT_SIZEOF(CStringSymbol, 4);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,5 @@
|
|||
namespace Hedgehog::Base
|
||||
{
|
||||
inline const char* SSymbolNode::GetValue() const
|
||||
{
|
||||
return reinterpret_cast<const char*>(this) + sizeof(SSymbolNode);
|
||||
}
|
||||
|
||||
inline CStringSymbol::CStringSymbol()
|
||||
{
|
||||
}
|
||||
|
|
@ -19,23 +14,18 @@ namespace Hedgehog::Base
|
|||
GuestToHostFunction<void>(sub_82E013B0, this, &in_rName);
|
||||
}
|
||||
|
||||
inline const char* CStringSymbol::GetValue() const
|
||||
{
|
||||
return m_pSymbolNode->GetValue();
|
||||
}
|
||||
|
||||
inline bool CStringSymbol::operator==(const CStringSymbol& in_rOther) const
|
||||
{
|
||||
return m_pSymbolNode == in_rOther.m_pSymbolNode;
|
||||
return m_Index == in_rOther.m_Index;
|
||||
}
|
||||
|
||||
inline bool CStringSymbol::operator!=(const CStringSymbol& in_rOther) const
|
||||
{
|
||||
return m_pSymbolNode != in_rOther.m_pSymbolNode;
|
||||
return m_Index != in_rOther.m_Index;
|
||||
}
|
||||
|
||||
inline bool CStringSymbol::operator<(const CStringSymbol& in_rOther) const
|
||||
{
|
||||
return m_pSymbolNode < in_rOther.m_pSymbolNode;
|
||||
return m_Index < in_rOther.m_Index;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue