00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <stdio.h>
00025 #include <Basics.H>
00026 #include <SourceOrDerived.H>
00027 #include <FS.H>
00028 #include <Model.H>
00029 #include "PkgBuild.H"
00030
00031 using std::istream;
00032 using std::ostream;
00033
00034 void PkgBuild::Write(ostream &ofs) const throw (FS::Failure)
00035 {
00036 this->pkgDirFP.Write(ofs);
00037 Model::Write(this->modelShortId, ofs);
00038 }
00039
00040 Word PkgBuild::Hash() const throw ()
00041 {
00042 Word res = this->pkgDirFP.Hash();
00043 res ^= (Word)(this->modelShortId);
00044 return res;
00045 }
00046
00047 PkgBuild& PkgBuild::operator= (const PkgBuild& pkg) throw ()
00048 {
00049 this->pkgDirFP = pkg.pkgDirFP;
00050 this->modelShortId = pkg.modelShortId;
00051 return *this;
00052 }
00053
00054 bool operator== (const PkgBuild& pkg1, const PkgBuild& pkg2) throw ()
00055 {
00056 return (pkg1.pkgDirFP == pkg2.pkgDirFP
00057 && pkg1.modelShortId == pkg2.modelShortId);
00058 }
00059
00060 void PkgBuild::Read(istream &ifs) throw (FS::EndOfFile, FS::Failure)
00061 {
00062 this->pkgDirFP.Read(ifs);
00063 Model::Read( this->modelShortId, ifs);
00064 }
00065
00066 void PkgBuild::Print(ostream &os, int indent) const throw ()
00067 {
00068 for (int i = 0; i < indent; i++) os << " ";
00069 os << "pkgDirFP = " << this->pkgDirFP << "; ";
00070 char buffer[20];
00071 int spres = sprintf(buffer, "%08x", this->modelShortId);
00072 assert(spres >= 0);
00073 os << "modelShortId = 0x" << buffer;
00074 }