summaryrefslogtreecommitdiffstats
path: root/xbmc/filesystem/LibraryDirectory.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--xbmc/filesystem/LibraryDirectory.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/xbmc/filesystem/LibraryDirectory.h b/xbmc/filesystem/LibraryDirectory.h
new file mode 100644
index 0000000..af76dd4
--- /dev/null
+++ b/xbmc/filesystem/LibraryDirectory.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2011-2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#pragma once
+
+#include "IDirectory.h"
+#include "utils/XBMCTinyXML.h"
+
+namespace XFILE
+{
+ class CLibraryDirectory : public IDirectory
+ {
+ public:
+ CLibraryDirectory();
+ ~CLibraryDirectory() override;
+ bool GetDirectory(const CURL& url, CFileItemList &items) override;
+ bool Exists(const CURL& url) override;
+ bool AllowAll() const override { return true; }
+ private:
+ /*! \brief parse the given path and return the node corresponding to this path
+ \param path the library:// path to parse
+ \return path to the XML file or directory corresponding to this path
+ */
+ std::string GetNode(const CURL& path);
+
+ /*! \brief load the XML file and return a pointer to the <node> root element.
+ Checks visible attribute and only returns non-NULL for valid nodes that should be visible.
+ \param xmlFile the XML file to load and parse
+ \return the TiXmlElement pointer to the node, if it should be visible.
+ */
+ TiXmlElement *LoadXML(const std::string &xmlFile);
+
+ CXBMCTinyXML m_doc;
+ };
+}