00001 /* --------------------------------------------------------------------------- 00002 commonc++ - A C++ Common Class Library 00003 Copyright (C) 2005-2012 Mark A Lindner 00004 00005 This file is part of commonc++. 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Library General Public 00009 License as published by the Free Software Foundation; either 00010 version 2 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Library General Public License for more details. 00016 00017 You should have received a copy of the GNU Library General Public 00018 License along with this library; if not, write to the Free 00019 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00020 --------------------------------------------------------------------------- 00021 */ 00022 00023 #ifndef __ccxx_DataWriter_hxx 00024 #define __ccxx_DataWriter_hxx 00025 00026 #include <commonc++/Blob.h++> 00027 #include <commonc++/DataEncoder.h++> 00028 #include <commonc++/IOException.h++> 00029 #include <commonc++/String.h++> 00030 00031 namespace ccxx { 00032 00040 class COMMONCPP_API DataWriter : public DataEncoder 00041 { 00042 public: 00043 00045 virtual ~DataWriter() throw(); 00046 00047 virtual void skip(size_t count) throw(IOException) = 0; 00048 00056 virtual void skip(size_t count, byte_t fillByte) throw(IOException) = 0; 00057 00061 virtual void flush() throw(IOException) = 0; 00062 00064 DataWriter & operator<<(bool v) throw(IOException); 00066 DataWriter & operator<<(byte_t v) throw(IOException); 00068 DataWriter & operator<<(const byte_t *v) throw(IOException); 00070 DataWriter & operator<<(char v) throw(IOException); 00072 DataWriter & operator<<(const char *v) throw(IOException); 00074 DataWriter & operator<<(int16_t v) throw(IOException); 00076 DataWriter & operator<<(const int16_t *v) throw(IOException); 00078 DataWriter & operator<<(uint16_t v) throw(IOException); 00080 DataWriter & operator<<(const uint16_t *v) throw(IOException); 00082 DataWriter & operator<<(int32_t v) throw(IOException); 00084 DataWriter & operator<<(const int32_t *v) throw(IOException); 00086 DataWriter & operator<<(uint32_t v) throw(IOException); 00088 DataWriter & operator<<(const uint32_t *v) throw(IOException); 00090 DataWriter & operator<<(const int64_t &v) throw(IOException); 00092 DataWriter & operator<<(const int64_t *v) throw(IOException); 00094 DataWriter & operator<<(const uint64_t &v) throw(IOException); 00096 DataWriter & operator<<(const uint64_t *v) throw(IOException); 00098 DataWriter & operator<<(float v) throw(IOException); 00100 DataWriter & operator<<(const float *v) throw(IOException); 00102 DataWriter & operator<<(const double &v) throw(IOException); 00104 DataWriter & operator<<(const double *v) throw(IOException); 00106 DataWriter & operator<<(const Blob &v) throw(IOException); 00108 DataWriter & operator<<(const String &v) throw(IOException); 00109 00111 DataWriter & operator<<(const Manipulator &manip) throw(IOException); 00112 00113 protected: 00114 00116 DataWriter() throw(); 00117 00119 virtual size_t write(const byte_t *buf, size_t count) throw(IOException) 00120 = 0; 00121 00122 private: 00123 00124 CCXX_COPY_DECLS(DataWriter); 00125 }; 00126 00127 }; // namespace ccxx 00128 00129 #endif // __ccxx_DataWriter_hxx 00130 00131 /* end of header file */
1.6.3