blob: ace04f3796788fa02705ad4b84eb398560b7757b [file] [log] [blame]
Pierre Ossman82c279e2015-02-04 14:11:42 +01001/* Copyright (C) 2013 D. R. Commander. All Rights Reserved.
2 * Copyright 2015 Pierre Ossman for Cendio AB
3 *
4 * This is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This software is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this software; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17 * USA.
18 */
19
20#ifndef __RDR_FILEINSTREAM_H__
21#define __RDR_FILEINSTREAM_H__
22
23#include <stdio.h>
24
25#include <rdr/InStream.h>
26
27namespace rdr {
28
29 class FileInStream : public InStream {
30
31 public:
32
33 FileInStream(const char *fileName);
34 ~FileInStream(void);
35
36 void reset(void);
37
38 int pos();
39
40 protected:
41 int overrun(int itemSize, int nItems, bool wait = true);
42
43 private:
44 U8 b[131072];
45 FILE *file;
46 };
47
48} // end of namespace rdr
49
50#endif