wsdlpull
1.23
Toggle main menu visibility
Loading...
Searching...
No Matches
src
xmlpull
XmlSerializer.h
Go to the documentation of this file.
1
/* Copyright (c) 2005,2007 Vivek Krishna
2
* Based on kxml2 by Stefan Haustein, Oberhausen, Rhld., Germany
3
* Permission is hereby granted, free of charge, to any person obtaining a copy
4
* of this software and associated documentation files (the "Software"), to deal
5
* in the Software without restriction, including without limitation the rights
6
* to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
* sell copies of the Software, and to permit persons to whom the Software is
8
* furnished to do so, subject to the following conditions:
9
*
10
* The above copyright notice and this permission notice shall be included in
11
* all copies or substantial portions of the Software.
12
*
13
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19
* IN THE SOFTWARE. */
20
21
#ifndef _XMLSERIALIZERH
22
#define _XMLSERIALIZERH
23
24
#include <iostream>
25
#include <sstream>
26
#include <string>
27
#include <vector>
28
#ifdef HAVE_CONFIG_H
//
29
#include <config.h>
30
#endif
31
#include "
wsdlpull_export.h
"
32
33
class
WSDLPULL_EXPORT
XmlSerializer
{
34
35
public
:
36
XmlSerializer
(std::ostream &os, std::string encoding=
"utf"
);
37
XmlSerializer
(std::string encoding=
"utf"
);
//standard output
38
~XmlSerializer
(
void
);
39
void
docdecl
(std::string dd);
40
void
startDocument
(std::string encoding,
41
bool
standalone);
42
XmlSerializer
&
startTag
(std::string nsp, std::string name);
43
XmlSerializer
&
attribute
(std::string nsp,
44
std::string name,
45
std::string value);
46
XmlSerializer
&
endTag
(std::string nsp, std::string name);
47
void
endDocument
();
48
void
entityRef
(std::string name);
49
bool
getFeature
(std::string name);
50
std::string
getPrefix
(std::string nsp,
bool
create);
51
std::string
getPrefix
(std::string nsp,
52
bool
includeDefault,
53
bool
create);
54
55
void
ignorableWhitespace
(std::string s);
56
void
setFeature
(std::string name,
bool
value);
57
void
setPrefix
(std::string prefix, std::string nsp);
58
59
void
flush
();
60
std::string
getNamespace
();
61
std::string
getName
();
62
int
getDepth
();
63
XmlSerializer
&
text
(std::string txt);
64
XmlSerializer
&
text
(std::string txt,
int
start,
int
len);
65
void
cdsect
(std::string data);
66
void
comment
(std::string
comment
);
67
void
processingInstruction
(std::string pi);
68
69
70
private
:
71
std::ostream& writer;
72
bool
pending;
73
int
auto_;
74
int
depth;
75
std::string encoding;
76
std::vector<std::string> elementStack,nspStack;
77
//nsp/prefix/name
78
std::vector<int> nspCounts;
79
//prefix/nsp; both empty are ""
80
std::vector<bool> indent;
81
bool
unicode;
82
void
check(
bool
close);
83
void
writeEscaped(std::string s,
int
quot);
84
void
exception (std::string desc);
85
void
init();
86
};
87
88
#endif
XmlSerializer::startTag
XmlSerializer & startTag(std::string nsp, std::string name)
Definition
XmlSerializer.cpp:314
XmlSerializer::ignorableWhitespace
void ignorableWhitespace(std::string s)
Definition
XmlSerializer.cpp:253
XmlSerializer::processingInstruction
void processingInstruction(std::string pi)
Definition
XmlSerializer.cpp:512
XmlSerializer::comment
void comment(std::string comment)
Definition
XmlSerializer.cpp:504
XmlSerializer::endDocument
void endDocument()
Definition
XmlSerializer.cpp:164
XmlSerializer::text
XmlSerializer & text(std::string txt)
Definition
XmlSerializer.cpp:480
XmlSerializer::setPrefix
void setPrefix(std::string prefix, std::string nsp)
Definition
XmlSerializer.cpp:269
XmlSerializer::XmlSerializer
XmlSerializer(std::ostream &os, std::string encoding="utf")
Definition
XmlSerializer.cpp:28
XmlSerializer::startDocument
void startDocument(std::string encoding, bool standalone)
Definition
XmlSerializer.cpp:290
XmlSerializer::getFeature
bool getFeature(std::string name)
Definition
XmlSerializer.cpp:183
XmlSerializer::getDepth
int getDepth()
Definition
XmlSerializer.cpp:475
XmlSerializer::entityRef
void entityRef(std::string name)
Definition
XmlSerializer.cpp:174
XmlSerializer::attribute
XmlSerializer & attribute(std::string nsp, std::string name, std::string value)
Definition
XmlSerializer.cpp:365
XmlSerializer::cdsect
void cdsect(std::string data)
Definition
XmlSerializer.cpp:495
XmlSerializer::docdecl
void docdecl(std::string dd)
Definition
XmlSerializer.cpp:156
XmlSerializer::flush
void flush()
Definition
XmlSerializer.cpp:413
XmlSerializer::setFeature
void setFeature(std::string name, bool value)
Definition
XmlSerializer.cpp:259
XmlSerializer::endTag
XmlSerializer & endTag(std::string nsp, std::string name)
Definition
XmlSerializer.cpp:420
XmlSerializer::getName
std::string getName()
Definition
XmlSerializer.cpp:469
XmlSerializer::getNamespace
std::string getNamespace()
Definition
XmlSerializer.cpp:463
XmlSerializer::getPrefix
std::string getPrefix(std::string nsp, bool create)
Definition
XmlSerializer.cpp:191
wsdlpull_export.h
WSDLPULL_EXPORT
#define WSDLPULL_EXPORT
Definition
wsdlpull_export.h:30
Generated by
1.17.0