Added StreamReader.h
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@182 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
888df37d0f
commit
f2c9745b7d
|
@ -59,7 +59,7 @@ namespace Assimp
|
||||||
* is known at compile-time.
|
* is known at compile-time.
|
||||||
*/
|
*/
|
||||||
template <bool SwapEndianess = false>
|
template <bool SwapEndianess = false>
|
||||||
class ASSIMP_API StreamReader
|
class StreamReader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ public:
|
||||||
*/
|
*/
|
||||||
inline int8_t GetI1()
|
inline int8_t GetI1()
|
||||||
{
|
{
|
||||||
if (current + 1 >= end)
|
if (current >= end)
|
||||||
throw new ImportErrorException("End of file was reached");
|
throw new ImportErrorException("End of file was reached");
|
||||||
|
|
||||||
return *current++;
|
return *current++;
|
||||||
|
@ -162,7 +162,7 @@ private:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline T Get()
|
inline T Get()
|
||||||
{
|
{
|
||||||
if (current + sizeof(T) >= end)
|
if (current + sizeof(T) > end)
|
||||||
throw new ImportErrorException("End of file was reached");
|
throw new ImportErrorException("End of file was reached");
|
||||||
|
|
||||||
T f = *((const T*)current);
|
T f = *((const T*)current);
|
||||||
|
|
Loading…
Reference in New Issue