-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e49d678
commit 4a0df24
Showing
12 changed files
with
157 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,4 @@ class AFrontendState : public ARootState | |
|
||
protected: | ||
static inline int sm_iFERefCount = 0; | ||
}; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "AFrontEndController.h" | ||
|
||
IMPLEMENT_DYNCREATE(AFrontEndController, Toshi::TTask) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
#include "TKernel/TTask.h" | ||
|
||
class AFrontEndController : public Toshi::TTask | ||
{ | ||
DECLARE_DYNAMIC(AFrontEndController) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#pragma once | ||
#include "TObject.h" | ||
#include "TFile.h" | ||
#include "TFileLexerUTF8.h" | ||
|
||
class PPropertyReader : public Toshi::TObject | ||
{ | ||
public: | ||
PPropertyReader(); | ||
|
||
void Close(); | ||
|
||
void Error(const Toshi::TCString& a_sMsg); | ||
|
||
virtual ~PPropertyReader() { Close(); } | ||
virtual TBOOL Open(const Toshi::TCString& a_rFileName, Toshi::TFile* a_pFile); | ||
virtual TBOOL Open(const Toshi::TCString& a_rFileName); | ||
|
||
void Warning(const Toshi::TCString& a_sMsg); | ||
|
||
private: | ||
Toshi::TCString m_szFileName; // 0x4 | ||
Toshi::TFile* m_pFile; // 0xC | ||
Toshi::TFileLexerUTF8* m_pLexer; // 0x10 | ||
TBOOL m_bLoadComments; // 0x24 | ||
TBOOL m_bAssertOnError; // 0x25 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#include "PPropertyParser/PPropertyReader.h" | ||
|
||
PPropertyReader::PPropertyReader() | ||
{ | ||
m_pFile = TNULL; | ||
m_pLexer = TNULL; | ||
m_bLoadComments = TFALSE; | ||
m_bAssertOnError = TTRUE; | ||
} | ||
|
||
void PPropertyReader::Close() | ||
{ | ||
if (m_pFile) { | ||
m_pFile->Destroy(); | ||
m_pFile = TNULL; | ||
} | ||
if (m_pLexer) { | ||
delete m_pLexer; | ||
m_pLexer = TNULL; | ||
} | ||
} | ||
|
||
void PPropertyReader::Error(const Toshi::TCString& a_sMsg) | ||
{ | ||
TDPRINTF("%s : error: %s\n", m_szFileName, a_sMsg); | ||
if (m_bAssertOnError) { | ||
TASSERT(!"PPropertyReader::Error()"); | ||
} | ||
} | ||
|
||
TBOOL PPropertyReader::Open(const Toshi::TCString& a_rFileName, Toshi::TFile* a_pFile) | ||
{ | ||
m_szFileName = a_rFileName; | ||
Close(); | ||
m_pFile = a_pFile; | ||
m_pLexer = new Toshi::TFileLexerUTF8(m_pFile, 2); | ||
m_pLexer->SetOutputComments(m_bLoadComments); | ||
} | ||
|
||
TBOOL PPropertyReader::Open(const Toshi::TCString& a_rFileName) | ||
{ | ||
m_szFileName = a_rFileName; | ||
Close(); | ||
m_pFile = Toshi::TFile::Create(m_szFileName, Toshi::TMODE_READONLY); | ||
if (!m_pFile) { | ||
Warning("Can't open file"); | ||
return TFALSE; | ||
} | ||
m_pLexer = new Toshi::TFileLexerUTF8(m_pFile, 2); | ||
m_pLexer->SetOutputComments(m_bLoadComments); | ||
return TTRUE; | ||
} | ||
|
||
void PPropertyReader::Warning(const Toshi::TCString& a_sMsg) | ||
{ | ||
TDPRINTF("%s : warning: %s\n", m_szFileName, a_sMsg); | ||
} |