00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef ZYPP_ZYPP_DETAIL_ZYPPIMPL_H 00013 #define ZYPP_ZYPP_DETAIL_ZYPPIMPL_H 00014 00015 #include <iosfwd> 00016 00017 #include "zypp/TmpPath.h" 00018 #include "zypp/ResPoolManager.h" 00019 #include "zypp/SourceFeed.h" 00020 #include "zypp/Target.h" 00021 #include "zypp/Resolver.h" 00022 #include "zypp/Locale.h" 00023 #include "zypp/KeyRing.h" 00024 #include "zypp/ZYppCommit.h" 00025 #include "zypp/DiskUsageCounter.h" 00026 00027 using namespace zypp::filesystem; 00028 00030 namespace zypp 00031 { 00032 00033 namespace zypp_detail 00034 { 00035 00037 // 00038 // CLASS NAME : ZYppImpl 00039 // 00041 class ZYppImpl 00042 { 00043 friend std::ostream & operator<<( std::ostream & str, const ZYppImpl & obj ); 00044 00045 public: 00047 ZYppImpl(); 00049 ~ZYppImpl(); 00050 00051 private: 00052 void removeInstalledResolvables (); 00053 00054 public: 00056 ResPool pool() const 00057 { return _pool.accessor(); } 00058 00059 ResPoolProxy poolProxy() const 00060 { return _pool.proxy(); } 00061 00063 SourceFeed_Ref sourceFeed() const 00064 { return _sourceFeed; } 00065 00067 KeyRing_Ptr keyRing() const 00068 { return _keyring; } 00069 00070 00071 Resolver_Ptr resolver() const 00072 { return _resolver; } 00073 00074 void addResolvables (const ResStore& store, bool installed = false); 00075 00076 void removeResolvables (const ResStore& store); 00077 00078 public: 00083 Target_Ptr target() const; 00084 00089 void initTarget(const Pathname & root, bool commit_only = false); 00090 00094 void finishTarget(); 00095 00097 ZYppCommitResult commit( const ZYppCommitPolicy & policy_r ); 00098 00099 public: 00101 void setTextLocale( const Locale & textLocale_r ) 00102 { _textLocale = textLocale_r; } 00104 Locale getTextLocale() const 00105 { return _textLocale; } 00106 private: 00107 Locale _textLocale; 00108 00109 public: 00110 typedef std::set<Locale> LocaleSet; 00112 void setRequestedLocales( const LocaleSet & locales_r ); 00114 LocaleSet getRequestedLocales() const; 00116 LocaleSet getAvailableLocales() const; 00117 00119 void availableLocale( const Locale & locale_r ); 00120 00121 public: 00123 Arch architecture() const 00124 { return _architecture; } 00128 void setArchitecture( const Arch & arch ); 00129 00131 Pathname homePath() const; 00132 00134 Pathname tmpPath() const; 00135 00137 void setHomePath( const Pathname & path ); 00138 00139 public: 00140 DiskUsageCounter::MountPointSet diskUsage(); 00141 void setPartitions(const DiskUsageCounter::MountPointSet &mp); 00142 00143 private: 00145 ResPoolManager _pool; 00147 SourceFeed_Ref _sourceFeed; 00149 Target_Ptr _target; 00151 Resolver_Ptr _resolver; 00152 00153 KeyRing_Ptr _keyring; 00155 Arch _architecture; 00157 Pathname _home_path; 00159 DiskUsageCounter _disk_usage; 00160 }; 00162 00164 std::ostream & operator<<( std::ostream & str, const ZYppImpl & obj ); 00165 00167 } // namespace zypp_detail 00170 } // namespace zypp 00172 #endif // ZYPP_ZYPP_DETAIL_ZYPPIMPL_H