/* * Copyright (c) 2001, Robert Collins. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * A copy of the GNU General Public License can be found at * http://www.gnu.org/ * * Written by Robert Collins * */ /* this is the parent class for all package operations. */ #if 0 static const char *cvsid = "\n%%% $Id$\n"; #endif #include "package_version.h" #include "package_db.h" #include "package_meta.h" #include "LogSingleton.h" #include "state.h" #include "resource.h" #include using namespace std; /* a default class to avoid special casing empty packageversions */ /* TODO place into the class header */ class _defaultversion : public _packageversion { public: _defaultversion() { // never try to free me! ++references; } String const Name(){return String();} String const Vendor_version() {return String();} String const Package_version() {return String();} String const Canonical_version() {return String();} void setCanonicalVersion (String const &) {} package_status_t Status (){return package_notinstalled;} package_type_t Type () {return package_binary;} String const getfirstfile () {return String();} String const getnextfile () {return String();} String const SDesc () {return String();} void set_sdesc (String const &) {} String const LDesc () {return String();} void set_ldesc (String const &) {} void uninstall (){} void pick(bool const &newValue){/* Ignore attempts to pick this!. Throw an exception here if you want to detect such attemtps instead */} virtual void addScript(Script const &) {} virtual std::vector