00001 /* 00002 * Copyright (C) 2009, Edmundo Albuquerque de Souza e Silva. 00003 * 00004 * This file may be distributed under the terms of the Q Public License 00005 * as defined by Trolltech AS of Norway and appearing in the file 00006 * LICENSE.QPL included in the packaging of this file. 00007 * 00008 * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING 00009 * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00010 * PURPOSE. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, 00011 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 00012 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 00013 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 00014 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 00015 * 00016 * Thanks: Jose Renato Santos 00017 * 00018 */ 00019 00020 /////////////////////////////////////////////////////////////////////////////// 00021 // vsidevice.h : Declaration of VSI device class CvsiDevice 00022 // (implements disk device) 00023 // (VSI: Virtual System Interface) 00024 /////////////////////////////////////////////////////////////////////////////// 00025 00026 00027 #ifndef __VSIDEVICE_H_ 00028 #define __VSIDEVICE_H_ 00029 00030 #include <vsitypesint.h> 00031 00032 /////////////////////////////////////////////////////////////////////////////// 00033 // CvsiDevice 00034 class CvsiDevice 00035 { 00036 public: 00037 CvsiDevice(); 00038 ~CvsiDevice(); 00039 int Open ( const char* deviceName ); 00040 int OpenDeviceAgain ( const char* deviceName, u64 Size ); 00041 int Close(); 00042 int Read(u64 startingByte, int numberBytes, char* data ); 00043 int Write(u64 startingByte,int numberBytes, char* data ); 00044 int SectorSize(); 00045 u64 Size(); 00046 00047 private: 00048 int m_Handle; 00049 int m_SectorSize; 00050 u64 m_Size; 00051 }; 00052 00053 #endif //__VSIDEVICE_H_