00001 /* vim: set sw=4 sts=4 et foldmethod=syntax : */ 00002 00003 /* 00004 * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh 00005 * 00006 * This file is part of the Paludis package manager. Paludis is free software; 00007 * you can redistribute it and/or modify it under the terms of the GNU General 00008 * Public License version 2, as published by the Free Software Foundation. 00009 * 00010 * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY 00011 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00012 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 00013 * details. 00014 * 00015 * You should have received a copy of the GNU General Public License along with 00016 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00017 * Place, Suite 330, Boston, MA 02111-1307 USA 00018 */ 00019 00020 #ifndef PALUDIS_GUARD_PALUDIS_USER_DEP_SPEC_HH 00021 #define PALUDIS_GUARD_PALUDIS_USER_DEP_SPEC_HH 1 00022 00023 #include <paludis/user_dep_spec-fwd.hh> 00024 #include <paludis/dep_spec.hh> 00025 #include <paludis/slot_requirement.hh> 00026 #include <paludis/filter.hh> 00027 #include <paludis/util/private_implementation_pattern.hh> 00028 00029 namespace paludis 00030 { 00031 /** 00032 * Create a PackageDepSpec from user input. 00033 * 00034 * \ingroup g_dep_spec 00035 * \since 0.28 00036 */ 00037 PackageDepSpec parse_user_package_dep_spec( 00038 const std::string &, 00039 const Environment * const, 00040 const UserPackageDepSpecOptions &, 00041 const Filter & = filter::All()) PALUDIS_VISIBLE; 00042 00043 class PALUDIS_VISIBLE UserSlotExactRequirement : 00044 public SlotExactRequirement 00045 { 00046 private: 00047 const SlotName _s; 00048 00049 public: 00050 ///\name Basic operations 00051 ///\{ 00052 00053 UserSlotExactRequirement(const SlotName &); 00054 00055 ///\} 00056 00057 virtual const SlotName slot() const PALUDIS_ATTRIBUTE((warn_unused_result)); 00058 virtual const std::string as_string() const PALUDIS_ATTRIBUTE((warn_unused_result)); 00059 }; 00060 00061 /** 00062 * A key requirement for a user PackageDepSpec. 00063 * 00064 * \since 0.36 00065 * \ingroup g_dep_spec 00066 */ 00067 class PALUDIS_VISIBLE UserKeyRequirement : 00068 public AdditionalPackageDepSpecRequirement, 00069 private PrivateImplementationPattern<UserKeyRequirement> 00070 { 00071 public: 00072 ///\name Basic operations 00073 ///\{ 00074 00075 UserKeyRequirement(const std::string &); 00076 ~UserKeyRequirement(); 00077 00078 ///\} 00079 00080 virtual bool requirement_met(const Environment * const, const PackageID &) const PALUDIS_ATTRIBUTE((warn_unused_result)); 00081 virtual const std::string as_human_string() const PALUDIS_ATTRIBUTE((warn_unused_result)); 00082 virtual const std::string as_raw_string() const PALUDIS_ATTRIBUTE((warn_unused_result)); 00083 }; 00084 00085 #ifdef PALUDIS_HAVE_EXTERN_TEMPLATE 00086 extern template class PrivateImplementationPattern<UserKeyRequirement>; 00087 #endif 00088 } 00089 00090 #endif