jigdo API

JigdoDescVec Class Reference

Container for JidoDesc objects. More...

#include <mkimage.hh>

List of all members.


Public Member Functions

 JigdoDescVec ()
 ~JigdoDescVec ()
bistreamget (bistream &file) throw (JigdoDescError, bad_alloc)
 Read JigdoDescs from a template file into *this.
bostreamput (bostream &file, MD5Sum *md=0) const
 Write a DESC section to a binary stream.
void list (ostream &s) throw ()
 List contents of a JigdoDescVec to a stream in human-readable format.

Detailed Description

Container for JidoDesc objects.

Is mostly a vector<JidoDesc*>, but deletes elements when destroyed. However, when removing elements, resizing the JigdoDescVec etc., the elements are *not* deleted automatically.


Constructor & Destructor Documentation

JigdoDescVec::JigdoDescVec (  )  [inline]

JigdoDescVec::~JigdoDescVec (  )  [inline]

References end.


Member Function Documentation

bistream & JigdoDescVec::get ( bistream file  )  throw (JigdoDescError, bad_alloc)

Read JigdoDescs from a template file into *this.

*this is clear()ed first. File pointer must be at start of first entry; the "DESC" must have been read already. If error is thrown, position of file pointer is undefined. A type 1 (IMAGE_INFO) will end up at this->back().

References _, debug, JigdoDesc::IMAGE_INFO, JigdoDesc::MATCHED_FILE, JigdoDesc::OBSOLETE_IMAGE_INFO, JigdoDesc::OBSOLETE_MATCHED_FILE, JigdoDesc::OBSOLETE_WRITTEN_FILE, off, RsyncSum64::reset(), RsyncSum64::serialSizeOf(), MD5::serialSizeOf(), JigdoDesc::ImageInfo::size(), subst, MD5::toString(), JigdoDesc::type(), JigdoDesc::UNMATCHED_DATA, unserialize(), unserialize4(), unserialize6(), and JigdoDesc::WRITTEN_FILE.

bostream & JigdoDescVec::put ( bostream file,
MD5Sum md = 0 
) const

Write a DESC section to a binary stream.

Note that there should not be two contiguous Unmatched regions - this is not checked. Similarly, the length of the ImageInfo part must match the accumulated lengths of the other parts.

References Assert, buf, DEBUG, end, info, JigdoDesc::MatchedFile::serialize(), JigdoDesc::WrittenFile::serialize(), JigdoDesc::UnmatchedData::serialize(), JigdoDesc::ImageInfo::serialize(), serialize4(), serialize6(), MD5Sum::update(), and writeBytes().

Referenced by operator<<().

void JigdoDescVec::list ( ostream &  s  )  throw ()

List contents of a JigdoDescVec to a stream in human-readable format.

References end, and flush().


The documentation for this class was generated from the following files:

Generated on Tue Sep 23 14:27:42 2008 for jigdo by  doxygen 1.5.6