ATLAS Offline Software
Loading...
Searching...
No Matches
Athena::DsoUtils Namespace Reference

Functions

bool inDso (const RootDataMember &mem, const std::string &dsoname)
std::string libNativeName (const std::string &libName)
static std::string dsoName (const RootDataMember &mem)

Function Documentation

◆ dsoName()

std::string Athena::DsoUtils::dsoName ( const RootDataMember & mem)
static

Definition at line 39 of file AthDsoUtils.cxx.

40{
41 const char *lib = mem.GetSharedLibs();
42 return lib? lib : "";
43}
const char * GetSharedLibs() const
Definition RootType.cxx:212

◆ inDso()

bool Athena::DsoUtils::inDso ( const RootDataMember & mem,
const std::string & dsoname )

Definition at line 46 of file AthDsoUtils.cxx.

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}
static std::string dsoName(const RootDataMember &mem)

◆ libNativeName()

std::string Athena::DsoUtils::libNativeName ( const std::string & libName)
inline

Definition at line 25 of file AthDsoUtils.cxx.

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}