Skip to content

Commit

Permalink
Fix PPropertyParser not building
Browse files Browse the repository at this point in the history
  • Loading branch information
AdventureT committed Jan 27, 2024
1 parent b73ab36 commit 4a63d3a
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 91 deletions.
173 changes: 85 additions & 88 deletions Toshi/Include/TKernel/TQList.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,100 +4,14 @@

TOSHI_NAMESPACE_BEGIN

template <class T, class Node>
class T2Iterator
{
public:

T2Iterator()
{
m_pPtr = TNULL;
}

T2Iterator(Node* pPtr)
{
m_pPtr = static_cast<T*>(pPtr);
}

T2Iterator(T* pPtr)
{
m_pPtr = pPtr;
}

/*TBOOL operator==(const T* ptr)
{
return m_pNode == ptr;
}*/

/*TBOOL operator!=(const T* ptr)
{
return m_pNode != ptr;
}*/

void operator=(const T2Iterator& other)
{
m_pPtr = other.m_pPtr;
}

void operator=(T* pPtr)
{
m_pPtr = pPtr;
}

T* operator->() const
{
TASSERT(m_pPtr != TNULL);
return m_pPtr;
}

operator T* () const
{
TASSERT(m_pPtr != TNULL);
return static_cast<T*>(m_pPtr);
}

T2Iterator operator++(int)
{
TASSERT(m_pPtr != TNULL);
T2Iterator old = m_pPtr;
m_pPtr = static_cast<T*>(m_pPtr->Next());
return old;
}

T2Iterator operator--(int)
{
TASSERT(m_pPtr != TNULL);
T2Iterator old = m_pPtr;
m_pPtr = static_cast<T*>(m_pPtr->Prev());
return old;
}

T2Iterator operator++()
{
TASSERT(m_pPtr != TNULL);
m_pPtr = static_cast<T*>(m_pPtr->Next());
return T2Iterator{ m_pPtr };
}

T2Iterator operator--()
{
TASSERT(m_pPtr != TNULL);
m_pPtr = static_cast<T*>(m_pPtr->Prev());
return T2Iterator{ m_pPtr };
}

private:
T* m_pPtr;
};

template <class T>
class TQList
{
public:
class TNode
{
public:
friend TQList;
friend class TQList;

public:
TNode()
Expand Down Expand Up @@ -161,7 +75,90 @@ class TQList
T* m_pPrev;
};

using Iterator = T2Iterator<T, TNode>;
class Iterator
{
public:

Iterator()
{
m_pPtr = TNULL;
}

Iterator(TNode* pPtr)
{
m_pPtr = static_cast<T*>(pPtr);
}

Iterator(T* pPtr)
{
m_pPtr = pPtr;
}

/*TBOOL operator==(const T* ptr)
{
return m_pNode == ptr;
}*/

/*TBOOL operator!=(const T* ptr)
{
return m_pNode != ptr;
}*/

void operator=(const Iterator& other)
{
m_pPtr = other.m_pPtr;
}

void operator=(T* pPtr)
{
m_pPtr = pPtr;
}

T* operator->() const
{
TASSERT(m_pPtr != TNULL);
return m_pPtr;
}

operator T* () const
{
TASSERT(m_pPtr != TNULL);
return static_cast<T*>(m_pPtr);
}

Iterator operator++(int)
{
TASSERT(m_pPtr != TNULL);
Iterator old = m_pPtr;
m_pPtr = static_cast<T*>(m_pPtr->Next());
return old;
}

Iterator operator--(int)
{
TASSERT(m_pPtr != TNULL);
Iterator old = m_pPtr;
m_pPtr = static_cast<T*>(m_pPtr->Prev());
return old;
}

Iterator operator++()
{
TASSERT(m_pPtr != TNULL);
m_pPtr = static_cast<T*>(m_pPtr->Next());
return Iterator{ m_pPtr };
}

Iterator operator--()
{
TASSERT(m_pPtr != TNULL);
m_pPtr = static_cast<T*>(m_pPtr->Prev());
return Iterator{ m_pPtr };
}

private:
T* m_pPtr;
};

public:
TQList() = default;
Expand Down
2 changes: 1 addition & 1 deletion Toshi/Plugins/Include/PPropertyParser/PProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "PPropertyName.h"
#include "TPCString.h"

class PPROPERTYPARSER_EXPORTS PProperty : Toshi::TQList<PProperty>::TNode
class PPROPERTYPARSER_EXPORTS PProperty : public Toshi::TQList<PProperty>::TNode
{
DECLARE_FREELIST(PProperty)

Expand Down
6 changes: 4 additions & 2 deletions Toshi/Plugins/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ project ("PPropertyParser")

links
{
"winmm.lib"
"winmm.lib",
"TKernelInterface"
}

includedirs
{
"Include",
"../Include/TKernel"
"%{wks.location}/Toshi/Include",
"%{wks.location}/Toshi/Include/TKernel"
}

defines
Expand Down

0 comments on commit 4a63d3a

Please sign in to comment.