17#include <boost/logic/tribool.hpp>
40 typedef boost::logic::tribool
TriBool;
41 using boost::logic::tribool;
42 using boost::logic::indeterminate;
44 inline std::string
asString(
const TriBool & val_r,
const std::string & istr_r = std::string(),
45 const std::string & tstr_r = std::string(),
46 const std::string & fstr_r = std::string() )
49 if (indeterminate(val_r))
50 ret = ( istr_r.empty() ?
"indeterminate" : istr_r );
52 ret = ( tstr_r.empty() ?
"true" : tstr_r );
54 ret = ( fstr_r.empty() ?
"false" : fstr_r );
60 {
return indeterminate(val_r) ? default_r :
bool(val_r); }
70 inline std::ostream &
operator<<(std::ostream & s,
const tribool & obj)
74 inline bool sameTriboolState( tribool lhs, tribool rhs )
75 {
return( ( indeterminate(lhs) && indeterminate(rhs) ) || (
bool )( lhs == rhs ) ); }
std::ostream & operator<<(std::ostream &str, const zypp::sat::detail::CDataiterator *obj)
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
std::string asString(TInt val, char zero='0', char one='1')
For printing bits.
Easy-to use interface to the ZYPP dependency resolver.
bool tri2bool(const TriBool &val_r, bool default_r)
Convert TriBool to bool returning default_r if indeterminate.
std::string asString(const Patch::Category &obj)