/** Gets an XML representation of the node's internals */ FString FPListNodeBoolean::ToXML(const int32 indent, bool bOutputKey) { FString Output; // Output key line if necessary if(bOutputKey) { Output += GenerateTabString(indent); Output += TEXT("<key>"); Output += KeyString; Output += TEXT("</key>"); Output += LINE_TERMINATOR; } // Output value line if(bValue) { Output += GenerateTabString(indent); Output += TEXT("<true />"); Output += LINE_TERMINATOR; } else { Output += GenerateTabString(indent); Output += TEXT("<false />"); Output += LINE_TERMINATOR; } return Output; }
void IFPEndSample(ProfileSample* sample) { if ( _currentSample != sample ) { MessageBox(NULL,"Sample closure not matched","CvGameCore",MB_OK); } if ( depth < 0 ) { MessageBox(NULL,"Too many end-samples","CvGameCore",MB_OK); } else if ( depth == 0 ) { _currentSample = NULL; depth = -1; } else { _currentSample = sampleStack[--depth]; } if ( sample->OpenProfiles-- == 1 ) { LARGE_INTEGER now; LONGLONG ellapsed; QueryPerformanceCounter(&now); ellapsed = (now.QuadPart - sample->StartTime.QuadPart); sample->Accumulator.QuadPart += ellapsed; if ( _currentSample != NULL ) { _currentSample->ChildrenSampleTime.QuadPart += ellapsed; } } #ifdef DETAILED_TRACE if ( detailedTraceEnabled && lastExit != sample ) { char buffer[300]; GenerateTabString(buffer, depth+1); strcpy(buffer+depth+1, "...\n"); OutputDebugString(buffer); exitCount = 1; } else { exitCount++; } lastExit = sample; #endif }
/** Gets an XML representation of the node's internals */ FString FPListNodeFile::ToXML(const int32 indent, bool /*bOutputKey*/) { // PList Header FString Output; (Output += GenerateTabString(indent) + TEXT("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")) += LINE_TERMINATOR; (Output += GenerateTabString(indent) + TEXT("<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">")) += LINE_TERMINATOR; (Output += GenerateTabString(indent) + TEXT("<plist version=\"1.0\">")) += LINE_TERMINATOR; // Get XML contents of children for(int32 i = 0; i < Children.Num(); ++i) { Output += Children[i]->ToXML(indent + 1); } // PList Footer (Output += GenerateTabString(indent) + TEXT("</plist>")) /*+= LINE_TERMINATOR*/; // Last line without newline return Output; }
/** Gets an XML representation of the node's internals */ FString FPListNodeDictionary::ToXML(const int32 indent, bool bOutputKey) { FString Output; // Dictionary header Output += GenerateTabString(indent); Output += TEXT("<dict>"); Output += LINE_TERMINATOR; // Dictionary contents for(int32 i = 0; i < Children.Num(); ++i) { Output += Children[i]->ToXML(indent + 1); } // Dictionary footer Output += GenerateTabString(indent); Output += TEXT("</dict>"); Output += LINE_TERMINATOR; return Output; }
/** Gets an XML representation of the node's internals */ FString FPListNodeString::ToXML(const int32 indent, bool bOutputKey) { FString Output; // Output key line if necessary if(bOutputKey) { Output += GenerateTabString(indent); Output += TEXT("<key>"); Output += KeyString; Output += TEXT("</key>"); Output += LINE_TERMINATOR; } // Output value line Output += GenerateTabString(indent); Output += TEXT("<string>"); Output += ValueString; Output += TEXT("</string>"); Output += LINE_TERMINATOR; return Output; }
void IFPBeginSample(ProfileSample* sample) { if ( sample->Id == -1 ) { if ( numSamples == MAX_SAMPLES ) { dumpProfileStack(); ::MessageBox(NULL,"Profile sample limit exceeded","CvGameCore",MB_OK); return; } sample->Id = numSamples; sample->OpenProfiles = 0; sample->ProfileInstances = 0; sample->Accumulator.QuadPart = 0; sample->ChildrenSampleTime.QuadPart = 0; sampleList[numSamples++] = sample; } if ( ++depth == MAX_SAMPLES ) { ::MessageBox(NULL,"Sample stack overflow","CvGameCore",MB_OK); } else { sampleStack[depth] = sample; } sample->ProfileInstances++; sample->OpenProfiles++; if ( sample->OpenProfiles == 1 ) { if ( _currentSample == NULL ) { sample->Parent = -1; } else { sample->Parent = _currentSample->Id; } QueryPerformanceCounter(&sample->StartTime); } _currentSample = sample; #ifdef DETAILED_TRACE if ( detailedTraceEnabled && lastExit != sample ) { char buffer[300]; if ( exitCount != 0 ) { GenerateTabString(buffer, depth); sprintf(buffer+depth, "[%d]\n", exitCount); OutputDebugString(buffer); exitCount = 0; } GenerateTabString(buffer, depth); sprintf(buffer+depth, "-->%s\n", sample->Name); OutputDebugString(buffer); } #endif }