Merge pull request #5095 from koying/fixdroidappcrash
[vuplus_xbmc] / xbmc / filesystem / FileReaderFile.h
1 #pragma once
2 /*
3  *      Copyright (c) 2002 Frodo
4  *      Portions Copyright (c) by the authors of ffmpeg and xvid
5  *      Copyright (C) 2002-2013 Team XBMC
6  *      http://xbmc.org
7  *
8  *  This Program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2, or (at your option)
11  *  any later version.
12  *
13  *  This Program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with XBMC; see the file COPYING.  If not, see
20  *  <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 #include "File.h"
25 #include "IFile.h"
26
27 namespace XFILE
28 {
29 class CFileReaderFile : public IFile
30 {
31 public:
32   CFileReaderFile();
33   virtual ~CFileReaderFile();
34   virtual int64_t GetPosition();
35   virtual int64_t GetLength();
36   virtual bool Open(const CURL& url);
37   virtual bool Exists(const CURL& url);
38   virtual int Stat(const CURL& url, struct __stat64* buffer);
39   virtual unsigned int Read(void* lpBuf, int64_t uiBufSize);
40   virtual int Write(const void* lpBuf, int64_t uiBufSize);
41   virtual int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET);
42   virtual void Close();
43
44   virtual bool OpenForWrite(const CURL& url, bool bOverWrite = false);
45   protected:
46   CFile m_reader;
47 };
48
49 }
50
51