Unicode library for C++ by Ross Smith
#include "unicorn/core.hpp"This module provides some common definitions used throughout the library.
using namespace Prionnamespace Unicorn::Literalsusing namespace Prion::LiteralsEverything in the Prion library is imported.
class InitializationError: public std::runtime_errorAn abstract base class for internal errors that may happen while loading the Unicode tables used by certain functions. Functions that can throw exceptions derived from this are individually documented.
class EncodingError: public std::runtime_errorEncodingError::EncodingError()explicit EncodingError::EncodingError(const u8string& encoding, size_t offset = 0, char32_t c = 0)template <typename C> EncodingError::EncodingError(const u8string& encoding, size_t offset, const C* ptr, size_t n = 1)const char* EncodingError::encoding() noexcept constsize_t EncodingError::offset() const noexceptAn exception thrown to indicate a text encoding error encountered when
converting a string from one encoding to another, or when checking an encoded
string for validity. The offset of the offending data within the source string
(when available) can be retrieved through the offset() method. If possible,
a hexadecimal representation of the offending data will be included in the
error message.
#define UNICORN_NATIVE_WCHAR 1Defined if the operating system's native API uses wide character strings (this is currently defined only for native Windows builds).
#define UNICORN_WCHAR_UTF16 1#define UNICORN_WCHAR_UTF32 1One of these is defined to indicate which UTF encoding the system's wstring
class uses.
template <typename C> struct IsCharacterTypestatic constexpr bool IsCharacterType::valueThe value flag is true if C is one of the character types recognized by
the Unicorn library (char, char16_t, char32_t, or wchar_t).
using NativeCharacter = [char on Unix, wchar_t on Windows]using NativeString = [string on Unix, wstring on Windows]These are the character and string types used in the operating system's native ABI.
using WcharEquivalent = [char16_t or char32_t]using WstringEquivalent = [u16string or u32string]These are defined to match the UTF encoding of the system's wstring class.
Version unicorn_version() noexceptVersion unicode_version() noexceptThese return the version of the Unicorn library and the supported version of the Unicode standard.