Browse Source

Better padding string generation

Michael Hansen 11 years ago
parent
commit
281f95638d
  1. 18
      Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp
  2. 21
      Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp

18
Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp

@ -736,10 +736,7 @@ void plStateDataRecord::DumpToObjectDebugger(const char* msg, bool dirtyOnly, in
if (!dbg)
return;
plString pad;
int i;
for(i=0;i<level; i++)
pad += " ";
plString pad = plString::Fill(level * 3, ' ');
int numVars = dirtyOnly ? GetNumDirtyVars() : GetNumUsedVars();
int numSDVars = dirtyOnly ? GetNumDirtySDVars() : GetNumUsedSDVars();
@ -752,7 +749,7 @@ void plStateDataRecord::DumpToObjectDebugger(const char* msg, bool dirtyOnly, in
pad.c_str(), this, fDescriptor->GetName().c_str(), dirtyOnly, numVars+numSDVars, fFlags&kVolatile).c_str());
// dump simple vars
for(i=0;i<fVarsList.size(); i++)
for (size_t i=0; i<fVarsList.size(); i++)
{
if ( (dirtyOnly && fVarsList[i]->IsDirty()) || (!dirtyOnly && fVarsList[i]->IsUsed()) )
{
@ -761,7 +758,7 @@ void plStateDataRecord::DumpToObjectDebugger(const char* msg, bool dirtyOnly, in
}
// dump nested vars
for(i=0;i<fSDVarsList.size(); i++)
for (size_t i=0; i<fSDVarsList.size(); i++)
{
if ( (dirtyOnly && fSDVarsList[i]->IsDirty()) || (!dirtyOnly && fSDVarsList[i]->IsUsed()) )
{
@ -772,10 +769,7 @@ void plStateDataRecord::DumpToObjectDebugger(const char* msg, bool dirtyOnly, in
void plStateDataRecord::DumpToStream(hsStream* stream, const char* msg, bool dirtyOnly, int level) const
{
std::string pad;
int i;
for(i=0;i<level; i++)
pad += " ";
plString pad = plString::Fill(level * 3, ' ');
int numVars = dirtyOnly ? GetNumDirtyVars() : GetNumUsedVars();
int numSDVars = dirtyOnly ? GetNumDirtySDVars() : GetNumUsedSDVars();
@ -794,7 +788,7 @@ void plStateDataRecord::DumpToStream(hsStream* stream, const char* msg, bool dir
stream->Write(logStr.GetSize(), logStr.c_str());
// dump simple vars
for(i=0;i<fVarsList.size(); i++)
for (size_t i=0; i<fVarsList.size(); i++)
{
if ( (dirtyOnly && fVarsList[i]->IsDirty()) || (!dirtyOnly && fVarsList[i]->IsUsed()) )
{
@ -803,7 +797,7 @@ void plStateDataRecord::DumpToStream(hsStream* stream, const char* msg, bool dir
}
// dump nested vars
for(i=0;i<fSDVarsList.size(); i++)
for (size_t i=0; i<fSDVarsList.size(); i++)
{
if ( (dirtyOnly && fSDVarsList[i]->IsDirty()) || (!dirtyOnly && fSDVarsList[i]->IsUsed()) )
{

21
Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp

@ -2279,10 +2279,7 @@ void plSimpleStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) cons
if (!dbg)
return;
plString pad;
int i;
for(i=0;i<level; i++)
pad += " ";
plString pad = plString::Fill(level * 3, ' ');
plString logMsg = plFormat("{}SimpleVar, name:{}[{}]", pad, GetName(), GetCount());
if (GetCount()>1)
@ -2292,7 +2289,7 @@ void plSimpleStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) cons
}
pad += "\t";
for(i=0;i<GetCount(); i++)
for (size_t i=0; i<GetCount(); i++)
{
plString s=GetAsString(i);
if (fVar.GetAtomicType() == plVarDescriptor::kTime)
@ -2317,10 +2314,7 @@ void plSimpleStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) cons
void plSimpleStateVariable::DumpToStream(hsStream* stream, bool dirtyOnly, int level) const
{
plString pad;
int i;
for(i=0;i<level; i++)
pad += " ";
plString pad = plString::Fill(level * 3, ' ');
plString logMsg = plFormat("{}SimpleVar, name:{}[{}]", pad, GetName(), GetCount());
if (GetCount()>1)
@ -2330,7 +2324,7 @@ void plSimpleStateVariable::DumpToStream(hsStream* stream, bool dirtyOnly, int l
}
pad += "\t";
for(i=0;i<GetCount(); i++)
for (size_t i=0; i<GetCount(); i++)
{
plString s=GetAsString(i);
if (fVar.GetAtomicType() == plVarDescriptor::kTime)
@ -2676,16 +2670,13 @@ void plSDStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) const
if (!dbg)
return;
std::string pad;
int i;
for(i=0;i<level; i++)
pad += " ";
plString pad = plString::Fill(level * 3, ' ');
int cnt = dirtyOnly ? GetDirtyCount() : GetUsedCount();
dbg->LogMsg(plString::Format( "%sSDVar, name:%s dirtyOnly:%d count:%d",
pad.c_str(), GetName().c_str(), dirtyOnly, cnt).c_str());
for(i=0;i<GetCount();i++)
for (size_t i=0; i<GetCount(); i++)
{
if ( (dirtyOnly && fDataRecList[i]->IsDirty()) ||
(!dirtyOnly && fDataRecList[i]->IsUsed()) )

Loading…
Cancel
Save