jigdo API
JigdoDesc Class Reference
Entry in a DESC section of a jigdo template. More...
#include <mkimage.hh>

Public Types | |
enum | Type { IMAGE_INFO = 5, UNMATCHED_DATA = 2, MATCHED_FILE = 6, WRITTEN_FILE = 7, OBSOLETE_IMAGE_INFO = 1, OBSOLETE_MATCHED_FILE = 3, OBSOLETE_WRITTEN_FILE = 4 } |
Types of entries in a description section. More... | |
Public Member Functions | |
virtual bool | operator== (const JigdoDesc &x) const =0 |
bool | operator!= (const JigdoDesc &x) const |
virtual | ~JigdoDesc ()=0 |
virtual Type | type () const =0 |
Entry type of JigdoDesc child class. | |
virtual ostream & | put (ostream &s) const =0 |
Output human-readable summary. | |
virtual uint64 | size () const =0 |
Size of image area or whole image. | |
virtual size_t | serialSizeOf () const =0 |
There are no virtual templates, so this wouldn't work: template<class Iterator> virtual Iterator serialize(Iterator i) const; . | |
Static Public Member Functions | |
static bool | isTemplate (bistream &file) |
Check whether the file is a .template file, i.e. | |
static void | seekFromEnd (bistream &file) throw (JigdoDescError) |
Assuming that a DESC section is at the end of a file, set the file pointer to the start of the section, allowing you to call read() immediately afterwards. | |
static int | makeImage (JigdoCache *cache, const string &imageFile, const string &imageTmpFile, const string &templFile, bistream *templ, const bool optForce, ProgressReporter &pr=noReport, size_t readAmnt=128U *1024, const bool optMkImageCheck=true) |
Create image file from template and files (via JigdoCache). | |
static int | listMissing (set< MD5 > &result, const string &imageTmpFile, const string &templFile, bistream *templ, ProgressReporter &reporter) |
Return list of MD5sums of files that still need to be copied to the image to complete it. | |
Classes | |
class | ImageInfo |
Information about the image file. More... | |
class | MatchedFile |
Info about data that *was* matched by an input file. More... | |
class | ProgressReporter |
Class allowing JigdoDesc to convey information back to the caller. More... | |
class | UnmatchedData |
Info about data that was not matched by any input file, i.e. More... | |
class | WrittenFile |
Like MatchedFile - used only in .tmp files to express that the file data was successfully written to the image. More... |
Detailed Description
Entry in a DESC section of a jigdo template.This definition is used both for an abstract base class and as a namespace for child classes.
Member Enumeration Documentation
enum JigdoDesc::Type |
Constructor & Destructor Documentation
JigdoDesc::~JigdoDesc | ( | ) | [pure virtual] |
Member Function Documentation
virtual bool JigdoDesc::operator== | ( | const JigdoDesc & | x | ) | const [pure virtual] |
Implemented in JigdoDesc::ImageInfo, JigdoDesc::UnmatchedData, JigdoDesc::MatchedFile, and JigdoDesc::WrittenFile.
bool JigdoDesc::operator!= | ( | const JigdoDesc & | x | ) | const [inline] |
virtual Type JigdoDesc::type | ( | ) | const [pure virtual] |
Entry type of JigdoDesc child class.
Implemented in JigdoDesc::ImageInfo, JigdoDesc::UnmatchedData, JigdoDesc::MatchedFile, and JigdoDesc::WrittenFile.
Referenced by JigdoDescVec::get().
virtual ostream& JigdoDesc::put | ( | ostream & | s | ) | const [pure virtual] |
Output human-readable summary.
Implemented in JigdoDesc::ImageInfo, JigdoDesc::UnmatchedData, JigdoDesc::MatchedFile, and JigdoDesc::WrittenFile.
Referenced by operator<<().
virtual uint64 JigdoDesc::size | ( | ) | const [pure virtual] |
Size of image area or whole image.
Implemented in JigdoDesc::ImageInfo, JigdoDesc::UnmatchedData, and JigdoDesc::MatchedFile.
virtual size_t JigdoDesc::serialSizeOf | ( | ) | const [pure virtual] |
There are no virtual templates, so this wouldn't work: template<class Iterator> virtual Iterator serialize(Iterator i) const;
.
Implemented in JigdoDesc::ImageInfo, JigdoDesc::UnmatchedData, JigdoDesc::MatchedFile, and JigdoDesc::WrittenFile.
bool JigdoDesc::isTemplate | ( | bistream & | file | ) | [static] |
Check whether the file is a .template file, i.e.
has the appropriate ASCII header
References compat_compare().
Referenced by main(), readTemplate(), and writeAll().
void JigdoDesc::seekFromEnd | ( | bistream & | file | ) | throw (JigdoDescError) [static] |
Assuming that a DESC section is at the end of a file, set the file pointer to the start of the section, allowing you to call read() immediately afterwards.
References _, buf, debug, end, readBytes(), and unserialize6().
Referenced by main(), readTemplate(), and readTmpFile().
int JigdoDesc::makeImage | ( | JigdoCache * | cache, | |
const string & | imageFile, | |||
const string & | imageTmpFile, | |||
const string & | templFile, | |||
bistream * | templ, | |||
const bool | optForce, | |||
ProgressReporter & | pr = noReport , |
|||
size_t | readAmnt = 128U*1024 , |
|||
const bool | optMkImageCheck = true | |||
) | [static] |
Create image file from template and files (via JigdoCache).
References _, Assert, JigdoCache::begin(), compat_rename(), CREATE_TMP, debug, JigdoCache::end(), JigdoDesc::ProgressReporter::error(), error_CouldntRename(), files, IMAGE_INFO, imageSize, info, JigdoDesc::ProgressReporter::info(), info_NeedMoreFiles(), MATCHED_FILE, md, JigdoDesc::MatchedFile::md5(), MERGE_TMP, msg, out, Paranoid, readTemplate(), readTmpFile(), SINGLE_PASS, JigdoDesc::MatchedFile::size(), subst, MD5::toString(), writeAll(), and writeMerge().
Referenced by main().
int JigdoDesc::listMissing | ( | set< MD5 > & | result, | |
const string & | imageTmpFile, | |||
const string & | templFile, | |||
bistream * | templ, | |||
ProgressReporter & | reporter | |||
) | [static] |
Return list of MD5sums of files that still need to be copied to the image to complete it.
Reads info from tmp file or (if imageTmpFile.empty() or error opening tmp file) outputs complete list from template.
References _, JigdoDesc::ProgressReporter::info(), MATCHED_FILE, JigdoDesc::MatchedFile::md5(), msg, readTemplate(), readTmpFile(), subst, swap(), and JigdoDesc::MatchedFile::type().
The documentation for this class was generated from the following files:
Generated on Tue Sep 23 14:27:42 2008 for jigdo by
