cmCableWrapCommand.cxx 1.2 KB

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