eLynx SDK
v3.0.1 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(const char * iprFilename, ModuleId& oModule); 00063 00066 ExportedByCore void elxUnloadModule(ModuleId& ioModule); 00067 00072 ExportedByCore void * elxResolveSymbol(const ModuleId& iModule, const char * iprSymbolName); 00074 00075 00078 00082 ExportedByCore bool elxIsPath(const char * iprPath); 00083 00087 ExportedByCore bool elxMakePath(const char * iprPath); 00088 00092 ExportedByCore bool elxDeletePath(const char * iprPath); 00094 00095 00098 00102 ExportedByCore bool elxIsFileExist(const char * iprFilename); 00103 00107 ExportedByCore bool elxDeleteFile(const char * iprFilename); 00108 00111 typedef bool (*elxFileEnumCB)(const char * iprFilename, void * iprUserData); 00112 00118 ExportedByCore void elxEnumerateFile(const char * iprTarget, elxFileEnumCB ifnCallback, void * iprUserData); 00120 00121 00124 00131 ExportedByCore bool elxSplitFilename(const char * iprFilename, 00132 char * oprPath, char * oprName, char * oprExt); 00133 00140 ExportedByCore void elxSplitFilename(const std::string &iFilename, 00141 std::string &oPath, std::string &oName, std::string &oExt); 00142 00147 ExportedByCore bool elxGetFilePath(const char * iprFilename, char * oprPath); 00148 00152 ExportedByCore const char * elxGetFileNameExt(const char * iprFilename); 00153 00158 ExportedByCore bool elxGetFileName(const char * iprFilename, char * oprName); 00159 00163 ExportedByCore const char * elxGetFileExt(const char * iprFilename); 00164 00168 ExportedByCore char * elxGetFileExt(char * iprFilename); 00169 00175 ExportedByCore bool elxCheckFileExt(const char * iprFilename, const char * iprExt, bool ibCase=true); 00176 00179 ExportedByCore void elxForceFilename(char * ioprFilename); 00180 00183 ExportedByCore void elxForceFilename(std::string &ioFilename); 00184 00186 00189 ExportedByCore void elxMakePath(const std::string &iPath); 00190 00194 ExportedByCore bool elxIsPath(const std::string &iPath); 00195 00196 ExportedByCore void elxGetFileList(const std::string &iTarget, 00197 std::vector<std::string> &oFileList); 00198 00199 } // namespace eLynx 00200 00201 #endif // __CoreFile_h__