SSPCPP-616 - fix tuple namespaces and string literal errors
authorScott Cantor <cantor.2@osu.edu>
Fri, 23 Jan 2015 01:31:59 +0000 (01:31 +0000)
committerScott Cantor <cantor.2@osu.edu>
Fri, 23 Jan 2015 01:31:59 +0000 (01:31 +0000)
plugins/TransformAttributeResolver.cpp
shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp
shibsp/attribute/resolver/impl/ChainingAttributeResolver.cpp
shibsp/attribute/resolver/impl/MetadataAttributeExtractor.cpp
shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp
shibsp/impl/XMLRequestMapper.cpp
shibsp/impl/XMLServiceProvider.cpp

index 21a0246..5dfcaa1 100644 (file)
@@ -132,7 +132,7 @@ namespace shibsp {
         Category& m_log;
         string m_source;
         // dest id, regex to apply, replacement string
         Category& m_log;
         string m_source;
         // dest id, regex to apply, replacement string
-        typedef tuple<string,boost::shared_ptr<RegularExpression>,const XMLCh*> regex_t;
+        typedef boost::tuple<string,boost::shared_ptr<RegularExpression>,const XMLCh*> regex_t;
         vector<regex_t> m_regex;
     };
 
         vector<regex_t> m_regex;
     };
 
@@ -168,7 +168,7 @@ TransformAttributeResolver::TransformAttributeResolver(const DOMElement* e)
                 try {
                     static XMLCh options[] = { chLatin_i, chNull };
                     boost::shared_ptr<RegularExpression> re(new RegularExpression(e->getAttributeNS(nullptr, match), (caseflag ? &chNull : options)));
                 try {
                     static XMLCh options[] = { chLatin_i, chNull };
                     boost::shared_ptr<RegularExpression> 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());
                 }
                 catch (XMLException& ex) {
                     auto_ptr_char msg(ex.getMessage());
index 895ac0a..ede3195 100644 (file)
@@ -90,14 +90,14 @@ namespace shibsp {
         MatchFunctor* buildFunctor(
             const DOMElement* e, const FilterPolicyContext& functorMap, const char* logname, bool standalone
             );
         MatchFunctor* buildFunctor(
             const DOMElement* e, const FilterPolicyContext& functorMap, const char* logname, bool standalone
             );
-        tuple<string,const MatchFunctor*,const MatchFunctor*> buildAttributeRule(
+        boost::tuple<string,const MatchFunctor*,const MatchFunctor*> buildAttributeRule(
             const DOMElement* e, const FilterPolicyContext& permMap, const FilterPolicyContext& denyMap, bool standalone
             );
 
         Category& m_log;
         DOMDocument* m_document;
         vector<Policy> m_policies;
             const DOMElement* e, const FilterPolicyContext& permMap, const FilterPolicyContext& denyMap, bool standalone
             );
 
         Category& m_log;
         DOMDocument* m_document;
         vector<Policy> m_policies;
-        map< string,tuple<string,const MatchFunctor*,const MatchFunctor*> > m_attrRules;
+        map< string,boost::tuple<string,const MatchFunctor*,const MatchFunctor*> > m_attrRules;
         multimap<string,MatchFunctor*> m_policyReqRules;
         multimap<string,MatchFunctor*> m_permitValRules;
         multimap<string,MatchFunctor*> m_denyValRules;
         multimap<string,MatchFunctor*> m_policyReqRules;
         multimap<string,MatchFunctor*> m_permitValRules;
         multimap<string,MatchFunctor*> 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)) {
                 e = XMLHelper::getNextSiblingElement(e);
                 while (e) {
                     if (e && XMLHelper::isNodeNamed(e, SHIB2ATTRIBUTEFILTER_NS, AttributeRule)) {
-                        tuple<string,const MatchFunctor*,const MatchFunctor*> rule = buildAttributeRule(e, permFunctors, denyFunctors, false);
+                        boost::tuple<string,const MatchFunctor*,const MatchFunctor*> 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()) {
                         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<string,const MatchFunctor*,const MatchFunctor*> >::const_iterator ar = m_attrRules.find(ref);
+                            map< string,boost::tuple<string,const MatchFunctor*,const MatchFunctor*> >::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>()))
                             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;
 }
 
     return nullptr;
 }
 
