00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ 00002 /* librevenge 00003 * Version: MPL 2.0 / LGPLv2.1+ 00004 * 00005 * This Source Code Form is subject to the terms of the Mozilla Public 00006 * License, v. 2.0. If a copy of the MPL was not distributed with this 00007 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 00008 * 00009 * Major Contributor(s): 00010 * Copyright (C) 2007 Fridrich Strba (fridrich.strba@bluewin.ch) 00011 * 00012 * For minor contributions see the git repository. 00013 * 00014 * Alternatively, the contents of this file may be used under the terms 00015 * of the GNU Lesser General Public License Version 2.1 or later 00016 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are 00017 * applicable instead of those above. 00018 */ 00019 00020 #ifndef RVNGBINARYDATA_H 00021 #define RVNGBINARYDATA_H 00022 00023 #include "librevenge-api.h" 00024 00025 #include <librevenge-stream/librevenge-stream.h> 00026 00027 #include "RVNGString.h" 00028 00029 namespace librevenge 00030 { 00031 00032 struct RVNGBinaryDataImpl; 00033 00036 class REVENGE_API RVNGBinaryData 00037 { 00038 public: 00039 RVNGBinaryData(); 00040 RVNGBinaryData(const RVNGBinaryData &); 00041 RVNGBinaryData(const unsigned char *buffer, const unsigned long bufferSize); 00042 explicit RVNGBinaryData(const RVNGString &base64); 00043 explicit RVNGBinaryData(const char *base64); 00044 ~RVNGBinaryData(); 00045 00046 void append(const RVNGBinaryData &data); 00047 void append(const unsigned char *buffer, const unsigned long bufferSize); 00048 void append(const unsigned char c); 00049 void appendBase64Data(const RVNGString &base64); 00050 void appendBase64Data(const char *base64); 00051 00054 void clear(); 00055 00060 unsigned long size() const; 00061 00066 bool empty() const; 00067 00075 const unsigned char *getDataBuffer() const; 00076 00081 const RVNGString getBase64Data() const; 00082 00093 RVNGInputStream *getDataStream() const; 00094 00099 RVNGBinaryData &operator=(const RVNGBinaryData &); 00100 00101 private: 00102 RVNGBinaryDataImpl *m_binaryDataImpl; 00103 }; 00104 00105 } 00106 00107 #endif 00108 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */