Zorba
The XQuery Processor
Documentation
Live Demo
Modules
Download
Tools
Blog
Code
Main Page
Related Pages
Classes
Files
Examples
File List
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
38
public
:
39
typedef
enum
40
{
41
ZORBA_API_SERIALIZATION_METHOD_XML
,
42
ZORBA_API_SERIALIZATION_METHOD_HTML
,
43
ZORBA_API_SERIALIZATION_METHOD_XHTML
,
44
ZORBA_API_SERIALIZATION_METHOD_TEXT
,
45
ZORBA_API_SERIALIZATION_METHOD_BINARY
46
}
SerializationMethod
;
47
48
typedef
enum
49
{
50
ZORBA_API_BYTE_ORDER_MARK_YES
,
51
ZORBA_API_BYTE_ORDER_MARK_NO
52
}
ByteOrderMark
;
53
54
55
typedef
enum
56
{
57
ZORBA_API_ESCAPE_URI_ATTRIBUTES_YES
,
58
ZORBA_API_ESCAPE_URI_ATTRIBUTES_NO
59
}
EscapeUriAttributes
;
60
61
typedef
enum
{
62
ZORBA_API_INCLUDE_CONTENT_TYPE_YES
,
63
ZORBA_API_INCLUDE_CONTENT_TYPE_NO
64
}
IncludeContentType
;
65
66
typedef
enum
{
67
ZORBA_API_INDENT_YES
,
68
ZORBA_API_INDENT_NO
69
}
Indent
;
70
71
typedef
enum
{
72
ZORBA_API_NORMALIZATION_FORM_NFC
,
73
ZORBA_API_NORMALIZATION_FORM_NFD
,
74
ZORBA_API_NORMALIZATION_FORM_NFKC
,
75
ZORBA_API_NORMALIZATION_FORM_NFKD
,
76
ZORBA_API_NORMALIZATION_FORM_FULLY_normalized
,
77
ZORBA_API_NORMALIZATION_FORM_NONE
78
}
NormalizationForm
;
79
80
typedef
enum
{
81
ZORBA_API_OMIT_XML_DECLARATION_YES
,
82
ZORBA_API_OMIT_XML_DECLARATION_NO
83
}
OmitXMLDeclaration
;
84
85
typedef
enum
{
86
ZORBA_API_STANDALONE_YES
,
87
ZORBA_API_STANDALONE_NO
,
88
ZORBA_API_STANDALONE_OMIT
89
}
Standalone
;
90
91
typedef
enum
{
92
ZORBA_API_UNDECLARE_PREFIXES_YES
,
93
ZORBA_API_UNDECLARE_PREFIXES_NO
94
}
UndeclarePrefixes
;
95
96
97
private
:
98
Zorba_SerializerOptions_t lOptions;
99
100
public
:
101
102
/* /brief Set the serialization method used
103
*/
104
void
setSerializationMethod
(
SerializationMethod
aSerializationMethod );
105
106
/* /brief Set the byte order mark used
107
*/
108
void
setByteOrderMark
(
ByteOrderMark
aByteOrderMark );
109
110
/* /brief Set the escape uri attributes used
111
*/
112
void
setEscapeUriAttributes
(
EscapeUriAttributes
aEscapeUriAttributes );
113
114
/* /brief Set the include content type used
115
*/
116
void
setIncludeContentType
(
IncludeContentType
aIncludeContentType );
117
118
/* /brief Set the identation used
119
*/
120
void
setIndent
(
Indent
aIndent );
121
122
/* /brief Set the normalization form used
123
*/
124
void
setNormalizationForm
(
NormalizationForm
aNormalizationForm );
125
126
/* /brief Set if XML declaration is omited
127
*/
128
void
setOmitXMLDeclaration
(
OmitXMLDeclaration
aOmitXMLDeclaration );
129
130
/* /brief Set the standalone option
131
*/
132
void
setStandalone
(
Standalone
aStandalone );
133
134
/* /brief Set the undeclared prefixes
135
*/
136
void
setUndeclarePrefixes
(
UndeclarePrefixes
aUndeclarePrefixes );
137
138
/** /brief Set the serialization options given a string parameter and a string value
139
*
140
* @param parameter The parameter to be changed
141
* @param value The value to be assigned in a string form
142
*/
143
void
setSerializerOption
(
const
std::string ¶meter,
const
std::string &value);
144
145
};
// class SerializationOptions
146
147
#endif
Please enable JavaScript to view the
comments powered by Disqus.
blog comments powered by
Disqus