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
5
#include "
CbmFormatDecHexPrintout.h
"
6
7
std::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
24
std::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
}
FormatDecPrintout
std::string FormatDecPrintout(uint64_t ulVal, char cFill, uint uWidth)
Definition
CbmFormatDecHexPrintout.cxx:7
FormatHexPrintout
std::string FormatHexPrintout(uint64_t ulVal, char cFill, uint uWidth, bool bUppercase)
Definition
CbmFormatDecHexPrintout.cxx:24
CbmFormatDecHexPrintout.h
core
base
utils
flestools
CbmFormatDecHexPrintout.cxx
Generated on Sun Dec 22 2024 23:04:08 for CbmRoot by
1.12.0