Sanitize identifier names before substituting them in C++ template files

This commit is contained in:
amzn-sj
2021-06-10 11:01:23 -07:00
parent 39d207095a
commit 2ee4d8ff6b
14 changed files with 114 additions and 87 deletions
@@ -15,24 +15,24 @@
#include <AzCore/Serialization/SerializeContext.h>
#include <${Name}EditorSystemComponent.h>
namespace ${Name}
namespace ${SanitizedCppName}
{
void ${Name}EditorSystemComponent::Reflect(AZ::ReflectContext* context)
void ${SanitizedCppName}EditorSystemComponent::Reflect(AZ::ReflectContext* context)
{
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<${Name}EditorSystemComponent, AZ::Component>()->Version(1);
serializeContext->Class<${SanitizedCppName}EditorSystemComponent, AZ::Component>()->Version(1);
}
}
void ${Name}EditorSystemComponent::Activate()
void ${SanitizedCppName}EditorSystemComponent::Activate()
{
AzToolsFramework::EditorEvents::Bus::Handler::BusConnect();
}
void ${Name}EditorSystemComponent::Deactivate()
void ${SanitizedCppName}EditorSystemComponent::Deactivate()
{
AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect();
}
} // namespace ${Name}
} // namespace ${SanitizedCppName}