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  */
35 {
36 friend class Item;
37 friend class XQuery;
38 
39 public:
40  typedef enum
41  {
48 
49  typedef enum
50  {
53  } ByteOrderMark;
54 
55 
56  typedef enum
57  {
61 
62  typedef enum {
66 
67  typedef enum {
70  } Indent;
71 
72  typedef enum {
80 
81  typedef enum {
85 
86  typedef enum {
90  } Standalone;
91 
92  typedef enum {
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 &parameter, const std::string &value);
145 
146 }; // class SerializationOptions
147 
148 #endif
void setByteOrderMark(ByteOrderMark aByteOrderMark)
void setUndeclarePrefixes(UndeclarePrefixes aUndeclarePrefixes)
void setIncludeContentType(IncludeContentType aIncludeContentType)
void setEscapeUriAttributes(EscapeUriAttributes aEscapeUriAttributes)
void setSerializationMethod(SerializationMethod aSerializationMethod)
void setIndent(Indent aIndent)
This class is the representation of an XQuery in the Zorba engine.
Definition: XQuery.h:27
void setSerializerOption(const std::string &parameter, const std::string &value)
/brief Set the serialization options given a string parameter and a string value
The Zorba Item interface.
Definition: Item.h:39
void setStandalone(Standalone aStandalone)
void setOmitXMLDeclaration(OmitXMLDeclaration aOmitXMLDeclaration)
This class defines a set of values used to define the way a serialization can be made over Items or C...
void setNormalizationForm(NormalizationForm aNormalizationForm)