/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (C) Yeico S. A. de C. V. * xlsLib -- A multiplatform, C++ library for dynamic generation of Excel (TM) * files. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Source: /cvsroot/xlslib/xlslib/src/oledoc/binfile.h,v $ * $Revision: 1.1.1.1 $ * $Author: darioglz $ * $Date: 2004/08/27 16:31:43 $ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * File description: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef BINFILE_H #define BINFILE_H #include #include #include "unit.h" #include #include namespace xlslib_core { /* ****************************** CBinFile class declaration ****************************** */ typedef int (*write_fptr_t)(const char *str, unsigned int str_length); class CBinFile { private: int write_service(const char *buffer, int size); static const int STROKE_CHUNK_SIZE; public: CBinFile(); CBinFile(const std::string& name); ~CBinFile(); int Open(const std::string& name); int Close(void); int Write ( unsigned8_t * data, unsigned32_t size ); int Write (CUnit& data_unit ); int WriteByte(unsigned8_t byte); int WriteUnsigned16(unsigned16_t data); int WriteUnsigned32(unsigned32_t data); int WriteSigned16(signed16_t data); int WriteSigned32(signed32_t data); int WriteByteArray(const unsigned8_t *data, unsigned32_t size); int SerializeFixedArray(const unsigned8_t data, unsigned32_t size); void SetStroke(){ is_stroke= true; } void UnSetStroke(){ is_stroke= false; } protected: write_fptr_t write_fptr; std::ofstream m_File; bool is_stroke; }; } #endif //BINFILE_H /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * $Log: binfile.h,v $ * Revision 1.1.1.1 2004/08/27 16:31:43 darioglz * Initial Import. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */