Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

PkgBuild.C

Go to the documentation of this file.
00001 // Copyright (C) 2001, Compaq Computer Corporation
00002 // 
00003 // This file is part of Vesta.
00004 // 
00005 // Vesta is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 // 
00010 // Vesta is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with Vesta; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 // Created on Fri Feb 28 09:30:30 PST 1997 by heydon
00020 
00021 // Last modified on Mon Aug  9 17:02:42 EDT 2004 by ken@xorian.net
00022 //      modified on Mon Jan 26 21:24:25 PST 1998 by heydon
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(/*OUT*/ 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 }

Generated on Mon May 8 00:48:59 2006 for Vesta by  doxygen 1.4.2