From 2d242ad9c47ec489fa726dc5ab0be957c70c5605 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Wed, 20 Sep 2017 15:54:04 +0200 Subject: [PATCH] add prologue and epilogue to XSD generated files --- src/xml/conference-info.cpp | 73 +++++++++++++++++++------------------ src/xml/conference-info.h | 11 ++++++ src/xml/generate.py | 17 +++++++++ src/xml/resource-lists.cpp | 11 ++++++ src/xml/resource-lists.h | 11 ++++++ src/xml/xml.cpp | 27 ++++++++------ src/xml/xml.h | 11 ++++++ 7 files changed, 114 insertions(+), 47 deletions(-) diff --git a/src/xml/conference-info.cpp b/src/xml/conference-info.cpp index e09fb01ae..7cd27bf03 100644 --- a/src/xml/conference-info.cpp +++ b/src/xml/conference-info.cpp @@ -33,26 +33,23 @@ // Begin prologue. // -// -// End prologue. - -#include #if __clang__ || __GNUC__ >= 4 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsuggest-override" #endif -#include "conference-info.h" +// +// End prologue. -#if __clang__ || __GNUC__ >= 4 - #pragma GCC diagnostic pop -#endif +#include + +#include "conference-info.h" namespace conference_info { // Conference_type - // + // const Conference_type::Conference_descriptionOptional& Conference_type:: getConference_description () const @@ -374,7 +371,7 @@ namespace conference_info // State_type - // + // State_type:: State_type (Value v) @@ -411,7 +408,7 @@ namespace conference_info State_type& State_type:: operator= (Value v) { - static_cast< ::xml_schema::String& > (*this) = + static_cast< ::xml_schema::String& > (*this) = ::xml_schema::String (_xsd_State_type_literals_[v]); return *this; @@ -419,7 +416,7 @@ namespace conference_info // Conference_description_type - // + // const Conference_description_type::Display_textOptional& Conference_description_type:: getDisplay_text () const @@ -705,7 +702,7 @@ namespace conference_info // Host_type - // + // const Host_type::Display_textOptional& Host_type:: getDisplay_text () const @@ -847,7 +844,7 @@ namespace conference_info // Conference_state_type - // + // const Conference_state_type::User_countOptional& Conference_state_type:: getUser_count () const @@ -971,7 +968,7 @@ namespace conference_info // Conference_media_type - // + // const Conference_media_type::EntrySequence& Conference_media_type:: getEntry () const @@ -1023,7 +1020,7 @@ namespace conference_info // Conference_medium_type - // + // const Conference_medium_type::Display_textOptional& Conference_medium_type:: getDisplay_text () const @@ -1195,7 +1192,7 @@ namespace conference_info // Uris_type - // + // const Uris_type::EntrySequence& Uris_type:: getEntry () const @@ -1283,7 +1280,7 @@ namespace conference_info // Uri_type - // + // const Uri_type::UriType& Uri_type:: getUri () const @@ -1479,7 +1476,7 @@ namespace conference_info } // Users_type - // + // const Users_type::UserSequence& Users_type:: getUser () const @@ -1585,7 +1582,7 @@ namespace conference_info // User_type - // + // const User_type::Display_textOptional& User_type:: getDisplay_text () const @@ -1871,7 +1868,7 @@ namespace conference_info // User_roles_type - // + // const User_roles_type::EntrySequence& User_roles_type:: getEntry () const @@ -1947,7 +1944,7 @@ namespace conference_info } // Endpoint_type - // + // const Endpoint_type::Display_textOptional& Endpoint_type:: getDisplay_text () const @@ -2323,7 +2320,7 @@ namespace conference_info // Endpoint_status_type - // + // Endpoint_status_type:: Endpoint_status_type (Value v) @@ -2360,7 +2357,7 @@ namespace conference_info Endpoint_status_type& Endpoint_status_type:: operator= (Value v) { - static_cast< ::xml_schema::String& > (*this) = + static_cast< ::xml_schema::String& > (*this) = ::xml_schema::String (_xsd_Endpoint_status_type_literals_[v]); return *this; @@ -2368,7 +2365,7 @@ namespace conference_info // Joining_type - // + // Joining_type:: Joining_type (Value v) @@ -2405,7 +2402,7 @@ namespace conference_info Joining_type& Joining_type:: operator= (Value v) { - static_cast< ::xml_schema::String& > (*this) = + static_cast< ::xml_schema::String& > (*this) = ::xml_schema::String (_xsd_Joining_type_literals_[v]); return *this; @@ -2413,7 +2410,7 @@ namespace conference_info // Disconnection_type - // + // Disconnection_type:: Disconnection_type (Value v) @@ -2450,7 +2447,7 @@ namespace conference_info Disconnection_type& Disconnection_type:: operator= (Value v) { - static_cast< ::xml_schema::String& > (*this) = + static_cast< ::xml_schema::String& > (*this) = ::xml_schema::String (_xsd_Disconnection_type_literals_[v]); return *this; @@ -2458,7 +2455,7 @@ namespace conference_info // Execution_type - // + // const Execution_type::WhenOptional& Execution_type:: getWhen () const @@ -2582,7 +2579,7 @@ namespace conference_info // Call_type - // + // const Call_type::SipOptional& Call_type:: getSip () const @@ -2664,7 +2661,7 @@ namespace conference_info // Sip_dialog_id_type - // + // const Sip_dialog_id_type::Display_textOptional& Sip_dialog_id_type:: getDisplay_text () const @@ -2836,7 +2833,7 @@ namespace conference_info // Media_type - // + // const Media_type::Display_textOptional& Media_type:: getDisplay_text () const @@ -3068,7 +3065,7 @@ namespace conference_info // Media_status_type - // + // Media_status_type:: Media_status_type (Value v) @@ -3105,7 +3102,7 @@ namespace conference_info Media_status_type& Media_status_type:: operator= (Value v) { - static_cast< ::xml_schema::String& > (*this) = + static_cast< ::xml_schema::String& > (*this) = ::xml_schema::String (_xsd_Media_status_type_literals_[v]); return *this; @@ -3113,7 +3110,7 @@ namespace conference_info // Sidebars_by_val_type - // + // const Sidebars_by_val_type::EntrySequence& Sidebars_by_val_type:: getEntry () const @@ -9276,5 +9273,11 @@ namespace conference_info // Begin epilogue. // + +#if __clang__ || __GNUC__ >= 4 + #pragma GCC diagnostic pop +#endif + // // End epilogue. + diff --git a/src/xml/conference-info.h b/src/xml/conference-info.h index 1626d55e3..f950882c9 100644 --- a/src/xml/conference-info.h +++ b/src/xml/conference-info.h @@ -48,6 +48,12 @@ // Begin prologue. // + +#if __clang__ || __GNUC__ >= 4 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wsuggest-override" +#endif + // // End prologue. @@ -3856,6 +3862,11 @@ namespace conference_info // Begin epilogue. // + +#if __clang__ || __GNUC__ >= 4 + #pragma GCC diagnostic pop +#endif + // // End epilogue. diff --git a/src/xml/generate.py b/src/xml/generate.py index 42b400479..256230869 100755 --- a/src/xml/generate.py +++ b/src/xml/generate.py @@ -30,6 +30,21 @@ def find_xsdcxx(): xsdcxx = find_executable("xsd") return xsdcxx +def get_prologue(): + return """ +#if __clang__ || __GNUC__ >= 4 +\t#pragma GCC diagnostic push +\t#pragma GCC diagnostic ignored "-Wsuggest-override" +#endif +""" + +def get_epilogue(): + return """ +#if __clang__ || __GNUC__ >= 4 +\t#pragma GCC diagnostic pop +#endif +""" + def generate(name): xsdcxx = find_xsdcxx() if xsdcxx is None: @@ -57,6 +72,8 @@ def generate(name): "--hxx-suffix", ".h", "--ixx-suffix", ".h", "--cxx-suffix", ".cpp", + "--prologue", get_prologue(), + "--epilogue", get_epilogue(), "--location-regex", "%http://.+/(.+)%$1%", "--output-dir", "xml", source_file diff --git a/src/xml/resource-lists.cpp b/src/xml/resource-lists.cpp index 0f94f63c0..bbafc58ea 100644 --- a/src/xml/resource-lists.cpp +++ b/src/xml/resource-lists.cpp @@ -33,6 +33,12 @@ // Begin prologue. // + +#if __clang__ || __GNUC__ >= 4 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wsuggest-override" +#endif + // // End prologue. @@ -2446,6 +2452,11 @@ namespace resource_lists // Begin epilogue. // + +#if __clang__ || __GNUC__ >= 4 + #pragma GCC diagnostic pop +#endif + // // End epilogue. diff --git a/src/xml/resource-lists.h b/src/xml/resource-lists.h index 4c499fa3d..b3dab2800 100644 --- a/src/xml/resource-lists.h +++ b/src/xml/resource-lists.h @@ -48,6 +48,12 @@ // Begin prologue. // + +#if __clang__ || __GNUC__ >= 4 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wsuggest-override" +#endif + // // End prologue. @@ -1248,6 +1254,11 @@ namespace resource_lists // Begin epilogue. // + +#if __clang__ || __GNUC__ >= 4 + #pragma GCC diagnostic pop +#endif + // // End epilogue. diff --git a/src/xml/xml.cpp b/src/xml/xml.cpp index d8fb4a977..68e991eb8 100644 --- a/src/xml/xml.cpp +++ b/src/xml/xml.cpp @@ -33,21 +33,18 @@ // Begin prologue. // -// -// End prologue. - -#include #if __clang__ || __GNUC__ >= 4 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsuggest-override" #endif -#include "xml.h" +// +// End prologue. -#if __clang__ || __GNUC__ >= 4 - #pragma GCC diagnostic pop -#endif +#include + +#include "xml.h" namespace namespace_ { @@ -75,7 +72,7 @@ namespace namespace_ } // Space - // + // Space:: Space (Value v) @@ -112,7 +109,7 @@ namespace namespace_ Space& Space:: operator= (Value v) { - static_cast< ::xml_schema::Ncname& > (*this) = + static_cast< ::xml_schema::Ncname& > (*this) = ::xml_schema::Ncname (_xsd_Space_literals_[v]); return *this; @@ -120,7 +117,7 @@ namespace namespace_ // Lang_member - // + // Lang_member:: Lang_member (Value v) @@ -157,7 +154,7 @@ namespace namespace_ Lang_member& Lang_member:: operator= (Value v) { - static_cast< ::xml_schema::String& > (*this) = + static_cast< ::xml_schema::String& > (*this) = ::xml_schema::String (_xsd_Lang_member_literals_[v]); return *this; @@ -455,5 +452,11 @@ namespace namespace_ // Begin epilogue. // + +#if __clang__ || __GNUC__ >= 4 + #pragma GCC diagnostic pop +#endif + // // End epilogue. + diff --git a/src/xml/xml.h b/src/xml/xml.h index 916ef8807..54ad50e8c 100644 --- a/src/xml/xml.h +++ b/src/xml/xml.h @@ -48,6 +48,12 @@ // Begin prologue. // + +#if __clang__ || __GNUC__ >= 4 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wsuggest-override" +#endif + // // End prologue. @@ -497,6 +503,11 @@ namespace namespace_ // Begin epilogue. // + +#if __clang__ || __GNUC__ >= 4 + #pragma GCC diagnostic pop +#endif + // // End epilogue.