forked from boostorg/beast
Add non-allocating overload for error category message function
Fixes #2646
This commit is contained in:
1 parent
5998feda44
commit
9e16754dd5
9 files changed
+72
-17
No files matched your search
@@ -29,8 +29,8 @@ public:
|
||||
}
|
||||
|
||||
BOOST_BEAST_DECL
|
||||
std::string
|
||||
message(int ev) const override
|
||||
char const*
|
||||
message(int ev, char*, std::size_t) const noexcept override
|
||||
{
|
||||
switch(static_cast<error>(ev))
|
||||
{
|
||||
@@ -40,6 +40,13 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_BEAST_DECL
|
||||
std::string
|
||||
message(int ev) const override
|
||||
{
|
||||
return message(ev, nullptr, 0);
|
||||
}
|
||||
|
||||
BOOST_BEAST_DECL
|
||||
error_condition
|
||||
default_error_condition(int ev) const noexcept override
|
||||
|
||||
@@ -28,10 +28,9 @@ public:
|
||||
|
||||
error_codes() : error_category(0x002f6e94401c6e8bu) {}
|
||||
|
||||
|
||||
BOOST_BEAST_DECL
|
||||
std::string
|
||||
message(int ev) const override
|
||||
char const*
|
||||
message(int ev, char*, std::size_t) const noexcept override
|
||||
{
|
||||
switch(static_cast<error>(ev))
|
||||
{
|
||||
@@ -41,6 +40,13 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_BEAST_DECL
|
||||
std::string
|
||||
message(int ev) const override
|
||||
{
|
||||
return message(ev, nullptr, 0);
|
||||
}
|
||||
|
||||
BOOST_BEAST_DECL
|
||||
error_condition
|
||||
default_error_condition(int ev) const noexcept override
|
||||
@@ -67,10 +73,9 @@ public:
|
||||
|
||||
error_conditions() : error_category(0x3dd0b0ce843c5b10u) {}
|
||||
|
||||
|
||||
BOOST_BEAST_DECL
|
||||
std::string
|
||||
message(int cv) const override
|
||||
char const*
|
||||
message(int cv, char*, std::size_t) const noexcept override
|
||||
{
|
||||
switch(static_cast<condition>(cv))
|
||||
{
|
||||
@@ -79,6 +84,13 @@ public:
|
||||
return "The operation timed out";
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_BEAST_DECL
|
||||
std::string
|
||||
message(int cv) const override
|
||||
{
|
||||
return message(cv, nullptr, 0);
|
||||
}
|
||||
};
|
||||
|
||||
} // detail
|
||||
|
||||
@@ -29,8 +29,9 @@ public:
|
||||
|
||||
http_error_category() : error_category(0x964627da815bf210u) {}
|
||||
|
||||
std::string
|
||||
message(int ev) const override
|
||||
BOOST_BEAST_DECL
|
||||
char const*
|
||||
message(int ev, char*, std::size_t) const noexcept override
|
||||
{
|
||||
switch(static_cast<error>(ev))
|
||||
{
|
||||
@@ -66,6 +67,12 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
std::string
|
||||
message(int ev) const override
|
||||
{
|
||||
return message(ev, nullptr, 0);
|
||||
}
|
||||
|
||||
error_condition
|
||||
default_error_condition(
|
||||
int ev) const noexcept override
|
||||
|
||||
@@ -29,8 +29,9 @@ public:
|
||||
return "boost.beast.websocket";
|
||||
}
|
||||
|
||||
std::string
|
||||
message(int ev) const override
|
||||
BOOST_BEAST_DECL
|
||||
char const*
|
||||
message(int ev, char*, std::size_t) const noexcept override
|
||||
{
|
||||
switch(static_cast<error>(ev))
|
||||
{
|
||||
@@ -71,6 +72,12 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
std::string
|
||||
message(int ev) const override
|
||||
{
|
||||
return message(ev, nullptr, 0);
|
||||
}
|
||||
|
||||
error_condition
|
||||
default_error_condition(int ev) const noexcept override
|
||||
{
|
||||
@@ -128,9 +135,9 @@ public:
|
||||
|
||||
error_conditions() : error_category(0x7a8de5d61799ce9eu) {}
|
||||
|
||||
|
||||
std::string
|
||||
message(int cv) const override
|
||||
BOOST_BEAST_DECL
|
||||
char const*
|
||||
message(int cv, char*, std::size_t) const noexcept override
|
||||
{
|
||||
switch(static_cast<condition>(cv))
|
||||
{
|
||||
@@ -139,6 +146,12 @@ public:
|
||||
case condition::protocol_violation: return "A WebSocket protocol violation occurred";
|
||||
}
|
||||
}
|
||||
|
||||
std::string
|
||||
message(int cv) const override
|
||||
{
|
||||
return message(cv, nullptr, 0);
|
||||
}
|
||||
};
|
||||
|
||||
} // detail
|
||||
|
||||
@@ -55,8 +55,9 @@ public:
|
||||
return "boost.beast.zlib";
|
||||
}
|
||||
|
||||
std::string
|
||||
message(int ev) const override
|
||||
BOOST_BEAST_DECL
|
||||
char const*
|
||||
message(int ev, char*, std::size_t) const noexcept override
|
||||
{
|
||||
switch(static_cast<error>(ev))
|
||||
{
|
||||
@@ -84,6 +85,12 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
std::string
|
||||
message(int ev) const override
|
||||
{
|
||||
return message(ev, nullptr, 0);
|
||||
}
|
||||
|
||||
error_condition
|
||||
default_error_condition(int ev) const noexcept override
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user