1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/DownloadMode.h
12 #ifndef ZYPP_DOWNLOADMODE_H
13 #define ZYPP_DOWNLOADMODE_H
17 ///////////////////////////////////////////////////////////////////
19 { /////////////////////////////////////////////////////////////////
21 /** Supported commit download policies. */
24 DownloadDefault, //!< libzypp will decide what to do.
25 DownloadOnly, //!< Just download all packages to the local cache.
26 //!< Do not install. Implies a dry-run.
27 DownloadInAdvance, //!< First download all packages to the local cache.
28 //!< Then start to install.
29 DownloadInHeaps, //!< Similar to DownloadInAdvance, but try to split
30 //!< the transaction into heaps, where at the end of
31 //!< each heap a consistent system state is reached.
32 DownloadAsNeeded //!< Alternating download and install. Packages are
33 //!< cached just to avid CD/DVD hopping. This is the
34 //!< traditional behaviour.
37 /** \relates DownloadMode Parse from string.
38 * On success the \ref DownloadMode is returned via \a result_r,
39 * and the function returns \c true. Otherwise it returns \c false
40 * and \a result_r remains unchanged.
42 bool deserialize( const std::string & str_r, DownloadMode & result_r );
44 /** \relates DownloadMode Parse from string.
45 * Similar as \ref deserialize, but silently return \ref DownloadDefault
46 * in case of a parse error.
48 inline DownloadMode deserializeDownloadMode( const std::string & str_r )
50 DownloadMode ret( DownloadDefault );
51 deserialize( str_r, ret );
55 /** \relates DownloadMode Stream output. */
56 std::ostream & operator<<( std::ostream & str, DownloadMode obj );
58 /////////////////////////////////////////////////////////////////
60 ///////////////////////////////////////////////////////////////////
61 #endif // ZYPP_DOWNLOADMODE_H