12#ifndef ZYPP_BASE_LOGTOOLS_H
13#define ZYPP_BASE_LOGTOOLS_H
59 {
if (
obj._first )
obj._first =
false;
else str <<
obj._sep;
return str; }
118 template<
class TIterator>
120 TIterator begin, TIterator end,
121 const std::string &
intro =
"{",
122 const std::string &
pfx =
"\n ",
123 const std::string &
sep =
"\n ",
124 const std::string &
sfx =
"\n",
125 const std::string &
extro =
"}" )
131 for ( ++begin; begin != end; ++begin )
141 template<
class TIterator>
143 TIterator begin, TIterator end )
144 {
return dumpRange(
str, begin, end,
"(",
"",
", ",
"",
")" ); }
146 template<
class TContainer>
158 template<
class TIterator>
170 template<
class TIterator>
184 template<
class TIterator>
188 template<
class TContainer>
196 template<
class Tp,
class TCmp,
class TAlloc>
217 namespace _logtoolsdetail
229 template<
class TPair>
245 template<
class TPair>
248 return str <<
'[' <<
obj.pair().first <<
"] = " <<
obj.pair().second;
252 template<
class TPair>
275 {
return mapEntry(
pair_r ); }
403 using _logtoolsdetail::mapEntry;
404 using _logtoolsdetail::dumpMap;
405 using _logtoolsdetail::dumpKeys;
406 using _logtoolsdetail::dumpValues;
408 template<
class TKey,
class Tp>
410 {
return str << dumpMap(
obj ); }
412 template<
class TKey,
class Tp>
414 {
return str << dumpMap(
obj ); }
416 template<
class TKey,
class Tp>
418 {
return str << dumpMap(
obj ); }
431 std::string
ret(
"[" );
432 ret += (
obj.good() ?
'g' :
'_' );
433 ret += (
obj.eof() ?
'e' :
'_' );
434 ret += (
obj.fail() ?
'F' :
'_' );
435 ret += (
obj.bad() ?
'B' :
'_' );
471 inline std::ostream &
hexdumpOn( std::ostream &
outs,
const unsigned char *
ptr,
size_t size )
474 unsigned width = 0x10;
475 outs <<
str::form(
"hexdump %10.10ld bytes (0x%8.8lx):\n", (
long)size, (
long)size );
477 for (
i = 0;
i < size;
i +=
width ) {
487 for (
c = 0; (
c <
width) && (
i+
c < size); ++
c ) {
503 inline std::ostream &
operator<<( std::ostream &
str,
const std::type_info &info )
509 std::unique_ptr<char,
void(*)(
void*)>
res {
510 abi::__cxa_demangle(info.name(),
NULL,
NULL, &status),
513 return str << std::string((status==0) ?
res.get() : info.name());
515 return str << info.name();
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
std::pair wrapper for std::map output.
MapEntry(const TPair &pair_r)
const TPair & pair() const
std::ostream & operator<<(std::ostream &str, const MapEntry< TPair > &obj)
Stream output.
MapEntry< TPair > mapEntry(const TPair &pair_r)
Convenience function to create MapEntry from std::pair.
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const SolutionActionList &actionlist)
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & dumpRangeLine(std::ostream &str, TIterator begin, TIterator end)
Print range defined by iterators (single line style).
MapKVIteratorTraits< TMap >::Key_const_iterator make_map_key_begin(const TMap &map_r)
Convenience to create the key iterator from container::begin()
std::ostream & dumpRange(std::ostream &str, TIterator begin, TIterator end, const std::string &intro="{", const std::string &pfx="\n ", const std::string &sep="\n ", const std::string &sfx="\n", const std::string &extro="}")
Print range defined by iterators (multiline style).
iomanip::RangeLine< TIterator > rangeLine(TIterator begin, TIterator end)
Iomanip printing dumpRangeLine style.
MapKVIteratorTraits< TMap >::Value_const_iterator make_map_value_begin(const TMap &map_r)
Convenience to create the value iterator from container::begin()
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
MapKVIteratorTraits< TMap >::Key_const_iterator make_map_key_end(const TMap &map_r)
Convenience to create the key iterator from container::end()
MapKVIteratorTraits< TMap >::Value_const_iterator make_map_value_end(const TMap &map_r)
Convenience to create the value iterator from container::end()
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
std::ostream & hexdumpOn(std::ostream &outs, const unsigned char *ptr, size_t size)
hexdump data on stream
detail::Dump< Tp > dump(const Tp &obj_r)
Helper to produce not-NL-terminated multi line output.
transform_iterator< GetPairFirst< typename MapType::value_type >, typename MapType::const_iterator > Key_const_iterator
The key iterator type.
transform_iterator< GetPairSecond< typename MapType::value_type >, typename MapType::const_iterator > Value_const_iterator
The value iterator type.
std::ostream & operator<<(std::ostream &str, const RangeLine< TIterator > &obj)
<TIterator>
RangeLine(TIterator begin, TIterator end)