@@ -324,7 +324,7 @@ namespace FPSProfiler
324
324
return m_configRecord.m_RecordStats != Configs::RecordStatistics::None;
325
325
}
326
326
327
- void FPSProfilerComponent::ChangeSavePath (const AZStd::string & newSavePath)
327
+ void FPSProfilerComponent::ChangeSavePath (const AZ::IO::Path & newSavePath)
328
328
{
329
329
if (!IsPathValid (newSavePath))
330
330
{
@@ -335,7 +335,7 @@ namespace FPSProfiler
335
335
AZ_Warning (" FPS Profiler" , !m_configDebug.m_PrintDebugInfo && !m_isProfiling, " Path changed during activated profiling." );
336
336
}
337
337
338
- void FPSProfilerComponent::SafeChangeSavePath (const AZStd::string & newSavePath)
338
+ void FPSProfilerComponent::SafeChangeSavePath (const AZ::IO::Path & newSavePath)
339
339
{
340
340
// If profiling is enabled, save current opened file and stop profiling.
341
341
StopProfiling ();
@@ -393,7 +393,7 @@ namespace FPSProfiler
393
393
WriteDataToFile ();
394
394
}
395
395
396
- void FPSProfilerComponent::SaveLogToFileWithNewPath (const AZStd::string & newSavePath, bool useSafeChangePath)
396
+ void FPSProfilerComponent::SaveLogToFileWithNewPath (const AZ::IO::Path & newSavePath, bool useSafeChangePath)
397
397
{
398
398
if (useSafeChangePath)
399
399
{
@@ -485,10 +485,9 @@ namespace FPSProfiler
485
485
char timestamp[20 ];
486
486
strftime (timestamp, sizeof (timestamp), " %Y%m%d_%H%M%S" , &timeInfo);
487
487
488
- AZ::IO::Path logFilePath (m_configFile.m_OutputFilename );
489
- logFilePath.ReplaceFilename ((logFilePath.Stem ().String () + " _" + timestamp + logFilePath.Extension ().String ()).data ());
490
-
491
- m_configFile.m_OutputFilename = logFilePath.c_str ();
488
+ m_configFile.m_OutputFilename .ReplaceFilename (
489
+ (m_configFile.m_OutputFilename .Stem ().String () + " _" + timestamp + m_configFile.m_OutputFilename .Extension ().String ())
490
+ .data ());
492
491
}
493
492
494
493
// Write profiling headers to file
@@ -531,19 +530,17 @@ namespace FPSProfiler
531
530
return static_cast <float >(bytes) / (1024 .0f * 1024 .0f );
532
531
}
533
532
534
- bool FPSProfilerComponent::IsPathValid (const AZStd::string & path) const
533
+ bool FPSProfilerComponent::IsPathValid (const AZ::IO::Path & path) const
535
534
{
536
535
AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance ();
537
- AZ::IO::Path pathToValidate (path.c_str ());
538
536
539
- if (pathToValidate.empty () || !pathToValidate.HasFilename () || !pathToValidate.HasExtension () || !fileIO ||
540
- !fileIO->ResolvePath (pathToValidate))
537
+ if (path.empty () || !path.HasFilename () || !path.HasExtension () || !fileIO || !fileIO->ResolvePath (path))
541
538
{
542
- const char * reason = pathToValidate .empty () ? " Path cannot be empty."
543
- : !pathToValidate .HasFilename () ? " Path must have a file at the end."
544
- : !pathToValidate .HasExtension () ? " Path must have a *.csv extension."
545
- : !fileIO ? " Could not get a FileIO object. Try again."
546
- : " Path is not registered or recognizable by O3DE FileIO System." ;
539
+ const char * reason = path .empty () ? " Path cannot be empty."
540
+ : !path .HasFilename () ? " Path must have a file at the end."
541
+ : !path .HasExtension () ? " Path must have a *.csv extension."
542
+ : !fileIO ? " Could not get a FileIO object. Try again."
543
+ : " Path is not registered or recognizable by O3DE FileIO System." ;
547
544
548
545
AZ_Warning (" FPSProfiler::IsPathValid" , !m_configDebug.m_PrintDebugInfo , " %s" , reason);
549
546
return false ;
0 commit comments