libzypp 8.13.6
|
00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef REPOINFOBASE_H_ 00013 #define REPOINFOBASE_H_ 00014 00015 #include <iosfwd> 00016 00017 #include "zypp/base/PtrTypes.h" 00018 00019 #include "zypp/Pathname.h" 00020 00022 namespace zypp 00023 { 00024 00025 namespace repo 00026 { 00027 00029 // 00030 // CLASS NAME : RepoInfoBase 00031 // 00036 class RepoInfoBase 00037 { 00038 friend std::ostream & operator<<( std::ostream & str, const RepoInfoBase & obj ); 00039 00040 public: 00041 RepoInfoBase(); 00042 RepoInfoBase(const std::string & alias); 00043 virtual ~RepoInfoBase(); 00044 00052 std::string alias() const; 00053 00057 std::string escaped_alias() const; 00058 00065 std::string name() const; 00066 00072 std::string label() const; 00073 00078 bool enabled() const; 00079 00084 bool autorefresh() const; 00085 00092 Pathname filepath() const; 00093 00094 00095 public: 00096 00101 void setAlias( const std::string &alias ); 00102 00107 void setName( const std::string &name ); 00108 00113 void setEnabled( bool enabled ); 00114 00119 void setAutorefresh( bool autorefresh ); 00120 00129 void setFilepath( const Pathname &filename ); 00130 00135 virtual std::ostream & dumpOn( std::ostream & str ) const; 00136 00141 virtual std::ostream & dumpAsIniOn( std::ostream & str ) const; 00142 00147 virtual std::ostream & dumpAsXMLOn(std::ostream & str) const; 00148 00152 virtual std::ostream & dumpAsXMLOn( 00153 std::ostream & str, const std::string & content) const; 00154 00155 class Impl; 00156 private: 00158 RWCOW_pointer<Impl> _pimpl; 00159 }; 00161 00163 inline bool operator==( const RepoInfoBase & lhs, const RepoInfoBase & rhs ) 00164 { return lhs.alias() == rhs.alias(); } 00165 00167 inline bool operator!=( const RepoInfoBase & lhs, const RepoInfoBase & rhs ) 00168 { return lhs.alias() != rhs.alias(); } 00169 00170 inline bool operator<( const RepoInfoBase & lhs, const RepoInfoBase & rhs ) 00171 { return lhs.alias() < rhs.alias(); } 00172 00174 std::ostream & operator<<( std::ostream & str, const RepoInfoBase & obj ); 00175 00177 typedef shared_ptr<RepoInfoBase> RepoInfoBase_Ptr; 00179 typedef shared_ptr<const RepoInfoBase> RepoInfoBase_constPtr; 00180 00181 00183 } // namespace repo 00186 } // namespace zypp 00188 00189 #endif /*REPOINFOBASE_H_*/