17 #ifndef COM_BORA_SOFTWARE__BALAU_RESOURCE__HTTP_UTF8_TO_32_READ_RESOURCE 18 #define COM_BORA_SOFTWARE__BALAU_RESOURCE__HTTP_UTF8_TO_32_READ_RESOURCE 21 #include <Balau/Resource/Impl/HttpSource.hpp> 23 #include <boost/iostreams/code_converter.hpp> 24 #include <boost/iostreams/stream.hpp> 36 private:
using idevice_utf8_utf32 = boost::iostreams::code_converter<std::istream, std::codecvt_utf8<char32_t, 0x10ffff, std::consume_header>>;
37 private:
using istream_utf8_utf32 = boost::iostreams::stream<idevice_utf8_utf32>;
47 : url(std::move(rhs.url))
48 , utf8Stream(std::move(rhs.utf8Stream))
50 , utf32Stream(std::move(rhs.utf32Stream)) {}
60 public:
const Uri &
uri()
const override;
68 private: std::unique_ptr<Http> url;
69 private: std::unique_ptr<boost::iostreams::stream<Impl::HttpSource>> utf8Stream;
70 private: std::istream & ref;
71 private: std::unique_ptr<istream_utf8_utf32> utf32Stream;
76 #endif // COM_BORA_SOFTWARE__BALAU_RESOURCE__HTTP_UTF8_TO_32_READ_RESOURCE A read-only UTF-8 resource which is read as UTF-32 characters.
A read-only UTF-8 resource which is read in as UTF-32 characters.
Definition: Utf8To32ReadResource.hpp:28
HttpUtf8To32ReadResource(const Http &url_)
Create a new HTTP UTF-8 to UTF-32 read resource from the supplied HTTP URI.
A read-only HTTP UTF-8 resource which is read as UTF-32 characters.
Definition: HttpUtf8To32ReadResource.hpp:35
const Uri & uri() const override
Get the URI associated with this resource.
An abstract universal resource identifier.
Definition: Uri.hpp:131
std::u32istream & readStream() override
Get the input stream of the UTF-8 to UTF-32 read resource.
Definition: HttpUtf8To32ReadResource.hpp:56
The unified resource class hierarchy.
Definition: ByteReadResource.hpp:24
An HTTP URL.
Definition: Http.hpp:31
void close() override
Close the stream(s) in the resource.
Definition: HttpUtf8To32ReadResource.hpp:62