From b2d05fe9b9c117fd9ab597ad5ff8a2d68ba7cc6e Mon Sep 17 00:00:00 2001 From: Jiri Srain Date: Wed, 8 Feb 2006 22:49:31 +0000 Subject: [PATCH] updated pattern interface classes --- zypp/Pattern.cc | 15 +++++++++++++++ zypp/Pattern.h | 13 +++++++++++++ zypp/detail/Makefile.am | 1 + zypp/detail/PatternImplIf.cc | 43 +++++++++++++++++++++++++++++++++++++++++++ zypp/detail/PatternImplIf.h | 38 +++++++++++--------------------------- 5 files changed, 83 insertions(+), 27 deletions(-) create mode 100644 zypp/detail/PatternImplIf.cc diff --git a/zypp/Pattern.cc b/zypp/Pattern.cc index a6cc61e..75ee4e6 100644 --- a/zypp/Pattern.cc +++ b/zypp/Pattern.cc @@ -41,6 +41,21 @@ namespace zypp // Pattern interface forwarded to implementation // /////////////////////////////////////////////////////////////////// + /** */ + bool Pattern::isDefault() const + { return pimpl().isDefault(); } + /** */ + bool Pattern::userVisible() const + { return pimpl().userVisible(); } + /** */ + std::string Pattern::category() const + { return pimpl().category(); } + /** */ + Pathname Pattern::icon() const + { return pimpl().icon(); } + /** */ + Pathname Pattern::script() const + { return pimpl().script(); } ///////////////////////////////////////////////////////////////// diff --git a/zypp/Pattern.h b/zypp/Pattern.h index 2e2d850..136f3c5 100644 --- a/zypp/Pattern.h +++ b/zypp/Pattern.h @@ -14,6 +14,7 @@ #include "zypp/ResObject.h" #include "zypp/detail/PatternImplIf.h" +#include "zypp/Pathname.h" /////////////////////////////////////////////////////////////////// namespace zypp @@ -36,6 +37,18 @@ namespace zypp public: /** */ + std::string patternId() const; + /** */ + bool isDefault() const; + /** */ + bool userVisible() const; + /** */ + std::string category() const; + /** */ + Pathname icon() const; + /** */ + Pathname script() const; + /** */ // data here: protected: diff --git a/zypp/detail/Makefile.am b/zypp/detail/Makefile.am index 27e12bf..8d74f87 100644 --- a/zypp/detail/Makefile.am +++ b/zypp/detail/Makefile.am @@ -39,6 +39,7 @@ lib@PACKAGE@_detail_la_SOURCES = \ ResObjectImplIf.cc \ PackageImplIf.cc \ SelectionImplIf.cc \ + PatternImplIf.cc \ MessageImplIf.cc \ ScriptImplIf.cc \ PatchImplIf.cc \ diff --git a/zypp/detail/PatternImplIf.cc b/zypp/detail/PatternImplIf.cc new file mode 100644 index 0000000..4469db7 --- /dev/null +++ b/zypp/detail/PatternImplIf.cc @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ +/** \file zypp/detail/PatternImplIf.cc + * +*/ + +#include "zypp/detail/PatternImplIf.h" + +/////////////////////////////////////////////////////////////////// +namespace zypp +{ ///////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + namespace detail + { ///////////////////////////////////////////////////////////////// + + bool PatternImplIf::isDefault() const + { return false; } + + bool PatternImplIf::userVisible() const + { return true; } + + std::string PatternImplIf::category() const + { return std::string(); } + + Pathname PatternImplIf::icon() const + { return Pathname(); } + + Pathname PatternImplIf::script() const + { return Pathname(); } + + ///////////////////////////////////////////////////////////////// + } // namespace detail + /////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////// +} // namespace zypp +/////////////////////////////////////////////////////////////////// diff --git a/zypp/detail/PatternImplIf.h b/zypp/detail/PatternImplIf.h index 7d82a4a..fddfe58 100644 --- a/zypp/detail/PatternImplIf.h +++ b/zypp/detail/PatternImplIf.h @@ -13,6 +13,8 @@ #define ZYPP_DETAIL_PATTERNIMPLIF_H #include "zypp/detail/ResObjectImplIf.h" +#include "zypp/Pathname.h" +#include /////////////////////////////////////////////////////////////////// namespace zypp @@ -36,33 +38,15 @@ namespace zypp typedef Pattern ResType; public: -#if 0 - virtual std::string summary( const LangCode & lang = LangCode("") ) const; - virtual std::list description( const LangCode & lang = LangCode("") ) const; - virtual std::list insnotify( const LangCode & lang = LangCode("") ) const; - virtual std::list delnotify( const LangCode & lang = LangCode("") ) const; - virtual ByteCount size() const; - virtual bool providesSources() const; - virtual std::string instSrcLabel() const; - virtual Vendor instSrcVendor() const; - virtual unsigned instSrcRank() const; - virtual std::string category() const; - virtual bool visible() const; - virtual std::list suggests() const; - virtual std::list suggests_ptrs() const; - virtual std::list recommends() const; - virtual std::list recommends_ptrs() const; - virtual std::list inspacks( const LangCode & lang = LangCode("") ) const; - virtual std::list delpacks( const LangCode & lang = LangCode("") ) const; - virtual PM::LocaleSet supportedLocales() const; - virtual std::set pureInspacks_ptrs( const LangCode & lang ) const; - virtual std::set inspacks_ptrs( const LangCode & lang ) const; - virtual std::set delpacks_ptrs( const LangCode & lang ) const; - virtual ByteCount archivesize() const; - virtual std::string order() const; - virtual bool isBase() const; - virtual PMError provideSelToInstall( Pathname & path_r ) const; -#endif + virtual bool isDefault() const PURE_VIRTUAL; + + virtual bool userVisible() const PURE_VIRTUAL; + + virtual std::string category() const PURE_VIRTUAL; + + virtual Pathname icon() const PURE_VIRTUAL; + + virtual Pathname script() const PURE_VIRTUAL; }; /////////////////////////////////////////////////////////////////// -- 2.7.4