CbmRoot
Loading...
Searching...
No Matches
CbmFormatDecHexPrintout.cxx
Go to the documentation of this file.
1/* Copyright (C) 2019 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
6
7std::string FormatDecPrintout(uint64_t ulVal, char cFill, uint uWidth)
8{
9 std::stringstream ss;
10
12 if (0 != cFill) ss << std::setfill(cFill);
13 if (0 < uWidth) ss << std::setw(uWidth);
14
16 ss << ulVal;
17
19 if (0 != cFill) ss << std::setfill(' ');
20
21 return ss.str();
22}
23
24std::string FormatHexPrintout(uint64_t ulVal, char cFill, uint uWidth, bool bUppercase)
25{
26 std::stringstream ss;
27
29 ss << std::hex;
30
32 if (0 != cFill) ss << std::setfill(cFill);
33 if (0 < uWidth) ss << std::setw(uWidth);
34 if (bUppercase) ss << std::uppercase;
35
37 ss << ulVal << std::dec;
38
40 if (0 != cFill) ss << std::setfill(' ');
41
42 return ss.str();
43}
std::string FormatDecPrintout(uint64_t ulVal, char cFill, uint uWidth)
std::string FormatHexPrintout(uint64_t ulVal, char cFill, uint uWidth, bool bUppercase)