diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-08-02 01:31:50 +0100 | 
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-08-02 01:31:50 +0100 | 
| commit | 15098c9e333c1347d5f8e9ab600df3ff1fa3af9d (patch) | |
| tree | 4f833ae8d39106e4edc0104cd8b5b05d0ce63c69 | |
| parent | constexpr and member initial all/most parameter specification vars where poss... (diff) | |
| download | icespider-15098c9e333c1347d5f8e9ab600df3ff1fa3af9d.tar.bz2 icespider-15098c9e333c1347d5f8e9ab600df3ff1fa3af9d.tar.xz icespider-15098c9e333c1347d5f8e9ab600df3ff1fa3af9d.zip | |
Don't use same name for consts as instances in the base
| -rw-r--r-- | icespider/core/exceptions.cpp | 5 | ||||
| -rw-r--r-- | icespider/core/exceptions.h | 11 | 
2 files changed, 10 insertions, 6 deletions
| diff --git a/icespider/core/exceptions.cpp b/icespider/core/exceptions.cpp index 83ab13a..8448a0b 100644 --- a/icespider/core/exceptions.cpp +++ b/icespider/core/exceptions.cpp @@ -1,5 +1,10 @@  #include "exceptions.h" +#define DefineHttpEx(Name, Code, Message) \ +	Name::Name() : ::IceSpider::HttpException(__FILE__, __LINE__, CODE, MESSAGE) { } \ +	const short Name::CODE(Code); \ +	const std::string Name::MESSAGE(Message); +  namespace IceSpider {  	DefineHttpEx(Http400_BadRequest, 400, "Bad Request");  	DefineHttpEx(Http404_NotFound, 404, "Not found"); diff --git a/icespider/core/exceptions.h b/icespider/core/exceptions.h index 0f1d1e8..b82f1f3 100644 --- a/icespider/core/exceptions.h +++ b/icespider/core/exceptions.h @@ -9,13 +9,11 @@  	class DLL_PUBLIC Name : public ::IceSpider::HttpException { \  	public: \  		Name(); \ -		static const short code; \ -		static const std::string message; \ +\ +	private: \ +		static const short CODE; \ +		static const std::string MESSAGE; \  	} -#define DefineHttpEx(Name, Code, Message) \ -	Name::Name() : ::IceSpider::HttpException(__FILE__, __LINE__, code, message) { } \ -	const short Name::code(Code); \ -	const std::string Name::message(Message);  namespace IceSpider {  	DeclareHttpEx(Http400_BadRequest); @@ -25,4 +23,5 @@ namespace IceSpider {  	DeclareHttpEx(Http415_UnsupportedMediaType);  } +#undef DeclareHttpEx  #endif | 
