home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- ** $Id: qbuffer.h,v 2.6 1998/07/03 00:09:43 hanord Exp $
- **
- ** Definition of QBuffer class
- **
- ** Created : 930812
- **
- ** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved.
- **
- ** This file is part of Qt Free Edition, version 1.40.
- **
- ** See the file LICENSE included in the distribution for the usage
- ** and distribution terms, or http://www.troll.no/free-license.html.
- **
- ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
- ** your own programs or libraries.
- **
- ** Please see http://www.troll.no/pricing.html for information about
- ** Qt Professional Edition, which is this same library but with a
- ** license which allows creation of commercial/proprietary software.
- **
- *****************************************************************************/
-
- #ifndef QBUFFER_H
- #define QBUFFER_H
-
- #ifndef QT_H
- #include "qiodevice.h"
- #include "qstring.h"
- #endif // QT_H
-
-
- class QBuffer : public QIODevice // buffer I/O device class
- {
- public:
- QBuffer();
- QBuffer( QByteArray );
- ~QBuffer();
-
- QByteArray buffer() const;
- bool setBuffer( QByteArray );
-
- bool open( int );
- void close();
- void flush();
-
- uint size() const;
- int at() const;
- bool at( int );
-
- int readBlock( char *p, uint );
- int writeBlock( const char *p, uint );
- int readLine( char *p, uint );
-
- int getch();
- int putch( int );
- int ungetch( int );
-
- protected:
- QByteArray a;
-
- private:
- uint a_len;
- uint a_inc;
-
- private: // Disabled copy constructor and operator=
- QBuffer( const QBuffer & );
- QBuffer &operator=( const QBuffer & );
- };
-
-
- inline QByteArray QBuffer::buffer() const
- { return a; }
-
- inline uint QBuffer::size() const
- { return a.size(); }
-
- inline int QBuffer::at() const
- { return index; }
-
-
- #endif // QBUFFER_H
-