MkTemplate Class ReferenceCreate location list (jigdo) and image template (template) from one big file and a list of files. More...
Public Member Functions
|MkTemplate (JigdoCache *jcache, bistream *imageStream, JigdoConfig *jigdoInfo, bostream *templateStream, ProgressReporter &pr=noReport, int zipQuality=9, size_t readAmnt=128U *1024, bool addImage=true, bool addServers=true, bool useBzip2=false)|
|A create operation with no files known to it yet. |
|void||setMatchExec (const string &me)|
|Set command(s) to be executed when a file matches. |
|void||setGreedyMatching (bool x)|
|Set and get whether to skip smaller matches if a larger match could be possible (with the risk to skip both). |
|bool||getGreedyMatching () const|
|bool||run (const string &imageLeafName="image", const string &templLeafName="template")|
|First scan through all the individual files, creating checksums, then read image file and find matches. |
Static Public Attributes
|Default reporter: Only prints error messages to stderr. |
|Build up a template DESC section by appending items to a JigdoDescVec. More...|
|One object for each offset in image where any file /might/ match. More...|
|Queue of PartialMatch objects, always kept sorted by ascending nextEvent. More...|
|Index over JigdoParts by md5sum string. More...|
|Line content with whitespace and '=' removed and left/right side swapped, i.e. More...|
|Class allowing MkTemplate to convey information back to the creator of a MkTemplate object. More...|
Detailed DescriptionCreate location list (jigdo) and image template (template) from one big file and a list of files.
The template file contains a compressed version of the big file, excluding the data of any of the other files that are contained somewhere in the big file. Instead of their data, the image template file just lists their checksums.
Constructor & Destructor Documentation
|ProgressReporter &|| pr =
|int|| zipQuality =
|size_t|| readAmnt =
|bool|| addImage =
|bool|| addServers =
|bool|| useBzip2 = |
A create operation with no files known to it yet.
jcache Cache for the files (will not be deleted in dtor) imageStream The large image file jigdoInfo Where to output .jigdo data to templateStream Stream for outputting binary image template pr Function object which is called at regular intervals during run() to inform about files scanned, nr of bytes scanned, matches found etc. zipQuality 0 (fast) to 9 (smallest output) readAmnt Number of bytes that are read at a time with one read() call by the operation before the data is processed. Should not be too large because the OS copes best when small bits of I/O are interleaved with small bits of CPU work. In practice, the default seems to work well. addImage Add a [Image] section to the output .jigdo. addServers Add a [Servers] section to the output .jigdo. useBzip2 false=>gzip, true=>bzip2
Member Function Documentation
|void MkTemplate::setMatchExec||(||const string &||me||)||
Set command(s) to be executed when a file matches.
Set and get whether to skip smaller matches if a larger match could be possible (with the risk to skip both).
True <=> prefer small matches; false <=> skip small, prefer large
|bool MkTemplate::getGreedyMatching||(||)|| const
|bool MkTemplate::run||(||const string &|| imageLeafName =
|const string &|| templLeafName = |
First scan through all the individual files, creating checksums, then read image file and find matches.
Write .template and .jigdo files.
imageLeafName Name for the image, which should be a relative path name. This does not need to be similar to the filename that the image has now - it is *only* used when creating the .jigdo file, nowhere else. It is the name that will be used when someone reassembles the image. templLeafName Name to write to jigdo file as template URL. Can be a full http/ftp URL, or a relative URL.
- returns FAILURE if any open/read/write/close failed, unless it was that of a file with reportErrors==false.
References append(), Assert, JigdoCache::begin(), bitWidth(), JigdoCache::deallocBuffer(), JigdoCache::end(), MD5Sum::finish(), ArrayAutoPtr< X >::get(), JigdoCache::getBlockLen(), JigdoCache::getMD5BlockLen(), JIGDO_VERSION, Paranoid, MD5Sum::update(), and writeBytes().
Referenced by main().
Friends And Related Function Documentation
|friend class PartialMatchQueue
Member Data Documentation
Default reporter: Only prints error messages to stderr.
The documentation for this class was generated from the following files:
Generated on Tue Sep 23 14:27:43 2008 for jigdo by 1.5.6