ZenLib

Dir.h

Go to the documentation of this file.
00001 // ZenLib::Dir - Directories functions
00002 // Copyright (C) 2007-2011 MediaArea.net SARL, Info@MediaArea.net
00003 //
00004 // This software is provided 'as-is', without any express or implied
00005 // warranty.  In no event will the authors be held liable for any damages
00006 // arising from the use of this software.
00007 //
00008 // Permission is granted to anyone to use this software for any purpose,
00009 // including commercial applications, and to alter it and redistribute it
00010 // freely, subject to the following restrictions:
00011 //
00012 // 1. The origin of this software must not be misrepresented; you must not
00013 //    claim that you wrote the original software. If you use this software
00014 //    in a product, an acknowledgment in the product documentation would be
00015 //    appreciated but is not required.
00016 // 2. Altered source versions must be plainly marked as such, and must not be
00017 //    misrepresented as being the original software.
00018 // 3. This notice may not be removed or altered from any source distribution.
00019 //
00020 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00021 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00022 //
00023 // Directories functions
00024 //
00025 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00026 
00027 //---------------------------------------------------------------------------
00028 #ifndef ZenLib_DirH
00029 #define ZenLib_DirH
00030 //---------------------------------------------------------------------------
00031 
00032 //---------------------------------------------------------------------------
00033 #include "ZenLib/Conf.h"
00034 #include "ZenLib/ZtringList.h"
00035 //---------------------------------------------------------------------------
00036 
00037 namespace ZenLib
00038 {
00039 
00040 //***************************************************************************
00041 /// @brief Directory manipulation
00042 //***************************************************************************
00043 
00044 class Dir
00045 {
00046 public :
00047     //---------------------------------------------------------------------------
00048     /// @brief Options for Open method
00049     enum dirlist_t
00050     {
00051         Nothing                     = 0x00,             ///<
00052         Include_Files               = 0x01,             ///< Include files
00053         Include_Dirs                = 0x02,             ///< Include directories
00054         Include_Hidden              = 0x04,             ///< Include hidden files
00055         Parse_SubDirs               = 0x10              ///< Parse subdirectories
00056     };
00057 
00058     //Constructor/Destructor
00059 
00060     //Open/close
00061     static ZtringList GetAllFileNames(const Ztring &Dir_Name, dirlist_t Options=(dirlist_t)(Include_Files|Parse_SubDirs));
00062 
00063     //Helpers
00064     static bool             Exists(const Ztring &Dir_Name);
00065     static bool             Create(const Ztring &Dir_Name);
00066 };
00067 
00068 } //NameSpace
00069 
00070 #endif