Doomseeker
   
  • Doomseeker
  • Wadseeker
  • Download
  • Tracker
  • Git
  • Docs
  • Main Page
  • Classes
  • Files
  • File List
  • File Members

src/core/datastreamoperatorwrapper.h

00001 //------------------------------------------------------------------------------
00002 // datastreamoperatorwrapper.h
00003 //------------------------------------------------------------------------------
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018 // 02110-1301, USA.
00019 //
00020 //------------------------------------------------------------------------------
00021 // Copyright (C) 2012 "Zalewa" <zalewapl@gmail.com>
00022 //------------------------------------------------------------------------------
00023 #ifndef DOOMSEEKER_DATASTREAMOPERATORWRAPPER_H
00024 #define DOOMSEEKER_DATASTREAMOPERATORWRAPPER_H
00025 
00026 #include <QDataStream>
00027 
00028 #include "global.h"
00029 
00034 class MAIN_EXPORT DataStreamOperatorWrapper
00035 {
00036         public:
00037                 DataStreamOperatorWrapper(QDataStream* stream);
00038                 virtual ~DataStreamOperatorWrapper() {};
00039                 
00043                 QDataStream* dataStream()
00044                 {
00045                         return s;
00046                 }
00047                 
00051                 const QDataStream* dataStream() const
00052                 {
00053                         return s;
00054                 }
00055                 
00061                 bool hasRemaining() const
00062                 {
00063                         return remaining() > 0;
00064                 }
00065         
00066                 qint8 readQInt8();
00067                 bool readBool();
00068                 quint8 readQUInt8();
00069                 quint16 readQUInt16();
00070                 qint16 readQInt16();
00071                 quint32 readQUInt32();
00072                 qint32 readQInt32();
00073                 quint64 readQUInt64();
00074                 qint64 readQInt64();
00075                 float readFloat();
00076                 double readDouble();
00077                 
00085                 QByteArray readRaw(qint64 length);
00086                 
00094                 QByteArray readRawAll();
00095                 
00099                 QByteArray readRawUntilByte(char stopByte);
00100                 
00109                 qint64 remaining() const;
00110                 
00118                 int skipRawData(int len);
00119                 
00120         private:
00121                 QDataStream* s;
00122 };
00123 
00124 #endif
00125 
   
Doomseeker © 2009-2024 The Doomseeker Team