diff options
-rw-r--r-- | Source/cmCableDefineSetCommand.cxx | 4 | ||||
-rw-r--r-- | Source/cmCableDefineSetCommand.h | 3 | ||||
-rw-r--r-- | Source/cmCableWrapCommand.cxx | 36 | ||||
-rw-r--r-- | Source/cmCableWrapCommand.h | 22 |
4 files changed, 19 insertions, 46 deletions
diff --git a/Source/cmCableDefineSetCommand.cxx b/Source/cmCableDefineSetCommand.cxx index 7d5a35c..f7552b6 100644 --- a/Source/cmCableDefineSetCommand.cxx +++ b/Source/cmCableDefineSetCommand.cxx @@ -103,7 +103,7 @@ void cmCableDefineSetCommand::WriteConfiguration() const cmCableData::Indentation indent = m_CableData->GetIndentation(); // Output the code. - os << indent << "<Set name=\"" << m_SetName.c_str() << "\">" << std::endl; + os << indent << "<" << this->GetXmlTag() << " name=\"" << m_SetName.c_str() << "\">" << std::endl; for(std::vector<std::string>::const_iterator e = m_SourceHeaders.begin(); e != m_SourceHeaders.end(); ++e) { @@ -135,7 +135,7 @@ void cmCableDefineSetCommand::WriteConfiguration() const } os << "</Element>" << std::endl; } - os << indent << "</Set>" << std::endl; + os << indent << "</" << this->GetXmlTag() << ">" << std::endl; } diff --git a/Source/cmCableDefineSetCommand.h b/Source/cmCableDefineSetCommand.h index 3b0d200..6b37e56 100644 --- a/Source/cmCableDefineSetCommand.h +++ b/Source/cmCableDefineSetCommand.h @@ -106,7 +106,8 @@ public: cmTypeMacro(cmCableDefineSetCommand, cmCableCommand); -private: +protected: + virtual const char* GetXmlTag() const { return "Set"; } void WriteConfiguration() const; bool AddElement(const std::string&); bool GenerateTag(const std::string&, std::string&); diff --git a/Source/cmCableWrapCommand.cxx b/Source/cmCableWrapCommand.cxx index 7cea981..9364cb3 100644 --- a/Source/cmCableWrapCommand.cxx +++ b/Source/cmCableWrapCommand.cxx @@ -41,38 +41,4 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmCableWrapCommand.h" #include "cmCacheManager.h" -/** - * Write the CABLE configuration code to define this WrapperSet. - */ -bool cmCableWrapCommand::WriteConfiguration() -{ - if(m_Entries.size() < 2) - { - this->SetError("called with incorrect number of arguments"); - return false; - } - - std::ostream& os = m_CableData->GetOutputStream(); - cmCableData::Indentation indent = m_CableData->GetIndentation(); - - cmRegularExpression needCdataBlock("[&<>]"); - - Entries::const_iterator e = m_Entries.begin(); - os << indent << "<WrapperSet name=\"" << e->c_str() << "\">" << std::endl; - for(++e;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; - - return true; -} +// Don't need to implement anything here. diff --git a/Source/cmCableWrapCommand.h b/Source/cmCableWrapCommand.h index 315eec3..9f7b60e 100644 --- a/Source/cmCableWrapCommand.h +++ b/Source/cmCableWrapCommand.h @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define cmCableWrapCommand_h #include "cmStandardIncludes.h" -#include "cmCablePackageEntryCommand.h" +#include "cmCableDefineSetCommand.h" /** \class cmCableWrapCommand * \brief Define a command that generates a rule for CABLE-generated wrappers. @@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * cmCableWrapCommand is used to generate a rule in a CABLE * configuration file to create type wrappers. */ -class cmCableWrapCommand : public cmCablePackageEntryCommand +class cmCableWrapCommand : public cmCableDefineSetCommand { public: /** @@ -71,7 +71,7 @@ public: */ virtual const char* GetTerseDocumentation() { - return "Define CABLE WrapSet in a package."; + return "Define CABLE WrapperSet in a package."; } /** @@ -80,13 +80,19 @@ public: virtual const char* GetFullDocumentation() { return - "CABLE_WRAP(member1 member2 ...)\n" - "Generates a WrapSet in the CABLE configuration."; + "CABLE_WRAP(name_of_set [[tag1]:]memeber1 [[tag2]:]member2 ...\n" + " [SOURCE_FILES source1 source2 ...]] )\n" + "Generates a WrapperSet definition in the CABLE configuration.\n" + "If a the \"tag:\" syntax is not used, an attempt is made to\n" + "auto-generate a meaningful tag. If the SOURCE_FILES keyword is\n" + "given, all arguments after it refer to header files to be included\n" + "in the package in which the set is defined.\n"; } - - virtual bool WriteConfiguration(); - cmTypeMacro(cmCableWrapCommand, cmCablePackageCommand); + cmTypeMacro(cmCableWrapCommand, cmCableDefineSetCommand); + +protected: + virtual const char* GetXmlTag() const { return "WrapperSet"; } }; |