Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-09 09:40:44

0001 //
0002 // Copyright 2019 The Abseil Authors.
0003 //
0004 // Licensed under the Apache License, Version 2.0 (the "License");
0005 // you may not use this file except in compliance with the License.
0006 // You may obtain a copy of the License at
0007 //
0008 //      https://www.apache.org/licenses/LICENSE-2.0
0009 //
0010 // Unless required by applicable law or agreed to in writing, software
0011 // distributed under the License is distributed on an "AS IS" BASIS,
0012 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013 // See the License for the specific language governing permissions and
0014 // limitations under the License.
0015 //
0016 
0017 #ifndef ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_
0018 #define ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_
0019 
0020 #include <string>
0021 
0022 #include "absl/base/config.h"
0023 
0024 namespace absl {
0025 ABSL_NAMESPACE_BEGIN
0026 namespace base_internal {
0027 
0028 class ScopedSetEnv {
0029  public:
0030   ScopedSetEnv(const char* var_name, const char* new_value);
0031   ~ScopedSetEnv();
0032 
0033  private:
0034   std::string var_name_;
0035   std::string old_value_;
0036 
0037   // True if the environment variable was initially not set.
0038   bool was_unset_;
0039 };
0040 
0041 }  // namespace base_internal
0042 ABSL_NAMESPACE_END
0043 }  // namespace absl
0044 
0045 #endif  // ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_