SourceInfo.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_SourceInfo_H
00013 #define ZYPP_SourceInfo_H
00014 
00015 #include <list>
00016 
00017 #include <boost/logic/tribool.hpp>
00018 #include "zypp/Pathname.h"
00019 #include "zypp/Url.h"
00020 #include "zypp/CheckSum.h"
00021 #include "zypp/Date.h"
00022 
00024 namespace zypp
00025 { 
00026 namespace source
00027 {
00028 
00029   class SourceInfo
00030   {
00031     public:
00032 
00033     SourceInfo();
00034 
00035     SourceInfo( const Url & url, const Pathname & path, const std::string & alias = "", const Pathname & cache_dir = "", boost::tribool autorefresh = boost::indeterminate );
00036 
00037     SourceInfo & setEnabled( boost::tribool enabled );
00038     SourceInfo & setAutorefresh( boost::tribool autorefresh );
00039     SourceInfo & setBaseSource( bool val_r );
00040     SourceInfo & setUrl( const Url &url );
00041     SourceInfo & setPath( const Pathname &p );
00042     SourceInfo & setAlias( const std::string &alias );
00043     SourceInfo & setType( const std::string &t );
00044     SourceInfo & setCacheDir( const Pathname &p );
00045     SourceInfo & setDescription( const std::string &description );
00046     SourceInfo & setChecksum( const CheckSum &checksum );
00047     SourceInfo & setTimestamp( const Date &timestamp );
00048     boost::tribool enabled() const;
00049     boost::tribool autorefresh() const;
00050     boost::tribool baseSource() const;
00051     Pathname cacheDir() const;
00052     Pathname path() const;
00053     std::string alias() const;
00054     std::string type() const;
00055     std::string description() const;
00056     CheckSum checksum() const;
00057     Date timestamp() const;
00058     Url url() const;
00059 
00060 
00062     std::ostream & dumpOn( std::ostream & str ) const;
00063 
00064     private:
00065 
00066     boost::tribool _enabled;
00067     boost::tribool _autorefresh;
00068     boost::tribool _base_source;
00069     std::string _type;
00070     Url _url;
00071     Pathname _cache_dir;
00072     Pathname _path;
00073     std::string _alias;
00074     std::string _description;
00075     CheckSum _checksum;
00076     Date _timestamp;
00077   };
00078 
00080   inline std::ostream & operator<<( std::ostream & str, const SourceInfo & obj )
00081   { return obj.dumpOn( str ); }
00082 
00083   typedef std::list<SourceInfo> SourceInfoList;
00084 }
00086 } // namespace zypp
00088 #endif // ZYPP_SourceInfo_H

Generated on Tue Nov 28 16:49:32 2006 for zypp by  doxygen 1.5.0