From f0cab28136e0758f7bf7c60581d714f5f5dbbf08 Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Fri, 23 Jan 2015 01:31:59 +0000 Subject: [PATCH] SSPCPP-616 - fix tuple namespaces and string literal errors --- plugins/TransformAttributeResolver.cpp | 4 ++-- .../attribute/filtering/impl/XMLAttributeFilter.cpp | 20 ++++++++++---------- .../resolver/impl/ChainingAttributeResolver.cpp | 6 +++--- .../resolver/impl/MetadataAttributeExtractor.cpp | 4 ++-- .../resolver/impl/XMLAttributeExtractor.cpp | 6 +++--- shibsp/impl/XMLRequestMapper.cpp | 6 +++--- shibsp/impl/XMLServiceProvider.cpp | 6 +++--- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/plugins/TransformAttributeResolver.cpp b/plugins/TransformAttributeResolver.cpp index 21a0246..5dfcaa1 100644 --- a/plugins/TransformAttributeResolver.cpp +++ b/plugins/TransformAttributeResolver.cpp @@ -132,7 +132,7 @@ namespace shibsp { Category& m_log; string m_source; // dest id, regex to apply, replacement string - typedef tuple,const XMLCh*> regex_t; + typedef boost::tuple,const XMLCh*> regex_t; vector m_regex; }; @@ -168,7 +168,7 @@ TransformAttributeResolver::TransformAttributeResolver(const DOMElement* e) try { static XMLCh options[] = { chLatin_i, chNull }; boost::shared_ptr re(new RegularExpression(e->getAttributeNS(nullptr, match), (caseflag ? &chNull : options))); - m_regex.push_back(make_tuple(destId, re, repl)); + m_regex.push_back(boost::make_tuple(destId, re, repl)); } catch (XMLException& ex) { auto_ptr_char msg(ex.getMessage()); diff --git a/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp b/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp index 895ac0a..ede3195 100644 --- a/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp +++ b/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp @@ -90,14 +90,14 @@ namespace shibsp { MatchFunctor* buildFunctor( const DOMElement* e, const FilterPolicyContext& functorMap, const char* logname, bool standalone ); - tuple buildAttributeRule( + boost::tuple buildAttributeRule( const DOMElement* e, const FilterPolicyContext& permMap, const FilterPolicyContext& denyMap, bool standalone ); Category& m_log; DOMDocument* m_document; vector m_policies; - map< string,tuple > m_attrRules; + map< string,boost::tuple > m_attrRules; multimap m_policyReqRules; multimap m_permitValRules; multimap m_denyValRules; @@ -194,14 +194,14 @@ XMLFilterImpl::XMLFilterImpl(const DOMElement* e, Category& log) : m_log(log), m e = XMLHelper::getNextSiblingElement(e); while (e) { if (e && XMLHelper::isNodeNamed(e, SHIB2ATTRIBUTEFILTER_NS, AttributeRule)) { - tuple rule = buildAttributeRule(e, permFunctors, denyFunctors, false); + boost::tuple rule = buildAttributeRule(e, permFunctors, denyFunctors, false); if (rule.get<1>() || rule.get<2>()) m_policies.back().m_rules.insert(Policy::rules_t::value_type(rule.get<0>(), make_pair(rule.get<1>(), rule.get<2>()))); } else if (e && XMLHelper::isNodeNamed(e, SHIB2ATTRIBUTEFILTER_NS, AttributeRuleReference)) { string ref(XMLHelper::getAttrString(e, nullptr, _ref)); if (!ref.empty()) { - map< string,tuple >::const_iterator ar = m_attrRules.find(ref); + map< string,boost::tuple >::const_iterator ar = m_attrRules.find(ref); if (ar != m_attrRules.end()) { m_policies.back().m_rules.insert( Policy::rules_t::value_type(ar->second.get<0>(), make_pair(ar->second.get<1>(), ar->second.get<2>())) @@ -261,7 +261,7 @@ MatchFunctor* XMLFilterImpl::buildFunctor( return nullptr; } -tuple XMLFilterImpl::buildAttributeRule( +boost::tuple XMLFilterImpl::buildAttributeRule( const DOMElement* e, const FilterPolicyContext& permMap, const FilterPolicyContext& denyMap, bool standalone ) { @@ -269,12 +269,12 @@ tuple XMLFilterImpl::buildAttrib if (standalone && id.empty()) { m_log.warn("skipping stand-alone AttributeRule with no id"); - return tuple(string(),nullptr,nullptr); + return boost::tuple(string(),nullptr,nullptr); } else if (!id.empty() && m_attrRules.count(id)) { if (standalone) { m_log.warn("skipping duplicate stand-alone AttributeRule with id (%s)", id.c_str()); - return tuple(string(),nullptr,nullptr); + return boost::tuple(string(),nullptr,nullptr); } else id.clear(); @@ -314,11 +314,11 @@ tuple XMLFilterImpl::buildAttrib if (perm || deny) { if (!id.empty()) { - m_attrRules[id] = make_tuple(attrID, perm, deny); + m_attrRules[id] = boost::make_tuple(attrID, perm, deny); return m_attrRules[id]; } else { - return make_tuple(attrID, perm, deny); + return boost::make_tuple(attrID, perm, deny); } } @@ -326,7 +326,7 @@ tuple XMLFilterImpl::buildAttrib m_log.warn("skipping AttributeRule (%s), permit and denial rule(s) invalid or missing", id.c_str()); else m_log.warn("skipping AttributeRule, permit and denial rule(s) invalid or missing"); - return tuple(string(),nullptr,nullptr); + return boost::tuple(string(),nullptr,nullptr); } void XMLFilterImpl::filterAttributes(const FilteringContext& context, vector& attributes) const diff --git a/shibsp/attribute/resolver/impl/ChainingAttributeResolver.cpp b/shibsp/attribute/resolver/impl/ChainingAttributeResolver.cpp index d4227f9..39ee374 100644 --- a/shibsp/attribute/resolver/impl/ChainingAttributeResolver.cpp +++ b/shibsp/attribute/resolver/impl/ChainingAttributeResolver.cpp @@ -233,7 +233,7 @@ ChainingAttributeResolver::ChainingAttributeResolver(const DOMElement* e) string t(XMLHelper::getAttrString(e, nullptr, _type)); if (!t.empty()) { try { - Category::getInstance(SHIBSP_LOGCAT ".AttributeResolver."CHAINING_ATTRIBUTE_RESOLVER).info( + Category::getInstance(SHIBSP_LOGCAT ".AttributeResolver." CHAINING_ATTRIBUTE_RESOLVER).info( "building AttributeResolver of type (%s)...", t.c_str() ); auto_ptr np(conf.AttributeResolverManager.newPlugin(t.c_str(), e)); @@ -241,7 +241,7 @@ ChainingAttributeResolver::ChainingAttributeResolver(const DOMElement* e) np.release(); } catch (exception& ex) { - Category::getInstance(SHIBSP_LOGCAT ".AttributeResolver."CHAINING_ATTRIBUTE_RESOLVER).error( + Category::getInstance(SHIBSP_LOGCAT ".AttributeResolver." CHAINING_ATTRIBUTE_RESOLVER).error( "caught exception processing embedded AttributeResolver element: %s", ex.what() ); } @@ -275,7 +275,7 @@ void ChainingAttributeResolver::resolveAttributes(ResolutionContext& ctx) const context->getResolvedAssertions().clear(); } catch (exception& ex) { - Category::getInstance(SHIBSP_LOGCAT ".AttributeResolver."CHAINING_ATTRIBUTE_RESOLVER).error( + Category::getInstance(SHIBSP_LOGCAT ".AttributeResolver." CHAINING_ATTRIBUTE_RESOLVER).error( "caught exception applying AttributeResolver in chain: %s", ex.what() ); } diff --git a/shibsp/attribute/resolver/impl/MetadataAttributeExtractor.cpp b/shibsp/attribute/resolver/impl/MetadataAttributeExtractor.cpp index 61742ed..3a4ed59 100644 --- a/shibsp/attribute/resolver/impl/MetadataAttributeExtractor.cpp +++ b/shibsp/attribute/resolver/impl/MetadataAttributeExtractor.cpp @@ -96,8 +96,8 @@ namespace shibsp { m_orgName, m_orgDisplayName, m_orgURL; - typedef tuple< string,xstring,boost::shared_ptr > contact_tuple_t; - typedef tuple< string,int,int,boost::shared_ptr > logo_tuple_t; + typedef boost::tuple< string,xstring,boost::shared_ptr > contact_tuple_t; + typedef boost::tuple< string,int,int,boost::shared_ptr > logo_tuple_t; vector m_contacts; // tuple is attributeID, contact type, decoder vector m_logos; // tuple is attributeID, height, width, decoder diff --git a/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp b/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp index ffd9108..beb726c 100644 --- a/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp +++ b/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp @@ -124,7 +124,7 @@ namespace shibsp { typedef map< pair,pair< boost::shared_ptr,vector > > attrmap_t; attrmap_t m_attrMap; vector m_attributeIds; - vector< tuple > m_requestedAttrs; + vector< boost::tuple > m_requestedAttrs; // settings for embedded assertions in metadata string m_policyId; @@ -341,7 +341,7 @@ XMLExtractorImpl::XMLExtractorImpl(const DOMElement* e, Category& log) bool requested = XMLHelper::getAttrBool(child, false, isRequested); bool required = XMLHelper::getAttrBool(child, false, RequestedAttribute::ISREQUIRED_ATTRIB_NAME); if (required || requested) - m_requestedAttrs.push_back(tuple(name,format,required)); + m_requestedAttrs.push_back(boost::tuple(name,format,required)); name = child->getAttributeNS(nullptr, _aliases); if (name && *name) { @@ -387,7 +387,7 @@ void XMLExtractorImpl::generateMetadata(SPSSODescriptor& role) const static const XMLCh english[] = UNICODE_LITERAL_2(e,n); sn->setLang(english); - for (vector< tuple >::const_iterator i = m_requestedAttrs.begin(); i != m_requestedAttrs.end(); ++i) { + for (vector< boost::tuple >::const_iterator i = m_requestedAttrs.begin(); i != m_requestedAttrs.end(); ++i) { RequestedAttribute* req = RequestedAttributeBuilder::buildRequestedAttribute(); svc->getRequestedAttributes().push_back(req); req->setName(i->get<0>().c_str()); diff --git a/shibsp/impl/XMLRequestMapper.cpp b/shibsp/impl/XMLRequestMapper.cpp index 300a0c8..2b4905d 100644 --- a/shibsp/impl/XMLRequestMapper.cpp +++ b/shibsp/impl/XMLRequestMapper.cpp @@ -94,7 +94,7 @@ namespace shibsp { bool m_unicodeAware; map< string,boost::shared_ptr > m_map; vector< pair< boost::shared_ptr,boost::shared_ptr > > m_regexps; - vector< tuple< string,boost::shared_ptr,boost::shared_ptr > > m_queries; + vector< boost::tuple< string,boost::shared_ptr,boost::shared_ptr > > m_queries; private: scoped_ptr m_acl; @@ -346,7 +346,7 @@ Override::Override(bool unicodeAware, const DOMElement* e, Category& log, const try { boost::shared_ptr o(new Override(m_unicodeAware, path, log, this)); boost::shared_ptr re((v && *v) ? new RegularExpression(v) : nullptr); - m_queries.push_back(make_tuple(string(ntemp.get()), re, o)); + m_queries.push_back(boost::make_tuple(string(ntemp.get()), re, o)); } catch (XMLException& ex) { auto_ptr_char tmp(ex.getMessage()); @@ -418,7 +418,7 @@ const Override* Override::locate(const HTTPRequest& request) const CGIParser cgi(request, true); do { descended = false; - for (vector< tuple< string,boost::shared_ptr,boost::shared_ptr > >::const_iterator q = o->m_queries.begin(); !descended && q != o->m_queries.end(); ++q) { + for (vector< boost::tuple< string,boost::shared_ptr,boost::shared_ptr > >::const_iterator q = o->m_queries.begin(); !descended && q != o->m_queries.end(); ++q) { pair vals = cgi.getParameters(q->get<0>().c_str()); if (vals.first != vals.second) { if (q->get<1>()) { diff --git a/shibsp/impl/XMLServiceProvider.cpp b/shibsp/impl/XMLServiceProvider.cpp index f729ed2..59c86eb 100644 --- a/shibsp/impl/XMLServiceProvider.cpp +++ b/shibsp/impl/XMLServiceProvider.cpp @@ -304,7 +304,7 @@ namespace { #ifndef SHIBSP_LITE scoped_ptr m_tranLog; scoped_ptr m_policy; - vector< tuple > m_transportOptions; + vector< boost::tuple > m_transportOptions; #endif scoped_ptr m_requestMapper; map< string,boost::shared_ptr > m_appmap; @@ -439,7 +439,7 @@ namespace { bool setTransportOptions(SOAPTransport& transport) const { bool ret = true; - for (vector< tuple >::const_iterator opt = m_impl->m_transportOptions.begin(); + for (vector< boost::tuple >::const_iterator opt = m_impl->m_transportOptions.begin(); opt != m_impl->m_transportOptions.end(); ++opt) { if (!transport.setProviderOption(opt->get<0>().c_str(), opt->get<1>().c_str(), opt->get<2>().c_str())) { m_log.error("failed to set SOAPTransport option (%s)", opt->get<1>().c_str()); @@ -2194,7 +2194,7 @@ XMLConfigImpl::XMLConfigImpl(const DOMElement* e, bool first, XMLConfig* outer, string option(XMLHelper::getAttrString(child, nullptr, _option)); auto_ptr_char value(child->getFirstChild()->getNodeValue()); if (!provider.empty() && !option.empty() && value.get() && *value.get()) { - m_transportOptions.push_back(make_tuple(provider, option, string(value.get()))); + m_transportOptions.push_back(boost::make_tuple(provider, option, string(value.get()))); } } child = XMLHelper::getPreviousSiblingElement(child, TransportOption); -- 2.1.4