~zorba-coders/zorba/bugs-912586-912593-912722

« back to all changes in this revision

Viewing changes to swig/SerializationOptions.h

  • Committer: Cezar Andrei
  • Date: 2012-03-28 15:42:12 UTC
  • mfrom: (10606.1.129 zorba)
  • Revision ID: cezar.lp@cezarandrei.com-20120328154212-jh2heq49xcqjppce
Merge from trunck and resolve ChangeLog conflict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
class SerializationOptions
 
21
{
 
22
friend class Item;
 
23
 
 
24
public:
 
25
  typedef enum 
 
26
  {
 
27
    ZORBA_API_SERIALIZATION_METHOD_XML,
 
28
    ZORBA_API_SERIALIZATION_METHOD_HTML,
 
29
    ZORBA_API_SERIALIZATION_METHOD_XHTML,
 
30
    ZORBA_API_SERIALIZATION_METHOD_TEXT,
 
31
    ZORBA_API_SERIALIZATION_METHOD_BINARY
 
32
  } SerializationMethod;
 
33
 
 
34
  typedef enum 
 
35
  {
 
36
    ZORBA_API_BYTE_ORDER_MARK_YES,
 
37
    ZORBA_API_BYTE_ORDER_MARK_NO
 
38
  } ByteOrderMark;
 
39
 
 
40
 
 
41
  typedef enum 
 
42
  {
 
43
    ZORBA_API_ESCAPE_URI_ATTRIBUTES_YES,
 
44
    ZORBA_API_ESCAPE_URI_ATTRIBUTES_NO
 
45
  } EscapeUriAttributes;
 
46
 
 
47
  typedef enum {
 
48
    ZORBA_API_INCLUDE_CONTENT_TYPE_YES,
 
49
    ZORBA_API_INCLUDE_CONTENT_TYPE_NO
 
50
  } IncludeContentType;
 
51
 
 
52
  typedef enum {
 
53
    ZORBA_API_INDENT_YES,
 
54
    ZORBA_API_INDENT_NO
 
55
  } Indent;
 
56
 
 
57
  typedef enum {
 
58
    ZORBA_API_NORMALIZATION_FORM_NFC,
 
59
    ZORBA_API_NORMALIZATION_FORM_NFD,
 
60
    ZORBA_API_NORMALIZATION_FORM_NFKC,
 
61
    ZORBA_API_NORMALIZATION_FORM_NFKD,
 
62
    ZORBA_API_NORMALIZATION_FORM_FULLY_normalized,
 
63
    ZORBA_API_NORMALIZATION_FORM_NONE
 
64
  } NormalizationForm;
 
65
 
 
66
  typedef enum {
 
67
    ZORBA_API_OMIT_XML_DECLARATION_YES,
 
68
    ZORBA_API_OMIT_XML_DECLARATION_NO
 
69
  } OmitXMLDeclaration;
 
70
 
 
71
  typedef enum {
 
72
    ZORBA_API_STANDALONE_YES,
 
73
    ZORBA_API_STANDALONE_NO,
 
74
    ZORBA_API_STANDALONE_OMIT
 
75
  } Standalone;
 
76
 
 
77
  typedef enum {
 
78
    ZORBA_API_UNDECLARE_PREFIXES_YES,
 
79
    ZORBA_API_UNDECLARE_PREFIXES_NO
 
80
  } UndeclarePrefixes;
 
81
 
 
82
 
 
83
private:
 
84
  Zorba_SerializerOptions_t lOptions;
 
85
  
 
86
public:
 
87
  /*
 
88
   * Default values:
 
89
   *   - serialization method: XML
 
90
   *   - byte order mark: NO
 
91
   *   - esacpe uri attributes: NO
 
92
   *   - include content type: NO
 
93
   *   - indent: NO
 
94
   *   - normalization form: none
 
95
   *   - omit xml declaration: NO
 
96
   *   - standalone: omit
 
97
   *   - undeclare prefixes: NO
 
98
   */
 
99
 
 
100
 
 
101
  void setSerializationMethod ( SerializationMethod aSerializationMethod );
 
102
  void setByteOrderMark ( ByteOrderMark aByteOrderMark );
 
103
  void setEscapeUriAttributes ( EscapeUriAttributes aEscapeUriAttributes );
 
104
  void setIncludeContentType ( IncludeContentType aIncludeContentType );
 
105
  void setIndent ( Indent aIndent );
 
106
  void setNormalizationForm ( NormalizationForm aNormalizationForm );
 
107
  void setOmitXMLDeclaration ( OmitXMLDeclaration aOmitXMLDeclaration );
 
108
  void setStandalone ( Standalone aStandalone );
 
109
  void setUndeclarePrefixes ( UndeclarePrefixes aUndeclarePrefixes );
 
110
  void setSerializerOption(const std::string &parameter, const std::string &value);
 
111
 
 
112
}; // class SerializationOptions
 
113
 
 
114
#endif