8#ifndef INCLUDED_ORCUS_TYPES_HPP
9#define INCLUDED_ORCUS_TYPES_HPP
15#include <unordered_set>
26using xml_token_t = std::size_t;
33using xmlns_id_t =
const char*;
40struct ORCUS_PSR_DLLPUBLIC parse_error_value_t
47 parse_error_value_t();
48 parse_error_value_t(
const parse_error_value_t& other);
49 parse_error_value_t(std::string_view _str, std::ptrdiff_t _offset);
51 parse_error_value_t& operator=(
const parse_error_value_t& other);
53 bool operator==(
const parse_error_value_t& other)
const;
54 bool operator!=(
const parse_error_value_t& other)
const;
61struct ORCUS_PSR_DLLPUBLIC xml_name_t
63 enum to_string_type { use_alias, use_short_name };
66 std::string_view name;
68 xml_name_t()
noexcept;
69 xml_name_t(xmlns_id_t _ns, std::string_view _name);
70 xml_name_t(
const xml_name_t& other);
72 xml_name_t& operator= (
const xml_name_t& other);
74 bool operator== (
const xml_name_t& other)
const noexcept;
75 bool operator!= (
const xml_name_t& other)
const noexcept;
109struct ORCUS_PSR_DLLPUBLIC xml_token_attr_t
113 std::string_view raw_name;
114 std::string_view value;
126 xml_token_attr_t(
const xml_token_attr_t& other);
128 xmlns_id_t _ns, xml_token_t _name, std::string_view _value,
bool _transient);
130 xmlns_id_t _ns, xml_token_t _name, std::string_view _raw_name,
131 std::string_view _value,
bool _transient);
133 xml_token_attr_t& operator=(
const xml_token_attr_t& other);
136using xml_token_attrs_t = std::vector<xml_token_attr_t>;
147struct ORCUS_PSR_DLLPUBLIC xml_token_element_t
151 std::string_view raw_name;
152 xml_token_attrs_t attrs;
154 xml_token_element_t& operator= (xml_token_element_t) =
delete;
156 xml_token_element_t();
157 xml_token_element_t(xmlns_id_t _ns, xml_token_t _name, std::string_view _raw_name, std::vector<xml_token_attr_t>&& _attrs);
158 xml_token_element_t(
const xml_token_element_t& other);
159 xml_token_element_t(xml_token_element_t&& other);
167enum class character_set_t
170 adobe_standard_encoding,
171 adobe_symbol_encoding,
212 extended_unix_code_fixed_width_for_japanese,
295 iso_10646_unicode_latin1,
317 iso_8859_1_windows_3_0_latin_1,
318 iso_8859_1_windows_3_1_latin_1,
320 iso_8859_2_windows_latin_2,
332 iso_8859_9_windows_latin_5,
335 iso_unicode_ibm_1261,
336 iso_unicode_ibm_1264,
337 iso_unicode_ibm_1265,
338 iso_unicode_ibm_1268,
339 iso_unicode_ibm_1276,
347 jis_c6229_1984_b_add,
349 jis_c6229_1984_hand_add,
367 microsoft_publishing,
383 pc8_danish_norwegian,
411 ventura_international,
433struct ORCUS_PSR_DLLPUBLIC xml_declaration_t
435 uint8_t version_major;
436 uint8_t version_minor;
437 character_set_t encoding;
441 xml_declaration_t(uint8_t _version_major, uint8_t _version_minor, character_set_t _encoding,
bool _standalone);
442 xml_declaration_t(
const xml_declaration_t& other);
443 ~xml_declaration_t();
445 xml_declaration_t& operator= (
const xml_declaration_t& other);
447 bool operator== (
const xml_declaration_t& other)
const;
448 bool operator!= (
const xml_declaration_t& other)
const;
454enum class length_unit_t
491enum class dump_format_t
508struct ORCUS_PSR_DLLPUBLIC length_t
514 length_t(length_unit_t _unit,
double _value);
515 length_t(
const length_t& other);
516 length_t& operator= (
const length_t& other);
518 std::string to_string()
const;
520 bool operator== (
const length_t& other)
const noexcept;
521 bool operator!= (
const length_t& other)
const noexcept;
527struct ORCUS_PSR_DLLPUBLIC date_time_t
537 date_time_t(
int _year,
int _month,
int _day);
538 date_time_t(
int _year,
int _month,
int _day,
int _hour,
int _minute,
double _second);
539 date_time_t(
const date_time_t& other);
542 date_time_t& operator= (date_time_t other);
544 bool operator== (
const date_time_t& other)
const;
545 bool operator!= (
const date_time_t& other)
const;
546 bool operator< (
const date_time_t& other)
const;
589ORCUS_PSR_DLLPUBLIC dump_format_t to_dump_format_enum(std::string_view s);
601ORCUS_PSR_DLLPUBLIC character_set_t to_character_set(std::string_view s);
609ORCUS_PSR_DLLPUBLIC std::vector<std::pair<std::string_view, dump_format_t>> get_dump_format_entries();
611ORCUS_PSR_DLLPUBLIC std::ostream& operator<< (std::ostream& os,
const length_t& v);
612ORCUS_PSR_DLLPUBLIC std::ostream& operator<< (std::ostream& os,
const date_time_t& v);
613ORCUS_PSR_DLLPUBLIC std::ostream& operator<< (std::ostream& os, format_t v);
619ORCUS_PSR_DLLPUBLIC
extern const std::size_t INDEX_NOT_FOUND;
624ORCUS_PSR_DLLPUBLIC
extern const xmlns_id_t XMLNS_UNKNOWN_ID;
629ORCUS_PSR_DLLPUBLIC
extern const xml_token_t XML_UNKNOWN_TOKEN;
Definition xml_namespace.hpp:100
Definition xml_namespace.hpp:30
static date_time_t from_chars(std::string_view str)
std::string to_string() const
void swap(date_time_t &other)
std::string_view str
Definition types.hpp:43
std::ptrdiff_t offset
Definition types.hpp:45
std::string to_string(const xmlns_repository &repo) const
std::string to_string(const xmlns_context &cxt, to_string_type type) const
bool transient
Definition types.hpp:123