serializer.h
Go to the documentation of this file.
1 /*
2  * Copyright 2006-2009 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 #ifndef ZORBA_SERIALIZER_API_H
17 #define ZORBA_SERIALIZER_API_H
18 
19 #include <zorba/options.h>
20 #include <zorba/config.h>
21 #include <zorba/api_shared_types.h>
22 #include <zorba/item.h>
23 
24 namespace zorba {
25 
26  class ZORBA_DLL_PUBLIC Serializer : public SmartObject
27  {
28  public:
29 
30  virtual ~Serializer() {}
31 
32  virtual void
33  serialize(
34  ItemSequence *object,
35  std::ostream& stream) const = 0;
36 
37  virtual int
38  getSerializationMethod() const = 0;
39 
40  static Serializer_t
41  createSerializer(const Zorba_SerializerOptions_t& options);
42 
43  static Serializer_t
44  createSerializer(ItemSequence* options);
45 
46  };
47 
48 } /* namespace zorba */
49 
50 #endif
51 /* vim:set et sw=2 ts=2: */