xbmc
EventsDirectory.h
1 /*
2  * Copyright (C) 2015-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 #include <memory>
14 
15 class CFileItem;
16 class CFileItemList;
17 class IEvent;
18 
19 #define PROPERTY_EVENT_IDENTIFIER "Event.ID"
20 #define PROPERTY_EVENT_LEVEL "Event.Level"
21 #define PROPERTY_EVENT_DESCRIPTION "Event.Description"
22 
23 namespace XFILE
24 {
26  {
27  public:
28  CEventsDirectory() = default;
29  ~CEventsDirectory() override = default;
30 
31  // implementations of IDirectory
32  bool GetDirectory(const CURL& url, CFileItemList& items) override;
33  bool Create(const CURL& url) override { return true; }
34  bool Exists(const CURL& url) override { return true; }
35  bool AllowAll() const override { return true; }
36 
37  static std::shared_ptr<CFileItem> EventToFileItem(
38  const std::shared_ptr<const IEvent>& activity);
39  };
40 }
Interface to the directory on a file system.
Definition: IDirectory.h:50
Definition: Scraper.h:41
Represents a list of files.
Definition: FileItem.h:713
Definition: URL.h:20
Definition: IEvent.h:26
bool AllowAll() const override
Whether to allow all files/folders to be listed.
Definition: EventsDirectory.h:35
bool Exists(const CURL &url) override
Check for directory existence.
Definition: EventsDirectory.h:34
bool Create(const CURL &url) override
Create the directory.
Definition: EventsDirectory.h:33
Definition: EventsDirectory.h:25
bool GetDirectory(const CURL &url, CFileItemList &items) override
Get the items of the directory strPath.
Definition: EventsDirectory.cpp:20
Represents a file on a share.
Definition: FileItem.h:102