cmCableInstantiateCommand.cxx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 "cmCableInstantiateCommand.h"
  12. #include "cmCacheManager.h"
  13. #include "cmRegularExpression.h"
  14. /**
  15. * Write the CABLE configuration code to define this InstantiationSet.
  16. */
  17. void cmCableInstantiateCommand::WriteConfiguration() const
  18. {
  19. std::ostream& os = m_CableData->GetOutputStream();
  20. cmCableData::Indentation indent = m_CableData->GetIndentation();
  21. cmRegularExpression needCdataBlock("[&<>]");
  22. os << indent << "<InstantiationSet>" << std::endl;
  23. for(Entries::const_iterator e = m_Entries.begin();
  24. e != m_Entries.end(); ++e)
  25. {
  26. os << indent << " <Element>";
  27. if(needCdataBlock.find(e->c_str()))
  28. {
  29. os << "<![CDATA[" << e->c_str() << "]]>";
  30. }
  31. else
  32. {
  33. os << e->c_str();
  34. }
  35. os << "</Element>" << std::endl;
  36. }
  37. os << indent << "</InstantiationSet>" << std::endl;
  38. }