Bike-X  0.8
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
OVR_File.h
Go to the documentation of this file.
1 /************************************************************************************
2 
3 PublicHeader: Kernel
4 Filename : OVR_File.h
5 Content : Header for all internal file management - functions and structures
6  to be inherited by OS specific subclasses.
7 Created : September 19, 2012
8 Notes :
9 
10 Notes : errno may not be preserved across use of BaseFile member functions
11  : Directories cannot be deleted while files opened from them are in use
12  (For the GetFullName function)
13 
14 Copyright : Copyright 2014 Oculus VR, Inc. All Rights reserved.
15 
16 Licensed under the Oculus VR Rift SDK License Version 3.1 (the "License");
17 you may not use the Oculus VR Rift SDK except in compliance with the License,
18 which is provided at the time of installation or download, or which
19 otherwise accompanies this software in either electronic or hard copy form.
20 
21 You may obtain a copy of the License at
22 
23 http://www.oculusvr.com/licenses/LICENSE-3.1
24 
25 Unless required by applicable law or agreed to in writing, the Oculus VR SDK
26 distributed under the License is distributed on an "AS IS" BASIS,
27 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 See the License for the specific language governing permissions and
29 limitations under the License.
30 
31 ************************************************************************************/
32 
33 #ifndef OVR_File_h
34 #define OVR_File_h
35 
36 #include "OVR_RefCount.h"
37 #include "OVR_Std.h"
38 #include "OVR_Alg.h"
39 
40 #include <stdio.h>
41 #include "OVR_String.h"
42 
43 namespace OVR {
44 
45 // ***** Declared classes
46 class FileConstants;
47 class File;
48 class DelegatedFile;
49 class BufferedFile;
50 
51 
52 // ***** Flags for File & Directory accesses
53 
55 {
56 public:
57 
58  // *** File open flags
59  enum OpenFlags
60  {
61  Open_Read = 1,
64 
65  // Opens file and truncates it to zero length
66  // - file must have write permission
67  // - when used with Create, it opens an existing
68  // file and empties it or creates a new file
70 
71  // Creates and opens new file
72  // - does not erase contents if file already
73  // exists unless combined with Truncate
75 
76  // Returns an error value if the file already exists
78 
79  // Open file with buffering
81  };
82 
83  // *** File Mode flags
84  enum Modes
85  {
86  Mode_Read = 0444,
87  Mode_Write = 0222,
88  Mode_Execute = 0111,
89 
91  };
92 
93  // *** Seek operations
94  enum SeekOps
95  {
96  Seek_Set = 0,
97  Seek_Cur = 1,
99  };
100 
101  // *** Errors
102  enum Errors
103  {
105  Error_Access = 0x1002,
106  Error_IOError = 0x1003,
107  Error_DiskFull = 0x1004
108  };
109 };
110 
111 
112 //-----------------------------------------------------------------------------------
113 // ***** File Class
114 
115 // The pure virtual base random-access file
116 // This is a base class to all files
117 
118 class File : public RefCountBase<File>, public FileConstants
119 {
120 public:
121  File() { }
122  // ** Location Information
123 
124  // Returns a file name path relative to the 'reference' directory
125  // This is often a path that was used to create a file
126  // (this is not a global path, global path can be obtained with help of directory)
127  virtual const char* GetFilePath() = 0;
128 
129 
130  // ** File Information
131 
132  // Return 1 if file's usable (open)
133  virtual bool IsValid() = 0;
134  // Return 1 if file's writable, otherwise 0
135  virtual bool IsWritable() = 0;
136 
137  // Return position
138  virtual int Tell() = 0;
139  virtual SInt64 LTell() = 0;
140 
141  // File size
142  virtual int GetLength() = 0;
143  virtual SInt64 LGetLength() = 0;
144 
145  // Returns file stats
146  // 0 for failure
147  //virtual bool Stat(FileStats *pfs) = 0;
148 
149  // Return errno-based error code
150  // Useful if any other function failed
151  virtual int GetErrorCode() = 0;
152 
153 
154  // ** Stream implementation & I/O
155 
156  // Blocking write, will write in the given number of bytes to the stream
157  // Returns : -1 for error
158  // Otherwise number of bytes read
159  virtual int Write(const UByte *pbufer, int numBytes) = 0;
160  // Blocking read, will read in the given number of bytes or less from the stream
161  // Returns : -1 for error
162  // Otherwise number of bytes read,
163  // if 0 or < numBytes, no more bytes available; end of file or the other side of stream is closed
164  virtual int Read(UByte *pbufer, int numBytes) = 0;
165 
166  // Skips (ignores) a given # of bytes
167  // Same return values as Read
168  virtual int SkipBytes(int numBytes) = 0;
169 
170  // Returns the number of bytes available to read from a stream without blocking
171  // For a file, this should generally be number of bytes to the end
172  virtual int BytesAvailable() = 0;
173 
174  // Causes any implementation's buffered data to be delivered to destination
175  // Return 0 for error
176  virtual bool Flush() = 0;
177 
178 
179  // Need to provide a more optimized implementation that doe snot necessarily involve a lot of seeking
180  inline bool IsEOF() { return !BytesAvailable(); }
181 
182 
183  // Seeking
184  // Returns new position, -1 for error
185  virtual int Seek(int offset, int origin=Seek_Set) = 0;
186  virtual SInt64 LSeek(SInt64 offset, int origin=Seek_Set) = 0;
187  // Seek simplification
188  int SeekToBegin() {return Seek(0); }
189  int SeekToEnd() {return Seek(0,Seek_End); }
190  int Skip(int numBytes) {return Seek(numBytes,Seek_Cur); }
191 
192 
193  // Appends other file data from a stream
194  // Return -1 for error, else # of bytes written
195  virtual int CopyFromStream(File *pstream, int byteSize) = 0;
196 
197  // Closes the file
198  // After close, file cannot be accessed
199  virtual bool Close() = 0;
200 
201 
202  // ***** Inlines for convenient primitive type serialization
203 
204  // Read/Write helpers
205 private:
206  UInt64 PRead64() { UInt64 v = 0; Read((UByte*)&v, 8); return v; }
207  UInt32 PRead32() { UInt32 v = 0; Read((UByte*)&v, 4); return v; }
208  UInt16 PRead16() { UInt16 v = 0; Read((UByte*)&v, 2); return v; }
209  UByte PRead8() { UByte v = 0; Read((UByte*)&v, 1); return v; }
210  void PWrite64(UInt64 v) { Write((UByte*)&v, 8); }
211  void PWrite32(UInt32 v) { Write((UByte*)&v, 4); }
212  void PWrite16(UInt16 v) { Write((UByte*)&v, 2); }
213  void PWrite8(UByte v) { Write((UByte*)&v, 1); }
214 
215 public:
216 
217  // Writing primitive types - Little Endian
228  inline void WriteFloat(float v) { v = Alg::ByteUtil::SystemToLE(v); Write((UByte*)&v, 4); }
229  inline void WriteDouble(double v) { v = Alg::ByteUtil::SystemToLE(v); Write((UByte*)&v, 8); }
230  // Writing primitive types - Big Endian
241  inline void WriteFloatBE(float v) { v = Alg::ByteUtil::SystemToBE(v); Write((UByte*)&v, 4); }
242  inline void WriteDoubleBE(double v) { v = Alg::ByteUtil::SystemToBE(v); Write((UByte*)&v, 8); }
243 
244  // Reading primitive types - Little Endian
255  inline float ReadFloat() { float v = 0.0f; Read((UByte*)&v, 4); return Alg::ByteUtil::LEToSystem(v); }
256  inline double ReadDouble() { double v = 0.0; Read((UByte*)&v, 8); return Alg::ByteUtil::LEToSystem(v); }
257  // Reading primitive types - Big Endian
268  inline float ReadFloatBE() { float v = 0.0f; Read((UByte*)&v, 4); return Alg::ByteUtil::BEToSystem(v); }
269  inline double ReadDoubleBE() { double v = 0.0; Read((UByte*)&v, 8); return Alg::ByteUtil::BEToSystem(v); }
270 };
271 
272 
273 // *** Delegated File
274 
275 class DelegatedFile : public File
276 {
277 protected:
278  // Delegating file pointer
280 
281  // Hidden default constructor
282  DelegatedFile() : pFile(0) { }
283  DelegatedFile(const DelegatedFile &source) : File() { OVR_UNUSED(source); }
284 public:
285  // Constructors
286  DelegatedFile(File *pfile) : pFile(pfile) { }
287 
288  // ** Location Information
289  virtual const char* GetFilePath() { return pFile->GetFilePath(); }
290 
291  // ** File Information
292  virtual bool IsValid() { return pFile && pFile->IsValid(); }
293  virtual bool IsWritable() { return pFile->IsWritable(); }
294 // virtual bool IsRecoverable() { return pFile->IsRecoverable(); }
295 
296  virtual int Tell() { return pFile->Tell(); }
297  virtual SInt64 LTell() { return pFile->LTell(); }
298 
299  virtual int GetLength() { return pFile->GetLength(); }
300  virtual SInt64 LGetLength() { return pFile->LGetLength(); }
301 
302  //virtual bool Stat(FileStats *pfs) { return pFile->Stat(pfs); }
303 
304  virtual int GetErrorCode() { return pFile->GetErrorCode(); }
305 
306  // ** Stream implementation & I/O
307  virtual int Write(const UByte *pbuffer, int numBytes) { return pFile->Write(pbuffer,numBytes); }
308  virtual int Read(UByte *pbuffer, int numBytes) { return pFile->Read(pbuffer,numBytes); }
309 
310  virtual int SkipBytes(int numBytes) { return pFile->SkipBytes(numBytes); }
311 
312  virtual int BytesAvailable() { return pFile->BytesAvailable(); }
313 
314  virtual bool Flush() { return pFile->Flush(); }
315 
316  // Seeking
317  virtual int Seek(int offset, int origin=Seek_Set) { return pFile->Seek(offset,origin); }
318  virtual SInt64 LSeek(SInt64 offset, int origin=Seek_Set) { return pFile->LSeek(offset,origin); }
319 
320  virtual int CopyFromStream(File *pstream, int byteSize) { return pFile->CopyFromStream(pstream,byteSize); }
321 
322  // Closing the file
323  virtual bool Close() { return pFile->Close(); }
324 };
325 
326 
327 //-----------------------------------------------------------------------------------
328 // ***** Buffered File
329 
330 // This file class adds buffering to an existing file
331 // Buffered file never fails by itself; if there's not
332 // enough memory for buffer, no buffer's used
333 
335 {
336 protected:
338  {
342  };
343 
344  // Buffer & the mode it's in
347  // Position in buffer
348  unsigned Pos;
349  // Data in buffer if reading
350  unsigned DataSize;
351  // Underlying file position
353 
354  // Initializes buffering to a certain mode
355  bool SetBufferMode(BufferModeType mode);
356  // Flushes buffer
357  // WriteBuffer - write data to disk, ReadBuffer - reset buffer & fix file position
358  void FlushBuffer();
359  // Loads data into ReadBuffer
360  // WARNING: Right now LoadBuffer() assumes the buffer's empty
361  void LoadBuffer();
362 
363  // Hidden constructor
364  BufferedFile();
365  inline BufferedFile(const BufferedFile &source) : DelegatedFile() { OVR_UNUSED(source); }
366 public:
367 
368  // Constructor
369  // - takes another file as source
370  BufferedFile(File *pfile);
371  ~BufferedFile();
372 
373 
374  // ** Overridden functions
375 
376  // We override all the functions that can possibly
377  // require buffer mode switch, flush, or extra calculations
378  virtual int Tell();
379  virtual SInt64 LTell();
380 
381  virtual int GetLength();
382  virtual SInt64 LGetLength();
383 
384 // virtual bool Stat(GFileStats *pfs);
385 
386  virtual int Write(const UByte *pbufer, int numBytes);
387  virtual int Read(UByte *pbufer, int numBytes);
388 
389  virtual int SkipBytes(int numBytes);
390 
391  virtual int BytesAvailable();
392 
393  virtual bool Flush();
394 
395  virtual int Seek(int offset, int origin=Seek_Set);
396  virtual SInt64 LSeek(SInt64 offset, int origin=Seek_Set);
397 
398  virtual int CopyFromStream(File *pstream, int byteSize);
399 
400  virtual bool Close();
401 };
402 
403 
404 //-----------------------------------------------------------------------------------
405 // ***** Memory File
406 
407 class MemoryFile : public File
408 {
409 public:
410 
411  const char* GetFilePath() { return FilePath.ToCStr(); }
412 
413  bool IsValid() { return Valid; }
414  bool IsWritable() { return false; }
415 
416  bool Flush() { return true; }
417  int GetErrorCode() { return 0; }
418 
419  int Tell() { return FileIndex; }
420  SInt64 LTell() { return (SInt64) FileIndex; }
421 
422  int GetLength() { return FileSize; }
424 
425  bool Close()
426  {
427  Valid = false;
428  return false;
429  }
430 
431  int CopyFromStream(File *pstream, int byteSize)
432  { OVR_UNUSED2(pstream, byteSize);
433  return 0;
434  }
435 
436  int Write(const UByte *pbuffer, int numBytes)
437  { OVR_UNUSED2(pbuffer, numBytes);
438  return 0;
439  }
440 
441  int Read(UByte *pbufer, int numBytes)
442  {
443  if (FileIndex + numBytes > FileSize)
444  {
445  numBytes = FileSize - FileIndex;
446  }
447 
448  if (numBytes > 0)
449  {
450  ::memcpy (pbufer, &FileData [FileIndex], numBytes);
451 
452  FileIndex += numBytes;
453  }
454 
455  return numBytes;
456  }
457 
458  int SkipBytes(int numBytes)
459  {
460  if (FileIndex + numBytes > FileSize)
461  {
462  numBytes = FileSize - FileIndex;
463  }
464 
465  FileIndex += numBytes;
466 
467  return numBytes;
468  }
469 
471  {
472  return (FileSize - FileIndex);
473  }
474 
475  int Seek(int offset, int origin = Seek_Set)
476  {
477  switch (origin)
478  {
479  case Seek_Set : FileIndex = offset; break;
480  case Seek_Cur : FileIndex += offset; break;
481  case Seek_End : FileIndex = FileSize - offset; break;
482  }
483 
484  return FileIndex;
485  }
486 
487  SInt64 LSeek(SInt64 offset, int origin = Seek_Set)
488  {
489  return (SInt64) Seek((int) offset, origin);
490  }
491 
492 public:
493 
494  MemoryFile (const String& fileName, const UByte *pBuffer, int buffSize)
495  : FilePath(fileName)
496  {
497  FileData = pBuffer;
498  FileSize = buffSize;
499  FileIndex = 0;
500  Valid = (!fileName.IsEmpty() && pBuffer && buffSize > 0) ? true : false;
501  }
502 
503  // pfileName should be encoded as UTF-8 to support international file names.
504  MemoryFile (const char* pfileName, const UByte *pBuffer, int buffSize)
505  : FilePath(pfileName)
506  {
507  FileData = pBuffer;
508  FileSize = buffSize;
509  FileIndex = 0;
510  Valid = (pfileName && pBuffer && buffSize > 0) ? true : false;
511  }
512 private:
513 
515  const UByte *FileData;
516  int FileSize;
518  bool Valid;
519 };
520 
521 
522 // ***** Global path helpers
523 
524 // Find trailing short filename in a path.
525 const char* OVR_CDECL GetShortFilename(const char* purl);
526 
527 } // OVR
528 
529 #endif
SInt64 LGetLength()
Definition: OVR_File.h:423
void WriteSInt8BE(SInt16 v)
Definition: OVR_File.h:234
virtual bool IsValid()=0
void PWrite16(UInt16 v)
Definition: OVR_File.h:212
virtual int GetLength()
Definition: OVR_File.h:299
void WriteUByteBE(UByte v)
Definition: OVR_File.h:231
virtual bool Close()=0
void PWrite32(UInt32 v)
Definition: OVR_File.h:211
UInt32 PRead32()
Definition: OVR_File.h:207
UByte PRead8()
Definition: OVR_File.h:209
void WriteFloatBE(float v)
Definition: OVR_File.h:241
#define OVR_CDECL
virtual int BytesAvailable()
Definition: OVR_File.cpp:372
void WriteUInt64BE(UInt64 v)
Definition: OVR_File.h:239
virtual bool Close()
Definition: OVR_File.cpp:551
void WriteUInt16BE(UInt16 v)
Definition: OVR_File.h:235
UByte SystemToBE(UByte v)
Definition: OVR_Alg.h:916
int GetErrorCode()
Definition: OVR_File.h:417
BufferModeType BufferMode
Definition: OVR_File.h:346
int SkipBytes(int numBytes)
Definition: OVR_File.h:458
bool SetBufferMode(BufferModeType mode)
Definition: OVR_File.cpp:97
virtual int CopyFromStream(File *pstream, int byteSize)
Definition: OVR_File.cpp:524
UByte ReadUInt8BE()
Definition: OVR_File.h:260
UInt32 ReadUInt32BE()
Definition: OVR_File.h:264
__BEGIN_NAMESPACE_STD void * memcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull((1
uint64_t UInt64
Definition: OVR_Types.h:255
SByte ReadSInt8()
Definition: OVR_File.h:248
bool IsEOF()
Definition: OVR_File.h:180
virtual int Seek(int offset, int origin=Seek_Set)=0
uint16_t UInt16
Definition: OVR_Types.h:251
void WriteSInt8(SByte v)
Definition: OVR_File.h:221
const char * GetFilePath()
Definition: OVR_File.h:411
UByte BEToSystem(UByte v)
Definition: OVR_Alg.h:892
virtual SInt64 LGetLength()=0
void WriteSInt32BE(UInt32 v)
Definition: OVR_File.h:238
int GetLength()
Definition: OVR_File.h:422
uint32_t UInt32
Definition: OVR_Types.h:253
virtual const char * GetFilePath()
Definition: OVR_File.h:289
virtual SInt64 LGetLength()
Definition: OVR_File.h:300
#define OVR_UNUSED(a)
unsigned DataSize
Definition: OVR_File.h:350
virtual int Write(const UByte *pbufer, int numBytes)
Definition: OVR_File.cpp:242
void WriteDoubleBE(double v)
Definition: OVR_File.h:242
UByte * pBuffer
Definition: OVR_File.h:345
SByte ReadSByte()
Definition: OVR_File.h:246
virtual int BytesAvailable()
Definition: OVR_File.h:312
int BytesAvailable()
Definition: OVR_File.h:470
void WriteFloat(float v)
Definition: OVR_File.h:228
virtual int Read(UByte *pbuffer, int numBytes)
Definition: OVR_File.h:308
const UByte * FileData
Definition: OVR_File.h:515
void WriteUInt16(UInt16 v)
Definition: OVR_File.h:222
uint8_t UByte
Definition: OVR_Types.h:249
UInt64 PRead64()
Definition: OVR_File.h:206
virtual SInt64 LTell()=0
UByte ReadUInt8()
Definition: OVR_File.h:247
void WriteSByteBE(SByte v)
Definition: OVR_File.h:232
float ReadFloat()
Definition: OVR_File.h:255
void WriteSInt32(SInt32 v)
Definition: OVR_File.h:225
virtual bool Flush()
Definition: OVR_File.cpp:392
void PWrite64(UInt64 v)
Definition: OVR_File.h:210
virtual int BytesAvailable()=0
virtual bool Close()
Definition: OVR_File.h:323
void PWrite8(UByte v)
Definition: OVR_File.h:213
virtual SInt64 LTell()
Definition: OVR_File.h:297
const char * ToCStr() const
Definition: OVR_String.h:186
virtual bool Flush()=0
UInt16 ReadUInt16()
Definition: OVR_File.h:249
UInt16 PRead16()
Definition: OVR_File.h:208
bool IsValid()
Definition: OVR_File.h:413
UByte LEToSystem(UByte v)
Definition: OVR_Alg.h:880
void WriteUInt32BE(UInt32 v)
Definition: OVR_File.h:237
double ReadDoubleBE()
Definition: OVR_File.h:269
virtual int CopyFromStream(File *pstream, int byteSize)=0
virtual bool Flush()
Definition: OVR_File.h:314
MemoryFile(const String &fileName, const UByte *pBuffer, int buffSize)
Definition: OVR_File.h:494
virtual int Write(const UByte *pbuffer, int numBytes)
Definition: OVR_File.h:307
__END_DECLS typedef int8_t SByte
Definition: OVR_Types.h:248
UInt16 ReadUInt16BE()
Definition: OVR_File.h:262
void WriteSInt64(SInt64 v)
Definition: OVR_File.h:227
virtual bool IsWritable()
Definition: OVR_File.h:293
float ReadFloatBE()
Definition: OVR_File.h:268
void WriteSInt16BE(UInt16 v)
Definition: OVR_File.h:236
SByte ReadSByteBE()
Definition: OVR_File.h:259
int Write(const UByte *pbuffer, int numBytes)
Definition: OVR_File.h:436
void WriteSInt16(SInt16 v)
Definition: OVR_File.h:223
int64_t SInt64
Definition: OVR_Types.h:254
SInt64 LSeek(SInt64 offset, int origin=Seek_Set)
Definition: OVR_File.h:487
virtual const char * GetFilePath()=0
UByte ReadUByte()
Definition: OVR_File.h:245
SByte ReadSInt8BE()
Definition: OVR_File.h:261
void WriteUInt64(UInt64 v)
Definition: OVR_File.h:226
virtual bool IsWritable()=0
virtual int Tell()=0
int CopyFromStream(File *pstream, int byteSize)
Definition: OVR_File.h:431
const char *OVR_CDECL GetShortFilename(const char *purl)
Definition: OVR_File.cpp:572
virtual int Write(const UByte *pbufer, int numBytes)=0
int Read(UByte *pbufer, int numBytes)
Definition: OVR_File.h:441
SInt64 LTell()
Definition: OVR_File.h:420
bool IsEmpty() const
Definition: OVR_String.h:191
SInt32 ReadSInt32BE()
Definition: OVR_File.h:265
void WriteDouble(double v)
Definition: OVR_File.h:229
virtual bool IsValid()
Definition: OVR_File.h:292
Ptr< File > pFile
Definition: OVR_File.h:279
SInt16 ReadSInt16BE()
Definition: OVR_File.h:263
MemoryFile(const char *pfileName, const UByte *pBuffer, int buffSize)
Definition: OVR_File.h:504
int16_t SInt16
Definition: OVR_Types.h:250
virtual int SkipBytes(int numBytes)
Definition: OVR_File.cpp:344
bool Flush()
Definition: OVR_File.h:416
int32_t SInt32
Definition: OVR_Types.h:252
UInt32 ReadUInt32()
Definition: OVR_File.h:251
virtual int CopyFromStream(File *pstream, int byteSize)
Definition: OVR_File.h:320
DelegatedFile(File *pfile)
Definition: OVR_File.h:286
int SeekToEnd()
Definition: OVR_File.h:189
int Seek(int offset, int origin=Seek_Set)
Definition: OVR_File.h:475
virtual int SkipBytes(int numBytes)=0
double ReadDouble()
Definition: OVR_File.h:256
void WriteUByte(UByte v)
Definition: OVR_File.h:218
SInt64 ReadSInt64()
Definition: OVR_File.h:254
UInt64 ReadUInt64()
Definition: OVR_File.h:253
UByte SystemToLE(UByte v)
Definition: OVR_Alg.h:904
virtual int Seek(int offset, int origin=Seek_Set)
Definition: OVR_File.h:317
virtual int GetErrorCode()
Definition: OVR_File.h:304
void WriteUInt8(UByte v)
Definition: OVR_File.h:220
void WriteSByte(SByte v)
Definition: OVR_File.h:219
virtual int GetErrorCode()=0
UInt64 ReadUInt64BE()
Definition: OVR_File.h:266
String FilePath
Definition: OVR_File.h:514
SInt32 ReadSInt32()
Definition: OVR_File.h:252
unsigned Pos
Definition: OVR_File.h:348
void WriteSInt64BE(UInt64 v)
Definition: OVR_File.h:240
DelegatedFile(const DelegatedFile &source)
Definition: OVR_File.h:283
virtual SInt64 LSeek(SInt64 offset, int origin=Seek_Set)=0
virtual SInt64 LSeek(SInt64 offset, int origin=Seek_Set)
Definition: OVR_File.cpp:464
virtual int Read(UByte *pbufer, int numBytes)=0
BufferedFile(const BufferedFile &source)
Definition: OVR_File.h:365
virtual SInt64 LTell()
Definition: OVR_File.cpp:180
UByte ReadUByteBE()
Definition: OVR_File.h:258
virtual int Tell()
Definition: OVR_File.cpp:164
void WriteUInt32(UInt32 v)
Definition: OVR_File.h:224
virtual SInt64 LSeek(SInt64 offset, int origin=Seek_Set)
Definition: OVR_File.h:318
bool IsWritable()
Definition: OVR_File.h:414
virtual int GetLength()=0
int Skip(int numBytes)
Definition: OVR_File.h:190
SInt64 ReadSInt64BE()
Definition: OVR_File.h:267
virtual int GetLength()
Definition: OVR_File.cpp:195
int SeekToBegin()
Definition: OVR_File.h:188
virtual int Seek(int offset, int origin=Seek_Set)
Definition: OVR_File.cpp:399
virtual int Read(UByte *pbufer, int numBytes)
Definition: OVR_File.cpp:271
virtual int Tell()
Definition: OVR_File.h:296
virtual int SkipBytes(int numBytes)
Definition: OVR_File.h:310
virtual SInt64 LGetLength()
Definition: OVR_File.cpp:207
#define OVR_UNUSED2(a1, a2)
void WriteUInt8BE(UInt16 v)
Definition: OVR_File.h:233
bool Close()
Definition: OVR_File.h:425
SInt16 ReadSInt16()
Definition: OVR_File.h:250