Irrlicht 3D Engine
IReadFile.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __I_READ_FILE_H_INCLUDED__
6 #define __I_READ_FILE_H_INCLUDED__
7 
8 #include "IReferenceCounted.h"
9 #include "coreutil.h"
10 #include "EReadFileType.h"
11 
12 namespace irr
13 {
14 namespace io
15 {
16 
18  class IReadFile : public virtual IReferenceCounted
19  {
20  public:
22 
25  virtual size_t read(void* buffer, size_t sizeToRead) = 0;
26 
28 
33  virtual bool seek(long finalPos, bool relativeMovement = false) = 0;
34 
36 
37  virtual long getSize() const = 0;
38 
40 
41  virtual long getPos() const = 0;
42 
44 
45  virtual const io::path& getFileName() const = 0;
46 
48  virtual EREAD_FILE_TYPE getType() const
49  {
50  return EFIT_UNKNOWN;
51  }
52  };
53 
55  IReadFile* createLimitReadFile(const io::path& fileName, IReadFile* alreadyOpenedFile, long pos, long areaSize);
56 
57 } // end namespace io
58 } // end namespace irr
59 
60 #endif
61 
Interface providing read access to a file.
Definition: IReadFile.h:18
virtual long getPos() const =0
Get the current position in the file.
Everything in the Irrlicht Engine can be found in this namespace.
Definition: aabbox3d.h:12
IReadFile * createLimitReadFile(const io::path &fileName, IReadFile *alreadyOpenedFile, long pos, long areaSize)
Internal function, please do not use.
File containing useful basic utility functions.
virtual long getSize() const =0
Get size of file.
virtual EREAD_FILE_TYPE getType() const
Get the type of the class implementing this interface.
Definition: IReadFile.h:48
virtual const io::path & getFileName() const =0
Get name of file.
virtual size_t read(void *buffer, size_t sizeToRead)=0
Reads an amount of bytes from the file.
Base class of most objects of the Irrlicht Engine.
EREAD_FILE_TYPE
An enumeration for different class types implementing IReadFile.
Definition: EReadFileType.h:16
virtual bool seek(long finalPos, bool relativeMovement=false)=0
Changes position in file.