yoda
is hosted by
Hepforge
,
IPPP Durham
Home
C++ code docs
Python code docs
Plotting
Downloads
Source code
Contact
YODA - Yet more Objects for Data Analysis
2.0.3
src
Paths.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// This file is part of YODA -- Yet more Objects for Data Analysis
4
// Copyright (C) 2008-2024 The YODA collaboration (see AUTHORS for details)
5
//
6
#include "
YODA/Utils/Paths.h
"
7
#include "
YODA/Utils/StringUtils.h
"
8
#include "
binreloc/binreloc.h
"
9
10
#include <cstring>
11
12
using namespace
std;
13
14
namespace
YODA
{
15
16
17
string
getLibPath
() {
18
BrInitError
error;
19
br_init_lib
(&error);
20
char
* temp =
br_find_lib_dir
(DEFAULTLIBDIR);
21
const
string
libdir(temp);
22
free(temp);
23
return
libdir;
24
}
25
26
string
getDataPath
() {
27
BrInitError
error;
28
br_init_lib
(&error);
29
char
* temp =
br_find_data_dir
(DEFAULTDATADIR);
30
const
string
sharedir(temp);
31
free(temp);
32
return
sharedir +
"/YODA"
;
33
}
34
35
vector<string>
getYodaDataPath
() {
36
vector<string> dirs;
37
// Use the YODA data path variable if set...
38
const
char
* env = getenv(
"YODA_DATA_PATH"
);
39
if
(env) dirs = Utils::pathsplit(env);
40
// ... then, unless the path ends in :: ...
41
if
(!env || strlen(env) < 2 ||
string
(env).substr(strlen(env)-2) !=
"::"
) {
42
// ... fall back to the YODA data install path
43
dirs.push_back(
getDataPath
());
44
}
45
return
dirs;
46
}
47
48
49
}
Paths.h
StringUtils.h
binreloc.h
br_find_data_dir
#define br_find_data_dir
Definition
binreloc.h:47
BrInitError
BrInitError
Definition
binreloc.h:22
br_find_lib_dir
#define br_find_lib_dir
Definition
binreloc.h:49
br_init_lib
#define br_init_lib
Definition
binreloc.h:41
YODA
Anonymous namespace to limit visibility.
Definition
AnalysisObject.h:17
YODA::getYodaDataPath
std::vector< std::string > getYodaDataPath()
YODA data paths.
Definition
Paths.cc:35
YODA::getDataPath
std::string getDataPath()
Get the path to the installed share/YODA/ data directory.
Definition
Paths.cc:26
YODA::getLibPath
std::string getLibPath()
Get the path to the directory containing libYODA.
Definition
Paths.cc:17
Generated on Sun Feb 9 2025 18:56:41 for YODA - Yet more Objects for Data Analysis by
1.9.8