ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaKernel
src
AthDsoUtils.cxx
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5
*/
6
11
// note: This, I believe, should be part of Reflex::SharedLibrary
12
13
// STL includes
14
#include <string.h>
15
#include <string>
16
17
#include "GaudiKernel/System.h"
18
#include "
AthenaKernel/AthDsoUtils.h
"
19
20
namespace
Athena
{
21
namespace
DsoUtils
{
22
23
inline
24
std::string
25
libNativeName
(
const
std::string& libName )
26
{
27
#if defined(_WIN32)
28
return
libName+
".dll"
;
29
#elif defined(__linux) || defined(__APPLE__)
30
return
"lib"
+libName+
".so"
;
31
#else
32
// variant of the GIGO design pattern
33
return
libName;
34
#endif
35
}
36
37
static
38
std::string
39
dsoName
(
const
RootDataMember
& mem )
40
{
41
const
char
*lib = mem.
GetSharedLibs
();
42
return
lib? lib :
""
;
43
}
44
45
bool
46
inDso
(
const
RootDataMember
& mem,
47
const
std::string& dsoname )
48
{
49
#ifdef _WIN32
50
char
sep =
'\\'
;
51
#else
52
char
sep =
'/'
;
53
#endif
54
55
std::string srcname =
dsoName
(mem);
56
if
(srcname.empty()) {
57
// we do not know the name of the library, let's guess it's OK
58
return
true
;
59
}
60
61
std::string::size_type pos = dsoname.find_last_of(sep);
62
std::string curname;
63
if
(std::string::npos == pos) {
64
curname = dsoname;
65
}
else
{
66
curname = dsoname.substr(pos+1);
67
}
68
69
return
srcname == curname;
70
}
71
72
}
// end namespace DsoUtils
73
74
}
// end namespace Athena
75
76
AthDsoUtils.h
RootDataMember
TMemberAdapter RootDataMember
Definition
RootType.h:208
TMemberAdapter::GetSharedLibs
const char * GetSharedLibs() const
Definition
RootType.cxx:212
Athena::DsoUtils
Definition
AthDsoUtils.h:11
Athena::DsoUtils::dsoName
static std::string dsoName(const RootDataMember &mem)
Definition
AthDsoUtils.cxx:39
Athena::DsoUtils::libNativeName
std::string libNativeName(const std::string &libName)
Definition
AthDsoUtils.cxx:25
Athena::DsoUtils::inDso
bool inDso(const RootDataMember &mem, const std::string &dsoname)
Definition
AthDsoUtils.cxx:46
Athena
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
Definition
AthDsoUtils.h:10
Generated on
for ATLAS Offline Software by
1.17.0