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 
38 public:
39  typedef enum
40  {
47 
48  typedef enum
49  {
52  } ByteOrderMark;
53 
54 
55  typedef enum
56  {
60 
61  typedef enum {
65 
66  typedef enum {
69  } Indent;
70 
71  typedef enum {
79 
80  typedef enum {
84 
85  typedef enum {
89  } Standalone;
90 
91  typedef enum {
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 &parameter, const std::string &value);
144 
145 }; // class SerializationOptions
146 
147 #endif
blog comments powered by Disqus