Skip to content

Commit 2fefa0e

Browse files
committed
Minor PPropertyParser improvments
1 parent ca78414 commit 2fefa0e

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

Toshi/Include/TKernel/TPCString.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ class TKERNELINTERFACE_EXPORTS TCStringPool
186186

187187
TPCString Get(TPCCHAR a_szString);
188188
TPCString Get(TINT a_iInt);
189+
TPCString Get(const TCString &a_sString);
189190

190191
protected:
191192
void Remove(TPooledCString &a_rPooledCString);

Toshi/Plugins/Include/PPropertyParser/PProperties.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class PPROPERTYPARSER_EXPORTS PProperties : Toshi::TObject
2121
// $PPropertyParser: FUNCTION 10001e30 COMPLETED
2222
PProperty(const PPropertyName &a_rName, const PPropertyValue &a_rValue)
2323
{
24-
m_oName = PPropertyName(a_rName);
25-
m_oValue = PPropertyValue(a_rValue);
24+
m_oName = a_rName;
25+
m_oValue = a_rValue;
2626
}
2727
// $PPropertyParser: FUNCTION 10001e70 COMPLETED
2828
PProperty(const PPropertyName &a_rName, const PPropertyValue &a_rValue, const Toshi::TPCString &a_rComment)

Toshi/Plugins/Source/PPropertyParser/PProperties.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,7 @@ const PPropertyValue *PProperties::GetProperty(const PPropertyName &a_rPropertyN
175175

176176
const PPropertyValue *PProperties::GetProperty(const TPCString &a_rPropertyName, TINT a_iIndex) const
177177
{
178-
// This format is in the binary but seems unused
179-
TCString().Format("%i", a_iIndex);
180-
return GetProperty(PPropertyName(a_rPropertyName, TSystem::GetCStringPool()->Get(a_iIndex)));
178+
return GetProperty(PPropertyName(a_rPropertyName, TSystem::GetCStringPool()->Get(TCString().Format("%i", a_iIndex))));
181179
}
182180

183181
const PPropertyValue *PProperties::GetProperty(const TPCString &a_rPropertyName, const TPCString &a_rPropertySubname) const

Toshi/Source/TKernel/TPCString.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ TCStringPool::TCStringPool(TINT a_iMaxSize, TINT a_iInitialSize)
1717
m_oPooledCStrings = TArray<TPooledCString>(a_iMaxSize, a_iInitialSize);
1818
}
1919

20+
// $TKernelInterface: FUNCTION 10028000
2021
TPCString TCStringPool::Get(TPCCHAR a_szString)
2122
{
2223
if (!a_szString || TSystem::StringLength(a_szString) == 0) {
@@ -34,11 +35,18 @@ TPCString TCStringPool::Get(TPCCHAR a_szString)
3435
return TPCString(string);
3536
}
3637

38+
// $TKernelInterface: FUNCTION 100281f0
3739
TPCString TCStringPool::Get(TINT a_iInt)
3840
{
3941
return Get(TCString().Format("%d", a_iInt));
4042
}
4143

44+
// $TKernelInterface: FUNCTION 10028ee0
45+
TPCString TCStringPool::Get(const TCString &a_sString)
46+
{
47+
return Get(a_sString.GetString());
48+
}
49+
4250
// $TKernelInterface: FUNCTION 10028d10
4351
void TCStringPool::Remove(TPooledCString &a_rPooledCString)
4452
{

0 commit comments

Comments
 (0)