Medical Imaging Interaction Toolkit  2025.08.99-f7084adb
Medical Imaging Interaction Toolkit
mitkEnvironment.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkEnvironment_h
14 #define mitkEnvironment_h
15 
16 #include <mitkFileSystem.h>
17 #include <MitkCoreExports.h>
18 
19 #include <optional>
20 #include <string>
21 
22 namespace mitk
23 {
24 #if defined(_WIN32)
25  inline constexpr char PATH_ENV_SEPARATOR = ';';
26 #else
27  inline constexpr char PATH_ENV_SEPARATOR = ':';
28 #endif
29 
50  MITKCORE_EXPORT std::optional<std::string> GetEnv(const std::string& name);
51 
63  MITKCORE_EXPORT bool SetEnv(const std::string& name, const std::string& value);
64 
75  MITKCORE_EXPORT bool UnsetEnv(const std::string& name);
76 
88  MITKCORE_EXPORT bool AddPathEnv(const fs::path& pathEntry);
89 
101  MITKCORE_EXPORT bool RemovePathEnv(const fs::path& pathEntry);
102 }
103 
104 #endif
mitk::GetEnv
MITKCORE_EXPORT std::optional< std::string > GetEnv(const std::string &name)
Retrieve the value of an environment variable.
mitk::UnsetEnv
MITKCORE_EXPORT bool UnsetEnv(const std::string &name)
Remove an environment variable.
mitk::AddPathEnv
MITKCORE_EXPORT bool AddPathEnv(const fs::path &pathEntry)
Add a directory to the PATH environment variable.
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
MitkCoreExports.h
mitk::PATH_ENV_SEPARATOR
constexpr char PATH_ENV_SEPARATOR
Definition: mitkEnvironment.h:27
mitk::RemovePathEnv
MITKCORE_EXPORT bool RemovePathEnv(const fs::path &pathEntry)
Remove a directory from the PATH environment variable.
mitkFileSystem.h
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::SetEnv
MITKCORE_EXPORT bool SetEnv(const std::string &name, const std::string &value)
Set the value of an environment variable.