1 : /******************************************************************************
2 : *
3 : * Purpose: PCIDSK I/O Interface declaration. The I/O interfaces for the
4 : * library can be overridden by an object implementing this class.
5 : *
6 : ******************************************************************************
7 : * Copyright (c) 2009
8 : * PCI Geomatics, 50 West Wilmot Street, Richmond Hill, Ont, Canada
9 : *
10 : * Permission is hereby granted, free of charge, to any person obtaining a
11 : * copy of this software and associated documentation files (the "Software"),
12 : * to deal in the Software without restriction, including without limitation
13 : * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 : * and/or sell copies of the Software, and to permit persons to whom the
15 : * Software is furnished to do so, subject to the following conditions:
16 : *
17 : * The above copyright notice and this permission notice shall be included
18 : * in all copies or substantial portions of the Software.
19 : *
20 : * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 : * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 : * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 : * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 : * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 : * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 : * DEALINGS IN THE SOFTWARE.
27 : ****************************************************************************/
28 : #ifndef __INCLUDE_PCIDSK_IO_H
29 : #define __INCLUDE_PCIDSK_IO_H
30 :
31 : #include "pcidsk_config.h"
32 :
33 : #include <string>
34 :
35 : namespace PCIDSK
36 : {
37 : /************************************************************************/
38 : /* IOInterfaces */
39 : /************************************************************************/
40 :
41 : //! IO Interface class.
42 :
43 : class IOInterfaces
44 8 : {
45 : public:
46 8 : virtual ~IOInterfaces() {}
47 : virtual void *Open( std::string filename, std::string access ) const = 0;
48 : virtual uint64 Seek( void *io_handle, uint64 offset, int whence ) const = 0;
49 : virtual uint64 Tell( void *io_handle ) const = 0;
50 : virtual uint64 Read( void *buffer, uint64 size, uint64 nmemb, void *io_handle ) const = 0;
51 : virtual uint64 Write( const void *buffer, uint64 size, uint64 nmemb, void *io_handle ) const = 0;
52 : virtual int Eof( void *io_handle ) const = 0;
53 : virtual int Flush( void *io_handle ) const = 0;
54 : virtual int Close( void *io_handle ) const = 0;
55 : };
56 :
57 : const IOInterfaces PCIDSK_DLL *GetDefaultIOInterfaces();
58 :
59 : } // end namespace PCIDSK
60 :
61 : #endif // __INCLUDE_PCIDSK_IO_H
|