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_WRITER_H 18#define SYNCML_DM_WRITER_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_FileHandle.H" 25 26class SyncML_DM_Writer 27{ 28 29 public: 30 31 /* Class constructor */ 32 SyncML_DM_Writer(DMFileHandler* handle) : fileHandle(handle){ } 33 34 /* Class destructor */ 35 virtual ~SyncML_DM_Writer(){ } 36 37 /* Accessor for setting the file handle used by this class */ 38 virtual void setFileHandle(DMFileHandler* fileHandle){ this->fileHandle = fileHandle; } 39 40 /* write a byte into the file 41 * implementations of this class will take advantage of this method 42 */ 43 virtual SYNCML_DM_RET_STATUS_T writeByte(UINT8 bYte) = 0; 44 45 /* write a string into the file 46 * implementations of this class will take advantage of this method 47 */ 48 virtual SYNCML_DM_RET_STATUS_T writeString(CPCHAR string) = 0; 49 50 protected: 51 52 /* file handle used by class' utility methods */ 53 DMFileHandler* fileHandle; 54 55}; 56 57#endif /* SYNCML_DM_WRITER_H */ 58