| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef BASE_ENVIRONMENT_H_ | 5 #ifndef BASE_ENVIRONMENT_H_ |
| 6 #define BASE_ENVIRONMENT_H_ | 6 #define BASE_ENVIRONMENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // value is replaced by the second of the pair, unless the second is empty, in | 59 // value is replaced by the second of the pair, unless the second is empty, in |
| 60 // which case the key-value is removed. | 60 // which case the key-value is removed. |
| 61 // | 61 // |
| 62 // This Windows version takes and returns a Windows-style environment block | 62 // This Windows version takes and returns a Windows-style environment block |
| 63 // which is a concatenated list of null-terminated 16-bit strings. The end is | 63 // which is a concatenated list of null-terminated 16-bit strings. The end is |
| 64 // marked by a double-null terminator. The size of the returned string will | 64 // marked by a double-null terminator. The size of the returned string will |
| 65 // include the terminators. | 65 // include the terminators. |
| 66 BASE_EXPORT string16 AlterEnvironment(const wchar_t* env, | 66 BASE_EXPORT string16 AlterEnvironment(const wchar_t* env, |
| 67 const EnvironmentMap& changes); | 67 const EnvironmentMap& changes); |
| 68 | 68 |
| 69 #elif defined(OS_POSIX) | 69 #elif defined(OS_POSIX) || defined(OS_FUCHSIA) |
| 70 | 70 |
| 71 typedef std::string NativeEnvironmentString; | 71 typedef std::string NativeEnvironmentString; |
| 72 typedef std::map<NativeEnvironmentString, NativeEnvironmentString> | 72 typedef std::map<NativeEnvironmentString, NativeEnvironmentString> |
| 73 EnvironmentMap; | 73 EnvironmentMap; |
| 74 | 74 |
| 75 // See general comments for the Windows version above. | 75 // See general comments for the Windows version above. |
| 76 // | 76 // |
| 77 // This Posix version takes and returns a Posix-style environment block, which | 77 // This Posix version takes and returns a Posix-style environment block, which |
| 78 // is a null-terminated list of pointers to null-terminated strings. The | 78 // is a null-terminated list of pointers to null-terminated strings. The |
| 79 // returned array will have appended to it the storage for the array itself so | 79 // returned array will have appended to it the storage for the array itself so |
| 80 // there is only one pointer to manage, but this means that you can't copy the | 80 // there is only one pointer to manage, but this means that you can't copy the |
| 81 // array without keeping the original around. | 81 // array without keeping the original around. |
| 82 BASE_EXPORT std::unique_ptr<char* []> AlterEnvironment( | 82 BASE_EXPORT std::unique_ptr<char* []> AlterEnvironment( |
| 83 const char* const* env, | 83 const char* const* env, |
| 84 const EnvironmentMap& changes); | 84 const EnvironmentMap& changes); |
| 85 | 85 |
| 86 #endif | 86 #endif |
| 87 | 87 |
| 88 } // namespace base | 88 } // namespace base |
| 89 | 89 |
| 90 #endif // BASE_ENVIRONMENT_H_ | 90 #endif // BASE_ENVIRONMENT_H_ |
| OLD | NEW |