Convert legacy XML handling to rapidxml

Updates the Audio Controls Editor code to use rapidxml instead of legacy
xml apis.  Further makes improvements to path manipulations away from
strings towards PathView apis and similar.

Fixes some issues encountered with memory management when handling xml
data that did not occur previously.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
This commit is contained in:
amzn-phist
2021-07-22 17:37:44 -05:00
parent 4d5a985276
commit 5b148b1f40
15 changed files with 580 additions and 410 deletions
@@ -1005,14 +1005,14 @@ namespace Audio
AZStd::string searchPath;
AZ::StringFunc::Path::Join(m_rootPath.c_str(), folderPath, searchPath);
AZStd::vector<AZStd::string> foundFiles = Audio::FindFilesInPath(searchPath, "*.xml");
auto foundFiles = Audio::FindFilesInPath(searchPath, "*.xml");
for (const auto& file : foundFiles)
{
AZ_Assert(AZ::IO::FileIOBase::GetInstance()->Exists(file.c_str()), "FindFiles found file '%s' but FileIO says it doesn't exist!", file.c_str());
g_audioLogger.Log(eALT_ALWAYS, "Loading Audio Controls Library: '%s'", file.c_str());
Audio::ScopedXmlLoader xmlFileLoader(file);
Audio::ScopedXmlLoader xmlFileLoader(file.Native());
if (xmlFileLoader.HasError())
{
continue;
@@ -1053,14 +1053,14 @@ namespace Audio
AZStd::string searchPath;
AZ::StringFunc::Path::Join(m_rootPath.c_str(), folderPath, searchPath);
AZStd::vector<AZStd::string> foundFiles = Audio::FindFilesInPath(searchPath, "*.xml");
auto foundFiles = Audio::FindFilesInPath(searchPath, "*.xml");
for (const auto& file : foundFiles)
{
AZ_Assert(AZ::IO::FileIOBase::GetInstance()->Exists(file.c_str()), "FindFiles found file '%s' but FileIO says it doesn't exist!", file.c_str());
g_audioLogger.Log(eALT_ALWAYS, "Loading Audio Preloads Library: '%s'", file.c_str());
Audio::ScopedXmlLoader xmlFileLoader(file);
Audio::ScopedXmlLoader xmlFileLoader(file.Native());
if (xmlFileLoader.HasError())
{
continue;