![]() |
Polygon Crucher SDK - Documentation
Documentation
|
Contains many convenient functions for handling files, paths and give a way to add some custom format support. More...
Contains many convenient functions for handling files, paths and give a way to add some custom format support.
Go to the source code of this file.
Classes | |
class | CFileNameSpec |
A given extension may match several formats. In case of conflict CFileNameSpec is a way to indicate that a given file name matches a specified file class. CFileNameSpec(filename) simply construct a filename without specifying which is its class. In that case, the SDK will choose the appropriate parser based an the extension. If loading fails, a try will be done using the next available parser, and so on. More... | |
class | CFileExt |
CFileExt is the class that allows to add a custom file parser for supporting a new file format. You have to give a specific class identifier, provide the format extensions, the read/write capabilities of the parser... More... | |
class | CFileInfo |
A convenient class to get some information giving a specific file name through a CFileNameSpec object. More... | |
Macros | |
#define | UNKNOWN_CLASS 0 |
#define | TGA_FILE MAKE_CUSTOM_ID('T', 'G', 'A', ' ') |
#define | Z_FILE MAKE_CUSTOM_ID('Z', 'F', 'I', 'L') |
#define | BMP_FILE MAKE_CUSTOM_ID('B', 'M', 'P', ' ') |
#define | JPEG_FILE MAKE_CUSTOM_ID('J', 'P', 'E', 'G') |
#define | GIF_FILE MAKE_CUSTOM_ID('G', 'I', 'F', ' ') |
#define | PNG_FILE MAKE_CUSTOM_ID('P', 'N', 'G', ' ') |
#define | TIFF_FILE MAKE_CUSTOM_ID('T', 'I', 'F', 'F') |
#define | ZPIC_FILE MAKE_CUSTOM_ID('Z', 'P', 'I', 'C') |
#define | PIC_FILE MAKE_CUSTOM_ID('P', 'I', 'C', ' ') |
#define | RLA_FILE MAKE_CUSTOM_ID('R', 'L', 'A', ' ') |
#define | IFF_FILE MAKE_CUSTOM_ID('I', 'F', 'F', ' ') |
#define | GIF_FILE MAKE_CUSTOM_ID('G', 'I', 'F', ' ') |
#define | ICON_FILE MAKE_CUSTOM_ID('I', 'C', 'O', 'N') |
#define | CURSOR_FILE MAKE_CUSTOM_ID('C', 'U', 'R', 'S') |
#define | HDR_FILE MAKE_CUSTOM_ID('H', 'D', 'R', ' ') |
#define | FOLDER_CLASS MAKE_CUSTOM_ID('F', 'L', 'D', 'R') |
#define | AMAPI_3D_FILE MAKE_CUSTOM_ID('A', 'M', 'A', 'P') |
#define | CINEMA4D_3D_FILE MAKE_CUSTOM_ID('C', 'N', '4', 'D') |
#define | COLLADA_3D_FILE MAKE_CUSTOM_ID('D', 'A', 'E', ' ') |
#define | DIRECTX_3D_FILE MAKE_CUSTOM_ID('D', 'R', 'T', 'X') |
#define | DXF_3D_FILE MAKE_CUSTOM_ID('D', 'X', 'F', '4') |
#define | DXF_FBX_3D_FILE MAKE_CUSTOM_ID('D', 'X', 'F', 'B') |
#define | INTERNALFORMAT_3D_FILE MAKE_CUSTOM_ID('3', 'D', 'I', 'F') |
#define | KMZ_3D_FILE MAKE_CUSTOM_ID('K', 'M', 'Z', 'I') |
#define | LIGHTWAVE_3D_FILE MAKE_CUSTOM_ID('L', 'I', 'G', 'T') |
#define | LIGHTWAVE_3D_SCENE_FILE MAKE_CUSTOM_ID('L', 'I', 'G', 'S') |
#define | LXO_3D_FILE MAKE_CUSTOM_ID('L', 'X', 'O', 'I') |
#define | MAYAASCII_3D_FILE MAKE_CUSTOM_ID('M', 'Y', 'A', 'S') |
#define | MAYA_3D_FILE MAKE_CUSTOM_ID('M', 'A', 'Y', 'A') |
#define | SKETCHUP_3D_FILE MAKE_CUSTOM_ID('S', 'K', 'E', 'T') |
#define | JT_3D_FILE MAKE_CUSTOM_ID('J', 'T', 'K', 'F') |
#define | KERNELIO_3D_FILE MAKE_CUSTOM_ID('C', 'T', 'K', 'I') |
#define | STL_3D_FILE MAKE_CUSTOM_ID('S', 'T', 'L', ' ') |
#define | STUDIO_MAX_3D_FILE MAKE_CUSTOM_ID('3', 'M', 'A', 'X') |
#define | STUDIO_3D_FILE MAKE_CUSTOM_ID('3', 'D', 'S', 'T') |
#define | TRUESPACE_3D_FILE MAKE_CUSTOM_ID('T', 'R', 'U', 'E') |
#define | VRML_3D_FILE MAKE_CUSTOM_ID('V', 'R', 'M', 'L') |
#define | VRML97_3D_FILE MAKE_CUSTOM_ID('V', 'R', '9', '7') |
#define | PLY_3D_FILE MAKE_CUSTOM_ID('P', 'L', 'Y', 'Y') |
#define | WAVEFRONT_3D_FILE MAKE_CUSTOM_ID('W', 'A', 'V', 'F') |
#define | XSI_3D_FILE MAKE_CUSTOM_ID('X', 'S', 'I', ' ') |
#define | FBX_3D_FILE MAKE_CUSTOM_ID('F', 'B', 'X', ' ') |
#define | ALEMBIC_3D_FILE MAKE_CUSTOM_ID('A', 'B', 'C', 'F') |
#define | MR_3D_FILE MAKE_CUSTOM_ID('P', 'C', 'M', 'R') |
#define | GLTF_3D_FILE MAKE_CUSTOM_ID('G', 'L', 'T', 'F') |
#define | BLENDER_3D_FILE MAKE_CUSTOM_ID('B', 'L', 'E', 'N') |
#define | WAV_AUDIO_FILE MAKE_CUSTOM_ID('A', 'I', 'W', 'V') |
#define | WINMEDIA_AUDIO_FILE MAKE_CUSTOM_ID('A', 'I', 'W', 'M') |
#define | MAC_AUDIO_FILE MAKE_CUSTOM_ID('A', 'I', 'M', 'C') |
#define | UNIX_AUDIO_FILE MAKE_CUSTOM_ID('A', 'I', 'U', 'X') |
#define | MPEG_AUDIO_FILE MAKE_CUSTOM_ID('A', 'I', 'M', 'G') |
#define | MIDI_FILE MAKE_CUSTOM_ID('M', 'I', 'D', 'I') |
#define | FLASH_FILE MAKE_CUSTOM_ID('F', 'L', 'A', 'S') |
#define | HTMLS_FILE MAKE_CUSTOM_ID('I', 'H', 'T', 'M') |
#define | RAWS_FILE MAKE_CUSTOM_ID('R', 'A', 'W', 'S') |
#define | MOV_FILE MAKE_CUSTOM_ID('M', 'O', 'V', ' ') |
#define | ZIP_FILE MAKE_CUSTOM_ID('Z', 'I', 'P', ' ') |
#define | RAR_FILE MAKE_CUSTOM_ID('R', 'A', 'R', ' ') |
#define | TAR_FILE MAKE_CUSTOM_ID('T', 'A', 'R', ' ') |
#define | ZIP7_FILE MAKE_CUSTOM_ID('Z', 'I', 'P', '7') |
#define | GZ_FILE MAKE_CUSTOM_ID('G', 'Z', ' ', ' ') |
#define | STEGANO_FILE MAKE_CUSTOM_ID('S', 'T', 'E', 'G') |
#define | PPM_FILE MAKE_CUSTOM_ID('P', 'P', 'M', ' ') |
#define | AVI_FILE MAKE_CUSTOM_ID('A', 'V', 'I', ' ') |
#define | MPEG4_FILE MAKE_CUSTOM_ID('M', 'P', 'G', '4') |
#define | FLV_FILE MAKE_CUSTOM_ID('F', 'L', 'V', ' ') |
#define | WMV_FILE MAKE_CUSTOM_ID('W', 'M', 'V', ' ') |
#define | ALL_FILE_CLASS MAKE_CUSTOM_ID('A', 'L', 'L', 'F') |
#define | PLUGIN_PARSER MAKE_CUSTOM_ID('P', 'L', 'G', 'P') |
#define | MOOTOOLS_PARSER MAKE_CUSTOM_ID('M', 'O', 'O', 'T') |
#define | CALLBACK_PARSER MAKE_CUSTOM_ID('C', 'A', 'L', 'K') |
#define | MAGICK_PARSER MAKE_CUSTOM_ID('M', 'A', 'G', 'I') |
#define | UNKNOWN_PARSER MAKE_CUSTOM_ID('U', 'N', 'K', 'N') |
#define | IOTIMEOUT_ALWAYS_USE (0x80000000) |
#define | IOTIMEOUT_DEFAULT 750 |
#define | IOTIMEOUT_OCCURED ((unsigned int)-1) |
File format properties and kind of file | |
#define | UNKNOWN_PROPERTIES 0x00 |
#define | IMPORT_FILE 0x01 |
#define | EXPORT_FILE 0x02 |
#define | PRIVATE_IMPORT_FILE 0x04 |
#define | PRIVATE_EXPORT_FILE 0x08 |
#define | COMMON_EXTENSION_FILE 0x10 |
#define | LOAD_HAS_DIALOG 0x20 |
#define | LOAD_NEED_DIALOG 0x40 |
#define | SAVE_HAS_DIALOG 0x80 |
#define | SAVE_NEED_DIALOG 0x100 |
#define | FORCE_DISPLAY_FILE 0x200 |
#define | ONE_SHOT_FORMAT 0x400 |
#define | MAIN_FORMAT_PARSER 0x800 |
#define | KIND_OF_FILE 0xFFFFF000 |
#define | UNKNOWN_KIND_OF_FILE 0x00 |
#define | BITMAP_FILE 0x00001000 |
#define | ANIMATED_BITMAP_FILE 0x00002000 |
#define | OBJECT_FILE 0x00004000 |
#define | SOUND_FILE 0x00008000 |
#define | VIDEO_FILE 0x00010000 |
#define | WWW_FILE 0x00020000 |
#define | COMPRESSED_FILE 0x00040000 |
#define | GENERAL_FILE 0x00080000 |
#define | FOLDER_FILE 0x00100000 |
#define | LAST_KIND_OF FOLDER_FILE |
#define | ALL_KIND_OF_FILES (KIND_OF_FILE) |
#define | MULTIMEDIA_FILES (BITMAP_FILE|ANIMATED_BITMAP_FILE|OBJECT_FILE|SOUND_FILE|VIDEO_FILE) |
Typedefs | |
typedef enum IoPluginMode | IoPluginMode |
typedef bool(* | InitIOPluginFunc) (IoPluginMode mode, void *data) |
typedef enum DirCompare | DirCompare |
typedef enum FileValidateNameMode | FileValidateNameMode |
typedef enum FileCheckAccessFlag | FileCheckAccessFlag |
typedef enum FILENAME_TYPE | FILENAME_TYPE |
Enumerations | |
enum | IoPluginMode { IO_INIT_PLUGIN , IO_GET_PARSER } |
enum | DirCompare { DIFFERENT_DIRECTORY = 0 , SAME_DIRECTORY , DIR1_IN_DIR2_DIRECTORY , DIR2_IN_DIR1_DIRECTORY } |
enum | FileValidateNameMode { FILEVALIDATE_DEFAULT = 0 , FILEVALIDATE_FILENAME = 0x01 , FILEVALIDATE_DIRECTORY = 0x02 , FILEVALIDATE_PATH = FILEVALIDATE_FILENAME|FILEVALIDATE_DIRECTORY , FILEVALIDATE_CAN_BE_RELATIVE = 0x04 , FILEVALIDATE_ALLOW_EMPTY_NAME = 0x08 , FILEVALIDATE_FILENAME_ONLY = 0x10 , FILEVALIDATE_QUIET = 0x20 } |
enum | FileCheckAccessFlag { FILE_CHECK_READ = 0x01 , FILE_CHECK_WRITE = 0x02 , FILE_CHECK_SHARED_READ = 0x04 , FILE_CHECK_SHARED_WRITE = 0x08 , FILE_CHECK_CREATE = 0x10 , FILE_CHECK_SHARED_CREATE = FILE_CHECK_CREATE|FILE_CHECK_SHARED_READ|FILE_CHECK_SHARED_WRITE } |
enum | FILENAME_TYPE { FILENAME_UNKNOWN = 0 , FILENAME_IS_A_FILE , FILENAME_IS_A_DIRECTORY , FILENAME_IS_A_NETWORK_FILE , FILENAME_IS_IN_ZIP , FILENAME_IS_AN_URL } |
Functions | |
void | fileRegisterFiles () |
Automatically call to make all recognized by being registered and recognized. | |
void | fileUnregisterFiles () |
DLL_TOOLSFUNCTION void | fileRegisterFile (CFileExt &fileinfo) |
DLL_TOOLSFUNCTION void | fileUnregisterFile (unsigned int fileClass, unsigned int flags) |
DLL_TOOLSFUNCTION CFileExt * | fileGetRegisteredFiles (unsigned int &size, unsigned int filter=0) |
DLL_TOOLSFUNCTION void | fileFreeRegisteredFiles (CFileExt *files, unsigned int size) |
DLL_TOOLSFUNCTION CXString | fileCompactPath (const CXString &path, int charNbr=15) |
DLL_TOOLSFUNCTION bool | fileIsPathRelative (const CXString &mainpath) |
DLL_TOOLSFUNCTION CXString | fileMakeRelativePath (const CXString &mainpath, const CXString &relpath, bool noSlashAndDotAtBeginning=false, FILENAME_TYPE type=FILENAME_UNKNOWN) |
noSlashAndDotAtBeginning = false will return .\folder\filename.ext, noSlashAndDotAtBeginning = true will return folder\filename.ext | |
DLL_TOOLSFUNCTION CXString | fileMakeAbsolutePath (const CXString &mainpath, const CXString &relpath, bool slashTerminate=false) |
if relpath is relative, it returns an absolute path using mainpath. If relpath is not relative or if creating absolute path fails, it return relpath. if slashTerminate set, a slash is added, which implies that the return result is used as a directory | |
DLL_TOOLSFUNCTION bool | fileMakePathShortest (CXString &path) |
Converts C:\abc..\abc\file.txt to C:\abc\file.txt if possible or uneeded, path is not changed if conversion fails (C:/../file.txt) | |
DLL_TOOLSFUNCTION CXString | fileGetCurrentDirectory () |
DLL_TOOLSFUNCTION bool | filePushCurrentDirectory (const CXString &newpath, unsigned int *timeOut=NULL) |
return true if directory change is a success. Whatever the results, filePopCurrentDirectory must always be called. | |
DLL_TOOLSFUNCTION bool | filePopCurrentDirectory () |
pop the latest push current directory | |
DLL_TOOLSFUNCTION bool | fileDirectoryExists (const CXString &filename, unsigned int *timeOut=NULL) |
DLL_TOOLSFUNCTION bool | fileExists (const CXString &filename, unsigned int *timeOut=NULL) |
Accessing file can take time. specify timeOut if critical (ie access through network). If timeout reach, the function return false. | |
DLL_TOOLSFUNCTION bool | fileCheckAccess (const CXString &filename, unsigned int flags) |
DLL_TOOLSFUNCTION bool | fileGetCreationDate (const CXString &filename, CXTime &time) |
DLL_TOOLSFUNCTION bool | fileSetCreationDate (const CXString &filename, const CXTime &time) |
DLL_TOOLSFUNCTION bool | fileGetLastWriteDate (const CXString &filename, CXTime &time) |
DLL_TOOLSFUNCTION bool | fileSetLastWriteDate (const CXString &filename, const CXTime &time) |
DLL_TOOLSFUNCTION fileuint | fileGetSize (const CXString &filename) |
DLL_TOOLSFUNCTION bool | fileConvertSlash (CXString &dir) |
Make slash OS compatible. | |
DLL_TOOLSFUNCTION void | fileRemoveDuplicatedSlash (CXString &path) |
DLL_TOOLSFUNCTION void | fileSlashTerminate (CXString &dir) |
DLL_TOOLSFUNCTION bool | fileIsSlashTerminated (const CXString &path) |
DLL_TOOLSFUNCTION void | fileRemoveSlashTermination (CXString &filenameWithoutExt) |
DLL_TOOLSFUNCTION void | fileRemoveInvalidChar (CXString &path, char spaceReplace=' ') |
Remove any invalid character for a filename <>:"/|?* and eventually replaces space without something else. | |
DLL_TOOLSFUNCTION bool | fileGetCInfo (const CXString &filename, unsigned int &checksum1, unsigned int &checksum2, bool alert=FALSE) |
DLL_TOOLSFUNCTION bool | fileIsDirectory (const CXString &filename, bool checkIfExists=FALSE, unsigned int *timeOut=NULL) |
DLL_TOOLSFUNCTION bool | fileIsValidFileName (const CXString &filename, unsigned int checkMode) |
DLL_TOOLSFUNCTION DirCompare | fileCompareDirectory (CXString dir1, CXString dir2) |
DLL_TOOLSFUNCTION bool | fileIsSameFile (const CXString &file1, const CXString &file2) |
DLL_TOOLSFUNCTION bool | fileIsSameDir (const CXString &file1, const CXString &file2) |
DLL_TOOLSFUNCTION bool | filePathContainMatchingFile (const CXString &path, const CXString &pattern, xFileFindInfo *info=NULL, unsigned int *timeOut=NULL) |
Fast check if matchin file exist in path. | |
DLL_TOOLSFUNCTION bool | fileMatchWilcards (const CXString &reffilename, const CHashTable< CXString > &hashMap) |
DLL_TOOLSFUNCTION bool | fileMatchWilcards (const CXString &filename, const CXString &pattern, bool caseSensitive) |
DLL_TOOLSFUNCTION CXString | fileCutName (const CXString &filename, int maxNameSize=-1) |
name couldn't be lower than 8 characters (without extension). | |
DLL_TOOLSFUNCTION CXString | fileRemoveNameDigitEnding (const CXString &filename, int &value) |
Remove the final name digit if any. Return the digit value or -1 if no digit is present. | |
DLL_TOOLSFUNCTION CXString | fileNextNumberedName (const CXString &filename, bool parenthesisFormat=true, int namesize=-1) |
Given a filename, it returns the next numbered filename without checking if the file exists or not. It example.jpg will return example1.jpg. | |
DLL_TOOLSFUNCTION CXString | fileCreateUniqueName (const CXString &filename, bool parenthesisFormat=true, int namesize=-1) |
the name is truncated if namesize > 0 | |
DLL_TOOLSFUNCTION CXString | fileCreateTmpName (const CXString &filename, bool allowUnicode=true) |
DLL_TOOLSFUNCTION bool | fileIsUNCPath (const CXString &filename) |
DLL_TOOLSFUNCTION CXString | fileGetRoot (const CXString &filename) |
DLL_TOOLSFUNCTION CXString | fileGetTopDirectory (const CXString &filename, bool slashTerminate=false) |
DLL_TOOLSFUNCTION CXString | fileStripPath (const CXString &filename, bool removeExtension=false) |
DLL_TOOLSFUNCTION CXString | fileStripName (const CXString &filename) |
DLL_TOOLSFUNCTION CXString | fileStripPathAndExtension (const CXString &filename) |
DLL_TOOLSFUNCTION CXString | fileRemoveExtension (const CXString &filename) |
DLL_TOOLSFUNCTION CXString | fileGetExtension (const CXString &filename) |
DLL_TOOLSFUNCTION bool | fileGetParentDirectory (CXString &path) |
Retrieve the parent directory of the provided directory (C:\tmp1\tmp2\ return C:\tmp1). If the path target a file, returns the parent directory of the file directory (C:\tmp1\tmp2\file.txt return C:\tmp1\) | |
DLL_TOOLSFUNCTION CXString | fileCleanExtensionList (const CXString &extlist, bool extByDefault=TRUE, CHashTable< CXString > *hashMap=NULL) |
DLL_TOOLSFUNCTION int | fileGetHashFromExtensionList (CXString &extlist, CHashTable< CXString > &hash, bool extByDefault=TRUE) |
DLL_TOOLSFUNCTION bool | fileGetExtensionInfo (unsigned int type, CFileExt &fileinfo) |
DLL_TOOLSFUNCTION int | fileGetExtensionArray (unsigned int fileclass, CXStringArray &array, bool addAsterisk=FALSE) |
DLL_TOOLSFUNCTION CXString | fileGetMainExtension (unsigned int fileclass) |
DLL_TOOLSFUNCTION CXString | fileGetMainExtension (const CXString &ext) |
DLL_TOOLSFUNCTION int | fileGetExtensionArrayByProperty (unsigned int fileproperty, CXStringArray &array, bool addAsterisk=FALSE, bool onlyMain=FALSE) |
DLL_TOOLSFUNCTION bool | fileGetFileExt (const CXString &extension, CFileExt &info) |
DLL_TOOLSFUNCTION unsigned int | fileFindParser (const CXString &filename, unsigned int properties) |
DLL_TOOLSFUNCTION unsigned int | fileGetProperties (const CXString &filename) |
DLL_TOOLSFUNCTION unsigned int | fileGetClass (const CXString &filename) |
DLL_TOOLSFUNCTION unsigned int | fileGetKindOf (const CXString &filename) |
DLL_TOOLSFUNCTION unsigned int | fileGetProperties (unsigned int fileclass) |
DLL_TOOLSFUNCTION unsigned int | fileGetKindOf (unsigned int fileclass) |
DLL_TOOLSFUNCTION unsigned int | fileGetLoader (const CXString &filename) |
DLL_TOOLSFUNCTION unsigned int | fileGetSaver (const CXString &filename) |
DLL_TOOLSFUNCTION bool | fileDelete (const CXString &filename) |
DLL_TOOLSFUNCTION bool | fileCopy (const CXString &srcfile, const CXString &newfile, bool dontOverwrite=true) |
DLL_TOOLSFUNCTION bool | fileRename (const CXString &srcfile, const CXString &dstfile) |
DLL_TOOLSFUNCTION bool | fileCreateDirectory (const CXString &dir, bool recurseCreate) |
DLL_TOOLSFUNCTION bool | fileRemoveDirectory (const CXString &dir, bool recurse, bool evenIfNotEmpty, CXStringArray *excludeExt=NULL) |
DLL_TOOLSFUNCTION int | fileGetFileCount (const CXString &dir, bool recurse) |
DLL_TOOLSFUNCTION CXString | fileCreateTmpFolder (const CXString &foldername, bool createFolder=true) |
Allows to define what kind of file a filename is.