[videodb] Remove nested transaction when saving state after stopping PVR playback
[xbmc.git] / xbmc / filesystem / OverrideFile.h
blob974b47360dd2e3d7a37bbe8eb96ee7f0f6a46bf0
1 /*
2 * Copyright (C) 2014-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "filesystem/File.h"
12 #include "filesystem/IFile.h"
14 namespace XFILE
16 class COverrideFile : public IFile
18 public:
19 explicit COverrideFile(bool writable);
20 ~COverrideFile() override;
22 bool Open(const CURL& url) override;
23 bool Exists(const CURL& url) override;
24 int Stat(const CURL& url, struct __stat64* buffer) override;
25 int Stat(struct __stat64* buffer) override;
26 bool OpenForWrite(const CURL& url, bool bOverWrite = false) override;
27 bool Delete(const CURL& url) override;
28 bool Rename(const CURL& url, const CURL& urlnew) override;
30 ssize_t Read(void* lpBuf, size_t uiBufSize) override;
31 ssize_t Write(const void* lpBuf, size_t uiBufSize) override;
32 int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET) override;
33 void Close() override;
34 int64_t GetPosition() override;
35 int64_t GetLength() override;
37 protected:
38 virtual std::string TranslatePath(const CURL &url) = 0;
40 CFile m_file;
41 bool m_writable;