kodi
BlurayDirectory.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 "IDirectory.h"
12 #include "URL.h"
13 
14 #include <memory>
15 
16 class CFileItem;
17 class CFileItemList;
18 
19 typedef struct bluray BLURAY;
20 typedef struct bd_title_info BLURAY_TITLE_INFO;
21 
22 namespace XFILE
23 {
24 
26 {
27 public:
28  CBlurayDirectory() = default;
29  ~CBlurayDirectory() override;
30  bool GetDirectory(const CURL& url, CFileItemList &items) override;
31 
32  bool InitializeBluray(const std::string &root);
33  std::string GetBlurayTitle();
34  std::string GetBlurayID();
35 
36 private:
37  enum class DiscInfo
38  {
39  TITLE,
40  ID
41  };
42 
43  void Dispose();
44  std::string GetDiscInfoString(DiscInfo info);
45  void GetRoot (CFileItemList &items);
46  void GetTitles(bool main, CFileItemList &items);
47  std::vector<BLURAY_TITLE_INFO*> GetUserPlaylists();
48  std::shared_ptr<CFileItem> GetTitle(const BLURAY_TITLE_INFO* title, const std::string& label);
49  CURL GetUnderlyingCURL(const CURL& url);
50  std::string HexToString(const uint8_t * buf, int count);
51  CURL m_url;
52  BLURAY* m_bd = nullptr;
53  bool m_blurayInitialized = false;
54 };
55 
56 }
bool GetDirectory(const CURL &url, CFileItemList &items) override
Get the items of the directory strPath.
Definition: BlurayDirectory.cpp:214
Interface to the directory on a file system.
Definition: IDirectory.h:51
Definition: Scraper.h:41
Represents a list of files.
Definition: FileItem.h:702
Definition: URL.h:21
Definition: BlurayDirectory.h:25
Definition: main.py:1
Represents a file on a share.
Definition: FileItem.h:102