17 #ifndef COM_BORA_SOFTWARE__BALAU_RESOURCE__STRING_URI_UTF8_TO_32_READ_RESOURCE 18 #define COM_BORA_SOFTWARE__BALAU_RESOURCE__STRING_URI_UTF8_TO_32_READ_RESOURCE 22 #include <boost/iostreams/code_converter.hpp> 23 #include <boost/iostreams/stream.hpp> 38 private:
using idevice_utf8_utf32 = boost::iostreams::code_converter<std::istream, std::codecvt_utf8<char32_t, 0x10ffff, std::consume_header>>;
39 private:
using istream_utf8_utf32 = boost::iostreams::stream<idevice_utf8_utf32>;
47 : stringUri(std::move(rhs.stringUri))
48 , utf8Stream(std::move(rhs.utf8Stream))
50 , utf32Stream(std::move(rhs.utf32Stream)) {}
56 public:
const Uri &
uri()
const override;
58 public:
void close()
override {}
62 private: std::unique_ptr<StringUri> stringUri;
63 private: std::unique_ptr<std::istringstream> utf8Stream;
64 private: std::istream & ref;
65 private: std::unique_ptr<istream_utf8_utf32> utf32Stream;
70 #endif // COM_BORA_SOFTWARE__BALAU_RESOURCE__STRING_URI_UTF8_TO_32_READ_RESOURCE void close() override
Close the stream(s) in the resource.
Definition: StringUriUtf8To32ReadResource.hpp:58
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
const Uri & uri() const override
Get the URI associated with this resource.
An abstract universal resource identifier.
Definition: Uri.hpp:131
The unified resource class hierarchy.
Definition: ByteReadResource.hpp:24
An immediate string pseudo-URI.
Definition: StringUri.hpp:49
std::u32istream & readStream() override
Get the input stream of the UTF-8 to UTF-32 read resource.
Definition: StringUriUtf8To32ReadResource.hpp:52
A read-only String UTF-8 resource which is read as UTF-32 characters.
Definition: StringUriUtf8To32ReadResource.hpp:37
StringUriUtf8To32ReadResource(const StringUri &stringUri_)
Create a new String URI UTF-8 to UTF-32 read resource from the supplied String URI.