OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/env_var.h" | 5 #include "base/env_var.h" |
6 | 6 |
7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #elif defined(OS_WIN) | 9 #elif defined(OS_WIN) |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 ::SetEnvironmentVariable(ASCIIToWide(variable_name).c_str(), | 78 ::SetEnvironmentVariable(ASCIIToWide(variable_name).c_str(), |
79 ASCIIToWide(new_value).c_str()); | 79 ASCIIToWide(new_value).c_str()); |
80 #endif | 80 #endif |
81 } | 81 } |
82 }; | 82 }; |
83 | 83 |
84 } // namespace | 84 } // namespace |
85 | 85 |
86 namespace base { | 86 namespace base { |
87 | 87 |
| 88 EnvVarGetter::~EnvVarGetter() {} |
| 89 |
| 90 bool EnvVarGetter::HasEnv(const char* variable_name) { |
| 91 return GetEnv(variable_name, NULL); |
| 92 } |
| 93 |
88 // static | 94 // static |
89 EnvVarGetter* EnvVarGetter::Create() { | 95 EnvVarGetter* EnvVarGetter::Create() { |
90 return new EnvVarGetterImpl(); | 96 return new EnvVarGetterImpl(); |
91 } | 97 } |
92 | 98 |
93 } // namespace base | 99 } // namespace base |
OLD | NEW |