kodi
RSSDirectory.h
1 /*
2  * Copyright (C) 2005-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 "IFileDirectory.h"
12 #include "XBDateTime.h"
13 #include "threads/CriticalSection.h"
14 
15 #include <map>
16 #include <string>
17 
18 class CFileItemList;
19 
20 namespace XFILE
21 {
23  {
24  public:
25  CRSSDirectory();
26  ~CRSSDirectory() override;
27  bool GetDirectory(const CURL& url, CFileItemList &items) override;
28  bool Exists(const CURL& url) override;
29  bool AllowAll() const override { return true; }
30  bool ContainsFiles(const CURL& url) override;
31  DIR_CACHE_TYPE GetCacheType(const CURL& url) const override { return DIR_CACHE_ONCE; }
32 
33  protected:
34  // key is path, value is cache invalidation date
35  static std::map<std::string,CDateTime> m_cache;
36  static CCriticalSection m_section;
37  };
38 }
39 
Definition: Scraper.h:41
Represents a list of files.
Definition: FileItem.h:702
Definition: URL.h:21
bool Exists(const CURL &url) override
Check for directory existence.
Definition: RSSDirectory.cpp:619
bool GetDirectory(const CURL &url, CFileItemList &items) override
Get the items of the directory strPath.
Definition: RSSDirectory.cpp:543
Definition: RSSDirectory.h:22
bool AllowAll() const override
Whether to allow all files/folders to be listed.
Definition: RSSDirectory.h:29
Definition: IFileDirectory.h:15
DIR_CACHE_TYPE GetCacheType(const CURL &url) const override
How this directory should be cached.
Definition: RSSDirectory.h:31