-tuple<string,const MatchFunctor*,const MatchFunctor*> XMLFilterImpl::buildAttributeRule(
+boost::tuple<string,const MatchFunctor*,const MatchFunctor*> XMLFilterImpl::buildAttributeRule(
     const DOMElement* e, const FilterPolicyContext& permMap, const FilterPolicyContext& denyMap, bool standalone
     )
 {
     const DOMElement* e, const FilterPolicyContext& permMap, const FilterPolicyContext& denyMap, bool standalone
     )
 {
@@ -269,12 +269,12 @@ tuple<string,const MatchFunctor*,const MatchFunctor*> XMLFilterImpl::buildAttrib
 
     if (standalone && id.empty()) {
         m_log.warn("skipping stand-alone AttributeRule with no id");
 
     if (standalone && id.empty()) {
         m_log.warn("skipping stand-alone AttributeRule with no id");
-        return tuple<string,const MatchFunctor*,const MatchFunctor*>(string(),nullptr,nullptr);
+        return boost::tuple<string,const MatchFunctor*,const MatchFunctor*>(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());
     }
     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,const MatchFunctor*,const MatchFunctor*>(string(),nullptr,nullptr);
+            return boost::tuple<string,const MatchFunctor*,const MatchFunctor*>(string(),nullptr,nullptr);
         }
         else
             id.clear();
         }
         else
             id.clear();
@@ -314,11 +314,11 @@ tuple<string,const MatchFunctor*,const MatchFunctor*> XMLFilterImpl::buildAttrib
 
     if (perm || deny) {
         if (!id.empty()) {
 
     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 m_attrRules[id];
         }
         else {
-            return make_tuple(attrID, perm, deny);
+            return boost::make_tuple(attrID, perm, deny);
         }
     }
 
         }
     }
 
@@ -326,7 +326,7 @@ tuple<string,const MatchFunctor*,const MatchFunctor*> 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");
         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,const MatchFunctor*,const MatchFunctor*>(string(),nullptr,nullptr);
+    return boost::tuple<string,const MatchFunctor*,const MatchFunctor*>(string(),nullptr,nullptr);
 }
 
 void XMLFilterImpl::filterAttributes(const FilteringContext& context, vector<Attribute*>& attributes) const
 }
 
 void XMLFilterImpl::filterAttributes(const FilteringContext& context, vector<Attribute*>& attributes) const
index d4227f9..39ee374 100644 (file)
@@ -233,7 +233,7 @@ ChainingAttributeResolver::ChainingAttributeResolver(const DOMElement* e)
         string t(XMLHelper::getAttrString(e, nullptr, _type));
         if (!t.empty()) {
             try {
         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<AttributeResolver> np(conf.AttributeResolverManager.newPlugin(t.c_str(), e));
                     "building AttributeResolver of type (%s)...", t.c_str()
                     );
                 auto_ptr<AttributeResolver> np(conf.AttributeResolverManager.newPlugin(t.c_str(), e));
@@ -241,7 +241,7 @@ ChainingAttributeResolver::ChainingAttributeResolver(const DOMElement* e)
                 np.release();
             }
             catch (exception& ex) {
                 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()
                     );
             }
                     "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) {
             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()
                 );
         }
                 "caught exception applying AttributeResolver in chain: %s", ex.what()
                 );
         }
