cmCableInstantiateClassCommand.cxx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2000 National Library of Medicine
  8. All rights reserved.
  9. See COPYRIGHT.txt for copyright details.
  10. =========================================================================*/
  11. #include "cmCableInstantiateClassCommand.h"
  12. #include "cmCacheManager.h"
  13. #include "cmRegularExpression.h"
  14. /**
  15. * Write the CABLE configuration code to define this InstantiationSet.
  16. * This includes the "class" keyword to do class template instantiations.
  17. */
  18. void cmCableInstantiateClassCommand::WriteConfiguration() const
  19. {
  20. std::ostream& os = m_CableData->GetOutputStream();
  21. cmCableData::Indentation indent = m_CableData->GetIndentation();
  22. cmRegularExpression needCdataBlock("[&<>]");
  23. os << indent << "<InstantiationSet>" << std::endl;
  24. for(Entries::const_iterator e = m_Entries.begin();
  25. e != m_Entries.end(); ++e)
  26. {
  27. os << indent << " <Element>class ";
  28. if(needCdataBlock.find(e->c_str()))
  29. {
  30. os << "<![CDATA[" << e->c_str() << "]]>";
  31. }
  32. else
  33. {
  34. os << e->c_str();
  35. }
  36. os << "</Element>" << std::endl;
  37. }
  38. os << indent << "</InstantiationSet>" << std::endl;
  39. }