~baltix/+junk/irrlicht-test

« back to all changes in this revision

Viewing changes to source/Irrlicht/CReadFile.h

  • Committer: Mantas Kriaučiūnas
  • Date: 2011-07-18 13:06:25 UTC
  • Revision ID: mantas@akl.lt-20110718130625-c5pvifp61e7kj1ol
Included whole irrlicht SVN libraries to work around launchpad recipe issue with quilt, see https://answers.launchpad.net/launchpad/+question/165193

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2002-2011 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 __C_READ_FILE_H_INCLUDED__
 
6
#define __C_READ_FILE_H_INCLUDED__
 
7
 
 
8
#include <stdio.h>
 
9
#include "IReadFile.h"
 
10
#include "irrString.h"
 
11
 
 
12
namespace irr
 
13
{
 
14
 
 
15
namespace io
 
16
{
 
17
 
 
18
        /*!
 
19
                Class for reading a real file from disk.
 
20
        */
 
21
        class CReadFile : public IReadFile
 
22
        {
 
23
        public:
 
24
 
 
25
                CReadFile(const io::path& fileName);
 
26
 
 
27
                virtual ~CReadFile();
 
28
 
 
29
                //! returns how much was read
 
30
                virtual s32 read(void* buffer, u32 sizeToRead);
 
31
 
 
32
                //! changes position in file, returns true if successful
 
33
                virtual bool seek(long finalPos, bool relativeMovement = false);
 
34
 
 
35
                //! returns size of file
 
36
                virtual long getSize() const;
 
37
 
 
38
                //! returns if file is open
 
39
                virtual bool isOpen() const
 
40
                {
 
41
                        return File != 0;
 
42
                }
 
43
 
 
44
                //! returns where in the file we are.
 
45
                virtual long getPos() const;
 
46
 
 
47
                //! returns name of file
 
48
                virtual const io::path& getFileName() const;
 
49
 
 
50
        private:
 
51
 
 
52
                //! opens the file
 
53
                void openFile();
 
54
 
 
55
                FILE* File;
 
56
                long FileSize;
 
57
                io::path Filename;
 
58
        };
 
59
 
 
60
} // end namespace io
 
61
} // end namespace irr
 
62
 
 
63
#endif
 
64