xbmc
WinLibraryDirectory.h
1 /*
2  * Copyright (C) 2011-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "filesystem/IDirectory.h"
12 
13 namespace XFILE
14 {
15  class CWinLibraryFile;
16 
18  {
19  public:
21  virtual ~CWinLibraryDirectory(void);
22  bool GetDirectory(const CURL& url, CFileItemList &items) override;
23  DIR_CACHE_TYPE GetCacheType(const CURL& url) const override { return DIR_CACHE_ONCE; }
24  bool Create(const CURL& url) override;
25  bool Exists(const CURL& url) override;
26  bool Remove(const CURL& url) override;
27 
28  static bool GetStoragePath(std::string library, std::string& path);
29  static bool IsValid(const CURL& url);
30 
31  private:
32  friend CWinLibraryFile;
33  static winrt::Windows::Storage::StorageFolder GetRootFolder(const CURL& url);
34  static winrt::Windows::Storage::StorageFolder GetFolder(const CURL &url);
35  static int StatDirectory(const CURL& url, struct __stat64* statData);
36  };
37 }
Interface to the directory on a file system.
Definition: IDirectory.h:51
Definition: Scraper.h:41
bool Remove(const CURL &url) override
Removes the directory.
Definition: WinLibraryDirectory.cpp:175
Definition: WinLibraryFile.h:17
Definition: WinLibraryDirectory.h:17
Represents a list of files.
Definition: FileItem.h:721
Definition: URL.h:21
DIR_CACHE_TYPE GetCacheType(const CURL &url) const override
How this directory should be cached.
Definition: WinLibraryDirectory.h:23
bool Exists(const CURL &url) override
Check for directory existence.
Definition: WinLibraryDirectory.cpp:170
bool Create(const CURL &url) override
Create the directory.
Definition: WinLibraryDirectory.cpp:146
bool GetDirectory(const CURL &url, CFileItemList &items) override
Get the items of the directory strPath.
Definition: WinLibraryDirectory.cpp:95