Add IReadFile::getType() interface to all users to find out what kind of class implements that interface.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5798 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
39e5fdc3e7
commit
0408c9eb52
@ -1,5 +1,6 @@
|
|||||||
--------------------------
|
--------------------------
|
||||||
Changes in 1.9 (not yet released)
|
Changes in 1.9 (not yet released)
|
||||||
|
- Add IReadFile::getType() interface to all users to find out what kind of class implements that interface.
|
||||||
- .dae/Collada reader/writer now handle whitespace in texture-filenames with escape characters (handle them as xs:anyURI).
|
- .dae/Collada reader/writer now handle whitespace in texture-filenames with escape characters (handle them as xs:anyURI).
|
||||||
- Add function string::insert.
|
- Add function string::insert.
|
||||||
- EditBox now still allows overwriting characters when the text-length is at max.
|
- EditBox now still allows overwriting characters when the text-length is at max.
|
||||||
|
34
include/EReadFileType.h
Normal file
34
include/EReadFileType.h
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// Copyright (C) Michael Zeilfelder
|
||||||
|
// This file is part of the "Irrlicht Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||||
|
|
||||||
|
#ifndef __E_READ_FILE_TYPES_H_INCLUDED__
|
||||||
|
#define __E_READ_FILE_TYPES_H_INCLUDED__
|
||||||
|
|
||||||
|
#include "irrTypes.h"
|
||||||
|
|
||||||
|
namespace irr
|
||||||
|
{
|
||||||
|
namespace io
|
||||||
|
{
|
||||||
|
|
||||||
|
//! An enumeration for different class types implementing IReadFile
|
||||||
|
enum EREAD_FILE_TYPE
|
||||||
|
{
|
||||||
|
//! CReadFile
|
||||||
|
ERFT_READ_FILE = MAKE_IRR_ID('r','e','a','d'),
|
||||||
|
|
||||||
|
//! CMemoryReadFile
|
||||||
|
ERFT_MEMORY_READ_FILE = MAKE_IRR_ID('r','m','e','m'),
|
||||||
|
|
||||||
|
//! CLimitReadFile
|
||||||
|
ERFT_LIMIT_READ_FILE = MAKE_IRR_ID('r','l','i','m'),
|
||||||
|
|
||||||
|
//! Unknown type
|
||||||
|
EFIT_UNKNOWN = MAKE_IRR_ID('u','n','k','n'),
|
||||||
|
};
|
||||||
|
} // end namespace io
|
||||||
|
} // end namespace irr
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "IReferenceCounted.h"
|
#include "IReferenceCounted.h"
|
||||||
#include "coreutil.h"
|
#include "coreutil.h"
|
||||||
|
#include "EReadFileType.h"
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
@ -42,6 +43,12 @@ namespace io
|
|||||||
//! Get name of file.
|
//! Get name of file.
|
||||||
/** \return File name as zero terminated character string. */
|
/** \return File name as zero terminated character string. */
|
||||||
virtual const io::path& getFileName() const = 0;
|
virtual const io::path& getFileName() const = 0;
|
||||||
|
|
||||||
|
//! Get the type of the class implementing this interface
|
||||||
|
virtual EREAD_FILE_TYPE getType() const
|
||||||
|
{
|
||||||
|
return EFIT_UNKNOWN;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Internal function, please do not use.
|
//! Internal function, please do not use.
|
||||||
|
@ -46,6 +46,12 @@ namespace io
|
|||||||
//! returns name of file
|
//! returns name of file
|
||||||
virtual const io::path& getFileName() const _IRR_OVERRIDE_;
|
virtual const io::path& getFileName() const _IRR_OVERRIDE_;
|
||||||
|
|
||||||
|
//! Get the type of the class implementing this interface
|
||||||
|
virtual EREAD_FILE_TYPE getType() const _IRR_OVERRIDE_
|
||||||
|
{
|
||||||
|
return ERFT_LIMIT_READ_FILE;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
io::path Filename;
|
io::path Filename;
|
||||||
|
@ -43,6 +43,12 @@ namespace io
|
|||||||
//! returns name of file
|
//! returns name of file
|
||||||
virtual const io::path& getFileName() const _IRR_OVERRIDE_;
|
virtual const io::path& getFileName() const _IRR_OVERRIDE_;
|
||||||
|
|
||||||
|
//! Get the type of the class implementing this interface
|
||||||
|
virtual EREAD_FILE_TYPE getType() const _IRR_OVERRIDE_
|
||||||
|
{
|
||||||
|
return ERFT_MEMORY_READ_FILE;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
const void *Buffer;
|
const void *Buffer;
|
||||||
|
@ -47,6 +47,12 @@ namespace io
|
|||||||
//! returns name of file
|
//! returns name of file
|
||||||
virtual const io::path& getFileName() const _IRR_OVERRIDE_;
|
virtual const io::path& getFileName() const _IRR_OVERRIDE_;
|
||||||
|
|
||||||
|
//! Get the type of the class implementing this interface
|
||||||
|
virtual EREAD_FILE_TYPE getType() const _IRR_OVERRIDE_
|
||||||
|
{
|
||||||
|
return ERFT_READ_FILE;
|
||||||
|
}
|
||||||
|
|
||||||
//! create read file on disk.
|
//! create read file on disk.
|
||||||
static IReadFile* createReadFile(const io::path& fileName);
|
static IReadFile* createReadFile(const io::path& fileName);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user