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 initializeTarget(const Pathname & root); 00090 00095 ZYPP_DEPRECATED void initTarget(const Pathname & root, bool commit_only); 00096 00100 void finishTarget(); 00101 00103 ZYppCommitResult commit( const ZYppCommitPolicy & policy_r ); 00104 00105 public: 00107 void setTextLocale( const Locale & textLocale_r ) 00108 { _textLocale = textLocale_r; } 00110 Locale getTextLocale() const 00111 { return _textLocale; } 00112 private: 00113 Locale _textLocale; 00114 00115 public: 00116 typedef std::set<Locale> LocaleSet; 00118 void setRequestedLocales( const LocaleSet & locales_r ); 00120 LocaleSet getRequestedLocales() const; 00122 LocaleSet getAvailableLocales() const; 00123 00125 void availableLocale( const Locale & locale_r ); 00126 00127 public: 00129 Arch architecture() const 00130 { return _architecture; } 00134 void setArchitecture( const Arch & arch ); 00135 00137 Pathname homePath() const; 00138 00140 Pathname tmpPath() const; 00141 00143 void setHomePath( const Pathname & path ); 00144 00145 public: 00146 DiskUsageCounter::MountPointSet diskUsage(); 00147 void setPartitions(const DiskUsageCounter::MountPointSet &mp); 00148 00149 private: 00151 ResPoolManager _pool; 00153 SourceFeed_Ref _sourceFeed; 00155 Target_Ptr _target; 00157 Resolver_Ptr _resolver; 00158 00159 KeyRing_Ptr _keyring; 00161 Arch _architecture; 00163 Pathname _home_path; 00165 DiskUsageCounter _disk_usage; 00166 }; 00168 00170 std::ostream & operator<<( std::ostream & str, const ZYppImpl & obj ); 00171 00173 } // namespace zypp_detail 00176 } // namespace zypp 00178 #endif // ZYPP_ZYPP_DETAIL_ZYPPIMPL_H
1.5.0