liblcf
writer_xml.h
Go to the documentation of this file.
1
/*
2
* This file is part of liblcf. Copyright (c) 2020 liblcf authors.
3
* https://github.com/EasyRPG/liblcf - https://easyrpg.org
4
*
5
* liblcf is Free/Libre Open Source Software, released under the MIT License.
6
* For the full copyright and license information, please view the COPYING
7
* file that was distributed with this source code.
8
*/
9
10
#ifndef LCF_WRITER_XML_H
11
#define LCF_WRITER_XML_H
12
13
#include <string>
14
#include <vector>
15
#include <memory>
16
#include <cstdio>
17
#include <stdint.h>
18
22
class
XmlWriter
{
23
24
public
:
30
XmlWriter
(std::ostream& filestream);
31
35
~XmlWriter
();
36
40
void
Close
();
41
47
void
WriteInt
(
int
val);
48
54
template
<
class
T>
55
void
Write
(
const
T& val);
56
64
template
<
class
T>
65
void
WriteNode
(
const
std::string& name,
const
T& val);
66
72
void
BeginElement
(
const
std::string& name);
73
80
void
BeginElement
(
const
std::string& name,
int
ID);
81
87
void
EndElement
(
const
std::string& name);
88
92
void
NewLine
();
93
100
bool
IsOk
()
const
;
101
102
protected
:
104
std::ostream&
stream
;
106
int
indent
;
108
bool
at_bol
;
109
113
void
Indent
();
114
120
template
<
class
T>
121
void
WriteVector
(
const
std::vector<T>& val);
122
123
};
124
125
#endif
XmlWriter::NewLine
void NewLine()
Definition:
writer_xml.cpp:184
XmlWriter::WriteInt
void WriteInt(int val)
Definition:
writer_xml.cpp:137
XmlWriter::EndElement
void EndElement(const std::string &name)
Definition:
writer_xml.cpp:177
XmlWriter::stream
std::ostream & stream
Definition:
writer_xml.h:104
XmlWriter::XmlWriter
XmlWriter(std::ostream &filestream)
Definition:
writer_xml.cpp:18
XmlWriter
Definition:
writer_xml.h:22
XmlWriter::indent
int indent
Definition:
writer_xml.h:106
XmlWriter::~XmlWriter
~XmlWriter()
Definition:
writer_xml.cpp:27
XmlWriter::Write
void Write(const T &val)
XmlWriter::WriteNode
void WriteNode(const std::string &name, const T &val)
Definition:
writer_xml.cpp:155
XmlWriter::Indent
void Indent()
Definition:
writer_xml.cpp:191
XmlWriter::Close
void Close()
XmlWriter::WriteVector
void WriteVector(const std::vector< T > &val)
Definition:
writer_xml.cpp:142
XmlWriter::IsOk
bool IsOk() const
Definition:
writer_xml.cpp:199
XmlWriter::at_bol
bool at_bol
Definition:
writer_xml.h:108
XmlWriter::BeginElement
void BeginElement(const std::string &name)
Definition:
writer_xml.cpp:161
src
writer_xml.h
Generated on Sun Aug 2 2020 00:00:00 for liblcf by
1.8.18