1/*
2 * Copyright (C) 2014 The Android Open Source Project
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 SYNCML_DM_WBXMLWRITER_H
18#define SYNCML_DM_WBXMLWRITER_H
19
20#ifndef __cplusplus
21#error "This is a C++ header file; it requires C++ to compile."
22#endif
23
24#include "SyncML_DM_Writer.H"
25#include "dm_tree_node_class.H"
26
27class SyncML_DM_WBXMLWriter : public SyncML_DM_Writer
28{
29  public:
30
31    /* Class constructor */
32        SyncML_DM_WBXMLWriter(DMFileHandler* fileHandle) : SyncML_DM_Writer(fileHandle) { }
33
34    /* Write a byte of data into the file handle */
35    virtual SYNCML_DM_RET_STATUS_T writeByte(UINT8 bYte);
36
37    /* Write a string into the file handle using opaque */
38        virtual SYNCML_DM_RET_STATUS_T writeString(CPCHAR string);
39
40    /* Write opaque data into the file handle */
41    SYNCML_DM_RET_STATUS_T writeOpaque(const UINT8* data, UINT32 len);
42
43    /* Write raw data string without WBXML encodings */
44    SYNCML_DM_RET_STATUS_T writeData(const UINT8* data, UINT8 len);
45
46    /* Write a tree node of type DMNode into the file handle */
47    //SYNCML_DM_RET_STATUS_T writeNode(const DMNode* pNode);
48
49    /* Write a tree node of type DMAddNodeProp into the file handle */
50    SYNCML_DM_RET_STATUS_T writeNode(const DMNode* node);
51
52    /* Operators to allocate and delete memory for operation */
53    void* operator new(size_t sz);
54    void operator delete(void* buf);
55
56    static const int MAX_OPAQUE_STRING_LENGTH;
57
58};
59
60#endif /* SYNCML_DM_WBXMLWRITER_H */
61