Gazebo Utils

API Reference

1.5.1
gz/utils/Environment.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef GZ_UTILS_ENVIRONMENT_HH_
19 #define GZ_UTILS_ENVIRONMENT_HH_
20 
21 #include <gz/utils/config.hh>
22 #include <gz/utils/Export.hh>
23 
24 #include <string>
25 
26 namespace ignition
27 {
28 namespace utils
29 {
30 inline namespace IGNITION_UTILS_VERSION_NAMESPACE {
31 
42 bool IGNITION_UTILS_VISIBLE env(
43  const std::string &_name, std::string &_value,
44  bool _allowEmpty = false);
45 
50 //
57 bool IGNITION_UTILS_VISIBLE setenv(
58  const std::string &_name, const std::string &_value);
59 
67 bool IGNITION_UTILS_VISIBLE unsetenv(const std::string &_name);
68 
69 }
70 } // namespace utils
71 } // namespace ignition
72 
73 #endif // GZ_UTILS_ENVIRONMENT_HH_
Definition: gz/utils/Environment.hh:26
STL class.
bool setenv(const std::string &_name, const std::string &_value)
Set the environment variable '_name'.
bool env(const std::string &_name, std::string &_value, bool _allowEmpty=false)
Find the environment variable '_name' and return its value.
bool unsetenv(const std::string &_name)
Unset the environment variable '_name'.