Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
IReadFile.hpp
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 nirtcpp/nirtcpp.hpp
4
5#ifndef NIRT_I_READ_FILE_HPP_INCLUDED
6#define NIRT_I_READ_FILE_HPP_INCLUDED
7
8#include <nirtcpp/core/engine/IReferenceCounted.hpp>
9#include <nirtcpp/core/engine/coreutil.hpp>
10#include <nirtcpp/core/engine/EReadFileType.hpp>
11
12namespace nirt
13{
14namespace 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 nirt
59
60#endif
Base class of most objects of the Nirtcpp Engine.
Definition IReferenceCounted.hpp:46
Interface providing read access to a file.
Definition IReadFile.hpp:19
virtual bool seek(long finalPos, bool relativeMovement=false)=0
Changes position in file.
virtual long getPos() const =0
Get the current position in the file.
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.
virtual EREAD_FILE_TYPE getType() const
Get the type of the class implementing this interface.
Definition IReadFile.hpp:48
virtual long getSize() const =0
Get size of file.
EREAD_FILE_TYPE
An enumeration for different class types implementing IReadFile.
Definition EReadFileType.hpp:17
@ EFIT_UNKNOWN
Unknown type.
Definition EReadFileType.hpp:28
IReadFile * createLimitReadFile(const io::path &fileName, IReadFile *alreadyOpenedFile, long pos, long areaSize)
Internal function, please do not use.
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11

Nirtcpp    @cppfx.xyz

Esvcpp    esv::print