rasdaman API
ecwmemfs.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 */
23 
24 #ifndef _ECWMEMFS_HH_
25 #define _ECWMEMFS_HH_
26 
27 #include "raslib/mddtypes.hh"
28 
30 {
31 public:
32  enum m_Error
33  {
34  No_Error = 0,
35  Error = 1
36  };
37 
39 
41  m_Error open(const char* fileName);
42 
44  m_Error open(const char* memorySource, r_Bytes mSize);
45 
47  m_Error close();
48 
51 
53  m_Error read(void* buffer, r_Bytes bSize);
54 
56  unsigned long long tell();
57 
59  m_Error seek(unsigned long long offset);
60 
62  static const char* memorySrc;
63 
65  static const char* memorySrcName;
66 
68  static r_Bytes memorySrcLength;
69 
70 private:
71 
73  char* source;
75  char* current;
77  bool closed;
79  bool owner;
81  r_Bytes length;
82 };
83 
84 #endif
unsigned long long tell()
get current position
static const char * memorySrc
if you use open(const* char) and the pointer is memorySrcName then no file will be read but this poin...
Definition: ecwmemfs.hh:62
~MemoryFileSystem()
call close
Definition: ecwmemfs.hh:35
m_Error
Definition: ecwmemfs.hh:32
m_Error close()
close and deinitialise (delete only my own data)
static r_Bytes memorySrcLength
the length of the memorySrc chunk must be specified in memoryLength
Definition: ecwmemfs.hh:68
static const char * memorySrcName
file names which point to this will not read from file system but from memorySrc
Definition: ecwmemfs.hh:65
m_Error read(void *buffer, r_Bytes bSize)
read bSize bytes into buffer, only if bSize bytes are available
Definition: ecwmemfs.hh:29
m_Error open(const char *fileName)
open file an read into memory - completely
Definition: ecwmemfs.hh:34
m_Error seek(unsigned long long offset)
go to offset bytes from begining of memory