1 | /*************************************************************************** |
2 | * Copyright (C) 2008 by Jakub Stachowski <qbast@go2.pl> * |
3 | * * |
4 | * This program 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 | |
10 | #include "qfilestream.h" |
11 | |
12 | using namespace Mobipocket; |
13 | |
14 | QFileStream::QFileStream(const QString& name) |
15 | : d(new QFile(name)) |
16 | { |
17 | d->open(flags: QIODevice::ReadOnly); |
18 | } |
19 | |
20 | QFileStream::~QFileStream() |
21 | { |
22 | delete d; |
23 | } |
24 | |
25 | int QFileStream::read(char* buf, int size) |
26 | { |
27 | return d->read(data: buf,maxlen: size); |
28 | } |
29 | |
30 | bool QFileStream::seek(int pos) |
31 | { |
32 | return d->seek(offset: pos); |
33 | } |
34 | |