Orcus
Toggle main menu visibility
Loading...
Searching...
No Matches
include
orcus
xml_namespace.hpp
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This Source Code Form is subject to the terms of the Mozilla Public
4
* License, v. 2.0. If a copy of the MPL was not distributed with this
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
*/
7
8
#ifndef INCLUDED_ORCUS_XML_NAMESPACE_MANAGER_HPP
9
#define INCLUDED_ORCUS_XML_NAMESPACE_MANAGER_HPP
10
11
#include "types.hpp"
12
13
#include <ostream>
14
#include <memory>
15
16
namespace
orcus {
17
18
class
xmlns_context
;
19
struct
xmlns_repository_impl;
20
struct
xmlns_context_impl;
21
29
class
ORCUS_PSR_DLLPUBLIC xmlns_repository
30
{
31
friend
class
xmlns_context;
32
33
struct
impl;
34
std::unique_ptr<impl> mp_impl;
35
36
xmlns_id_t intern(std::string_view uri);
37
38
size_t
get_index(xmlns_id_t ns_id)
const
;
39
40
public
:
41
xmlns_repository(
const
xmlns_repository&) =
delete
;
42
xmlns_repository& operator= (
const
xmlns_repository&) =
delete
;
43
44
xmlns_repository();
45
xmlns_repository(xmlns_repository&& other);
46
~xmlns_repository();
47
48
xmlns_repository& operator= (xmlns_repository&&);
49
62
void
add_predefined_values
(
const
xmlns_id_t* predefined_ns);
63
73
xmlns_context
create_context
();
74
82
xmlns_id_t
get_identifier
(
size_t
index)
const
;
83
88
std::string
get_short_name
(xmlns_id_t ns_id)
const
;
89
};
90
99
class
ORCUS_PSR_DLLPUBLIC xmlns_context
100
{
101
friend
class
xmlns_repository;
102
103
struct
impl;
104
std::unique_ptr<impl> mp_impl;
105
106
xmlns_context(xmlns_repository& repo);
107
public
:
108
xmlns_context();
109
xmlns_context(xmlns_context&&);
110
xmlns_context(
const
xmlns_context& r);
111
~xmlns_context();
112
113
xmlns_context& operator= (
const
xmlns_context& r);
114
xmlns_context& operator= (xmlns_context&& r);
115
126
xmlns_id_t
push
(std::string_view alias, std::string_view uri);
127
133
void
pop
(std::string_view alias);
134
142
xmlns_id_t
get
(std::string_view alias)
const
;
143
152
size_t
get_index
(xmlns_id_t ns_id)
const
;
153
167
std::string
get_short_name
(xmlns_id_t ns_id)
const
;
168
178
std::string_view
get_alias
(xmlns_id_t ns_id)
const
;
179
180
std::vector<xmlns_id_t> get_all_namespaces()
const
;
181
182
void
dump(std::ostream& os)
const
;
183
187
void
dump_state
(std::ostream& os)
const
;
188
189
void
swap(xmlns_context& other)
noexcept
;
190
};
191
192
}
193
194
#endif
195
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
orcus::xmlns_context
Definition
xml_namespace.hpp:100
orcus::xmlns_context::get_index
size_t get_index(xmlns_id_t ns_id) const
orcus::xmlns_context::push
xmlns_id_t push(std::string_view alias, std::string_view uri)
orcus::xmlns_context::get_short_name
std::string get_short_name(xmlns_id_t ns_id) const
orcus::xmlns_context::get
xmlns_id_t get(std::string_view alias) const
orcus::xmlns_context::dump_state
void dump_state(std::ostream &os) const
orcus::xmlns_context::get_alias
std::string_view get_alias(xmlns_id_t ns_id) const
orcus::xmlns_context::pop
void pop(std::string_view alias)
orcus::xmlns_repository::create_context
xmlns_context create_context()
orcus::xmlns_repository::get_short_name
std::string get_short_name(xmlns_id_t ns_id) const
orcus::xmlns_repository::add_predefined_values
void add_predefined_values(const xmlns_id_t *predefined_ns)
orcus::xmlns_repository::get_identifier
xmlns_id_t get_identifier(size_t index) const
Generated on
for Orcus by
1.17.0