2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "IDirectory.h"
12 #include "MediaSource.h"
22 \brief Get access to shares and it's directories.
24 class CVirtualDirectory
: public IDirectory
27 CVirtualDirectory(void);
28 ~CVirtualDirectory(void) override
;
29 bool GetDirectory(const CURL
& url
, CFileItemList
&items
) override
;
30 void CancelDirectory() override
;
31 bool GetDirectory(const CURL
& url
, CFileItemList
&items
, bool bUseFileDirectories
, bool keepImpl
);
32 void SetSources(const VECSOURCES
& vecSources
);
33 inline unsigned int GetNumberOfSources()
35 return static_cast<uint32_t>(m_vecSources
.size());
38 bool IsSource(const std::string
& strPath
, VECSOURCES
*sources
= NULL
, std::string
*name
= NULL
) const;
39 bool IsInSource(const std::string
& strPath
) const;
41 inline const CMediaSource
& operator [](const int index
) const
43 return m_vecSources
[index
];
46 inline CMediaSource
& operator[](const int index
)
48 return m_vecSources
[index
];
51 void GetSources(VECSOURCES
&sources
) const;
53 void AllowNonLocalSources(bool allow
) { m_allowNonLocalSources
= allow
; }
55 std::shared_ptr
<IDirectory
> GetDirImpl() { return m_pDir
; }
56 void ReleaseDirImpl() { m_pDir
.reset(); }
59 void CacheThumbs(CFileItemList
&items
);
61 VECSOURCES m_vecSources
;
62 bool m_allowNonLocalSources
;
63 std::shared_ptr
<IDirectory
> m_pDir
;