Zorba
The XQuery Processor
Documentation
Live Demo
Modules
Download
Tools
Blog
Code
Main Page
Related Pages
Classes
Files
File List
File Members
swig
SerializationOptions.h
Go to the documentation of this file.
1
/*
2
* Copyright 2006-2008 The FLWOR Foundation.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef API_SERIALIZATION_OPTIONS_H
18
#define API_SERIALIZATION_OPTIONS_H
19
20
/** \brief This class defines a set of values used to define the way a serialization can be made over Items or Collections
21
* collections.
22
*
23
* Default values:
24
* - Serialization method: XML
25
* - Byte order mark: NO
26
* - Escape uri attributes: NO
27
* - Include content type: NO
28
* - Indent: NO
29
* - Normalization form: none
30
* - Omit xml declaration: NO
31
* - Standalone: omit
32
* - Undeclare prefixes: NO
33
*/
34
class
SerializationOptions
35
{
36
friend
class
Item
;
37
friend
class
XQuery
;
38
39
public
:
40
typedef
enum
41
{
42
ZORBA_API_SERIALIZATION_METHOD_XML
,
43
ZORBA_API_SERIALIZATION_METHOD_HTML
,
44
ZORBA_API_SERIALIZATION_METHOD_XHTML
,
45
ZORBA_API_SERIALIZATION_METHOD_TEXT
,
46
ZORBA_API_SERIALIZATION_METHOD_BINARY
47
}
SerializationMethod
;
48
49
typedef
enum
50
{
51
ZORBA_API_BYTE_ORDER_MARK_YES
,
52
ZORBA_API_BYTE_ORDER_MARK_NO
53
}
ByteOrderMark
;
54
55
56
typedef
enum
57
{
58
ZORBA_API_ESCAPE_URI_ATTRIBUTES_YES
,
59
ZORBA_API_ESCAPE_URI_ATTRIBUTES_NO
60
}
EscapeUriAttributes
;
61
62
typedef
enum
{
63
ZORBA_API_INCLUDE_CONTENT_TYPE_YES
,
64
ZORBA_API_INCLUDE_CONTENT_TYPE_NO
65
}
IncludeContentType
;
66
67
typedef
enum
{
68
ZORBA_API_INDENT_YES
,
69
ZORBA_API_INDENT_NO
70
}
Indent
;
71
72
typedef
enum
{
73
ZORBA_API_NORMALIZATION_FORM_NFC
,
74
ZORBA_API_NORMALIZATION_FORM_NFD
,
75
ZORBA_API_NORMALIZATION_FORM_NFKC
,
76
ZORBA_API_NORMALIZATION_FORM_NFKD
,
77
ZORBA_API_NORMALIZATION_FORM_FULLY_normalized
,
78
ZORBA_API_NORMALIZATION_FORM_NONE
79
}
NormalizationForm
;
80
81
typedef
enum
{
82
ZORBA_API_OMIT_XML_DECLARATION_YES
,
83
ZORBA_API_OMIT_XML_DECLARATION_NO
84
}
OmitXMLDeclaration
;
85
86
typedef
enum
{
87
ZORBA_API_STANDALONE_YES
,
88
ZORBA_API_STANDALONE_NO
,
89
ZORBA_API_STANDALONE_OMIT
90
}
Standalone
;
91
92
typedef
enum
{
93
ZORBA_API_UNDECLARE_PREFIXES_YES
,
94
ZORBA_API_UNDECLARE_PREFIXES_NO
95
}
UndeclarePrefixes
;
96
97
98
private
:
99
Zorba_SerializerOptions_t lOptions;
100
101
public
:
102
103
/* /brief Set the serialization method used
104
*/
105
void
setSerializationMethod
(
SerializationMethod
aSerializationMethod );
106
107
/* /brief Set the byte order mark used
108
*/
109
void
setByteOrderMark
(
ByteOrderMark
aByteOrderMark );
110
111
/* /brief Set the escape uri attributes used
112
*/
113
void
setEscapeUriAttributes
(
EscapeUriAttributes
aEscapeUriAttributes );
114
115
/* /brief Set the include content type used
116
*/
117
void
setIncludeContentType
(
IncludeContentType
aIncludeContentType );
118
119
/* /brief Set the identation used
120
*/
121
void
setIndent
(
Indent
aIndent );
122
123
/* /brief Set the normalization form used
124
*/
125
void
setNormalizationForm
(
NormalizationForm
aNormalizationForm );
126
127
/* /brief Set if XML declaration is omited
128
*/
129
void
setOmitXMLDeclaration
(
OmitXMLDeclaration
aOmitXMLDeclaration );
130
131
/* /brief Set the standalone option
132
*/
133
void
setStandalone
(
Standalone
aStandalone );
134
135
/* /brief Set the undeclared prefixes
136
*/
137
void
setUndeclarePrefixes
(
UndeclarePrefixes
aUndeclarePrefixes );
138
139
/** /brief Set the serialization options given a string parameter and a string value
140
*
141
* @param parameter The parameter to be changed
142
* @param value The value to be assigned in a string form
143
*/
144
void
setSerializerOption
(
const
std::string ¶meter,
const
std::string &value);
145
146
};
// class SerializationOptions
147
148
#endif
Please enable JavaScript to view the
comments powered by Disqus.
blog comments powered by
Disqus