libragephoto: add opt-in C++17 support

- RagePhoto(A): add jpeg_view() function
- CMakeLists.txt: move C++17 and WebAssembly stuff inside include files
This commit is contained in:
Syping 2023-03-03 03:26:59 +01:00
parent 4ca8ac9297
commit 3c433ca072
8 changed files with 102 additions and 35 deletions

View file

@ -602,6 +602,16 @@ const std::string RagePhoto::jpeg() const
return std::string();
}
#if (RAGEPHOTO_CXX_STD >= 17) && (__cplusplus >= 201703L)
const std::string_view RagePhoto::jpeg_view() const
{
if (m_data->jpeg)
return std::string_view(m_data->jpeg, m_data->jpegSize);
else
return std::string_view();
}
#endif
const char* RagePhoto::jpegData() const
{
return m_data->jpeg;