eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // CoreFile.h Core.Component package 00003 //============================================================================ 00004 // Usage : declare core file methods 00005 //---------------------------------------------------------------------------- 00006 // Copyright (C) 2006 by eLynx project 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU Library General Public 00010 // License as published by the Free Software Foundation; either 00011 // version 2 of the License, or (at your option) any later version. 00012 // 00013 // This library 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. 00016 // See the GNU Library General Public License for more details. 00017 //---------------------------------------------------------------------------- 00018 #ifndef __CoreFile_h__ 00019 #define __CoreFile_h__ 00020 00021 #include <string> 00022 #include <vector> 00023 00024 #include "CoreLib.h" 00025 #include "CoreOS.h" 00026 00027 #ifdef elxWINDOWS 00028 00029 #include <stdio.h> 00030 typedef HMODULE ModuleId; 00031 00032 #define elxPATH_MAX _MAX_PATH 00033 #define elxPATH_SEPARATOR '\\' 00034 #define elxMODULE_EXT "dll" 00035 00036 #elif elxLINUX 00037 00038 #include <sys/param.h> 00039 typedef void* ModuleId; 00040 00041 #define elxPATH_MAX MAXPATHLEN 00042 #define elxPATH_SEPARATOR '/' 00043 #define elxMODULE_EXT "so" 00044 00045 #elif elxMACOSX 00046 00047 #define elxPATH_MAX _MAX_PATH 00048 #define elxPATH_SEPARATOR '/' 00049 #define elxMODULE_EXT "dylib" 00050 00051 #endif 00052 00053 namespace eLynx { 00054 00057 00062 ExportedByCore bool elxLoadModule( 00063 const char * iprFilename, 00064 ModuleId& oModule); 00065 00068 ExportedByCore void elxUnloadModule(ModuleId& ioModule); 00069 00074 ExportedByCore void * elxResolveSymbol( 00075 const ModuleId& iModule, 00076 const char * iprSymbolName); 00078 00079 00082 00086 ExportedByCore bool elxIsPath(const char * iprPath); 00087 00091 ExportedByCore bool elxMakePath(const char * iprPath); 00092 00096 ExportedByCore bool elxDeletePath(const char * iprPath); 00098 00099 00102 00106 ExportedByCore bool elxIsFileExist(const char * iprFilename); 00107 00111 ExportedByCore bool elxDeleteFile(const char * iprFilename); 00112 00115 typedef bool (*elxFileEnumCB)(const char * iprFilename, void * iprUserData); 00116 00122 ExportedByCore void elxEnumerateFile( 00123 const char * iprTarget, 00124 elxFileEnumCB ifnCallback, 00125 void * iprUserData); 00127 00128 00131 00138 ExportedByCore bool elxSplitFilename( 00139 const char * iprFilename, 00140 char * oprPath, 00141 char * oprName, 00142 char * oprExt); 00143 00150 ExportedByCore void elxSplitFilename( 00151 const std::string &iFilename, 00152 std::string &oPath, 00153 std::string &oName, 00154 std::string &oExt); 00155 00160 ExportedByCore bool elxGetFilePath( 00161 const char * iprFilename, 00162 char * oprPath); 00163 00167 ExportedByCore const char * elxGetFileNameExt(const char * iprFilename); 00168 00173 ExportedByCore bool elxGetFileName( 00174 const char * iprFilename, 00175 char * oprName); 00176 00180 ExportedByCore const char * elxGetFileExt(const char * iprFilename); 00181 00185 ExportedByCore char * elxGetFileExt(char * iprFilename); 00186 00192 ExportedByCore bool elxCheckFileExt( 00193 const char * iprFilename, 00194 const char * iprExt, 00195 bool ibCase = true); 00196 00199 ExportedByCore void elxForceFilename(char * ioprFilename); 00200 00203 ExportedByCore void elxForceFilename(std::string &ioFilename); 00204 00206 00209 ExportedByCore void elxMakePath(const std::string &iPath); 00210 00214 ExportedByCore bool elxIsPath(const std::string &iPath); 00215 00216 ExportedByCore void elxGetFileList( 00217 const std::string &iTarget, 00218 std::vector<std::string> &oFileList); 00219 00220 } // namespace eLynx 00221 00222 #endif // __CoreFile_h__