diff options
-rw-r--r-- | XBMC-ATV2.xcodeproj/project.pbxproj | 6 | ||||
-rw-r--r-- | XBMC-IOS.xcodeproj/project.pbxproj | 6 | ||||
-rw-r--r-- | XBMC.xcodeproj/project.pbxproj | 6 | ||||
-rw-r--r-- | project/VS2010Express/XBMC.vcxproj | 4 | ||||
-rw-r--r-- | project/VS2010Express/XBMC.vcxproj.filters | 8 | ||||
-rw-r--r-- | xbmc/filesystem/FileFactory.cpp | 2 | ||||
-rw-r--r-- | xbmc/filesystem/ImageFile.cpp | 114 | ||||
-rw-r--r-- | xbmc/filesystem/ImageFile.h | 45 | ||||
-rw-r--r-- | xbmc/filesystem/Makefile.in | 1 |
9 files changed, 190 insertions, 2 deletions
diff --git a/XBMC-ATV2.xcodeproj/project.pbxproj b/XBMC-ATV2.xcodeproj/project.pbxproj index dda2cb0f6e..4a631dd567 100644 --- a/XBMC-ATV2.xcodeproj/project.pbxproj +++ b/XBMC-ATV2.xcodeproj/project.pbxproj @@ -26,6 +26,7 @@ 7C0B990A154B80200065A238 /* AEDeviceInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C0B9908154B80200065A238 /* AEDeviceInfo.cpp */; }; 7C1A89BB152671FB00C63311 /* TextureCacheJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C1A89B9152671FB00C63311 /* TextureCacheJob.cpp */; }; 7C1F6F8C13ED17CC001726AB /* LibraryDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C1F6F8A13ED17CC001726AB /* LibraryDirectory.cpp */; }; + 7C6EB586155E3EC80080368A /* ImageFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C6EB584155E3EC80080368A /* ImageFile.cpp */; }; 7C89627013B702F3003631FE /* GUIWindowScreensaverDim.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C89626E13B702F3003631FE /* GUIWindowScreensaverDim.cpp */; }; 7C99B7AA134072CD00FC2B16 /* GUIDialogPlayEject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C99B7A8134072CD00FC2B16 /* GUIDialogPlayEject.cpp */; }; 7CCFD9AA1514952700211D82 /* PCMCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCFD9A81514952700211D82 /* PCMCodec.cpp */; }; @@ -1016,6 +1017,8 @@ 7C1A89BA152671FB00C63311 /* TextureCacheJob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextureCacheJob.h; sourceTree = "<group>"; }; 7C1F6F8A13ED17CC001726AB /* LibraryDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LibraryDirectory.cpp; sourceTree = "<group>"; }; 7C1F6F8B13ED17CC001726AB /* LibraryDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LibraryDirectory.h; sourceTree = "<group>"; }; + 7C6EB584155E3EC80080368A /* ImageFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageFile.cpp; sourceTree = "<group>"; }; + 7C6EB585155E3EC80080368A /* ImageFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageFile.h; sourceTree = "<group>"; }; 7C89626E13B702F3003631FE /* GUIWindowScreensaverDim.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIWindowScreensaverDim.cpp; sourceTree = "<group>"; }; 7C89626F13B702F3003631FE /* GUIWindowScreensaverDim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIWindowScreensaverDim.h; sourceTree = "<group>"; }; 7C99B7A8134072CD00FC2B16 /* GUIDialogPlayEject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogPlayEject.cpp; sourceTree = "<group>"; }; @@ -4291,6 +4294,8 @@ F56C73FA131EC151000AD0F6 /* IFile.cpp */, F56C73FB131EC151000AD0F6 /* IFile.h */, F56C73FC131EC151000AD0F6 /* IFileDirectory.h */, + 7C6EB584155E3EC80080368A /* ImageFile.cpp */, + 7C6EB585155E3EC80080368A /* ImageFile.h */, F56C73FD131EC151000AD0F6 /* iso9660.cpp */, F56C73FE131EC151000AD0F6 /* iso9660.h */, F56C73FF131EC151000AD0F6 /* ISO9660Directory.cpp */, @@ -7182,6 +7187,7 @@ DFB662FC15376810006B8FF1 /* AEWAVLoader.cpp in Sources */, DFB6631115376991006B8FF1 /* DVDAudioCodecPassthrough.cpp in Sources */, 7C0B990A154B80200065A238 /* AEDeviceInfo.cpp in Sources */, + 7C6EB586155E3EC80080368A /* ImageFile.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/XBMC-IOS.xcodeproj/project.pbxproj b/XBMC-IOS.xcodeproj/project.pbxproj index 638eec7491..99d59676d3 100644 --- a/XBMC-IOS.xcodeproj/project.pbxproj +++ b/XBMC-IOS.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ 7C0B98F9154B7FF30065A238 /* AEDeviceInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C0B98F7154B7FF30065A238 /* AEDeviceInfo.cpp */; }; 7C1A89CE1526722200C63311 /* TextureCacheJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C1A89CC1526722200C63311 /* TextureCacheJob.cpp */; }; 7C1F6F7A13ED178F001726AB /* LibraryDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C1F6F7813ED178F001726AB /* LibraryDirectory.cpp */; }; + 7C6EB570155E3E680080368A /* ImageFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C6EB56E155E3E680080368A /* ImageFile.cpp */; }; 7C89628013B7031E003631FE /* GUIWindowScreensaverDim.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C89627E13B7031E003631FE /* GUIWindowScreensaverDim.cpp */; }; 7C99B7BE1340730000FC2B16 /* GUIDialogPlayEject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C99B7BC1340730000FC2B16 /* GUIDialogPlayEject.cpp */; }; 7CCFD9991514950700211D82 /* PCMCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCFD9971514950700211D82 /* PCMCodec.cpp */; }; @@ -1016,6 +1017,8 @@ 7C1A89CD1526722200C63311 /* TextureCacheJob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextureCacheJob.h; sourceTree = "<group>"; }; 7C1F6F7813ED178F001726AB /* LibraryDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LibraryDirectory.cpp; sourceTree = "<group>"; }; 7C1F6F7913ED178F001726AB /* LibraryDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LibraryDirectory.h; sourceTree = "<group>"; }; + 7C6EB56E155E3E680080368A /* ImageFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageFile.cpp; sourceTree = "<group>"; }; + 7C6EB56F155E3E680080368A /* ImageFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageFile.h; sourceTree = "<group>"; }; 7C89627E13B7031E003631FE /* GUIWindowScreensaverDim.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIWindowScreensaverDim.cpp; sourceTree = "<group>"; }; 7C89627F13B7031E003631FE /* GUIWindowScreensaverDim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIWindowScreensaverDim.h; sourceTree = "<group>"; }; 7C99B7BC1340730000FC2B16 /* GUIDialogPlayEject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogPlayEject.cpp; sourceTree = "<group>"; }; @@ -4647,6 +4650,8 @@ F56C83DD131F42E8000AD0F6 /* IFile.cpp */, F56C83DE131F42E8000AD0F6 /* IFile.h */, F56C83DF131F42E8000AD0F6 /* IFileDirectory.h */, + 7C6EB56E155E3E680080368A /* ImageFile.cpp */, + 7C6EB56F155E3E680080368A /* ImageFile.h */, F56C83E0131F42E8000AD0F6 /* iso9660.cpp */, F56C83E1131F42E8000AD0F6 /* iso9660.h */, F56C83E2131F42E8000AD0F6 /* ISO9660Directory.cpp */, @@ -7193,6 +7198,7 @@ DFB6627615376791006B8FF1 /* AEWAVLoader.cpp in Sources */, DFB6630C1537697E006B8FF1 /* DVDAudioCodecPassthrough.cpp in Sources */, 7C0B98F9154B7FF30065A238 /* AEDeviceInfo.cpp in Sources */, + 7C6EB570155E3E680080368A /* ImageFile.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/XBMC.xcodeproj/project.pbxproj b/XBMC.xcodeproj/project.pbxproj index 452284d644..b630098bf3 100644 --- a/XBMC.xcodeproj/project.pbxproj +++ b/XBMC.xcodeproj/project.pbxproj @@ -260,6 +260,7 @@ 7C5608C70F1754930056433A /* ExternalPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C5608C40F1754930056433A /* ExternalPlayer.cpp */; }; 7C62F24210505BC7002AD2C1 /* Bookmark.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C62F24010505BC7002AD2C1 /* Bookmark.cpp */; }; 7C62F45E1057A62D002AD2C1 /* DirectoryNodeSingles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C62F45C1057A62D002AD2C1 /* DirectoryNodeSingles.cpp */; }; + 7C6EB330155BD1D40080368A /* ImageFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C6EB32E155BD1D40080368A /* ImageFile.cpp */; }; 7C779E3A104A57E500F444C4 /* RenderSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C779E1F104A57E500F444C4 /* RenderSystem.cpp */; }; 7C779E3B104A57E500F444C4 /* RenderSystemGL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C779E21104A57E500F444C4 /* RenderSystemGL.cpp */; }; 7C779E3C104A57E500F444C4 /* WinEventsSDL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C779E27104A57E500F444C4 /* WinEventsSDL.cpp */; }; @@ -1530,6 +1531,8 @@ 7C62F24110505BC7002AD2C1 /* Bookmark.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bookmark.h; sourceTree = "<group>"; }; 7C62F45C1057A62D002AD2C1 /* DirectoryNodeSingles.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectoryNodeSingles.cpp; sourceTree = "<group>"; }; 7C62F45D1057A62D002AD2C1 /* DirectoryNodeSingles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectoryNodeSingles.h; sourceTree = "<group>"; }; + 7C6EB32E155BD1D40080368A /* ImageFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageFile.cpp; sourceTree = "<group>"; }; + 7C6EB32F155BD1D40080368A /* ImageFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageFile.h; sourceTree = "<group>"; }; 7C779E1F104A57E500F444C4 /* RenderSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSystem.cpp; sourceTree = "<group>"; }; 7C779E20104A57E500F444C4 /* RenderSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSystem.h; sourceTree = "<group>"; }; 7C779E21104A57E500F444C4 /* RenderSystemGL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSystemGL.cpp; sourceTree = "<group>"; }; @@ -4917,6 +4920,8 @@ E38E16EE0D25F9FA00618676 /* IFile.cpp */, E38E16EF0D25F9FA00618676 /* IFile.h */, E38E16F00D25F9FA00618676 /* IFileDirectory.h */, + 7C6EB32E155BD1D40080368A /* ImageFile.cpp */, + 7C6EB32F155BD1D40080368A /* ImageFile.h */, E38E16F10D25F9FA00618676 /* iso9660.cpp */, E38E16F20D25F9FA00618676 /* iso9660.h */, E38E16F30D25F9FA00618676 /* ISO9660Directory.cpp */, @@ -7260,6 +7265,7 @@ F5ED9496155D7B9900842059 /* CoreAudioMixMap.cpp in Sources */, F5ED94AB155D7F8000842059 /* CoreAudioUnit.cpp in Sources */, F5ED9509155D855200842059 /* CoreAudioGraph.cpp in Sources */, + 7C6EB330155BD1D40080368A /* ImageFile.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj index 64d865b0cf..c9f51287bd 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj @@ -393,6 +393,7 @@ <ClCompile Include="..\..\xbmc\filesystem\HTTPDirectory.cpp" /> <ClCompile Include="..\..\xbmc\filesystem\IDirectory.cpp" /> <ClCompile Include="..\..\xbmc\filesystem\IFile.cpp" /> + <ClCompile Include="..\..\xbmc\filesystem\ImageFile.cpp" /> <ClCompile Include="..\..\xbmc\filesystem\iso9660.cpp" /> <ClCompile Include="..\..\xbmc\filesystem\ISO9660Directory.cpp" /> <ClCompile Include="..\..\xbmc\filesystem\ISOFile.cpp" /> @@ -923,6 +924,7 @@ <ClInclude Include="..\..\xbmc\cores\AudioEngine\Utils\AEWAVLoader.h" /> <ClInclude Include="..\..\xbmc\cores\dvdplayer\DVDCodecs\Audio\DVDAudioCodecPassthrough.h" /> <ClInclude Include="..\..\xbmc\cores\paplayer\PCMCodec.h" /> + <ClInclude Include="..\..\xbmc\filesystem\ImageFile.h" /> <ClInclude Include="..\..\xbmc\filesystem\windows\WINFileSMB.h" /> <ClInclude Include="..\..\xbmc\filesystem\windows\WINSMBDirectory.h" /> <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\pythreadstate.h" /> @@ -2278,4 +2280,4 @@ </VisualStudio> </ProjectExtensions> <Import Project="$(SolutionDir)\$(ProjectFileName).targets.user" Condition="Exists('$(SolutionDir)\$(ProjectFileName).targets.user')" /> -</Project> +</Project>
\ No newline at end of file diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters index 3de0c6a731..d76b87529f 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters @@ -2578,6 +2578,9 @@ <ClCompile Include="..\..\xbmc\utils\RecentlyAddedJob.cpp"> <Filter>utils</Filter> </ClCompile> + <ClCompile Include="..\..\xbmc\filesystem\ImageFile.cpp"> + <Filter>filesystem</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\xbmc\win32\pch.h"> @@ -5193,6 +5196,9 @@ <ClInclude Include="..\..\xbmc\utils\RecentlyAddedJob.h"> <Filter>utils</Filter> </ClInclude> + <ClInclude Include="..\..\xbmc\filesystem\ImageFile.h"> + <Filter>filesystem</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <ResourceCompile Include="..\..\xbmc\win32\XBMC_PC.rc"> @@ -5204,4 +5210,4 @@ <Filter>win32</Filter> </CustomBuild> </ItemGroup> -</Project> +</Project>
\ No newline at end of file diff --git a/xbmc/filesystem/FileFactory.cpp b/xbmc/filesystem/FileFactory.cpp index 4c007862a3..a3b06d9086 100644 --- a/xbmc/filesystem/FileFactory.cpp +++ b/xbmc/filesystem/FileFactory.cpp @@ -79,6 +79,7 @@ #include "MythFile.h" #include "HDHomeRunFile.h" #include "SlingboxFile.h" +#include "ImageFile.h" #include "Application.h" #include "URL.h" #include "utils/log.h" @@ -117,6 +118,7 @@ IFile* CFileFactory::CreateLoader(const CURL& url) else if (strProtocol == "videodb") return NULL; else if (strProtocol == "special") return new CSpecialProtocolFile(); else if (strProtocol == "multipath") return new CMultiPathFile(); + else if (strProtocol == "image") return new CImageFile(); else if (strProtocol == "file" || strProtocol.IsEmpty()) return new CHDFile(); else if (strProtocol == "filereader") return new CFileReaderFile(); #if defined(HAS_FILESYSTEM_CDDA) && defined(HAS_DVD_DRIVE) diff --git a/xbmc/filesystem/ImageFile.cpp b/xbmc/filesystem/ImageFile.cpp new file mode 100644 index 0000000000..d3a3bdb8a4 --- /dev/null +++ b/xbmc/filesystem/ImageFile.cpp @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "ImageFile.h" +#include "utils/URIUtils.h" +#include "URL.h" +#include "TextureCache.h" + +using namespace XFILE; +using namespace std; + +CImageFile::CImageFile(void) +{ +} + +CImageFile::~CImageFile(void) +{ + Close(); +} + +bool CImageFile::Open(const CURL& url) +{ + CStdString file = url.Get(); + bool needsRecaching = false; + CStdString cachedFile = CTextureCache::Get().CheckCachedImage(file, false, needsRecaching); + if (cachedFile.IsEmpty()) + { // not in the cache, so cache it + cachedFile = CTextureCache::Get().CacheTexture(file); + } + if (!cachedFile.IsEmpty()) + { // in the cache, return what we have + if (m_file.Open(cachedFile)) + return true; + } + return false; +} + +bool CImageFile::Exists(const CURL& url) +{ + bool needsRecaching = false; + CStdString cachedFile = CTextureCache::Get().CheckCachedImage(url.Get(), false, needsRecaching); + if (!cachedFile.IsEmpty()) + return CFile::Exists(cachedFile); + + // need to check if the original can be cached on demand and that the file exists + if (!url.GetUserName().IsEmpty()) + return false; // not in the cache, and can't be cached on demand + + CStdString image = url.GetHostName(); + CURL::Decode(image); + return CFile::Exists(image); +} + +int CImageFile::Stat(const CURL& url, struct __stat64* buffer) +{ + bool needsRecaching = false; + CStdString cachedFile = CTextureCache::Get().CheckCachedImage(url.Get(), false, needsRecaching); + if (!cachedFile.IsEmpty()) + return CFile::Stat(cachedFile, buffer); + + /* + Doesn't exist in the cache yet. We have 3 options here: + 1. Cache the file and do the Stat() on the cached file. + 2. Do the Stat() on the original file. + 3. Return -1; + Only 1 will return valid results, at the cost of being time consuming. ATM we do 3 under + the theory that the only user of this is the webinterface currently, where Stat() is not + required. + */ + return -1; +} + +unsigned int CImageFile::Read(void* lpBuf, int64_t uiBufSize) +{ + return m_file.Read(lpBuf, uiBufSize); +} + +int64_t CImageFile::Seek(int64_t iFilePosition, int iWhence /*=SEEK_SET*/) +{ + return m_file.Seek(iFilePosition, iWhence); +} + +void CImageFile::Close() +{ + m_file.Close(); +} + +int64_t CImageFile::GetPosition() +{ + return m_file.GetPosition(); +} + +int64_t CImageFile::GetLength() +{ + return m_file.GetLength(); +} diff --git a/xbmc/filesystem/ImageFile.h b/xbmc/filesystem/ImageFile.h new file mode 100644 index 0000000000..b956b44deb --- /dev/null +++ b/xbmc/filesystem/ImageFile.h @@ -0,0 +1,45 @@ +#pragma once +/* + * Copyright (C) 2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "File.h" + +namespace XFILE +{ + class CImageFile: public IFile + { + public: + CImageFile(); + virtual ~CImageFile(); + virtual bool Open(const CURL& url); + virtual bool Exists(const CURL& url); + virtual int Stat(const CURL& url, struct __stat64* buffer); + + virtual unsigned int Read(void* lpBuf, int64_t uiBufSize); + virtual int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET); + virtual void Close(); + virtual int64_t GetPosition(); + virtual int64_t GetLength(); + + protected: + CFile m_file; + }; +} diff --git a/xbmc/filesystem/Makefile.in b/xbmc/filesystem/Makefile.in index 5839cc83c9..cee6f27e13 100644 --- a/xbmc/filesystem/Makefile.in +++ b/xbmc/filesystem/Makefile.in @@ -33,6 +33,7 @@ SRCS=AddonsDirectory.cpp \ HTTPDirectory.cpp \ IDirectory.cpp \ IFile.cpp \ + ImageFile.cpp \ iso9660.cpp \ ISO9660Directory.cpp \ ISOFile.cpp \ |