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