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_MAC_FOUNDATION_UTIL_H_ | 5 #ifndef BASE_MAC_FOUNDATION_UTIL_H_ |
6 #define BASE_MAC_FOUNDATION_UTIL_H_ | 6 #define BASE_MAC_FOUNDATION_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <CoreFoundation/CoreFoundation.h> | 9 #include <CoreFoundation/CoreFoundation.h> |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Returns the ~/Library directory. | 86 // Returns the ~/Library directory. |
87 FilePath GetUserLibraryPath(); | 87 FilePath GetUserLibraryPath(); |
88 | 88 |
89 // Takes a path to an (executable) binary and tries to provide the path to an | 89 // Takes a path to an (executable) binary and tries to provide the path to an |
90 // application bundle containing it. It takes the outermost bundle that it can | 90 // application bundle containing it. It takes the outermost bundle that it can |
91 // find (so for "/Foo/Bar.app/.../Baz.app/..." it produces "/Foo/Bar.app"). | 91 // find (so for "/Foo/Bar.app/.../Baz.app/..." it produces "/Foo/Bar.app"). |
92 // |exec_name| - path to the binary | 92 // |exec_name| - path to the binary |
93 // returns - path to the application bundle, or empty on error | 93 // returns - path to the application bundle, or empty on error |
94 FilePath GetAppBundlePath(const FilePath& exec_name); | 94 FilePath GetAppBundlePath(const FilePath& exec_name); |
95 | 95 |
| 96 // Returns true if the module for |address| is found. |path| will contain |
| 97 // the path to the module. Note that |path| may not be absolute. |
| 98 bool GetModulePathForAddress(FilePath* path, const void* address); |
| 99 |
96 // Utility function to pull out a value from a dictionary, check its type, and | 100 // Utility function to pull out a value from a dictionary, check its type, and |
97 // return it. Returns NULL if the key is not present or of the wrong type. | 101 // return it. Returns NULL if the key is not present or of the wrong type. |
98 CFTypeRef GetValueFromDictionary(CFDictionaryRef dict, | 102 CFTypeRef GetValueFromDictionary(CFDictionaryRef dict, |
99 CFStringRef key, | 103 CFStringRef key, |
100 CFTypeID expected_type); | 104 CFTypeID expected_type); |
101 | 105 |
102 // Retain/release calls for memory management in C++. | 106 // Retain/release calls for memory management in C++. |
103 void NSObjectRetain(void* obj); | 107 void NSObjectRetain(void* obj); |
104 void NSObjectRelease(void* obj); | 108 void NSObjectRelease(void* obj); |
105 | 109 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 201 |
198 // Stream operations for CFTypes. They can be used with NSTypes as well | 202 // Stream operations for CFTypes. They can be used with NSTypes as well |
199 // by using the NSToCFCast methods above. | 203 // by using the NSToCFCast methods above. |
200 // e.g. LOG(INFO) << base::mac::NSToCFCast(@"foo"); | 204 // e.g. LOG(INFO) << base::mac::NSToCFCast(@"foo"); |
201 // Operator << can not be overloaded for ObjectiveC types as the compiler | 205 // Operator << can not be overloaded for ObjectiveC types as the compiler |
202 // can not distinguish between overloads for id with overloads for void*. | 206 // can not distinguish between overloads for id with overloads for void*. |
203 extern std::ostream& operator<<(std::ostream& o, const CFErrorRef err); | 207 extern std::ostream& operator<<(std::ostream& o, const CFErrorRef err); |
204 extern std::ostream& operator<<(std::ostream& o, const CFStringRef str); | 208 extern std::ostream& operator<<(std::ostream& o, const CFStringRef str); |
205 | 209 |
206 #endif // BASE_MAC_FOUNDATION_UTIL_H_ | 210 #endif // BASE_MAC_FOUNDATION_UTIL_H_ |
OLD | NEW |