00001 /* Copyright (c) MediaArea.net SARL. All Rights Reserved. 00002 * 00003 * Use of this source code is governed by a zlib-style license that can 00004 * be found in the License.txt file in the root of the source tree. 00005 */ 00006 00007 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00008 // 00009 // Directories functions 00010 // 00011 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00012 00013 //--------------------------------------------------------------------------- 00014 #ifndef ZenLib_DirH 00015 #define ZenLib_DirH 00016 //--------------------------------------------------------------------------- 00017 00018 //--------------------------------------------------------------------------- 00019 #include "ZenLib/ZtringList.h" 00020 //--------------------------------------------------------------------------- 00021 00022 namespace ZenLib 00023 { 00024 00025 //*************************************************************************** 00026 /// @brief Directory manipulation 00027 //*************************************************************************** 00028 00029 class Dir 00030 { 00031 public : 00032 //--------------------------------------------------------------------------- 00033 /// @brief Options for Open method 00034 enum dirlist_t 00035 { 00036 Nothing = 0x00, ///< 00037 Include_Files = 0x01, ///< Include files 00038 Include_Dirs = 0x02, ///< Include directories 00039 Include_Hidden = 0x04, ///< Include hidden files 00040 Parse_SubDirs = 0x10 ///< Parse subdirectories 00041 }; 00042 00043 //Constructor/Destructor 00044 00045 //Open/close 00046 static ZtringList GetAllFileNames(const Ztring &Dir_Name, dirlist_t Options=(dirlist_t)(Include_Files|Parse_SubDirs)); 00047 00048 //Helpers 00049 static bool Exists(const Ztring &Dir_Name); 00050 static bool Create(const Ztring &Dir_Name); 00051 }; 00052 00053 #if defined WINDOWS && !defined WINDOWS_UWP 00054 class GetAllFileNames_Private; 00055 class GetAllFileNames 00056 { 00057 public: 00058 //Constructor/Destructor 00059 GetAllFileNames(); 00060 ~GetAllFileNames(); 00061 00062 // 00063 void Start (const Ztring &Dir_Name, Dir::dirlist_t Options=(Dir::dirlist_t)(Dir::Include_Files|Dir::Parse_SubDirs)); 00064 bool Next (Ztring& Name); 00065 void Close (); 00066 00067 private: 00068 GetAllFileNames_Private* p; 00069 }; 00070 #endif //WINDOWS && !WINDOWS_UWP 00071 00072 } //NameSpace 00073 00074 #endif