index 61742ed..3a4ed59 100644 (file)
@@ -96,8 +96,8 @@ namespace shibsp {
             m_orgName,
             m_orgDisplayName,
             m_orgURL;
             m_orgName,
             m_orgDisplayName,
             m_orgURL;
-        typedef tuple< string,xstring,boost::shared_ptr<AttributeDecoder> > contact_tuple_t;
-        typedef tuple< string,int,int,boost::shared_ptr<AttributeDecoder> > logo_tuple_t;
+        typedef boost::tuple< string,xstring,boost::shared_ptr<AttributeDecoder> > contact_tuple_t;
+        typedef boost::tuple< string,int,int,boost::shared_ptr<AttributeDecoder> > logo_tuple_t;
         vector<contact_tuple_t> m_contacts; // tuple is attributeID, contact type, decoder
         vector<logo_tuple_t> m_logos;       // tuple is attributeID, height, width, decoder
 
         vector<contact_tuple_t> m_contacts; // tuple is attributeID, contact type, decoder
         vector<logo_tuple_t> m_logos;       // tuple is attributeID, height, width, decoder
 
index ffd9108..beb726c 100644 (file)
@@ -124,7 +124,7 @@ namespace shibsp {
         typedef map< pair<xstring,xstring>,pair< boost::shared_ptr<AttributeDecoder>,vector<string> > > attrmap_t;
         attrmap_t m_attrMap;
         vector<string> m_attributeIds;
         typedef map< pair<xstring,xstring>,pair< boost::shared_ptr<AttributeDecoder>,vector<string> > > attrmap_t;
         attrmap_t m_attrMap;
         vector<string> m_attributeIds;
-        vector< tuple<xstring,xstring,bool> > m_requestedAttrs;
+        vector< boost::tuple<xstring,xstring,bool> > m_requestedAttrs;
 
         // settings for embedded assertions in metadata
         string m_policyId;
 
         // 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)
         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<xstring,xstring,bool>(name,format,required));
+            m_requestedAttrs.push_back(boost::tuple<xstring,xstring,bool>(name,format,required));
 
         name = child->getAttributeNS(nullptr, _aliases);
         if (name && *name) {
 
         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);
 
     static const XMLCh english[] = UNICODE_LITERAL_2(e,n);
     sn->setLang(english);
 
-    for (vector< tuple<xstring,xstring,bool> >::const_iterator i = m_requestedAttrs.begin(); i != m_requestedAttrs.end(); ++i) {
+    for (vector< boost::tuple<xstring,xstring,bool> >::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());
         RequestedAttribute* req = RequestedAttributeBuilder::buildRequestedAttribute();
         svc->getRequestedAttributes().push_back(req);
         req->setName(i->get<0>().c_str());
index 300a0c8..2b4905d 100644 (file)
@@ -94,7 +94,7 @@ namespace shibsp {
         bool m_unicodeAware;
         map< string,boost::shared_ptr<Override> > m_map;
         vector< pair< boost::shared_ptr<RegularExpression>,boost::shared_ptr<Override> > > m_regexps;
         bool m_unicodeAware;
         map< string,boost::shared_ptr<Override> > m_map;
         vector< pair< boost::shared_ptr<RegularExpression>,boost::shared_ptr<Override> > > m_regexps;
-        vector< tuple< string,boost::shared_ptr<RegularExpression>,boost::shared_ptr<Override> > > m_queries;
+        vector< boost::tuple< string,boost::shared_ptr<RegularExpression>,boost::shared_ptr<Override> > > m_queries;
 
     private:
         scoped_ptr<AccessControl> m_acl;
 
     private:
         scoped_ptr<AccessControl> m_acl;
@@ -346,7 +346,7 @@ Override::Override(bool unicodeAware, const DOMElement* e, Category& log, const
         try {
             boost::shared_ptr<Override> o(new Override(m_unicodeAware, path, log, this));
             boost::shared_ptr<RegularExpression> re((v && *v) ? new RegularExpression(v) : nullptr);
         try {
             boost::shared_ptr<Override> o(new Override(m_unicodeAware, path, log, this));
             boost::shared_ptr<RegularExpression> 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());
         }
         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;
         CGIParser cgi(request, true);
         do {
             descended = false;
-            for (vector< tuple< string,boost::shared_ptr<RegularExpression>,boost::shared_ptr<Override> > >::const_iterator q = o->m_queries.begin(); !descended && q != o->m_queries.end(); ++q) {
+            for (vector< boost::tuple< string,boost::shared_ptr<RegularExpression>,boost::shared_ptr<Override> > >::const_iterator q = o->m_queries.begin(); !descended && q != o->m_queries.end(); ++q) {
                 pair<CGIParser::walker,CGIParser::walker> vals = cgi.getParameters(q->get<0>().c_str());
                 if (vals.first != vals.second) {
                     if (q->get<1>()) {
                 pair<CGIParser::walker,CGIParser::walker> vals = cgi.getParameters(q->get<0>().c_str());
                 if (vals.first != vals.second) {
                     if (q->get<1>()) {
index f729ed2..59c86eb 100644 (file)
@@ -304,7 +304,7 @@ namespace {
 #ifndef SHIBSP_LITE
         scoped_ptr<TransactionLog> m_tranLog;
         scoped_ptr<SecurityPolicyProvider> m_policy;
 #ifndef SHIBSP_LITE
         scoped_ptr<TransactionLog> m_tranLog;
         scoped_ptr<SecurityPolicyProvider> m_policy;
-        vector< tuple<string,string,string> > m_transportOptions;
+        vector< boost::tuple<string,string,string> > m_transportOptions;
 #endif
         scoped_ptr<RequestMapper> m_requestMapper;
         map< string,boost::shared_ptr<Application> > m_appmap;
 #endif
         scoped_ptr<RequestMapper> m_requestMapper;
         map< string,boost::shared_ptr<Application> > m_appmap;
@@ -439,7 +439,7 @@ namespace {
 
         bool setTransportOptions(SOAPTransport& transport) const {
             bool ret = true;
 
         bool setTransportOptions(SOAPTransport& transport) const {
             bool ret = true;
-            for (vector< tuple<string,string,string> >::const_iterator opt = m_impl->m_transportOptions.begin();
+            for (vector< boost::tuple<string,string,string> >::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());
                     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()) {
             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);
             }
         }
         child = XMLHelper::getPreviousSiblingElement(child, TransportOption);