Skip to content

Commit

Permalink
Some minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AdventureT committed Nov 12, 2023
1 parent 3dc7957 commit d99f28b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Toshi/Include/TKernel/TCString.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "Defines.h"
#include <corecrt_malloc.h>
#include <stdio.h>
#include <cstdarg>

TOSHI_NAMESPACE_BEGIN

Expand Down Expand Up @@ -41,6 +43,7 @@ class TOSHI_EXPORT TCString
void Copy(const TCString& a_rOther, TINT a_iLength = -1);
void Copy(TPCCHAR a_pcString, TINT a_iLength = -1);

TCString& __cdecl Format(TPCCHAR a_pcFormat, ...);

TBOOL IsIndexValid(TINT a_iIndex = 0) const
{
Expand Down
11 changes: 11 additions & 0 deletions Toshi/Source/TKernel/TCString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,14 @@ void TCString::Copy(TPCCHAR a_pcString, TINT a_iLength)
m_pBuffer[a_iLength] = '\0';
}
}

TCString& __cdecl TCString::Format(TPCCHAR a_pcFormat, ...)
{
char buffer[0x400];
va_list vargs;
va_start(vargs, a_pcFormat);
_vsnprintf(buffer, sizeof(buffer), a_pcFormat, vargs);
va_end(vargs);
TCString res = buffer;
return res;
}
6 changes: 6 additions & 0 deletions Toshi/Source/TKernel/TObject.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "TObject.h"
#include "TSystem.h"
#include <TKernel/TCString.h>

TOSHI_NAMESPACE_USING

Expand Down Expand Up @@ -37,6 +38,7 @@ void TClass::DeinitialiseStatic()
}

static TINT s_iCounter;
static TCHAR s_FourSpaces[4] = { ' ', ' ', ' ', ' ' };

TBOOL DumpObjectClassTree_BaseBegin(TClass*, TPCVOID)
{
Expand All @@ -53,6 +55,10 @@ TBOOL DumpObjectClassTree_BaseEnd(TClass*, TPCVOID)
TBOOL DumpObjectClassTree_Check(TClass*, TPCVOID)
{
TDPRINTF("DumpObjectClassTree_Check() Not Implemented\n");
for (TINT i = 0; i < s_iCounter; i++)
{
TCString idk;
}
return TTRUE;
}

Expand Down

0 comments on commit d99f28b

Please sign in to comment.