libkdenetwork Library API Documentation

qgpgme/dataprovider.h

00001 /* dataprovider.h
00002    Copyright (C) 2004 Klarälvdalens Datakonsult AB
00003 
00004    This file is part of QGPGME.
00005  
00006    QGPGME is free software; you can redistribute it and/or modify it
00007    under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010  
00011    QGPGME is distributed in the hope that it will be useful, but
00012    WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with QGPGME; if not, write to the Free Software Foundation,
00018    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA.  */
00019 
00020 // -*- c++ -*-
00021 #ifndef __QGPGME_DATAPROVIDER_H__
00022 #define __QGPGME_DATAPROVIDER_H__
00023 
00024 #include <gpgmepp/interfaces/dataprovider.h>
00025 
00026 #include <qcstring.h>
00027 
00028 namespace QGpgME {
00029 
00030   class QByteArrayDataProvider : public GpgME::DataProvider {
00031   public:
00032     QByteArrayDataProvider();
00033     QByteArrayDataProvider( const QByteArray & initialData );
00034     ~QByteArrayDataProvider();
00035 
00036     const QByteArray & data() const { return mArray; }
00037 
00038   private:
00039     // these shall only be accessed through the dataprovider
00040     // interface, where they're public:
00042     bool isSupported( Operation ) const { return true; }
00044     ssize_t read( void * buffer, size_t bufSize );
00046     ssize_t write( const void * buffer, size_t bufSize );
00048     off_t seek( off_t offset, int whence );
00050     void release();
00051 
00052   private:
00053     QByteArray mArray;
00054     off_t mOff;
00055   };
00056 
00057 } // namespace QGpgME
00058 
00059 #endif // __QGPGME_EVENTLOOPINTERACTOR_H__
00060 
00061 
KDE Logo
This file is part of the documentation for libkdenetwork Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Oct 4 14:39:09 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003