mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
return m_Data.c_str();
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <boost/utility/string_view.hpp>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace icinga {
|
||||
@ -75,6 +76,7 @@ public:
|
||||
|
||||
operator const std::string&() const;
|
||||
operator boost::beast::string_view() const;
|
||||
operator std::string_view() const;
|
||||
|
||||
const char *CStr() const;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user