QLocalPipe.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                            Local pipe i/o device                              *
00004 *                                                                               *
00005 *********************************************************************************
00006 *        Copyright (C) 2003-2006 by Niall Douglas.   All Rights Reserved.       *
00007 *       NOTE THAT I DO NOT PERMIT ANY OF MY CODE TO BE PROMOTED TO THE GPL      *
00008 *********************************************************************************
00009 * This code is free software; you can redistribute it and/or modify it under    *
00010 * the terms of the GNU Library General Public License v2.1 as published by the  *
00011 * Free Software Foundation EXCEPT that clause 3 does not apply ie; you may not  *
00012 * "upgrade" this code to the GPL without my prior written permission.           *
00013 * Please consult the file "License_Addendum2.txt" accompanying this file.       *
00014 *                                                                               *
00015 * This code is distributed in the hope that it will be useful,                  *
00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                          *
00018 *********************************************************************************
00019 * $Id:                                                                          *
00020 ********************************************************************************/
00021 
00022 
00023 #ifndef QLOCALPIPE_H
00024 #define QLOCALPIPE_H
00025 #include "QIODeviceS.h"
00026 
00027 namespace FX {
00028 
00057 struct QLocalPipePrivate;
00058 class FXAPIR QLocalPipe : public QIODeviceS
00059 {
00060     friend struct QLocalPipePrivate;
00061     QLocalPipePrivate *p;
00062     bool creator;
00063     QLocalPipe &operator=(const QLocalPipe &);
00064     virtual void *int_getOSHandle() const;
00065 public:
00067     QLocalPipe();
00069     QLocalPipe(const QLocalPipe &o);
00070     ~QLocalPipe();
00071 
00073     FXuval granularity() const;
00075     void setGranularity(FXuval newval);
00077     QLocalPipe clientEnd() const { return *this; }
00079     bool create(FXuint mode=IO_ReadWrite) { return open(mode); }
00081     bool open(FXuint mode=IO_ReadWrite);
00083     void close();
00085     void flush();
00086 
00088     bool atEnd() const;
00090     FXfval size() const;
00092     void truncate(FXfval size);
00094     FXfval at() const;
00096     bool at(FXfval newpos);
00097 
00106     FXuval readBlock(char *data, FXuval maxlen);
00113     FXuval writeBlock(const char *data, FXuval maxlen);
00114 
00116     int ungetch(int);
00117 };
00118 
00119 } // namespace
00120 
00121 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:26 2009 for TnFOX by doxygen v1.4.7