SIRF  3.6.0
utilities.h
Go to the documentation of this file.
1 /*
2 SyneRBI Synergistic Image Reconstruction Framework (SIRF)
3 Copyright 2023 Rutherford Appleton Laboratory STFC
4 Copyright 2023 University College London
5 
6 This is software developed for the Collaborative Computational
7 Project in Synergistic Reconstruction for Biomedical Imaging (formerly CCP PETMR)
8 (http://www.ccpsynerbi.ac.uk/).
9 
10 Licensed under the Apache License, Version 2.0 (the "License");
11 you may not use this file except in compliance with the License.
12 You may obtain a copy of the License at
13 http://www.apache.org/licenses/LICENSE-2.0
14 Unless required by applicable law or agreed to in writing, software
15 distributed under the License is distributed on an "AS IS" BASIS,
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 See the License for the specific language governing permissions and
18 limitations under the License.
19 
20 */
21 
29 #ifndef SIRF_UTILITIES
30 #define SIRF_UTILITIES
31 
32 #include <string>
33 
34 namespace sirf {
36 
40  char path_separator();
43 
54  template <typename T>
55  std::string append_path(std::string path, T a)
56  {
57  return path + path_separator() + std::string(a);
58  }
59  template <typename T, typename... Ts>
60  std::string append_path(std::string path, T a, Ts... args)
61  {
62  return append_path(append_path(path, a), args...);
63  }
66 
73  std::string examples_data_path(const char* data_type);
74 }
75 
76 #endif
Abstract data container.
Definition: GeometricalInfo.cpp:141
char path_separator()
return the path-separator used by the OS
Definition: utilities.cpp:35
std::string examples_data_path(const char *data_type)
Definition: utilities.cpp:44
std::string append_path(std::string path, T a)
Definition: utilities.h:55