]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/base/IoManip.cc
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
10 #include "base/IoManip.h"
11 #include "debug/Stream.h"
16 PrintHex(std::ostream
&os
, const char * const data
, const size_t n
)
22 const auto savedFill
= os
.fill('0');
23 const auto savedFlags
= os
.flags(); // std::ios_base::fmtflags
25 std::for_each(data
, data
+ n
,
26 [&os
](const char &c
) { os
<< std::setw(2) << static_cast<uint8_t>(c
); });