|
Source code. Composite files |
Home page |
|
Nowadays it is very funny to look at a program made up of thousands of files scattered over different directories, even logos and icons, what is clearly unprofessional because This source contains two main classes and some accompanying functions. The classes are >COMPFILS file_header file_mask output_file where - file_header is a string (the first bytes in the new file) with no spaces used to identify if this is a right file when loaded - file_mask is a file mask to place into the new composite file, this routine is very old, so please use only 8.3 DOS filenames. IMPORTANT : it is recommended to name files to be collected like 0000.ext, 0001.ext ... because files before collection will be sorted by names and the entry number in the composite file will be equal to its place in the sorted order. No internal checks are performed. Just sorted and placed inside the file one by one. - output_file is a filename for the new composite file (also 8.3). For example, if in the current directory you have five files 000.BMP 001.BMP 002.BMP 003.BMP 004.BMP >compfils MY_BITMAPS *.bmp pbitmaps.cmp will generate a new composite file pbitmaps.cmp with header "MY_BITMAPS" with 5 entries, entry 0 - for file 000.BMP, entry 1 - for file 001.BMP etc. But, if, for example, you have files named as 000.BMP 001.BMP 003.BMP 004.BMP 005.BMP entry 0 will correspond to 000.BMP, 1 - to 001.BMP, 2 - to 002.BMP, 3 - to 004.BMP, and 4 - to 005.BMP. Now we have the composite file. Get access to its components using a class CCompFile derived from CFile. You seek file position by SetEntryPos(int index) and load data for this entry (see cadlectures.dsw VC++ project for working samples). |
||
|
|
||
| © Copyright 2007..2009 MI Simulators | ||