Zen C++ Libraries
Zero-dependency re-usable components for C++
Loading...
Searching...
No Matches
unicode.hpp
1#ifndef ZEN_UNICODE_HPP
2#define ZEN_UNICODE_HPP
3
4#include <cstdint>
5
6#include "zen/error.hpp"
7#include "zen/json.hpp"
8#include "zen/stream.hpp"
9
10namespace zen {
11
12 using unicode_char = std::uint32_t;
13
14 // FIXME must be merged with zen::string
15 using unicode_string = std::basic_string<unicode_char>;
16
17 static constexpr const unicode_char eof = 0xFFFF;
18
19 class utf8_stream : public buffered_stream<unicode_char> {
20
22
23 public:
24
25 utf8_stream(stream<unsigned char>& parent);
26
27 result<maybe<unicode_char>> read() override;
28
29 };
30
31 unicode_string operator ""_utf8(const char* data, std::size_t sz);
32
33}
34
35#endif // #ifndef ZEN_UNICODE_HPP
Definition stream.hpp:33
Definition stream.hpp:17