diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-07-29 11:22:26 +0100 | 
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-07-29 11:22:26 +0100 | 
| commit | 47e8e7240d11e17afe527e8c73b74387f4b579c9 (patch) | |
| tree | d1ea7a3ff65a2fa3de7268fb4df847c86e8ca9e1 | |
| parent | Don't need a specific handler for string_view->string (diff) | |
| download | icespider-47e8e7240d11e17afe527e8c73b74387f4b579c9.tar.bz2 icespider-47e8e7240d11e17afe527e8c73b74387f4b579c9.tar.xz icespider-47e8e7240d11e17afe527e8c73b74387f4b579c9.zip  | |
Don't pass trivially copyable params as const ref
| -rw-r--r-- | icespider/common/maybeString.h | 2 | ||||
| -rw-r--r-- | icespider/common/pathparts.cpp | 10 | ||||
| -rw-r--r-- | icespider/common/pathparts.h | 12 | ||||
| -rw-r--r-- | icespider/core/ihttpRequest.cpp | 6 | ||||
| -rw-r--r-- | icespider/core/ihttpRequest.h | 30 | ||||
| -rw-r--r-- | icespider/core/irouteHandler.cpp | 6 | ||||
| -rw-r--r-- | icespider/core/irouteHandler.h | 6 | ||||
| -rw-r--r-- | icespider/core/xwwwFormUrlEncoded.cpp | 4 | ||||
| -rw-r--r-- | icespider/core/xwwwFormUrlEncoded.h | 4 | ||||
| -rw-r--r-- | icespider/fcgi/cgiRequestBase.cpp | 22 | ||||
| -rw-r--r-- | icespider/fcgi/cgiRequestBase.h | 14 | ||||
| -rw-r--r-- | icespider/testing/testRequest.cpp | 26 | ||||
| -rw-r--r-- | icespider/testing/testRequest.h | 26 | ||||
| -rw-r--r-- | icespider/unittests/string_view_support.h | 2 | 
14 files changed, 85 insertions, 85 deletions
diff --git a/icespider/common/maybeString.h b/icespider/common/maybeString.h index b507777..50928f5 100644 --- a/icespider/common/maybeString.h +++ b/icespider/common/maybeString.h @@ -47,7 +47,7 @@ namespace IceSpider {  		}  		[[nodiscard]] inline bool -		operator<(const std::string_view & o) const +		operator<(const std::string_view o) const  		{  			return value() < o;  		} diff --git a/icespider/common/pathparts.cpp b/icespider/common/pathparts.cpp index d7faeb5..cebfde0 100644 --- a/icespider/common/pathparts.cpp +++ b/icespider/common/pathparts.cpp @@ -9,7 +9,7 @@ namespace ba = boost::algorithm;  namespace IceSpider {  	const auto slash = ba::first_finder("/", ba::is_equal()); -	Path::Path(const std::string_view & p) : path(p) +	Path::Path(const std::string_view p) : path(p)  	{  		auto relp = p.substr(1);  		if (relp.empty()) { @@ -43,18 +43,18 @@ namespace IceSpider {  				== pathparts.end();  	} -	PathLiteral::PathLiteral(const std::string_view & p) : value(p) { } +	PathLiteral::PathLiteral(const std::string_view p) : value(p) { }  	bool -	PathLiteral::matches(const std::string_view & v) const +	PathLiteral::matches(const std::string_view v) const  	{  		return value == v;  	} -	PathParameter::PathParameter(const std::string_view & s) : name(s.substr(1, s.length() - 2)) { } +	PathParameter::PathParameter(const std::string_view s) : name(s.substr(1, s.length() - 2)) { }  	bool -	PathParameter::matches(const std::string_view &) const +	PathParameter::matches(const std::string_view) const  	{  		return true;  	} diff --git a/icespider/common/pathparts.h b/icespider/common/pathparts.h index 0053562..e972a6f 100644 --- a/icespider/common/pathparts.h +++ b/icespider/common/pathparts.h @@ -16,25 +16,25 @@ namespace IceSpider {  		virtual ~PathPart() = default;  		SPECIAL_MEMBERS_DEFAULT(PathPart); -		[[nodiscard]] virtual bool matches(const std::string_view &) const = 0; +		[[nodiscard]] virtual bool matches(const std::string_view) const = 0;  	};  	using PathPartPtr = std::unique_ptr<PathPart>;  	class DLL_PUBLIC PathLiteral : public PathPart {  	public: -		explicit PathLiteral(const std::string_view & v); +		explicit PathLiteral(const std::string_view v); -		[[nodiscard]] bool matches(const std::string_view &) const override; +		[[nodiscard]] bool matches(const std::string_view) const override;  		const std::string_view value;  	};  	class DLL_PUBLIC PathParameter : public PathPart {  	public: -		explicit PathParameter(const std::string_view &); +		explicit PathParameter(const std::string_view); -		[[nodiscard]] bool matches(const std::string_view &) const override; +		[[nodiscard]] bool matches(const std::string_view) const override;  		const std::string_view name;  	}; @@ -43,7 +43,7 @@ namespace IceSpider {  	public:  		using PathParts = std::vector<PathPartPtr>; -		explicit Path(const std::string_view &); +		explicit Path(const std::string_view);  		std::string_view path; diff --git a/icespider/core/ihttpRequest.cpp b/icespider/core/ihttpRequest.cpp index 6e04bf5..21c34fb 100644 --- a/icespider/core/ihttpRequest.cpp +++ b/icespider/core/ihttpRequest.cpp @@ -134,7 +134,7 @@ namespace IceSpider {  	}  	OptionalString -	IHttpRequest::getURLParamStr(const unsigned int & idx) const +	IHttpRequest::getURLParamStr(const unsigned int idx) const  	{  		auto & url = getRequestPath();  		if (idx >= url.size()) { @@ -157,7 +157,7 @@ namespace IceSpider {  	// Set-Cookie: value[; expires=date][; domain=domain][; path=path][; secure]  	void -	IHttpRequest::setCookie(const std::string_view & name, const std::string_view & value, const OptionalString & d, +	IHttpRequest::setCookie(const std::string_view name, const std::string_view value, const OptionalString & d,  			const OptionalString & p, bool s, std::optional<time_t> e)  	{  		std::stringstream o; @@ -197,7 +197,7 @@ namespace IceSpider {  	}  	void -	IHttpRequest::responseRedirect(const std::string_view & url, const OptionalString & statusMsg) const +	IHttpRequest::responseRedirect(const std::string_view url, const OptionalString & statusMsg) const  	{  		setHeader(H::LOCATION, url);  		response(303, (statusMsg ? *statusMsg : S::MOVED)); diff --git a/icespider/core/ihttpRequest.h b/icespider/core/ihttpRequest.h index e226e42..d1633b3 100644 --- a/icespider/core/ihttpRequest.h +++ b/icespider/core/ihttpRequest.h @@ -44,18 +44,18 @@ namespace IceSpider {  		[[nodiscard]] virtual PathElements & getRequestPath() = 0;  		[[nodiscard]] virtual HttpMethod getRequestMethod() const = 0; -		[[nodiscard]] OptionalString getURLParamStr(const unsigned int &) const; -		[[nodiscard]] virtual OptionalString getQueryStringParamStr(const std::string_view &) const = 0; -		[[nodiscard]] virtual OptionalString getHeaderParamStr(const std::string_view &) const = 0; -		[[nodiscard]] virtual OptionalString getCookieParamStr(const std::string_view &) const = 0; -		[[nodiscard]] virtual OptionalString getEnvStr(const std::string_view &) const = 0; +		[[nodiscard]] OptionalString getURLParamStr(const unsigned int) const; +		[[nodiscard]] virtual OptionalString getQueryStringParamStr(const std::string_view) const = 0; +		[[nodiscard]] virtual OptionalString getHeaderParamStr(const std::string_view) const = 0; +		[[nodiscard]] virtual OptionalString getCookieParamStr(const std::string_view) const = 0; +		[[nodiscard]] virtual OptionalString getEnvStr(const std::string_view) const = 0;  		[[nodiscard]] virtual bool isSecure() const = 0;  		[[nodiscard]] static Accepted parseAccept(std::string_view);  		[[nodiscard]] virtual Slicer::DeserializerPtr getDeserializer() const;  		[[nodiscard]] virtual ContentTypeSerializer getSerializer(const IRouteHandler *) const;  		[[nodiscard]] virtual std::istream & getInputStream() const = 0;  		[[nodiscard]] virtual std::ostream & getOutputStream() const = 0; -		virtual void setHeader(const std::string_view &, const std::string_view &) const = 0; +		virtual void setHeader(const std::string_view, const std::string_view) const = 0;  		virtual std::ostream & dump(std::ostream & s) const = 0; @@ -63,7 +63,7 @@ namespace IceSpider {  		template<typename T, typename K>  		[[nodiscard]] inline std::optional<T> -		getFrom(const K & key, OptionalString (IHttpRequest::*src)(const K &) const) const +		getFrom(const K key, OptionalString (IHttpRequest::*src)(const K) const) const  		{  			if (auto v = (this->*src)(key)) {  				if constexpr (std::is_convertible<std::string_view, T>::value) { @@ -102,7 +102,7 @@ namespace IceSpider {  		template<typename T>  		[[nodiscard]] std::optional<T> -		getBodyParam(const std::optional<IceSpider::StringMap> & map, const std::string_view & key) const +		getBodyParam(const std::optional<IceSpider::StringMap> & map, const std::string_view key) const  		{  			if (!map) {  				return {}; @@ -116,13 +116,13 @@ namespace IceSpider {  			}  		} -		void responseRedirect(const std::string_view & url, const OptionalString & = {}) const; -		void setCookie(const std::string_view &, const std::string_view &, const OptionalString & = {}, +		void responseRedirect(const std::string_view url, const OptionalString & = {}) const; +		void setCookie(const std::string_view, const std::string_view, const OptionalString & = {},  				const OptionalString & = {}, bool = false, std::optional<time_t> = {});  		template<typename T>  		void -		setCookie(const std::string_view & n, const T & v, const OptionalString & d, const OptionalString & p, bool s, +		setCookie(const std::string_view n, const T & v, const OptionalString & d, const OptionalString & p, bool s,  				std::optional<time_t> e)  		{  			if constexpr (std::is_constructible<std::string_view, T>::value) { @@ -136,26 +136,26 @@ namespace IceSpider {  		template<typename T>  		[[nodiscard]] std::optional<T> -		getQueryStringParam(const std::string_view & key) const +		getQueryStringParam(const std::string_view key) const  		{  			return getFrom<T, std::string_view>(key, &IHttpRequest::getQueryStringParamStr);  		}  		template<typename T>  		[[nodiscard]] std::optional<T> -		getHeaderParam(const std::string_view & key) const +		getHeaderParam(const std::string_view key) const  		{  			return getFrom<T, std::string_view>(key, &IHttpRequest::getHeaderParamStr);  		}  		template<typename T>  		[[nodiscard]] std::optional<T> -		getCookieParam(const std::string_view & key) const +		getCookieParam(const std::string_view key) const  		{  			return getFrom<T, std::string_view>(key, &IHttpRequest::getCookieParamStr);  		} -		virtual void response(short, const std::string_view &) const = 0; +		virtual void response(short, const std::string_view) const = 0;  		template<typename T>  		void diff --git a/icespider/core/irouteHandler.cpp b/icespider/core/irouteHandler.cpp index 3219e17..cb2f216 100644 --- a/icespider/core/irouteHandler.cpp +++ b/icespider/core/irouteHandler.cpp @@ -19,10 +19,10 @@ namespace IceSpider {  	const RouteOptions IRouteHandler::defaultRouteOptions {}; -	IRouteHandler::IRouteHandler(HttpMethod m, const std::string_view & p) : +	IRouteHandler::IRouteHandler(HttpMethod m, const std::string_view p) :  		IRouteHandler(m, p, defaultRouteOptions) { } -	IRouteHandler::IRouteHandler(HttpMethod m, const std::string_view & p, const RouteOptions & ro) : Path(p), method(m) +	IRouteHandler::IRouteHandler(HttpMethod m, const std::string_view p, const RouteOptions & ro) : Path(p), method(m)  	{  		if (ro.addDefaultSerializers) {  			auto globalSerializers = AdHoc::PluginManager::getDefault()->getAll<Slicer::StreamSerializerFactory>(); @@ -52,7 +52,7 @@ namespace IceSpider {  	}  	void -	IRouteHandler::requiredParameterNotFound(const char *, const std::string_view &) const +	IRouteHandler::requiredParameterNotFound(const char *, const std::string_view) const  	{  		throw Http400_BadRequest();  	} diff --git a/icespider/core/irouteHandler.h b/icespider/core/irouteHandler.h index 9282d42..adea779 100644 --- a/icespider/core/irouteHandler.h +++ b/icespider/core/irouteHandler.h @@ -24,8 +24,8 @@ namespace IceSpider {  	public:  		const static RouteOptions defaultRouteOptions; -		IRouteHandler(HttpMethod, const std::string_view & path); -		IRouteHandler(HttpMethod, const std::string_view & path, const RouteOptions &); +		IRouteHandler(HttpMethod, const std::string_view path); +		IRouteHandler(HttpMethod, const std::string_view path, const RouteOptions &);  		SPECIAL_MEMBERS_MOVE_RO(IRouteHandler);  		virtual ~IRouteHandler() = default; @@ -40,7 +40,7 @@ namespace IceSpider {  		using RouteSerializers = std::map<MimeType, StreamSerializerFactoryPtr>;  		RouteSerializers routeSerializers; -		[[noreturn]] void requiredParameterNotFound(const char *, const std::string_view & key) const; +		[[noreturn]] void requiredParameterNotFound(const char *, const std::string_view key) const;  		template<typename T, typename K>  		inline T diff --git a/icespider/core/xwwwFormUrlEncoded.cpp b/icespider/core/xwwwFormUrlEncoded.cpp index 0414cf7..7bbf144 100644 --- a/icespider/core/xwwwFormUrlEncoded.cpp +++ b/icespider/core/xwwwFormUrlEncoded.cpp @@ -196,7 +196,7 @@ namespace IceSpider {  	};  	std::string -	XWwwFormUrlEncoded::urlencode(const std::string_view & s) +	XWwwFormUrlEncoded::urlencode(const std::string_view s)  	{  		return urlencode(s.begin(), s.end());  	} @@ -280,7 +280,7 @@ namespace IceSpider {  	}  	void -	XWwwFormUrlEncoded::iterateVars(const std::string_view & input, const KVh & h, const std::string_view & split) +	XWwwFormUrlEncoded::iterateVars(const std::string_view input, const KVh & h, const std::string_view split)  	{  		if (!input.empty()) {  			iterateVars(h, ba::make_split_iterator(input, ba::first_finder(split, ba::is_equal()))); diff --git a/icespider/core/xwwwFormUrlEncoded.h b/icespider/core/xwwwFormUrlEncoded.h index 0f719dd..ba9f8d0 100644 --- a/icespider/core/xwwwFormUrlEncoded.h +++ b/icespider/core/xwwwFormUrlEncoded.h @@ -21,13 +21,13 @@ namespace IceSpider {  		void Deserialize(Slicer::ModelPartForRootPtr mp) override;  		DLL_PUBLIC static void iterateVars( -				const std::string_view & input, const KVh & h, const std::string_view & split); +				const std::string_view input, const KVh & h, const std::string_view split);  		DLL_PUBLIC static MaybeString urldecode(std::string_view::const_iterator s, std::string_view::const_iterator);  		DLL_PUBLIC static std::string urlencode(std::string_view::const_iterator s, std::string_view::const_iterator);  		DLL_PUBLIC static void urlencodeto(  				std::ostream &, std::string_view::const_iterator s, std::string_view::const_iterator); -		DLL_PUBLIC static std::string urlencode(const std::string_view & s); +		DLL_PUBLIC static std::string urlencode(const std::string_view s);  	private:  		static inline void iterateVars( diff --git a/icespider/fcgi/cgiRequestBase.cpp b/icespider/fcgi/cgiRequestBase.cpp index 6423995..33fdd7b 100644 --- a/icespider/fcgi/cgiRequestBase.cpp +++ b/icespider/fcgi/cgiRequestBase.cpp @@ -35,7 +35,7 @@ namespace IceSpider {  	template<typename in, typename out>  	inline void -	mapVars(const std::string_view & vn, const in & envmap, out & map, const std::string_view & sp) +	mapVars(const std::string_view vn, const in & envmap, out & map, const std::string_view sp)  	{  		auto qs = envmap.find(vn);  		if (qs != envmap.end()) { @@ -49,8 +49,8 @@ namespace IceSpider {  	}  	template<typename Ex, typename Map, typename... Ks> -	const std::string_view & -	findFirstOrElse(const Map & map, const std::string_view & k, const Ks &... ks) +	const std::string_view +	findFirstOrElse(const Map & map, const std::string_view k, const Ks &... ks)  	{  		if (const auto i = map.find(k); i != map.end()) {  			return i->second; @@ -90,7 +90,7 @@ namespace IceSpider {  	template<typename Fmt, typename Map>  	void -	dumpMap(std::ostream & s, const std::string_view & n, const Map & map) +	dumpMap(std::ostream & s, const std::string_view n, const Map & map)  	{  		s << n << std::endl;  		for (const auto & p : map) { @@ -113,7 +113,7 @@ namespace IceSpider {  	template<typename MapType>  	OptionalString -	CgiRequestBase::optionalLookup(const std::string_view & key, const MapType & vm) +	CgiRequestBase::optionalLookup(const std::string_view key, const MapType & vm)  	{  		auto i = vm.find(key);  		if (i == vm.end()) { @@ -150,19 +150,19 @@ namespace IceSpider {  	}  	OptionalString -	CgiRequestBase::getQueryStringParamStr(const std::string_view & key) const +	CgiRequestBase::getQueryStringParamStr(const std::string_view key) const  	{  		return optionalLookup(key, qsmap);  	}  	OptionalString -	CgiRequestBase::getCookieParamStr(const std::string_view & key) const +	CgiRequestBase::getCookieParamStr(const std::string_view key) const  	{  		return optionalLookup(key, cookiemap);  	}  	OptionalString -	CgiRequestBase::getEnvStr(const std::string_view & key) const +	CgiRequestBase::getEnvStr(const std::string_view key) const  	{  		return optionalLookup(key, envmap);  	} @@ -174,19 +174,19 @@ namespace IceSpider {  	}  	OptionalString -	CgiRequestBase::getHeaderParamStr(const std::string_view & key) const +	CgiRequestBase::getHeaderParamStr(const std::string_view key) const  	{  		return optionalLookup(key, hdrmap);  	}  	void -	CgiRequestBase::response(short statusCode, const std::string_view & statusMsg) const +	CgiRequestBase::response(short statusCode, const std::string_view statusMsg) const  	{  		StatusFmt::write(getOutputStream(), statusCode, statusMsg);  	}  	void -	CgiRequestBase::setHeader(const std::string_view & header, const std::string_view & value) const +	CgiRequestBase::setHeader(const std::string_view header, const std::string_view value) const  	{  		HdrFmt::write(getOutputStream(), header, value);  	} diff --git a/icespider/fcgi/cgiRequestBase.h b/icespider/fcgi/cgiRequestBase.h index c83264d..e5a0d32 100644 --- a/icespider/fcgi/cgiRequestBase.h +++ b/icespider/fcgi/cgiRequestBase.h @@ -30,19 +30,19 @@ namespace IceSpider {  		[[nodiscard]] const PathElements & getRequestPath() const override;  		[[nodiscard]] PathElements & getRequestPath() override;  		[[nodiscard]] HttpMethod getRequestMethod() const override; -		[[nodiscard]] OptionalString getQueryStringParamStr(const std::string_view & key) const override; -		[[nodiscard]] OptionalString getHeaderParamStr(const std::string_view & key) const override; -		[[nodiscard]] OptionalString getCookieParamStr(const std::string_view & key) const override; -		[[nodiscard]] OptionalString getEnvStr(const std::string_view & key) const override; +		[[nodiscard]] OptionalString getQueryStringParamStr(const std::string_view key) const override; +		[[nodiscard]] OptionalString getHeaderParamStr(const std::string_view key) const override; +		[[nodiscard]] OptionalString getCookieParamStr(const std::string_view key) const override; +		[[nodiscard]] OptionalString getEnvStr(const std::string_view key) const override;  		[[nodiscard]] bool isSecure() const override; -		void response(short, const std::string_view &) const override; -		void setHeader(const std::string_view &, const std::string_view &) const override; +		void response(short, const std::string_view) const override; +		void setHeader(const std::string_view, const std::string_view) const override;  		std::ostream & dump(std::ostream & s) const override;  	private: -		template<typename MapType> static OptionalString optionalLookup(const std::string_view & key, const MapType &); +		template<typename MapType> static OptionalString optionalLookup(const std::string_view key, const MapType &);  		VarMap envmap {40};  		StrMap qsmap; diff --git a/icespider/testing/testRequest.cpp b/icespider/testing/testRequest.cpp index 3657117..61c7d94 100644 --- a/icespider/testing/testRequest.cpp +++ b/icespider/testing/testRequest.cpp @@ -14,7 +14,7 @@  namespace IceSpider {  	constexpr std::string_view slash("/"); -	TestRequest::TestRequest(const Core * c, HttpMethod m, const std::string_view & p) : IHttpRequest(c), method(m) +	TestRequest::TestRequest(const Core * c, HttpMethod m, const std::string_view p) : IHttpRequest(c), method(m)  	{  		namespace ba = boost::algorithm;  		auto path = p.substr(1); @@ -44,7 +44,7 @@ namespace IceSpider {  	}  	OptionalString -	TestRequest::getEnvStr(const std::string_view & key) const +	TestRequest::getEnvStr(const std::string_view key) const  	{  		return get(key, env);  	} @@ -56,25 +56,25 @@ namespace IceSpider {  	}  	OptionalString -	TestRequest::getQueryStringParamStr(const std::string_view & key) const +	TestRequest::getQueryStringParamStr(const std::string_view key) const  	{  		return get(key, qs);  	}  	OptionalString -	TestRequest::getCookieParamStr(const std::string_view & key) const +	TestRequest::getCookieParamStr(const std::string_view key) const  	{  		return get(key, cookies);  	}  	OptionalString -	TestRequest::getHeaderParamStr(const std::string_view & key) const +	TestRequest::getHeaderParamStr(const std::string_view key) const  	{  		return get(key, hdr);  	}  	OptionalString -	TestRequest::get(const std::string_view & key, const MapVars & vars) const +	TestRequest::get(const std::string_view key, const MapVars & vars) const  	{  		auto i = vars.find(key);  		if (i == vars.end()) { @@ -84,31 +84,31 @@ namespace IceSpider {  	}  	void -	TestRequest::setQueryStringParam(const std::string_view & key, const OptionalString & val) +	TestRequest::setQueryStringParam(const std::string_view key, const OptionalString & val)  	{  		set(key, val, qs);  	}  	void -	TestRequest::setHeaderParam(const std::string_view & key, const OptionalString & val) +	TestRequest::setHeaderParam(const std::string_view key, const OptionalString & val)  	{  		set(key, val, hdr);  	}  	void -	TestRequest::setCookieParam(const std::string_view & key, const OptionalString & val) +	TestRequest::setCookieParam(const std::string_view key, const OptionalString & val)  	{  		set(key, val, cookies);  	}  	void -	TestRequest::setEnv(const std::string_view & key, const OptionalString & val) +	TestRequest::setEnv(const std::string_view key, const OptionalString & val)  	{  		set(key, val, env);  	}  	void -	TestRequest::set(const std::string_view & key, const OptionalString & val, MapVars & vars) +	TestRequest::set(const std::string_view key, const OptionalString & val, MapVars & vars)  	{  		if (val) {  			vars[std::string(key)] = *val; @@ -131,13 +131,13 @@ namespace IceSpider {  	}  	void -	TestRequest::response(short statusCode, const std::string_view & statusMsg) const +	TestRequest::response(short statusCode, const std::string_view statusMsg) const  	{  		StatusFmt::write(getOutputStream(), statusCode, statusMsg);  	}  	void -	TestRequest::setHeader(const std::string_view & header, const std::string_view & value) const +	TestRequest::setHeader(const std::string_view header, const std::string_view value) const  	{  		HdrFmt::write(getOutputStream(), header, value);  	} diff --git a/icespider/testing/testRequest.h b/icespider/testing/testRequest.h index 60bfcc5..77efda2 100644 --- a/icespider/testing/testRequest.h +++ b/icespider/testing/testRequest.h @@ -16,24 +16,24 @@ namespace IceSpider {  	public:  		using MapVars = std::map<std::string, std::string, std::less<>>; -		TestRequest(const Core * c, HttpMethod m, const std::string_view & p); +		TestRequest(const Core * c, HttpMethod m, const std::string_view p);  		const PathElements & getRequestPath() const override;  		PathElements & getRequestPath() override;  		HttpMethod getRequestMethod() const override; -		OptionalString getEnvStr(const std::string_view & key) const override; -		OptionalString getQueryStringParamStr(const std::string_view & key) const override; -		OptionalString getCookieParamStr(const std::string_view & key) const override; -		OptionalString getHeaderParamStr(const std::string_view & key) const override; +		OptionalString getEnvStr(const std::string_view key) const override; +		OptionalString getQueryStringParamStr(const std::string_view key) const override; +		OptionalString getCookieParamStr(const std::string_view key) const override; +		OptionalString getHeaderParamStr(const std::string_view key) const override;  		bool isSecure() const override; -		void setQueryStringParam(const std::string_view &, const OptionalString &); -		void setHeaderParam(const std::string_view &, const OptionalString &); -		void setCookieParam(const std::string_view &, const OptionalString &); -		void setEnv(const std::string_view &, const OptionalString &); +		void setQueryStringParam(const std::string_view, const OptionalString &); +		void setHeaderParam(const std::string_view, const OptionalString &); +		void setCookieParam(const std::string_view, const OptionalString &); +		void setEnv(const std::string_view, const OptionalString &);  		std::istream & getInputStream() const override;  		std::ostream & getOutputStream() const override; -		void response(short statusCode, const std::string_view & statusMsg) const override; -		void setHeader(const std::string_view & header, const std::string_view & value) const override; +		void response(short statusCode, const std::string_view statusMsg) const override; +		void setHeader(const std::string_view header, const std::string_view value) const override;  		std::ostream & dump(std::ostream & s) const override;  		const MapVars & getResponseHeaders(); @@ -48,8 +48,8 @@ namespace IceSpider {  		const HttpMethod method;  	protected: -		OptionalString get(const std::string_view &, const MapVars &) const; -		void set(const std::string_view &, const OptionalString &, MapVars &); +		OptionalString get(const std::string_view, const MapVars &) const; +		void set(const std::string_view, const OptionalString &, MapVars &);  	private:  		MapVars responseHeaders; diff --git a/icespider/unittests/string_view_support.h b/icespider/unittests/string_view_support.h index 41661f0..93e855c 100644 --- a/icespider/unittests/string_view_support.h +++ b/icespider/unittests/string_view_support.h @@ -14,7 +14,7 @@ namespace Ice {  	template<> struct StreamHelper<std::string_view, StreamHelperCategoryBuiltin> {  		template<class S>  		static inline void -		write(S * stream, const std::string_view & v) +		write(S * stream, const std::string_view v)  		{  			stream->write(v.data(), v.size());  		}  | 
