mirror of https://github.com/Kitware/CMake.git
Browse Source
ENH: Change to new CABLE command architecture. CABLE configuration code is now generated on the first pass, during the Invoke() calls.
pull/1/head
ENH: Change to new CABLE command architecture. CABLE configuration code is now generated on the first pass, during the Invoke() calls.
pull/1/head

23 changed files with 1016 additions and 232 deletions
-
55Source/cmCableCloseNamespaceCommand.cxx
-
89Source/cmCableCloseNamespaceCommand.h
-
19Source/cmCableCommand.cxx
-
3Source/cmCableCommand.h
-
190Source/cmCableData.cxx
-
76Source/cmCableData.h
-
19Source/cmCableDefineSetCommand.cxx
-
6Source/cmCableDefineSetCommand.h
-
16Source/cmCableInstantiateClassCommand.cxx
-
12Source/cmCableInstantiateClassCommand.h
-
90Source/cmCableInstantiateCommand.cxx
-
42Source/cmCableInstantiateCommand.h
-
55Source/cmCableOpenNamespaceCommand.cxx
-
89Source/cmCableOpenNamespaceCommand.h
-
70Source/cmCablePackageCommand.cxx
-
85Source/cmCablePackageCommand.h
-
42Source/cmCablePackageEntryCommand.cxx
-
57Source/cmCablePackageEntryCommand.h
-
37Source/cmCableSourceFilesCommand.cxx
-
71Source/cmCableSourceFilesCommand.h
-
45Source/cmCableWrapCommand.cxx
-
69Source/cmCableWrapCommand.h
-
11Source/cmCommands.cxx
@ -0,0 +1,55 @@ |
|||
/*=========================================================================
|
|||
|
|||
Program: Insight Segmentation & Registration Toolkit |
|||
Module: $RCSfile$ |
|||
Language: C++ |
|||
Date: $Date$ |
|||
Version: $Revision$ |
|||
|
|||
|
|||
Copyright (c) 2000 National Library of Medicine |
|||
All rights reserved. |
|||
|
|||
See COPYRIGHT.txt for copyright details. |
|||
|
|||
=========================================================================*/ |
|||
#include "cmCableCloseNamespaceCommand.h"
|
|||
#include "cmCacheManager.h"
|
|||
|
|||
|
|||
// cmCableCloseNamespaceCommand
|
|||
bool cmCableCloseNamespaceCommand::Invoke(std::vector<std::string>& args) |
|||
{ |
|||
if(args.size() != 1) |
|||
{ |
|||
this->SetError("called with incorrect number of arguments"); |
|||
return false; |
|||
} |
|||
|
|||
// This command needs to access the Cable data.
|
|||
this->SetupCableData(); |
|||
|
|||
// The argument is the namespace name.
|
|||
m_NamespaceName = args[0]; |
|||
|
|||
// Ask the cable data to close the namespace.
|
|||
m_CableData->CloseNamespace(m_NamespaceName); |
|||
|
|||
// Write the configuration for this command.
|
|||
this->WriteNamespaceFooter(); |
|||
|
|||
return true; |
|||
} |
|||
|
|||
|
|||
/**
|
|||
* Generate a CABLE Namespace close tag. |
|||
*/ |
|||
void cmCableCloseNamespaceCommand::WriteNamespaceFooter() const |
|||
{ |
|||
m_CableData->Unindent(); |
|||
std::ostream& os = m_CableData->GetOutputStream(); |
|||
cmCableData::Indentation indent = m_CableData->GetIndentation(); |
|||
os << indent << "</Namespace> <!-- \"" << m_NamespaceName.c_str() |
|||
<< "\" -->" << std::endl; |
|||
} |
@ -0,0 +1,89 @@ |
|||
/*========================================================================= |
|||
|
|||
Program: Insight Segmentation & Registration Toolkit |
|||
Module: $RCSfile$ |
|||
Language: C++ |
|||
Date: $Date$ |
|||
Version: $Revision$ |
|||
|
|||
|
|||
Copyright (c) 2000 National Library of Medicine |
|||
All rights reserved. |
|||
|
|||
See COPYRIGHT.txt for copyright details. |
|||
|
|||
=========================================================================*/ |
|||
#ifndef cmCableCloseNamespaceCommand_h |
|||
#define cmCableCloseNamespaceCommand_h |
|||
|
|||
#include "cmStandardIncludes.h" |
|||
#include "cmCableCommand.h" |
|||
|
|||
/** \class cmCableCloseNamespaceCommand |
|||
* \brief Define a command that closes a CABLE Namespace. |
|||
* |
|||
* cmCableCloseNamespaceCommand is used to generate CABLE Namespace |
|||
* close tags in the configuration file. |
|||
*/ |
|||
class cmCableCloseNamespaceCommand : public cmCableCommand |
|||
{ |
|||
public: |
|||
/** |
|||
* This is a virtual constructor for the command. |
|||
*/ |
|||
virtual cmCommand* Clone() |
|||
{ |
|||
return new cmCableCloseNamespaceCommand; |
|||
} |
|||
|
|||
/** |
|||
* This is called when the command is first encountered in |
|||
* the CMakeLists.txt file. |
|||
*/ |
|||
virtual bool Invoke(std::vector<std::string>& args); |
|||
|
|||
/** |
|||
* This determines if the command gets propagated down |
|||
* to makefiles located in subdirectories. |
|||
*/ |
|||
virtual bool IsInherited() |
|||
{return true;} |
|||
|
|||
/** |
|||
* The name of the command as specified in CMakeList.txt. |
|||
*/ |
|||
virtual const char* GetName() { return "CABLE_CLOSE_NAMESPACE";} |
|||
|
|||
/** |
|||
* Succinct documentation. |
|||
*/ |
|||
virtual const char* GetTerseDocumentation() |
|||
{ |
|||
return "Close a CABLE Namespace"; |
|||
} |
|||
|
|||
/** |
|||
* More documentation. |
|||
*/ |
|||
virtual const char* GetFullDocumentation() |
|||
{ |
|||
return |
|||
"CABLE_CLOSE_NAMESPACE(namespace_name)\n" |
|||
"Close the given namespace in the generated configuration file.\n" |
|||
"There must be a matching CABLE_OPEN_NAMESPACE(namespace_name)\n" |
|||
"called with the same name."; |
|||
} |
|||
|
|||
cmTypeMacro(cmCableCloseNamespaceCommand, cmCableCommand); |
|||
private: |
|||
void WriteNamespaceFooter() const; |
|||
private: |
|||
/** |
|||
* The name of the namespace to setup. |
|||
*/ |
|||
std::string m_NamespaceName; |
|||
}; |
|||
|
|||
|
|||
|
|||
#endif |
@ -0,0 +1,55 @@ |
|||
/*=========================================================================
|
|||
|
|||
Program: Insight Segmentation & Registration Toolkit |
|||
Module: $RCSfile$ |
|||
Language: C++ |
|||
Date: $Date$ |
|||
Version: $Revision$ |
|||
|
|||
|
|||
Copyright (c) 2000 National Library of Medicine |
|||
All rights reserved. |
|||
|
|||
See COPYRIGHT.txt for copyright details. |
|||
|
|||
=========================================================================*/ |
|||
#include "cmCableOpenNamespaceCommand.h"
|
|||
#include "cmCacheManager.h"
|
|||
|
|||
|
|||
// cmCableOpenNamespaceCommand
|
|||
bool cmCableOpenNamespaceCommand::Invoke(std::vector<std::string>& args) |
|||
{ |
|||
if(args.size() != 1) |
|||
{ |
|||
this->SetError("called with incorrect number of arguments"); |
|||
return false; |
|||
} |
|||
|
|||
// This command needs to access the Cable data.
|
|||
this->SetupCableData(); |
|||
|
|||
// The argument is the namespace name.
|
|||
m_NamespaceName = args[0]; |
|||
|
|||
// Write the configuration for this command.
|
|||
this->WriteNamespaceHeader(); |
|||
|
|||
// Ask the cable data to open the namespace.
|
|||
m_CableData->OpenNamespace(m_NamespaceName); |
|||
|
|||
return true; |
|||
} |
|||
|
|||
|
|||
/**
|
|||
* Generate a CABLE Namespace open tag. |
|||
*/ |
|||
void cmCableOpenNamespaceCommand::WriteNamespaceHeader() const |
|||
{ |
|||
std::ostream& os = m_CableData->GetOutputStream(); |
|||
cmCableData::Indentation indent = m_CableData->GetIndentation(); |
|||
os << indent << "<Namespace name=\"" << m_NamespaceName.c_str() |
|||
<< "\">" << std::endl; |
|||
m_CableData->Indent(); |
|||
} |
@ -0,0 +1,89 @@ |
|||
/*========================================================================= |
|||
|
|||
Program: Insight Segmentation & Registration Toolkit |
|||
Module: $RCSfile$ |
|||
Language: C++ |
|||
Date: $Date$ |
|||
Version: $Revision$ |
|||
|
|||
|
|||
Copyright (c) 2000 National Library of Medicine |
|||
All rights reserved. |
|||
|
|||
See COPYRIGHT.txt for copyright details. |
|||
|
|||
=========================================================================*/ |
|||
#ifndef cmCableOpenNamespaceCommand_h |
|||
#define cmCableOpenNamespaceCommand_h |
|||
|
|||
#include "cmStandardIncludes.h" |
|||
#include "cmCableCommand.h" |
|||
|
|||
/** \class cmCableOpenNamespaceCommand |
|||
* \brief Define a command that opens a CABLE Namespace. |
|||
* |
|||
* cmCableOpenNamespaceCommand is used to generate CABLE Namespace |
|||
* open tags in the configuration file. |
|||
*/ |
|||
class cmCableOpenNamespaceCommand : public cmCableCommand |
|||
{ |
|||
public: |
|||
/** |
|||
* This is a virtual constructor for the command. |
|||
*/ |
|||
virtual cmCommand* Clone() |
|||
{ |
|||
return new cmCableOpenNamespaceCommand; |
|||
} |
|||
|
|||
/** |
|||
* This is called when the command is first encountered in |
|||
* the CMakeLists.txt file. |
|||
*/ |
|||
virtual bool Invoke(std::vector<std::string>& args); |
|||
|
|||
/** |
|||
* This determines if the command gets propagated down |
|||
* to makefiles located in subdirectories. |
|||
*/ |
|||
virtual bool IsInherited() |
|||
{return true;} |
|||
|
|||
/** |
|||
* The name of the command as specified in CMakeList.txt. |
|||
*/ |
|||
virtual const char* GetName() { return "CABLE_OPEN_NAMESPACE";} |
|||
|
|||
/** |
|||
* Succinct documentation. |
|||
*/ |
|||
virtual const char* GetTerseDocumentation() |
|||
{ |
|||
return "Open a CABLE Namespace"; |
|||
} |
|||
|
|||
/** |
|||
* More documentation. |
|||
*/ |
|||
virtual const char* GetFullDocumentation() |
|||
{ |
|||
return |
|||
"CABLE_OPEN_NAMESPACE(namespace_name)\n" |
|||
"Open the given namespace in the generated configuration file.\n" |
|||
"There must be a matching CABLE_CLOSE_NAMESPACE(namespace_name)\n" |
|||
"called with the same name."; |
|||
} |
|||
|
|||
cmTypeMacro(cmCableOpenNamespaceCommand, cmCableCommand); |
|||
private: |
|||
void WriteNamespaceHeader() const; |
|||
private: |
|||
/** |
|||
* The name of the namespace to setup. |
|||
*/ |
|||
std::string m_NamespaceName; |
|||
}; |
|||
|
|||
|
|||
|
|||
#endif |
@ -0,0 +1,70 @@ |
|||
/*=========================================================================
|
|||
|
|||
Program: Insight Segmentation & Registration Toolkit |
|||
Module: $RCSfile$ |
|||
Language: C++ |
|||
Date: $Date$ |
|||
Version: $Revision$ |
|||
|
|||
|
|||
Copyright (c) 2000 National Library of Medicine |
|||
All rights reserved. |
|||
|
|||
See COPYRIGHT.txt for copyright details. |
|||
|
|||
=========================================================================*/ |
|||
#include "cmCablePackageCommand.h"
|
|||
#include "cmCacheManager.h"
|
|||
|
|||
// cmCablePackageCommand
|
|||
bool cmCablePackageCommand::Invoke(std::vector<std::string>& args) |
|||
{ |
|||
if(args.size() != 1) |
|||
{ |
|||
this->SetError("called with incorrect number of arguments"); |
|||
return false; |
|||
} |
|||
|
|||
// This command needs to access the Cable data.
|
|||
this->SetupCableData(); |
|||
|
|||
// The argument is the package name.
|
|||
m_PackageName = args[0]; |
|||
|
|||
// Ask the cable data to begin the package. This may call another
|
|||
// cmCablePackageCommand's WritePackageFooter().
|
|||
m_CableData->BeginPackage(this); |
|||
|
|||
// Write the configuration for this command.
|
|||
// The cmCableData::EndPackage() later on will call WritePackageFooter().
|
|||
this->WritePackageHeader(); |
|||
|
|||
return true; |
|||
} |
|||
|
|||
|
|||
/**
|
|||
* Write a CABLE package header. |
|||
*/ |
|||
void cmCablePackageCommand::WritePackageHeader() const |
|||
{ |
|||
std::ostream& os = m_CableData->GetOutputStream(); |
|||
cmCableData::Indentation indent = m_CableData->GetIndentation(); |
|||
os << indent << "<Package name=\"" << m_PackageName.c_str() << "\">" |
|||
<< std::endl; |
|||
m_CableData->Indent(); |
|||
} |
|||
|
|||
|
|||
/**
|
|||
* Write a CABLE package footer. |
|||
*/ |
|||
void cmCablePackageCommand::WritePackageFooter() const |
|||
{ |
|||
m_CableData->Unindent(); |
|||
std::ostream& os = m_CableData->GetOutputStream(); |
|||
cmCableData::Indentation indent = m_CableData->GetIndentation(); |
|||
os << indent << "</Package> <!-- \"" << m_PackageName.c_str() << "\" -->" |
|||
<< std::endl; |
|||
} |
|||
|
@ -0,0 +1,85 @@ |
|||
/*========================================================================= |
|||
|
|||
Program: Insight Segmentation & Registration Toolkit |
|||
Module: $RCSfile$ |
|||
Language: C++ |
|||
Date: $Date$ |
|||
Version: $Revision$ |
|||
|
|||
|
|||
Copyright (c) 2000 National Library of Medicine |
|||
All rights reserved. |
|||
|
|||
See COPYRIGHT.txt for copyright details. |
|||
|
|||
=========================================================================*/ |
|||
#ifndef cmCablePackageCommand_h |
|||
#define cmCablePackageCommand_h |
|||
|
|||
#include "cmStandardIncludes.h" |
|||
#include "cmCableCommand.h" |
|||
|
|||
/** \class cmCablePackageCommand |
|||
* \brief Define a command that begins a CABLE Package definition. |
|||
* |
|||
* cmCablePackageCommand is used to generate a new CABLE Package. |
|||
* All subsequent commands that require a package will refer to that |
|||
* setup by this command, until another package is started. |
|||
*/ |
|||
class cmCablePackageCommand : public cmCableCommand |
|||
{ |
|||
public: |
|||
cmCablePackageCommand() {} |
|||
virtual ~cmCablePackageCommand() {} |
|||
|
|||
/** |
|||
* This is a virtual constructor for the command. |
|||
*/ |
|||
virtual cmCommand* Clone() |
|||
{ |
|||
return new cmCablePackageCommand; |
|||
} |
|||
|
|||
/** |
|||
* This is called when the command is first encountered in |
|||
* the CMakeLists.txt file. |
|||
*/ |
|||
virtual bool Invoke(std::vector<std::string>& args); |
|||
|
|||
/** |
|||
* The name of the command as specified in CMakeList.txt. |
|||
*/ |
|||
virtual const char* GetName() { return "CABLE_PACKAGE";} |
|||
|
|||
/** |
|||
* Succinct documentation. |
|||
*/ |
|||
virtual const char* GetTerseDocumentation() |
|||
{ |
|||
return "Begin a package definition."; |
|||
} |
|||
|
|||
/** |
|||
* More documentation. |
|||
*/ |
|||
virtual const char* GetFullDocumentation() |
|||
{ |
|||
return |
|||
"CABLE_PACKAGE(package_name)\n" |
|||
"Close current package (if any), and open a new package definition."; |
|||
} |
|||
|
|||
void WritePackageHeader() const; |
|||
void WritePackageFooter() const; |
|||
|
|||
cmTypeMacro(cmCablePackageCommand, cmCableCommand); |
|||
private: |
|||
/** |
|||
* The name of the package. |
|||
*/ |
|||
std::string m_PackageName; |
|||
}; |
|||
|
|||
|
|||
|
|||
#endif |
@ -0,0 +1,42 @@ |
|||
/*=========================================================================
|
|||
|
|||
Program: Insight Segmentation & Registration Toolkit |
|||
Module: $RCSfile$ |
|||
Language: C++ |
|||
Date: $Date$ |
|||
Version: $Revision$ |
|||
|
|||
|
|||
Copyright (c) 2000 National Library of Medicine |
|||
All rights reserved. |
|||
|
|||
See COPYRIGHT.txt for copyright details. |
|||
|
|||
=========================================================================*/ |
|||
#include "cmCablePackageEntryCommand.h"
|
|||
#include "cmCacheManager.h"
|
|||
|
|||
// cmCablePackageEntryCommand
|
|||
bool cmCablePackageEntryCommand::Invoke(std::vector<std::string>& args) |
|||
{ |
|||
if(args.size() < 1) |
|||
{ |
|||
this->SetError("called with incorrect number of arguments"); |
|||
return false; |
|||
} |
|||
|
|||
// This command instance needs to use the cmCableData instance.
|
|||
this->SetupCableData(); |
|||
|
|||
// The arguments are the entries to the Pacakge.
|
|||
for(std::vector<std::string>::const_iterator arg = args.begin(); |
|||
arg != args.end(); ++arg) |
|||
{ |
|||
m_Entries.push_back(*arg); |
|||
} |
|||
|
|||
// Write this command's configuration.
|
|||
this->WriteConfiguration(); |
|||
|
|||
return true; |
|||
} |
@ -0,0 +1,57 @@ |
|||
/*========================================================================= |
|||
|
|||
Program: Insight Segmentation & Registration Toolkit |
|||
Module: $RCSfile$ |
|||
Language: C++ |
|||
Date: $Date$ |
|||
Version: $Revision$ |
|||
|
|||
|
|||
Copyright (c) 2000 National Library of Medicine |
|||
All rights reserved. |
|||
|
|||
See COPYRIGHT.txt for copyright details. |
|||
|
|||
=========================================================================*/ |
|||
#ifndef cmCablePackageEntryCommand_h |
|||
#define cmCablePackageEntryCommand_h |
|||
|
|||
#include "cmStandardIncludes.h" |
|||
#include "cmCableCommand.h" |
|||
|
|||
/** \class cmCablePackageEntryCommand |
|||
* \brief Superclass to all CABLE Package entry generation commands. |
|||
* |
|||
* cmCablePackageEntryCommand implements the Invoke method of a cmCommand |
|||
* to save the arguments as a vector of entries to a CABLE Package. The |
|||
* Invoke then calls the virtual WriteConfiguration() so that the subclass |
|||
* can generate the configuration code for its particular type of Package |
|||
* entry. |
|||
*/ |
|||
class cmCablePackageEntryCommand : public cmCableCommand |
|||
{ |
|||
public: |
|||
cmCablePackageEntryCommand() {} |
|||
virtual ~cmCablePackageEntryCommand() {} |
|||
|
|||
/** |
|||
* This is called when the command is first encountered in |
|||
* the CMakeLists.txt file. |
|||
*/ |
|||
virtual bool Invoke(std::vector<std::string>& args); |
|||
|
|||
cmTypeMacro(cmCablePackageEntryCommand, cmCableCommand); |
|||
|
|||
virtual void WriteConfiguration() const =0; |
|||
protected: |
|||
typedef std::vector<std::string> Entries; |
|||
|
|||
/** |
|||
* The package entries. |
|||
*/ |
|||
Entries m_Entries; |
|||
}; |
|||
|
|||
|
|||
|
|||
#endif |
@ -0,0 +1,37 @@ |
|||
/*=========================================================================
|
|||
|
|||
Program: Insight Segmentation & Registration Toolkit |
|||
Module: $RCSfile$ |
|||
Language: C++ |
|||
Date: $Date$ |
|||
Version: $Revision$ |
|||
|
|||
|
|||
Copyright (c) 2000 National Library of Medicine |
|||
All rights reserved. |
|||
|
|||
See COPYRIGHT.txt for copyright details. |
|||
|
|||
=========================================================================*/ |
|||
#include "cmCableSourceFilesCommand.h"
|
|||
#include "cmCacheManager.h"
|
|||
|
|||
/**
|
|||
* Write the CABLE configuration code to indicate header dependencies for |
|||
* a package. |
|||
*/ |
|||
void cmCableSourceFilesCommand::WriteConfiguration() const |
|||
{ |
|||
std::ostream& os = m_CableData->GetOutputStream(); |
|||
cmCableData::Indentation indent = m_CableData->GetIndentation(); |
|||
|
|||
cmRegularExpression needCdataBlock("[&<>]"); |
|||
|
|||
os << indent << "<Headers>" << std::endl; |
|||
for(Entries::const_iterator f = m_Entries.begin(); |
|||
f != m_Entries.end(); ++f) |
|||
{ |
|||
os << indent << " <File name=\"" << f->c_str() << ".h\"/>" << std::endl; |
|||
} |
|||
os << indent << "</Headers>" << std::endl; |
|||
} |
@ -0,0 +1,71 @@ |
|||
/*========================================================================= |
|||
|
|||
Program: Insight Segmentation & Registration Toolkit |
|||
Module: $RCSfile$ |
|||
Language: C++ |
|||
Date: $Date$ |
|||
Version: $Revision$ |
|||
|
|||
|
|||
Copyright (c) 2000 National Library of Medicine |
|||
All rights reserved. |
|||
|
|||
See COPYRIGHT.txt for copyright details. |
|||
|
|||
=========================================================================*/ |
|||
#ifndef cmCableSourceFilesCommand_h |
|||
#define cmCableSourceFilesCommand_h |
|||
|
|||
#include "cmStandardIncludes.h" |
|||
#include "cmCablePackageEntryCommand.h" |
|||
|
|||
/** \class cmCableSourceFilesCommand |
|||
* \brief Define a command that generates a rule for a CABLE Headers block. |
|||
* |
|||
* cmCableSourceFilesCommand is used to generate a rule in a CABLE |
|||
* configuration file to setup a Package's include files. |
|||
*/ |
|||
class cmCableSourceFilesCommand : public cmCablePackageEntryCommand |
|||
{ |
|||
public: |
|||
/** |
|||
* This is a virtual constructor for the command. |
|||
*/ |
|||
virtual cmCommand* Clone() |
|||
{ |
|||
return new cmCableSourceFilesCommand; |
|||
} |
|||
|
|||
/** |
|||
* The name of the command as specified in CMakeList.txt. |
|||
*/ |
|||
virtual const char* GetName() { return "CABLE_SOURCE_FILES";} |
|||
|
|||
/** |
|||
* Succinct documentation. |
|||
*/ |
|||
virtual const char* GetTerseDocumentation() |
|||
{ |
|||
return "Define CABLE header file dependencies in a package."; |
|||
} |
|||
|
|||
/** |
|||
* More documentation. |
|||
*/ |
|||
virtual const char* GetFullDocumentation() |
|||
{ |
|||
return |
|||
"CABLE_SOURCE_FILES(file1 file2 ...)" |
|||
"Generates a Package's Headers block in the CABLE configuration."; |
|||
} |
|||
|
|||
virtual void WriteConfiguration() const; |
|||
|
|||
cmTypeMacro(cmCableSourceFilesCommand, cmCableCommand); |
|||
protected: |
|||
typedef cmCablePackageEntryCommand::Entries Entries; |
|||
}; |
|||
|
|||
|
|||
|
|||
#endif |
@ -0,0 +1,45 @@ |
|||
/*=========================================================================
|
|||
|
|||
Program: Insight Segmentation & Registration Toolkit |
|||
Module: $RCSfile$ |
|||
Language: C++ |
|||
Date: $Date$ |
|||
Version: $Revision$ |
|||
|
|||
|
|||
Copyright (c) 2000 National Library of Medicine |
|||
All rights reserved. |
|||
|
|||
See COPYRIGHT.txt for copyright details. |
|||
|
|||
=========================================================================*/ |
|||
#include "cmCableWrapCommand.h"
|
|||
#include "cmCacheManager.h"
|
|||
|
|||
/**
|
|||
* Write the CABLE configuration code to define this WrapperSet. |
|||
*/ |
|||
void cmCableWrapCommand::WriteConfiguration() const |
|||
{ |
|||
std::ostream& os = m_CableData->GetOutputStream(); |
|||
cmCableData::Indentation indent = m_CableData->GetIndentation(); |
|||
|
|||
cmRegularExpression needCdataBlock("[&<>]"); |
|||
|
|||
os << indent << "<WrapperSet>" << std::endl; |
|||
for(Entries::const_iterator e = m_Entries.begin(); |
|||
e != m_Entries.end(); ++e) |
|||
{ |
|||
os << indent << " <Element>"; |
|||
if(needCdataBlock.find(e->c_str())) |
|||
{ |
|||
os << "<![CDATA[" << e->c_str() << "]]>"; |
|||
} |
|||
else |
|||
{ |
|||
os << e->c_str(); |
|||
} |
|||
os << "</Element>" << std::endl; |
|||
} |
|||
os << indent << "</WrapperSet>" << std::endl; |
|||
} |
@ -0,0 +1,69 @@ |
|||
/*========================================================================= |
|||
|
|||
Program: Insight Segmentation & Registration Toolkit |
|||
Module: $RCSfile$ |
|||
Language: C++ |
|||
Date: $Date$ |
|||
Version: $Revision$ |
|||
|
|||
|
|||
Copyright (c) 2000 National Library of Medicine |
|||
All rights reserved. |
|||
|
|||
See COPYRIGHT.txt for copyright details. |
|||
|
|||
=========================================================================*/ |
|||
#ifndef cmCableWrapCommand_h |
|||
#define cmCableWrapCommand_h |
|||
|
|||
#include "cmStandardIncludes.h" |
|||
#include "cmCablePackageEntryCommand.h" |
|||
|
|||
/** \class cmCableWrapCommand |
|||
* \brief Define a command that generates a rule for CABLE-generated wrappers. |
|||
* |
|||
* cmCableWrapCommand is used to generate a rule in a CABLE |
|||
* configuration file to create type wrappers. |
|||
*/ |
|||
class cmCableWrapCommand : public cmCablePackageEntryCommand |
|||
{ |
|||
public: |
|||
/** |
|||
* This is a virtual constructor for the command. |
|||
*/ |
|||
virtual cmCommand* Clone() |
|||
{ |
|||
return new cmCableWrapCommand; |
|||
} |
|||
|
|||
/** |
|||
* The name of the command as specified in CMakeList.txt. |
|||
*/ |
|||
virtual const char* GetName() { return "CABLE_WRAP";} |
|||
|
|||
/** |
|||
* Succinct documentation. |
|||
*/ |
|||
virtual const char* GetTerseDocumentation() |
|||
{ |
|||
return "Define CABLE WrapSet in a package."; |
|||
} |
|||
|
|||
/** |
|||
* More documentation. |
|||
*/ |
|||
virtual const char* GetFullDocumentation() |
|||
{ |
|||
return |
|||
"CABLE_WRAP(member1 member2 ...)\n" |
|||
"Generates a WrapSet in the CABLE configuration."; |
|||
} |
|||
|
|||
virtual void WriteConfiguration() const; |
|||
|
|||
cmTypeMacro(cmCableWrapCommand, cmCablePackageCommand); |
|||
}; |
|||
|
|||
|
|||
|
|||
#endif |
Write
Preview
Loading…
Cancel
Save
Reference in new issue