diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-05-08 20:03:09 +0100 | 
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-05-23 21:24:03 +0100 | 
| commit | 0cc440e9d28fa029819ad796a6d46a1de66b9bb9 (patch) | |
| tree | a61f648bf1d68546b713cc9c214833d52128075f | |
| parent | Update to Ice v3.7.1 release (diff) | |
| download | icespider-0cc440e9d28fa029819ad796a6d46a1de66b9bb9.tar.bz2 icespider-0cc440e9d28fa029819ad796a6d46a1de66b9bb9.tar.xz icespider-0cc440e9d28fa029819ad796a6d46a1de66b9bb9.zip | |
Move reposonse code into .cpp
Most of it does not need to be a template
| -rw-r--r-- | icespider/core/ihttpRequest.cpp | 8 | ||||
| -rw-r--r-- | icespider/core/ihttpRequest.h | 6 | 
2 files changed, 10 insertions, 4 deletions
| diff --git a/icespider/core/ihttpRequest.cpp b/icespider/core/ihttpRequest.cpp index 35eb465..9325a5e 100644 --- a/icespider/core/ihttpRequest.cpp +++ b/icespider/core/ihttpRequest.cpp @@ -131,6 +131,14 @@ namespace IceSpider {  		response(303, (statusMsg ? *statusMsg : "Moved"));  	} +	void +	IHttpRequest::modelPartResponse(const IRouteHandler * route, const Slicer::ModelPartForRootPtr & mp) const +	{ +		auto s = getSerializer(route); +		setHeader("Content-Type", s.first.group + "/" + s.first.type); +		response(200, "OK"); +		s.second->Serialize(mp); +	}  #define getParams(T) \  	template<> void IHttpRequest::setCookie<T>(const std::string & n, const T & v, \ diff --git a/icespider/core/ihttpRequest.h b/icespider/core/ihttpRequest.h index bbd83fb..23a9d7e 100644 --- a/icespider/core/ihttpRequest.h +++ b/icespider/core/ihttpRequest.h @@ -82,11 +82,9 @@ namespace IceSpider {  			template<typename T>  			void response(const IRouteHandler * route, const T & t) const  			{ -				auto s = getSerializer(route); -				setHeader("Content-Type", s.first.group + "/" + s.first.type); -				response(200, "OK"); -				Slicer::SerializeAnyWith<T>(t, s.second); +				modelPartResponse(route, Slicer::ModelPart::CreateRootFor(t));  			} +			void modelPartResponse(const IRouteHandler * route, const Slicer::ModelPartForRootPtr &) const;  			const Core * core;  	}; | 
