From 6f92de71449d77b1da71ed6b7eb9807da2bdd489 Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Fri, 25 Sep 2009 17:04:38 +0000 Subject: [PATCH] Non-inlining selected methods (CPPOST-35). --- xmltooling/Makefile.am | 1 + xmltooling/encryption/Decrypter.h | 4 ++-- xmltooling/encryption/Encrypter.h | 4 ++-- xmltooling/io/HTTPResponse.cpp | 33 +++++++++++++++++++++++++++++++++ xmltooling/io/HTTPResponse.h | 10 +++------- xmltooling/xmltooling-lite.vcproj | 4 ++++ xmltooling/xmltooling.vcproj | 4 ++++ 7 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 xmltooling/io/HTTPResponse.cpp diff --git a/xmltooling/Makefile.am b/xmltooling/Makefile.am index bee6243..9ce25a4 100644 --- a/xmltooling/Makefile.am +++ b/xmltooling/Makefile.am @@ -178,6 +178,7 @@ common_sources = \ io/AbstractXMLObjectMarshaller.cpp \ io/AbstractXMLObjectUnmarshaller.cpp \ io/HTTPRequest.cpp \ + io/HTTPResponse.cpp \ soap/impl/SOAPClient.cpp \ soap/impl/SOAPImpl.cpp \ soap/impl/SOAPSchemaValidators.cpp \ diff --git a/xmltooling/encryption/Decrypter.h b/xmltooling/encryption/Decrypter.h index 9f4b1e4..f1eeb21 100644 --- a/xmltooling/encryption/Decrypter.h +++ b/xmltooling/encryption/Decrypter.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Internet2 + * Copyright 2001-2009 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ namespace xmlencryption { ) : m_cipher(NULL), m_credResolver(credResolver), m_criteria(criteria), m_EKResolver(EKResolver) { } - ~Decrypter(); + virtual ~Decrypter(); /** * Replace the current EncryptedKeyResolver interface, if any, with a new one. diff --git a/xmltooling/encryption/Encrypter.h b/xmltooling/encryption/Encrypter.h index e01803a..33383ad 100644 --- a/xmltooling/encryption/Encrypter.h +++ b/xmltooling/encryption/Encrypter.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Internet2 + * Copyright 2001-2009 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -136,7 +136,7 @@ namespace xmlencryption { Encrypter() : m_cipher(NULL) {} - ~Encrypter(); + virtual ~Encrypter(); /** * Encrypts the supplied element and returns the resulting object. diff --git a/xmltooling/io/HTTPResponse.cpp b/xmltooling/io/HTTPResponse.cpp new file mode 100644 index 0000000..934de5e --- /dev/null +++ b/xmltooling/io/HTTPResponse.cpp @@ -0,0 +1,33 @@ +/* + * Copyright 2009 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * HTTPResponse.cpp + * + * Interface to HTTP responses. + */ + +#include "internal.h" +#include "HTTPResponse.h" + +using namespace xmltooling; + +void HTTPResponse::setCookie(const char* name, const char* value) +{ + std::string cookie(name); + cookie = cookie + '=' + value; + setResponseHeader("Set-Cookie", cookie.c_str()); +} diff --git a/xmltooling/io/HTTPResponse.h b/xmltooling/io/HTTPResponse.h index 77aec51..ab36b93 100644 --- a/xmltooling/io/HTTPResponse.h +++ b/xmltooling/io/HTTPResponse.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Internet2 + * Copyright 2001-2009 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ /** * @file xmltooling/io/HTTPResponse.h * - * Interface to HTTP response. + * Interface to HTTP responses. */ #ifndef __xmltooling_httpres_h__ @@ -60,11 +60,7 @@ namespace xmltooling { * @param name cookie name * @param value value to set, or NULL to clear */ - virtual void setCookie(const char* name, const char* value) { - std::string cookie(name); - cookie = cookie + '=' + value; - setResponseHeader("Set-Cookie", cookie.c_str()); - } + virtual void setCookie(const char* name, const char* value); /** * Redirect the client to the specified URL and complete the response. diff --git a/xmltooling/xmltooling-lite.vcproj b/xmltooling/xmltooling-lite.vcproj index 0e30a42..0fd03ca 100644 --- a/xmltooling/xmltooling-lite.vcproj +++ b/xmltooling/xmltooling-lite.vcproj @@ -449,6 +449,10 @@ RelativePath=".\io\HTTPRequest.cpp" > + + + +