PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: FileSearchImpl.h * 00003 * 00004 * Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLCORE_FILESEARCH_IMPL_H__ 00024 #define __PLCORE_FILESEARCH_IMPL_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLCore/String/String.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLCore { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Forward declarations ] 00042 //[-------------------------------------------------------] 00043 class FileSearch; 00044 class FileAccess; 00045 00046 00047 //[-------------------------------------------------------] 00048 //[ Classes ] 00049 //[-------------------------------------------------------] 00050 /** 00051 * @brief 00052 * Abstract base class for platform specific file search implementations 00053 * 00054 * @note 00055 * - Implementation of the bridge design pattern, this class is the implementor of the 'FileSearch' abstraction 00056 */ 00057 class FileSearchImpl { 00058 00059 00060 //[-------------------------------------------------------] 00061 //[ Friends ] 00062 //[-------------------------------------------------------] 00063 friend class FileSearch; 00064 00065 00066 //[-------------------------------------------------------] 00067 //[ Protected functions ] 00068 //[-------------------------------------------------------] 00069 protected: 00070 /** 00071 * @brief 00072 * Constructor 00073 * 00074 * @param[in] pAccess 00075 * Additional file access information (can be a null pointer) 00076 */ 00077 PLCORE_API FileSearchImpl(const FileAccess *pAccess); 00078 00079 /** 00080 * @brief 00081 * Destructor 00082 */ 00083 PLCORE_API virtual ~FileSearchImpl(); 00084 00085 00086 //[-------------------------------------------------------] 00087 //[ Protected virtual FileSearchImpl functions ] 00088 //[-------------------------------------------------------] 00089 protected: 00090 /** 00091 * @brief 00092 * Returns whether the file searcher has a next file 00093 * 00094 * @return 00095 * 'true' if the file searcher has a next file, else 'false' 00096 */ 00097 virtual bool HasNextFile() = 0; 00098 00099 /** 00100 * @brief 00101 * Returns the next filename 00102 * 00103 * @return 00104 * The next filename, empty on error 00105 * 00106 * @note 00107 * - Only the filename, no path shall be returned 00108 * - No '/' at the end of the file name shall be added for directories 00109 */ 00110 virtual String GetNextFile() = 0; 00111 00112 00113 //[-------------------------------------------------------] 00114 //[ Protected data ] 00115 //[-------------------------------------------------------] 00116 protected: 00117 const FileAccess *m_pAccess; /**< File access information, can be a null pointer */ 00118 00119 00120 }; 00121 00122 00123 //[-------------------------------------------------------] 00124 //[ Namespace ] 00125 //[-------------------------------------------------------] 00126 } // PLCore 00127 00128 00129 #endif // __PLCORE_FILESEARCH_IMPL_H__
|