mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 07:34:15 +02:00
Introduce String#operator std::string_view()
This commit is contained in:
parent
7958048a72
commit
b668b4de90
@ -139,6 +139,16 @@ String::operator boost::beast::string_view() const
|
|||||||
return boost::beast::string_view(m_Data);
|
return boost::beast::string_view(m_Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Conversion function to std::string_view.
|
||||||
|
*
|
||||||
|
* @return An std::string_view representing this string.
|
||||||
|
*/
|
||||||
|
String::operator std::string_view() const
|
||||||
|
{
|
||||||
|
return std::string_view(m_Data);
|
||||||
|
}
|
||||||
|
|
||||||
const char *String::CStr() const
|
const char *String::CStr() const
|
||||||
{
|
{
|
||||||
return m_Data.c_str();
|
return m_Data.c_str();
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include <boost/utility/string_view.hpp>
|
#include <boost/utility/string_view.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
|
|
||||||
namespace icinga {
|
namespace icinga {
|
||||||
@ -75,6 +76,7 @@ public:
|
|||||||
|
|
||||||
operator const std::string&() const;
|
operator const std::string&() const;
|
||||||
operator boost::beast::string_view() const;
|
operator boost::beast::string_view() const;
|
||||||
|
operator std::string_view() const;
|
||||||
|
|
||||||
const char *CStr() const;
|
const char *CStr() const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user