Merge pull request #5039 from CEikermann/patch-1
[vuplus_xbmc] / xbmc / filesystem / Directory.h
1 #pragma once
2 /*
3  *      Copyright (C) 2005-2013 Team XBMC
4  *      http://xbmc.org
5  *
6  *  This Program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2, or (at your option)
9  *  any later version.
10  *
11  *  This Program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with XBMC; see the file COPYING.  If not, see
18  *  <http://www.gnu.org/licenses/>.
19  *
20  */
21
22 #include "IDirectory.h"
23
24 namespace XFILE
25 {
26 /*!
27  \ingroup filesystem
28  \brief Wrappers for \e IDirectory
29  */
30 class CDirectory
31 {
32 public:
33   CDirectory(void);
34   virtual ~CDirectory(void);
35
36   class CHints
37   {
38   public:
39     CHints() : flags(DIR_FLAG_DEFAULTS)
40     {
41     };
42     CStdString mask;
43     int flags;
44   };
45
46   static bool GetDirectory(const CStdString& strPath
47                            , CFileItemList &items
48                            , const CStdString &strMask=""
49                            , int flags=DIR_FLAG_DEFAULTS
50                            , bool allowThreads=false);
51
52   static bool GetDirectory(const CStdString& strPath
53                            , CFileItemList &items
54                            , const CHints &hints
55                            , bool allowThreads=false);
56
57   static bool Create(const CStdString& strPath);
58   static bool Exists(const CStdString& strPath, bool bUseCache = true);
59   static bool Remove(const CStdString& strPath);
60
61   /*! \brief Filter files that act like directories from the list, replacing them with their directory counterparts
62    \param items The item list to filter
63    \param mask  The mask to apply when filtering files */
64   static void FilterFileDirectories(CFileItemList &items, const CStdString &mask);
65 };
66 }