From: Christian P. <cp...@us...> - 2005-01-30 17:16:14
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32751/include/pclasses/System Modified Files: Makefile.am Added Files: StorageDevice.h Log Message: Added StorageDevice. Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 16 Jan 2005 01:59:18 -0000 1.6 +++ Makefile.am 30 Jan 2005 17:16:05 -0000 1.7 @@ -4,4 +4,4 @@ METASOURCES = AUTO pclasses_system_include_HEADERS = SystemError.h SharedMemory.h CriticalSection.h Mutex.h \ Condition.h Semaphore.h Thread.h SharedLib.h File.h FileInfo.h \ - Directory.h SystemClock.h ProcessIO.h Process.h ThreadKey.h + Directory.h SystemClock.h ProcessIO.h Process.h ThreadKey.h StorageDevice.h --- NEW FILE: StorageDevice.h --- /*************************************************************************** * Copyright (C) 2005 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef P_System_StorageDevice_h #define P_System_StorageDevice_h #include <pclasses/Export.h> #include <pclasses/IO/IODevice.h> namespace P { namespace System { //! System Storage device (block device) class PSYSTEM_EXPORT StorageDevice: public IO::IODevice { public: StorageDevice() throw(); StorageDevice(const std::string& path, AccessMode access, ShareMode share) throw(IO::IOError); ~StorageDevice() throw(); void open(const std::string& path, AccessMode access, ShareMode share) throw(IO::IOError); protected: void _close() throw(IO::IOError); size_t _read(char* buffer, size_t count) throw(IO::IOError); size_t _peek(char* buffer, size_t count) throw(IO::IOError); size_t _write(const char* buffer, size_t count) throw(IO::IOError); offset_t _seek(offset_t offset, SeekMode mode) throw(IO::IOError); bool _isSeekable() const throw(); void _sync() const throw(IO::IOError); offset_t _size() const throw(IO::IOError); //! Returns the native O/S handle unsigned long handle() const throw(); private: unsigned long _handle; }; } // !namespace System } // !namespace P #endif |