LuaDocumentElementInstancer.cpp 754 B

1234567891011121314151617181920212223
  1. #include "LuaDocumentElementInstancer.h"
  2. #include "LuaDocument.h"
  3. namespace Rml {
  4. namespace Lua {
  5. /// Instances an element given the tag name and attributes.
  6. /// @param[in] parent The element the new element is destined to be parented to.
  7. /// @param[in] tag The tag of the element to instance.
  8. /// @param[in] attributes Dictionary of attributes.
  9. ElementPtr LuaDocumentElementInstancer::InstanceElement(Element* /*parent*/, const String& tag, const XMLAttributes& /*attributes*/)
  10. {
  11. return ElementPtr(new LuaDocument(tag));
  12. }
  13. /// Releases an element instanced by this instancer.
  14. /// @param[in] element The element to release.
  15. void LuaDocumentElementInstancer::ReleaseElement(Element* element)
  16. {
  17. delete element;
  18. }
  19. } // namespace Lua
  20. } // namespace Rml