Orcus
Toggle main menu visibility
Loading...
Searching...
No Matches
include
orcus
xml_writer.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_WRITER_HPP
9
#define INCLUDED_ORCUS_XML_WRITER_HPP
10
11
#include "orcus/types.hpp"
12
13
#include <memory>
14
15
namespace
orcus {
16
17
class
xmlns_repository
;
18
23
class
ORCUS_PSR_DLLPUBLIC xml_writer
24
{
25
struct
impl;
26
std::unique_ptr<impl> mp_impl;
27
28
void
close_current_element();
29
void
pop_elements();
30
31
public
:
32
class
ORCUS_PSR_DLLPUBLIC scope
33
{
34
friend
class
xml_writer;
35
36
struct
impl;
37
std::unique_ptr<impl> mp_impl;
38
39
scope(xml_writer* parent,
const
xml_name_t
& name);
40
public
:
41
scope(
const
scope&) =
delete
;
42
scope(scope&& other);
43
~scope();
44
45
scope& operator= (scope&& other);
46
};
47
48
xml_writer(
const
xml_writer&) =
delete
;
49
xml_writer& operator= (
const
xml_writer&) =
delete
;
50
51
xml_writer(
xmlns_repository
& ns_repo, std::ostream& os);
52
xml_writer(xml_writer&& other);
53
54
xml_writer& operator= (xml_writer&& other);
55
60
~xml_writer
();
61
73
scope
push_element_scope
(
const
xml_name_t
& name);
74
81
void
push_element
(
const
xml_name_t
& name);
82
91
xmlns_id_t
add_namespace
(std::string_view alias, std::string_view value);
92
99
void
add_attribute
(
const
xml_name_t
& name, std::string_view value);
100
107
void
add_content
(std::string_view content);
108
115
xml_name_t
pop_element
();
116
};
117
118
}
119
120
#endif
121
122
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
orcus::xml_writer::scope
Definition
xml_writer.hpp:33
orcus::xml_writer::push_element
void push_element(const xml_name_t &name)
orcus::xml_writer::pop_element
xml_name_t pop_element()
orcus::xml_writer::add_content
void add_content(std::string_view content)
orcus::xml_writer::push_element_scope
scope push_element_scope(const xml_name_t &name)
orcus::xml_writer::add_namespace
xmlns_id_t add_namespace(std::string_view alias, std::string_view value)
orcus::xml_writer::add_attribute
void add_attribute(const xml_name_t &name, std::string_view value)
orcus::xml_writer::~xml_writer
~xml_writer()
orcus::xmlns_repository
Definition
xml_namespace.hpp:30
orcus::xml_name_t
Definition
types.hpp:62
Generated on
for Orcus by
1.17.0