| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 if (value && !value_specific) { | 303 if (value && !value_specific) { |
| 304 std::string expected_type = TypeNameForCFType(value_specific); | 304 std::string expected_type = TypeNameForCFType(value_specific); |
| 305 DLOG(WARNING) << GetValueFromDictionaryErrorMessage(key, | 305 DLOG(WARNING) << GetValueFromDictionaryErrorMessage(key, |
| 306 expected_type, | 306 expected_type, |
| 307 value); | 307 value); |
| 308 } | 308 } |
| 309 | 309 |
| 310 return value_specific; | 310 return value_specific; |
| 311 } | 311 } |
| 312 | 312 |
| 313 // Converts |path| to an autoreleased NSString. Returns nil if |path| is empty. |
| 314 NSString* FilePathToNSString(const FilePath& path); |
| 315 |
| 316 // Converts |str| to a FilePath. Returns an empty path if |str| is nil. |
| 317 FilePath NSStringToFilePath(NSString* str); |
| 318 |
| 313 } // namespace mac | 319 } // namespace mac |
| 314 } // namespace base | 320 } // namespace base |
| 315 | 321 |
| 316 // Stream operations for CFTypes. They can be used with NSTypes as well | 322 // Stream operations for CFTypes. They can be used with NSTypes as well |
| 317 // by using the NSToCFCast methods above. | 323 // by using the NSToCFCast methods above. |
| 318 // e.g. LOG(INFO) << base::mac::NSToCFCast(@"foo"); | 324 // e.g. LOG(INFO) << base::mac::NSToCFCast(@"foo"); |
| 319 // Operator << can not be overloaded for ObjectiveC types as the compiler | 325 // Operator << can not be overloaded for ObjectiveC types as the compiler |
| 320 // can not distinguish between overloads for id with overloads for void*. | 326 // can not distinguish between overloads for id with overloads for void*. |
| 321 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, | 327 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, |
| 322 const CFErrorRef err); | 328 const CFErrorRef err); |
| 323 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, | 329 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, |
| 324 const CFStringRef str); | 330 const CFStringRef str); |
| 325 | 331 |
| 326 #endif // BASE_MAC_FOUNDATION_UTIL_H_ | 332 #endif // BASE_MAC_FOUNDATION_UTIL_H_ |
| OLD | NEW |