Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
z
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
GitLab
LXR
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Control
CxxUtils
Root
StrFormat.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// $Id: StrFormat.cxx 579482 2014-01-22 09:14:16Z krasznaa $
13
#include "
CxxUtils/StrFormat.h
"
14
15
// c includes
16
#include <stdarg.h>
17
#include <stdio.h>
18
#include <stdlib.h>
19
#include <stdexcept>
20
21
namespace
{
22
// little helper to ensure a char* is freed
23
class
CharLiberator
24
{
25
char
* m_buf;
26
27
public
:
28
explicit
29
CharLiberator(
char
* buf) : m_buf(
buf
)
30
{}
31
CharLiberator() : m_buf (NULL)
32
{}
33
~CharLiberator()
34
{
35
free(m_buf);
36
}
37
38
CharLiberator (
const
CharLiberator&) =
delete
;
39
CharLiberator&
operator=
(
const
CharLiberator&) =
delete
;
40
};
41
42
}
43
44
namespace
CxxUtils
{
45
48
std::string
49
strformat
(
const
char
*
fmt
, ...)
50
{
51
char
*buf = NULL;
52
int
nbytes = -1;
53
54
va_list
ap
;
55
va_start(
ap
,
fmt
);
/* Initialize the va_list */
56
57
nbytes = vasprintf(&buf,
fmt
,
ap
);
58
va_end(
ap
);
/* Cleanup the va_list */
59
60
if
(nbytes < 0) {
61
/*buf is undefined when allocation failed
62
* see: http://linux.die.net/man/3/asprintf
63
*/
64
// free(buf);
65
throw
std::runtime_error(
"problem while calling vasprintf"
);
66
}
67
68
CharLiberator guard(buf);
69
70
// help compiler to apply RVO
71
return
std::string(buf);
72
}
73
74
}
//> namespace CxxUtils
75
columnar::operator=
AccessorTemplate & operator=(AccessorTemplate &&that)
Definition:
VectorColumn.h:88
python.AtlRunQueryParser.ap
ap
Definition:
AtlRunQueryParser.py:826
StrFormat.h
Provide helper functions to create formatted strings.
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition:
DecayParser.py:27
CxxUtils
Definition:
aligned_vector.h:29
CxxUtils::strformat
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
Definition:
StrFormat.cxx:49
fmt
Generated on Sat Apr 19 2025 21:19:12 for ATLAS Offline Software by
1.8.18