├── .github ├── FUNDING.yml └── workflows │ ├── ci-mac.yaml │ └── ci-win.yaml ├── .gitignore ├── .gitmodules ├── Apple ├── include │ └── Apple │ │ ├── Availability.h │ │ ├── AvailabilityInternal.h │ │ ├── AvailabilityMacros.h │ │ ├── CoreFoundation │ │ ├── CFArray.h │ │ ├── CFAvailability.h │ │ ├── CFBag.h │ │ ├── CFBase.h │ │ ├── CFBasicHash.h │ │ ├── CFBigNumber.h │ │ ├── CFBinaryHeap.h │ │ ├── CFBitVector.h │ │ ├── CFBundle.h │ │ ├── CFBundlePriv.h │ │ ├── CFBundle_BinaryTypes.h │ │ ├── CFBundle_Internal.h │ │ ├── CFBurstTrie.h │ │ ├── CFByteOrder.h │ │ ├── CFCalendar.h │ │ ├── CFCharacterSet.h │ │ ├── CFCharacterSetPriv.h │ │ ├── CFData.h │ │ ├── CFDate.h │ │ ├── CFDateFormatter.h │ │ ├── CFDictionary.h │ │ ├── CFError.h │ │ ├── CFError_Private.h │ │ ├── CFICUConverters.h │ │ ├── CFICULogging.h │ │ ├── CFInternal.h │ │ ├── CFLocale.h │ │ ├── CFLocaleInternal.h │ │ ├── CFLogUtilities.h │ │ ├── CFMachPort.h │ │ ├── CFMessagePort.h │ │ ├── CFNumber.h │ │ ├── CFNumberFormatter.h │ │ ├── CFPlugIn.h │ │ ├── CFPlugInCOM.h │ │ ├── CFPlugIn_Factory.h │ │ ├── CFPreferences.h │ │ ├── CFPriv.h │ │ ├── CFPropertyList.h │ │ ├── CFRunLoop.h │ │ ├── CFRuntime.h │ │ ├── CFSet.h │ │ ├── CFSocket.h │ │ ├── CFStorage.h │ │ ├── CFStream.h │ │ ├── CFStreamAbstract.h │ │ ├── CFStreamInternal.h │ │ ├── CFStreamPriv.h │ │ ├── CFString.h │ │ ├── CFStringDefaultEncoding.h │ │ ├── CFStringEncodingConverter.h │ │ ├── CFStringEncodingConverterExt.h │ │ ├── CFStringEncodingConverterPriv.h │ │ ├── CFStringEncodingDatabase.h │ │ ├── CFStringEncodingExt.h │ │ ├── CFTimeZone.h │ │ ├── CFTree.h │ │ ├── CFURL.h │ │ ├── CFURL.inc.h │ │ ├── CFURLAccess.h │ │ ├── CFURLPriv.h │ │ ├── CFUUID.h │ │ ├── CFUniChar.h │ │ ├── CFUniCharPriv.h │ │ ├── CFUnicodeDecomposition.h │ │ ├── CFUnicodePrecomposition.h │ │ ├── CFUserNotification.h │ │ ├── CFUtilities.h │ │ ├── CFXMLInputStream.h │ │ ├── CFXMLNode.h │ │ ├── CFXMLParser.h │ │ ├── CoreFoundation.h │ │ ├── CoreFoundation_Prefix.h │ │ └── ForFoundationOnly.h │ │ └── TargetConditionals.h └── lib │ ├── win32 │ ├── CoreFoundation.def │ ├── CoreFoundation.exp │ ├── CoreFoundation.lib │ └── desktop.ini │ └── win64 │ ├── CoreFoundation.def │ ├── CoreFoundation.exp │ └── CoreFoundation.lib ├── Build └── .gitignore ├── CF++ ├── Info.plist ├── include │ ├── CF++.hpp │ └── CF++ │ │ ├── CFPP-AnyObject.hpp │ │ ├── CFPP-AnyPropertyListType.hpp │ │ ├── CFPP-Array.hpp │ │ ├── CFPP-AutoPointer.hpp │ │ ├── CFPP-Boolean.hpp │ │ ├── CFPP-Data.hpp │ │ ├── CFPP-Date.hpp │ │ ├── CFPP-Dictionary.hpp │ │ ├── CFPP-Error.hpp │ │ ├── CFPP-Null.hpp │ │ ├── CFPP-Number.hpp │ │ ├── CFPP-Object.hpp │ │ ├── CFPP-Pair.hpp │ │ ├── CFPP-PropertyListBase.hpp │ │ ├── CFPP-PropertyListType-Definition.hpp │ │ ├── CFPP-PropertyListType.hpp │ │ ├── CFPP-ReadStream.hpp │ │ ├── CFPP-String.hpp │ │ ├── CFPP-Type.hpp │ │ ├── CFPP-URL.hpp │ │ ├── CFPP-UUID.hpp │ │ └── CFPP-WriteStream.hpp └── source │ ├── CFPP-AnyObject.cpp │ ├── CFPP-AnyPropertyListType.cpp │ ├── CFPP-Array-Iterator.cpp │ ├── CFPP-Array.cpp │ ├── CFPP-AutoPointer.cpp │ ├── CFPP-Boolean.cpp │ ├── CFPP-Data-Iterator.cpp │ ├── CFPP-Data.cpp │ ├── CFPP-Date.cpp │ ├── CFPP-Dictionary-Iterator.cpp │ ├── CFPP-Dictionary.cpp │ ├── CFPP-Error.cpp │ ├── CFPP-Null.cpp │ ├── CFPP-Number.cpp │ ├── CFPP-Pair.cpp │ ├── CFPP-PropertyListBase.cpp │ ├── CFPP-ReadStream-Iterator.cpp │ ├── CFPP-ReadStream.cpp │ ├── CFPP-String-Iterator.cpp │ ├── CFPP-String.cpp │ ├── CFPP-Type.cpp │ ├── CFPP-URL.cpp │ ├── CFPP-UUID.cpp │ └── CFPP-WriteStream.cpp ├── CODE_OF_CONDUCT.md ├── CoreFoundation++.sln ├── CoreFoundation++.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── CoreFoundation++.xcscmblueprint │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ ├── CF++ Mac Dynamic Library.xcscheme │ ├── CF++ Mac Framework.xcscheme │ ├── CF++ Mac Static Library.xcscheme │ ├── CF++ Tests.xcscheme │ ├── CF++ iOS Static Library.xcscheme │ └── CF++.xcscheme ├── LICENSE ├── README.md ├── Unit-Tests ├── Constants.cpp ├── Constants.hpp ├── Info.plist ├── Test-CFPP-AnyObject.cpp ├── Test-CFPP-AnyPropertyListType.cpp ├── Test-CFPP-Array-Iterator.cpp ├── Test-CFPP-Array.cpp ├── Test-CFPP-AutoPointer.cpp ├── Test-CFPP-Boolean.cpp ├── Test-CFPP-Data-Iterator.cpp ├── Test-CFPP-Data.cpp ├── Test-CFPP-Date.cpp ├── Test-CFPP-Dictionary-Iterator.cpp ├── Test-CFPP-Dictionary.cpp ├── Test-CFPP-Error.cpp ├── Test-CFPP-Null.cpp ├── Test-CFPP-Number.cpp ├── Test-CFPP-Object.cpp ├── Test-CFPP-Pair.cpp ├── Test-CFPP-PropertyListType.cpp ├── Test-CFPP-ReadStream-Iterator.cpp ├── Test-CFPP-ReadStream.cpp ├── Test-CFPP-String-Iterator.cpp ├── Test-CFPP-String.cpp ├── Test-CFPP-Type.cpp ├── Test-CFPP-URL.cpp ├── Test-CFPP-UUID.cpp ├── Test-CFPP-WriteStream.cpp └── Win32-Init.cpp └── VisualStudio ├── All.vcxproj ├── All.vcxproj.filters ├── CF++ DLL VC142.vcxproj ├── CF++ DLL VC142.vcxproj.filters ├── CF++ DLL VC143.vcxproj ├── CF++ DLL VC143.vcxproj.filters ├── CF++ Static VC142.vcxproj ├── CF++ Static VC142.vcxproj.filters ├── CF++ Static VC143.vcxproj ├── CF++ Static VC143.vcxproj.filters └── Unit-Tests └── Unit-Tests.vcxproj /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: macmade 2 | -------------------------------------------------------------------------------- /.github/workflows/ci-mac.yaml: -------------------------------------------------------------------------------- 1 | name: ci-mac 2 | on: [push] 3 | jobs: 4 | ci: 5 | runs-on: macos-latest 6 | strategy: 7 | matrix: 8 | run-config: 9 | - { scheme: 'CF++ Mac Static Library', configuration: 'Debug', project: 'CoreFoundation++.xcodeproj', build: 1, analyze: 1, test: 1, info: 1, destination: 'platform=macOS' } 10 | - { scheme: 'CF++ Mac Static Library', configuration: 'Release', project: 'CoreFoundation++.xcodeproj', build: 1, analyze: 1, test: 0, info: 1, destination: 'platform=macOS' } 11 | - { scheme: 'CF++ Mac Dynamic Library', configuration: 'Debug', project: 'CoreFoundation++.xcodeproj', build: 1, analyze: 1, test: 1, info: 1, destination: 'platform=macOS' } 12 | - { scheme: 'CF++ Mac Dynamic Library', configuration: 'Release', project: 'CoreFoundation++.xcodeproj', build: 1, analyze: 1, test: 0, info: 1, destination: 'platform=macOS' } 13 | - { scheme: 'CF++ Mac Framework', configuration: 'Debug', project: 'CoreFoundation++.xcodeproj', build: 1, analyze: 1, test: 1, info: 1, destination: 'platform=macOS' } 14 | - { scheme: 'CF++ Mac Framework', configuration: 'Release', project: 'CoreFoundation++.xcodeproj', build: 1, analyze: 1, test: 0, info: 1, destination: 'platform=macOS' } 15 | - { scheme: 'CF++ iOS Static Library', configuration: 'Debug', project: 'CoreFoundation++.xcodeproj', build: 1, analyze: 1, test: 0, info: 1, destination: 'platform=iOS Simulator,name=iPhone 12' } 16 | - { scheme: 'CF++ iOS Static Library', configuration: 'Release', project: 'CoreFoundation++.xcodeproj', build: 1, analyze: 1, test: 0, info: 1, destination: 'platform=iOS Simulator,name=iPhone 12' } 17 | steps: 18 | 19 | - uses: actions/checkout@v1 20 | with: 21 | submodules: 'recursive' 22 | 23 | - uses: macmade/action-xcodebuild@v1.0.0 24 | 25 | - uses: macmade/action-slack@v1.0.0 26 | if: ${{ always() }} 27 | env: 28 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} 29 | with: 30 | channel: '#ci' 31 | status: ${{ job.status }} 32 | title: ${{ matrix.run-config[ 'scheme' ] }} - ${{ matrix.run-config[ 'configuration' ] }} 33 | -------------------------------------------------------------------------------- /.github/workflows/ci-win.yaml: -------------------------------------------------------------------------------- 1 | name: ci-win 2 | on: [push] 3 | jobs: 4 | ci: 5 | runs-on: windows-2022 6 | strategy: 7 | matrix: 8 | run-config: 9 | - { platform: 'x64', toolset: 'x64', configuration: 'Debug', solution: 'CoreFoundation++.sln' } 10 | - { platform: 'x64', toolset: 'x64', configuration: 'Release', solution: 'CoreFoundation++.sln' } 11 | - { platform: 'x86', toolset: 'x64', configuration: 'Debug', solution: 'CoreFoundation++.sln' } 12 | - { platform: 'x86', toolset: 'x64', configuration: 'Release', solution: 'CoreFoundation++.sln' } 13 | steps: 14 | 15 | - uses: actions/checkout@v1 16 | with: 17 | submodules: 'recursive' 18 | 19 | - uses: macmade/action-msbuild@v1.1.0 20 | 21 | - uses: macmade/action-slack@v1.0.0 22 | if: ${{ always() }} 23 | env: 24 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} 25 | with: 26 | channel: '#ci' 27 | status: ${{ job.status }} 28 | title: ${{ matrix.run-config[ 'solution' ] }} - ${{ matrix.run-config[ 'configuration' ] }} - ${{ matrix.run-config[ 'platform' ] }} 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Mac Finder 2 | .DS_Store 3 | .Trashes 4 | Icon? 5 | 6 | # Thumbnails 7 | ._* 8 | 9 | # Files that might appear on external disk 10 | .Spotlight-V100 11 | .Trashes 12 | 13 | # Windows 14 | Thumbs.db 15 | 16 | # Xcode 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | *.xccheckout 22 | *.profraw 23 | !default.pbxuser 24 | !default.mode1v3 25 | !default.mode2v3 26 | !default.perspectivev3 27 | xcuserdata 28 | 29 | # VisualStudio 30 | *.suo 31 | *.sdf 32 | *.opensdf 33 | *.vcxproj.user 34 | *.csproj.user 35 | ipch 36 | .vs 37 | *.VC.db 38 | 39 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Submodules/xcconfig"] 2 | path = Submodules/xcconfig 3 | url = https://github.com/macmade/xcconfig.git 4 | [submodule "Submodules/XSTest"] 5 | path = Submodules/XSTest 6 | url = https://github.com/macmade/XSTest.git 7 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFBag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFBag.h 25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFBAG__) 29 | #define __COREFOUNDATION_CFBAG__ 1 30 | 31 | #include 32 | 33 | CF_IMPLICIT_BRIDGING_ENABLED 34 | CF_EXTERN_C_BEGIN 35 | 36 | typedef const void * (*CFBagRetainCallBack)(CFAllocatorRef allocator, const void *value); 37 | typedef void (*CFBagReleaseCallBack)(CFAllocatorRef allocator, const void *value); 38 | typedef CFStringRef (*CFBagCopyDescriptionCallBack)(const void *value); 39 | typedef Boolean (*CFBagEqualCallBack)(const void *value1, const void *value2); 40 | typedef CFHashCode (*CFBagHashCallBack)(const void *value); 41 | typedef struct { 42 | CFIndex version; 43 | CFBagRetainCallBack retain; 44 | CFBagReleaseCallBack release; 45 | CFBagCopyDescriptionCallBack copyDescription; 46 | CFBagEqualCallBack equal; 47 | CFBagHashCallBack hash; 48 | } CFBagCallBacks; 49 | 50 | CF_EXPORT 51 | const CFBagCallBacks kCFTypeBagCallBacks; 52 | CF_EXPORT 53 | const CFBagCallBacks kCFCopyStringBagCallBacks; 54 | 55 | typedef void (*CFBagApplierFunction)(const void *value, void *context); 56 | 57 | typedef const struct __CFBag * CFBagRef; 58 | typedef struct __CFBag * CFMutableBagRef; 59 | 60 | CF_EXPORT 61 | CFTypeID CFBagGetTypeID(void); 62 | 63 | CF_EXPORT 64 | CFBagRef CFBagCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFBagCallBacks *callBacks); 65 | 66 | CF_EXPORT 67 | CFBagRef CFBagCreateCopy(CFAllocatorRef allocator, CFBagRef theBag); 68 | 69 | CF_EXPORT 70 | CFMutableBagRef CFBagCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFBagCallBacks *callBacks); 71 | 72 | CF_EXPORT 73 | CFMutableBagRef CFBagCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBagRef theBag); 74 | 75 | CF_EXPORT 76 | CFIndex CFBagGetCount(CFBagRef theBag); 77 | 78 | CF_EXPORT 79 | CFIndex CFBagGetCountOfValue(CFBagRef theBag, const void *value); 80 | 81 | CF_EXPORT 82 | Boolean CFBagContainsValue(CFBagRef theBag, const void *value); 83 | 84 | CF_EXPORT 85 | const void *CFBagGetValue(CFBagRef theBag, const void *value); 86 | 87 | CF_EXPORT 88 | Boolean CFBagGetValueIfPresent(CFBagRef theBag, const void *candidate, const void **value); 89 | 90 | CF_EXPORT 91 | void CFBagGetValues(CFBagRef theBag, const void **values); 92 | 93 | CF_EXPORT 94 | void CFBagApplyFunction(CFBagRef theBag, CFBagApplierFunction applier, void *context); 95 | 96 | CF_EXPORT 97 | void CFBagAddValue(CFMutableBagRef theBag, const void *value); 98 | 99 | CF_EXPORT 100 | void CFBagReplaceValue(CFMutableBagRef theBag, const void *value); 101 | 102 | CF_EXPORT 103 | void CFBagSetValue(CFMutableBagRef theBag, const void *value); 104 | 105 | CF_EXPORT 106 | void CFBagRemoveValue(CFMutableBagRef theBag, const void *value); 107 | 108 | CF_EXPORT 109 | void CFBagRemoveAllValues(CFMutableBagRef theBag); 110 | 111 | CF_EXTERN_C_END 112 | CF_IMPLICIT_BRIDGING_DISABLED 113 | 114 | #endif /* ! __COREFOUNDATION_CFBAG__ */ 115 | 116 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFBigNumber.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFBigNumber.h 25 | Copyright (c) 2012-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFBIGNUMBER__) 29 | #define __COREFOUNDATION_CFBIGNUMBER__ 1 30 | 31 | #include 32 | #include 33 | 34 | 35 | // Base 1 billion number: each digit represents 0 to 999999999 36 | typedef struct { 37 | uint32_t digits[5]; 38 | int32_t sign:8; 39 | uint32_t __:24; 40 | } _CFBigNum; 41 | 42 | void _CFBigNumInitWithInt8(_CFBigNum *r, int8_t inNum); 43 | void _CFBigNumInitWithInt16(_CFBigNum *r, int16_t inNum); 44 | void _CFBigNumInitWithInt32(_CFBigNum *r, int32_t inNum); 45 | void _CFBigNumInitWithInt64(_CFBigNum *r, int64_t inNum); 46 | #ifdef __LP64__ 47 | void _CFBigNumInitWithInt128(_CFBigNum *r, __int128_t inNum); 48 | #endif 49 | 50 | void _CFBigNumInitWithUInt8(_CFBigNum *r, uint8_t inNum); 51 | void _CFBigNumInitWithUInt16(_CFBigNum *r, uint16_t inNum); 52 | void _CFBigNumInitWithUInt32(_CFBigNum *r, uint32_t inNum); 53 | void _CFBigNumInitWithUInt64(_CFBigNum *r, uint64_t inNum); 54 | #ifdef __LP64__ 55 | void _CFBigNumInitWithUInt128(_CFBigNum *r, __uint128_t inNum); 56 | #endif 57 | 58 | int8_t _CFBigNumGetInt8(const _CFBigNum *num); 59 | int16_t _CFBigNumGetInt16(const _CFBigNum *num); 60 | int32_t _CFBigNumGetInt32(const _CFBigNum *num); 61 | int64_t _CFBigNumGetInt64(const _CFBigNum *num); 62 | #ifdef __LP64__ 63 | __int128_t _CFBigNumGetInt128(const _CFBigNum *num); 64 | #endif 65 | 66 | uint8_t _CFBigNumGetUInt8(const _CFBigNum *num); 67 | uint16_t _CFBigNumGetUInt16(const _CFBigNum *num); 68 | uint32_t _CFBigNumGetUInt32(const _CFBigNum *num); 69 | uint64_t _CFBigNumGetUInt64(const _CFBigNum *num); 70 | #ifdef __LP64__ 71 | __uint128_t _CFBigNumGetUInt128(const _CFBigNum *num); 72 | #endif 73 | 74 | void _CFBigNumInitWithCFNumber(_CFBigNum *r, CFNumberRef input); 75 | void _CFBigNumInitWithBytes(_CFBigNum *r, const void *bytes, CFNumberType type); 76 | CFNumberRef _CFNumberCreateWithBigNum(const _CFBigNum *input); 77 | 78 | 79 | CFComparisonResult _CFBigNumCompare(const _CFBigNum *a, const _CFBigNum *b); 80 | 81 | void _CFBigNumNeg(_CFBigNum *r, const _CFBigNum *a); 82 | uint8_t _CFBigNumAdd(_CFBigNum *r, const _CFBigNum *a, const _CFBigNum *b); 83 | uint8_t _CFBigNumSub(_CFBigNum *r, const _CFBigNum *a, const _CFBigNum *b); 84 | 85 | 86 | void _CFBigNumToCString(const _CFBigNum *vp, Boolean leading_zeros, Boolean leading_plus, char *buffer, size_t buflen); 87 | void _CFBigNumFromCString(_CFBigNum *r, const char *string); 88 | 89 | char *_CFBigNumCopyDescription(const _CFBigNum *num); // caller must free() returned ptr 90 | 91 | 92 | #endif /* ! __COREFOUNDATION_CFBIGNUMBER__ */ 93 | 94 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFBitVector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFBitVector.h 25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFBITVECTOR__) 29 | #define __COREFOUNDATION_CFBITVECTOR__ 1 30 | 31 | #include 32 | 33 | CF_IMPLICIT_BRIDGING_ENABLED 34 | CF_EXTERN_C_BEGIN 35 | 36 | typedef UInt32 CFBit; 37 | 38 | typedef const struct __CFBitVector * CFBitVectorRef; 39 | typedef struct __CFBitVector * CFMutableBitVectorRef; 40 | 41 | CF_EXPORT CFTypeID CFBitVectorGetTypeID(void); 42 | 43 | CF_EXPORT CFBitVectorRef CFBitVectorCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex numBits); 44 | CF_EXPORT CFBitVectorRef CFBitVectorCreateCopy(CFAllocatorRef allocator, CFBitVectorRef bv); 45 | CF_EXPORT CFMutableBitVectorRef CFBitVectorCreateMutable(CFAllocatorRef allocator, CFIndex capacity); 46 | CF_EXPORT CFMutableBitVectorRef CFBitVectorCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBitVectorRef bv); 47 | 48 | CF_EXPORT CFIndex CFBitVectorGetCount(CFBitVectorRef bv); 49 | CF_EXPORT CFIndex CFBitVectorGetCountOfBit(CFBitVectorRef bv, CFRange range, CFBit value); 50 | CF_EXPORT Boolean CFBitVectorContainsBit(CFBitVectorRef bv, CFRange range, CFBit value); 51 | CF_EXPORT CFBit CFBitVectorGetBitAtIndex(CFBitVectorRef bv, CFIndex idx); 52 | CF_EXPORT void CFBitVectorGetBits(CFBitVectorRef bv, CFRange range, UInt8 *bytes); 53 | CF_EXPORT CFIndex CFBitVectorGetFirstIndexOfBit(CFBitVectorRef bv, CFRange range, CFBit value); 54 | CF_EXPORT CFIndex CFBitVectorGetLastIndexOfBit(CFBitVectorRef bv, CFRange range, CFBit value); 55 | 56 | CF_EXPORT void CFBitVectorSetCount(CFMutableBitVectorRef bv, CFIndex count); 57 | CF_EXPORT void CFBitVectorFlipBitAtIndex(CFMutableBitVectorRef bv, CFIndex idx); 58 | CF_EXPORT void CFBitVectorFlipBits(CFMutableBitVectorRef bv, CFRange range); 59 | CF_EXPORT void CFBitVectorSetBitAtIndex(CFMutableBitVectorRef bv, CFIndex idx, CFBit value); 60 | CF_EXPORT void CFBitVectorSetBits(CFMutableBitVectorRef bv, CFRange range, CFBit value); 61 | CF_EXPORT void CFBitVectorSetAllBits(CFMutableBitVectorRef bv, CFBit value); 62 | 63 | CF_EXTERN_C_END 64 | CF_IMPLICIT_BRIDGING_DISABLED 65 | 66 | #endif /* ! __COREFOUNDATION_CFBITVECTOR__ */ 67 | 68 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFBundle_BinaryTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFBundle_BinaryTypes.h 25 | Copyright (c) 1999-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFBUNDLE_BINARYTYPES__) 29 | #define __COREFOUNDATION_CFBUNDLE_BINARYTYPES__ 1 30 | 31 | CF_EXTERN_C_BEGIN 32 | 33 | #if DEPLOYMENT_TARGET_MACOSX 34 | #define BINARY_SUPPORT_DYLD 1 35 | #define BINARY_SUPPORT_DLFCN 1 36 | #define USE_DYLD_PRIV 1 37 | #elif DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI 38 | #define BINARY_SUPPORT_DYLD 1 39 | #define BINARY_SUPPORT_DLFCN 1 40 | #define USE_DYLD_PRIV 1 41 | #elif DEPLOYMENT_TARGET_WINDOWS 42 | #define BINARY_SUPPORT_DLL 1 43 | #else 44 | #error Unknown or unspecified DEPLOYMENT_TARGET 45 | #endif 46 | 47 | 48 | typedef enum { 49 | __CFBundleUnknownBinary, 50 | __CFBundleCFMBinary, 51 | __CFBundleDYLDExecutableBinary, 52 | __CFBundleDYLDBundleBinary, 53 | __CFBundleDYLDFrameworkBinary, 54 | __CFBundleDLLBinary, 55 | __CFBundleUnreadableBinary, 56 | __CFBundleNoBinary, 57 | __CFBundleELFBinary 58 | } __CFPBinaryType; 59 | 60 | /* Intended for eventual public consumption */ 61 | typedef enum { 62 | kCFBundleOtherExecutableType = 0, 63 | kCFBundleMachOExecutableType, 64 | kCFBundlePEFExecutableType, 65 | kCFBundleELFExecutableType, 66 | kCFBundleDLLExecutableType 67 | } CFBundleExecutableType; 68 | 69 | CF_EXTERN_C_END 70 | 71 | #endif /* ! __COREFOUNDATION_CFBUNDLE_BINARYTYPES__ */ 72 | 73 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFCalendar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFCalendar.h 25 | Copyright (c) 2004-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFCALENDAR__) 29 | #define __COREFOUNDATION_CFCALENDAR__ 1 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | CF_IMPLICIT_BRIDGING_ENABLED 37 | CF_EXTERN_C_BEGIN 38 | 39 | typedef struct CF_BRIDGED_MUTABLE_TYPE(NSCalendar) __CFCalendar * CFCalendarRef; 40 | 41 | CF_EXPORT 42 | CFTypeID CFCalendarGetTypeID(void); 43 | 44 | CF_EXPORT 45 | CFCalendarRef CFCalendarCopyCurrent(void); 46 | 47 | CF_EXPORT 48 | CFCalendarRef CFCalendarCreateWithIdentifier(CFAllocatorRef allocator, CFStringRef identifier); 49 | // Create a calendar. The identifiers are the kCF*Calendar 50 | // constants in CFLocale.h. 51 | 52 | CF_EXPORT 53 | CFStringRef CFCalendarGetIdentifier(CFCalendarRef calendar); 54 | // Returns the calendar's identifier. 55 | 56 | CF_EXPORT 57 | CFLocaleRef CFCalendarCopyLocale(CFCalendarRef calendar); 58 | 59 | CF_EXPORT 60 | void CFCalendarSetLocale(CFCalendarRef calendar, CFLocaleRef locale); 61 | 62 | CF_EXPORT 63 | CFTimeZoneRef CFCalendarCopyTimeZone(CFCalendarRef calendar); 64 | 65 | CF_EXPORT 66 | void CFCalendarSetTimeZone(CFCalendarRef calendar, CFTimeZoneRef tz); 67 | 68 | CF_EXPORT 69 | CFIndex CFCalendarGetFirstWeekday(CFCalendarRef calendar); 70 | 71 | CF_EXPORT 72 | void CFCalendarSetFirstWeekday(CFCalendarRef calendar, CFIndex wkdy); 73 | 74 | CF_EXPORT 75 | CFIndex CFCalendarGetMinimumDaysInFirstWeek(CFCalendarRef calendar); 76 | 77 | CF_EXPORT 78 | void CFCalendarSetMinimumDaysInFirstWeek(CFCalendarRef calendar, CFIndex mwd); 79 | 80 | 81 | typedef CF_OPTIONS(CFOptionFlags, CFCalendarUnit) { 82 | kCFCalendarUnitEra = (1UL << 1), 83 | kCFCalendarUnitYear = (1UL << 2), 84 | kCFCalendarUnitMonth = (1UL << 3), 85 | kCFCalendarUnitDay = (1UL << 4), 86 | kCFCalendarUnitHour = (1UL << 5), 87 | kCFCalendarUnitMinute = (1UL << 6), 88 | kCFCalendarUnitSecond = (1UL << 7), 89 | kCFCalendarUnitWeek CF_ENUM_DEPRECATED(10_4, 10_10, 2_0, 8_0) = (1UL << 8), 90 | kCFCalendarUnitWeekday = (1UL << 9), 91 | kCFCalendarUnitWeekdayOrdinal = (1UL << 10), 92 | kCFCalendarUnitQuarter CF_ENUM_AVAILABLE(10_6, 4_0) = (1UL << 11), 93 | kCFCalendarUnitWeekOfMonth CF_ENUM_AVAILABLE(10_7, 5_0) = (1UL << 12), 94 | kCFCalendarUnitWeekOfYear CF_ENUM_AVAILABLE(10_7, 5_0) = (1UL << 13), 95 | kCFCalendarUnitYearForWeekOfYear CF_ENUM_AVAILABLE(10_7, 5_0) = (1UL << 14), 96 | }; 97 | 98 | CF_EXPORT 99 | CFRange CFCalendarGetMinimumRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit); 100 | 101 | CF_EXPORT 102 | CFRange CFCalendarGetMaximumRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit); 103 | 104 | CF_EXPORT 105 | CFRange CFCalendarGetRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit smallerUnit, CFCalendarUnit biggerUnit, CFAbsoluteTime at); 106 | 107 | CF_EXPORT 108 | CFIndex CFCalendarGetOrdinalityOfUnit(CFCalendarRef calendar, CFCalendarUnit smallerUnit, CFCalendarUnit biggerUnit, CFAbsoluteTime at); 109 | 110 | CF_EXPORT 111 | Boolean CFCalendarGetTimeRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit, CFAbsoluteTime at, CFAbsoluteTime *startp, CFTimeInterval *tip) CF_AVAILABLE(10_5, 2_0); 112 | 113 | CF_EXPORT 114 | Boolean CFCalendarComposeAbsoluteTime(CFCalendarRef calendar, /* out */ CFAbsoluteTime *at, const char *componentDesc, ...); 115 | 116 | CF_EXPORT 117 | Boolean CFCalendarDecomposeAbsoluteTime(CFCalendarRef calendar, CFAbsoluteTime at, const char *componentDesc, ...); 118 | 119 | 120 | enum { 121 | kCFCalendarComponentsWrap = (1UL << 0) // option for adding 122 | }; 123 | 124 | CF_EXPORT 125 | Boolean CFCalendarAddComponents(CFCalendarRef calendar, /* inout */ CFAbsoluteTime *at, CFOptionFlags options, const char *componentDesc, ...); 126 | 127 | CF_EXPORT 128 | Boolean CFCalendarGetComponentDifference(CFCalendarRef calendar, CFAbsoluteTime startingAT, CFAbsoluteTime resultAT, CFOptionFlags options, const char *componentDesc, ...); 129 | 130 | 131 | CF_EXTERN_C_END 132 | CF_IMPLICIT_BRIDGING_DISABLED 133 | 134 | #endif /* ! __COREFOUNDATION_CFCALENDAR__ */ 135 | 136 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFCharacterSetPriv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFCharacterSetPriv.h 25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFCHARACTERSETPRIV__) 29 | #define __COREFOUNDATION_CFCHARACTERSETPRIV__ 1 30 | 31 | #include 32 | 33 | CF_EXTERN_C_BEGIN 34 | 35 | /*! 36 | @function CFCharacterSetIsSurrogateHighCharacter 37 | Reports whether or not the character is a high surrogate. 38 | @param character The character to be checked. 39 | @result true, if character is a high surrogate, otherwise false. 40 | */ 41 | CF_INLINE Boolean CFCharacterSetIsSurrogateHighCharacter(UniChar character) { 42 | return ((character >= 0xD800UL) && (character <= 0xDBFFUL) ? true : false); 43 | } 44 | 45 | /*! 46 | @function CFCharacterSetIsSurrogateLowCharacter 47 | Reports whether or not the character is a low surrogate. 48 | @param character The character to be checked. 49 | @result true, if character is a low surrogate, otherwise false. 50 | */ 51 | CF_INLINE Boolean CFCharacterSetIsSurrogateLowCharacter(UniChar character) { 52 | return ((character >= 0xDC00UL) && (character <= 0xDFFFUL) ? true : false); 53 | } 54 | 55 | /*! 56 | @function CFCharacterSetGetLongCharacterForSurrogatePair 57 | Returns the UTF-32 value corresponding to the surrogate pair passed in. 58 | @param surrogateHigh The high surrogate character. If this parameter 59 | is not a valid high surrogate character, the behavior is undefined. 60 | @param surrogateLow The low surrogate character. If this parameter 61 | is not a valid low surrogate character, the behavior is undefined. 62 | @result The UTF-32 value for the surrogate pair. 63 | */ 64 | CF_INLINE UTF32Char CFCharacterSetGetLongCharacterForSurrogatePair(UniChar surrogateHigh, UniChar surrogateLow) { 65 | return (UTF32Char)(((surrogateHigh - 0xD800UL) << 10) + (surrogateLow - 0xDC00UL) + 0x0010000UL); 66 | } 67 | 68 | /* Check to see if the character represented by the surrogate pair surrogateHigh & surrogateLow is in the chraracter set */ 69 | CF_EXPORT Boolean CFCharacterSetIsSurrogatePairMember(CFCharacterSetRef theSet, UniChar surrogateHigh, UniChar surrogateLow) ; 70 | 71 | /* Keyed-coding support 72 | */ 73 | typedef CF_ENUM(CFIndex, CFCharacterSetKeyedCodingType) { 74 | kCFCharacterSetKeyedCodingTypeBitmap = 1, 75 | kCFCharacterSetKeyedCodingTypeBuiltin = 2, 76 | kCFCharacterSetKeyedCodingTypeRange = 3, 77 | kCFCharacterSetKeyedCodingTypeString = 4, 78 | kCFCharacterSetKeyedCodingTypeBuiltinAndBitmap = 5 79 | }; 80 | 81 | CF_EXPORT CFCharacterSetKeyedCodingType _CFCharacterSetGetKeyedCodingType(CFCharacterSetRef cset); 82 | CF_EXPORT CFCharacterSetPredefinedSet _CFCharacterSetGetKeyedCodingBuiltinType(CFCharacterSetRef cset); 83 | CF_EXPORT CFRange _CFCharacterSetGetKeyedCodingRange(CFCharacterSetRef cset); 84 | CF_EXPORT CFStringRef _CFCharacterSetCreateKeyedCodingString(CFCharacterSetRef cset); 85 | CF_EXPORT bool _CFCharacterSetIsInverted(CFCharacterSetRef cset); 86 | CF_EXPORT void _CFCharacterSetSetIsInverted(CFCharacterSetRef cset, bool flag); 87 | 88 | CF_EXTERN_C_END 89 | 90 | #endif /* ! __COREFOUNDATION_CFCHARACTERSETPRIV__ */ 91 | 92 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFData.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFData.h 25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFDATA__) 29 | #define __COREFOUNDATION_CFDATA__ 1 30 | 31 | #include 32 | 33 | CF_IMPLICIT_BRIDGING_ENABLED 34 | CF_EXTERN_C_BEGIN 35 | 36 | typedef const struct CF_BRIDGED_TYPE(NSData) __CFData * CFDataRef; 37 | typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMutableData) __CFData * CFMutableDataRef; 38 | 39 | CF_EXPORT 40 | CFTypeID CFDataGetTypeID(void); 41 | 42 | CF_EXPORT 43 | CFDataRef CFDataCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length); 44 | 45 | CF_EXPORT 46 | CFDataRef CFDataCreateWithBytesNoCopy(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length, CFAllocatorRef bytesDeallocator); 47 | /* Pass kCFAllocatorNull as bytesDeallocator to assure the bytes aren't freed */ 48 | 49 | CF_EXPORT 50 | CFDataRef CFDataCreateCopy(CFAllocatorRef allocator, CFDataRef theData); 51 | 52 | CF_EXPORT 53 | CFMutableDataRef CFDataCreateMutable(CFAllocatorRef allocator, CFIndex capacity); 54 | 55 | CF_EXPORT 56 | CFMutableDataRef CFDataCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFDataRef theData); 57 | 58 | CF_EXPORT 59 | CFIndex CFDataGetLength(CFDataRef theData); 60 | 61 | CF_EXPORT 62 | const UInt8 *CFDataGetBytePtr(CFDataRef theData); 63 | 64 | CF_EXPORT 65 | UInt8 *CFDataGetMutableBytePtr(CFMutableDataRef theData); 66 | 67 | CF_EXPORT 68 | void CFDataGetBytes(CFDataRef theData, CFRange range, UInt8 *buffer); 69 | 70 | CF_EXPORT 71 | void CFDataSetLength(CFMutableDataRef theData, CFIndex length); 72 | 73 | CF_EXPORT 74 | void CFDataIncreaseLength(CFMutableDataRef theData, CFIndex extraLength); 75 | 76 | CF_EXPORT 77 | void CFDataAppendBytes(CFMutableDataRef theData, const UInt8 *bytes, CFIndex length); 78 | 79 | CF_EXPORT 80 | void CFDataReplaceBytes(CFMutableDataRef theData, CFRange range, const UInt8 *newBytes, CFIndex newLength); 81 | 82 | CF_EXPORT 83 | void CFDataDeleteBytes(CFMutableDataRef theData, CFRange range); 84 | 85 | typedef CF_OPTIONS(CFOptionFlags, CFDataSearchFlags) { 86 | kCFDataSearchBackwards = 1UL << 0, 87 | kCFDataSearchAnchored = 1UL << 1 88 | } CF_ENUM_AVAILABLE(10_6, 4_0); 89 | 90 | CF_EXPORT 91 | CFRange CFDataFind(CFDataRef theData, CFDataRef dataToFind, CFRange searchRange, CFDataSearchFlags compareOptions) CF_AVAILABLE(10_6, 4_0); 92 | 93 | CF_EXTERN_C_END 94 | CF_IMPLICIT_BRIDGING_DISABLED 95 | 96 | #endif /* ! __COREFOUNDATION_CFDATA__ */ 97 | 98 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFError_Private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFError_Private.h 25 | Copyright (c) 2006-2014, Apple Inc. All rights reserved. 26 | 27 | This is Apple-internal SPI for CFError. 28 | */ 29 | 30 | #if !defined(__COREFOUNDATION_CFERRORPRIVATE__) 31 | #define __COREFOUNDATION_CFERRORPRIVATE__ 1 32 | 33 | #include 34 | 35 | CF_EXTERN_C_BEGIN 36 | 37 | /* This callback function is consulted if a key is not present in the userInfo dictionary. Note that setting a callback for the same domain again simply replaces the previous callback. Set NULL as the callback to remove it. 38 | */ 39 | typedef CFTypeRef (*CFErrorUserInfoKeyCallBack)(CFErrorRef err, CFStringRef key); 40 | CF_EXPORT void CFErrorSetCallBackForDomain(CFStringRef domainName, CFErrorUserInfoKeyCallBack callBack) CF_AVAILABLE(10_5, 2_0); 41 | CF_EXPORT CFErrorUserInfoKeyCallBack CFErrorGetCallBackForDomain(CFStringRef domainName) CF_AVAILABLE(10_5, 2_0); 42 | 43 | 44 | /* A key for "true" debugging descriptions which should never be shown to the user. It's only used when the CFError is shown to the console, and nothing else is available. For instance the rather terse and techie OSStatus descriptions are in this boat. 45 | */ 46 | CF_EXPORT const CFStringRef kCFErrorDebugDescriptionKey CF_AVAILABLE(10_5, 2_0); 47 | 48 | 49 | CF_EXTERN_C_END 50 | 51 | #endif /* ! __COREFOUNDATION_CFERRORPRIVATE__ */ 52 | 53 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFICUConverters.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* 25 | * CFICUConverters.h 26 | * CoreFoundation 27 | * 28 | * Created by Aki Inoue on 07/12/04. 29 | * Copyright (c) 2007-2014, Apple Inc. All rights reserved. 30 | * 31 | */ 32 | 33 | #include 34 | 35 | CF_PRIVATE const char *__CFStringEncodingGetICUName(CFStringEncoding encoding); 36 | 37 | CF_PRIVATE CFStringEncoding __CFStringEncodingGetFromICUName(const char *icuName); 38 | 39 | 40 | CF_PRIVATE CFIndex __CFStringEncodingICUToBytes(const char *icuName, uint32_t flags, const UniChar *characters, CFIndex numChars, CFIndex *usedCharLen, uint8_t *bytes, CFIndex maxByteLen, CFIndex *usedByteLen); 41 | CF_PRIVATE CFIndex __CFStringEncodingICUToUnicode(const char *icuName, uint32_t flags, const uint8_t *bytes, CFIndex numBytes, CFIndex *usedByteLen, UniChar *characters, CFIndex maxCharLen, CFIndex *usedCharLen); 42 | CF_PRIVATE CFIndex __CFStringEncodingICUCharLength(const char *icuName, uint32_t flags, const uint8_t *bytes, CFIndex numBytes); 43 | CF_PRIVATE CFIndex __CFStringEncodingICUByteLength(const char *icuName, uint32_t flags, const UniChar *characters, CFIndex numChars); 44 | 45 | // The caller is responsible for freeing the memory (use CFAllocatorDeallocate) 46 | CF_PRIVATE CFStringEncoding *__CFStringEncodingCreateICUEncodings(CFAllocatorRef allocator, CFIndex *numberOfIndex); 47 | 48 | 49 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFICULogging.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* 25 | CFICULogging.h 26 | Copyright (c) 2008-2014, Apple Inc. All rights reserved. 27 | */ 28 | 29 | /* 30 | This file is for the use of the CoreFoundation project only. 31 | */ 32 | 33 | #if !defined(__COREFOUNDATION_CFICULOGGING__) 34 | #define __COREFOUNDATION_CFICULOGGING__ 1 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | // ucal 44 | 45 | 46 | // ucal 47 | #define __cficu_ucal_open ucal_open 48 | #define __cficu_ucal_close ucal_close 49 | #define __cficu_ucal_clone ucal_clone 50 | #define __cficu_ucal_setAttribute ucal_setAttribute 51 | #define __cficu_ucal_getAttribute ucal_getAttribute 52 | #define __cficu_ucal_setGregorianChange ucal_setGregorianChange 53 | #define __cficu_ucal_getGregorianChange ucal_getGregorianChange 54 | #define __cficu_ucal_getMillis ucal_getMillis 55 | #define __cficu_ucal_setMillis ucal_setMillis 56 | #define __cficu_ucal_set ucal_set 57 | #define __cficu_ucal_get ucal_get 58 | #define __cficu_ucal_getDayOfWeekType ucal_getDayOfWeekType 59 | #define __cficu_ucal_getWeekendTransition ucal_getWeekendTransition 60 | #define __cficu_ucal_isWeekend ucal_isWeekend 61 | #define __cficu_ucal_clear ucal_clear 62 | #define __cficu_ucal_getLimit ucal_getLimit 63 | #define __cficu_ucal_add ucal_add 64 | #define __cficu_ucal_roll ucal_roll 65 | #define __cficu_ucal_getFieldDifference ucal_getFieldDifference 66 | #define __cficu_ucal_getNow ucal_getNow 67 | #define __cficu_ucal_setTimeZone ucal_setTimeZone 68 | // udatpg 69 | #define __cficu_udatpg_open udatpg_open 70 | #define __cficu_udatpg_close udatpg_close 71 | #define __cficu_udatpg_getSkeleton udatpg_getSkeleton 72 | #define __cficu_udatpg_getBestPattern udatpg_getBestPattern 73 | // udat 74 | #define __cficu_udat_applyPattern udat_applyPattern 75 | #define __cficu_udat_applyPatternRelative udat_applyPatternRelative 76 | #define __cficu_udat_clone udat_clone 77 | #define __cficu_udat_close udat_close 78 | #define __cficu_udat_countSymbols udat_countSymbols 79 | #define __cficu_udat_format udat_format 80 | #define __cficu_udat_get2DigitYearStart udat_get2DigitYearStart 81 | #define __cficu_udat_getCalendar udat_getCalendar 82 | #define __cficu_udat_getSymbols udat_getSymbols 83 | #define __cficu_udat_isLenient udat_isLenient 84 | #define __cficu_udat_open udat_open 85 | #define __cficu_udat_parseCalendar udat_parseCalendar 86 | #define __cficu_udat_set2DigitYearStart udat_set2DigitYearStart 87 | #define __cficu_udat_setCalendar udat_setCalendar 88 | #define __cficu_udat_setLenient udat_setLenient 89 | #define __cficu_udat_setSymbols udat_setSymbols 90 | #define __cficu_udat_toPattern udat_toPattern 91 | #define __cficu_udat_toPatternRelativeDate udat_toPatternRelativeDate 92 | #define __cficu_udat_toPatternRelativeTime udat_toPatternRelativeTime 93 | #define __cficu_unum_applyPattern unum_applyPattern 94 | #define __cficu_unum_close unum_close 95 | #define __cficu_unum_formatDecimal unum_formatDecimal 96 | #define __cficu_unum_formatDouble unum_formatDouble 97 | #define __cficu_unum_getAttribute unum_getAttribute 98 | #define __cficu_unum_getDoubleAttribute unum_getDoubleAttribute 99 | #define __cficu_unum_getSymbol unum_getSymbol 100 | #define __cficu_unum_getTextAttribute unum_getTextAttribute 101 | #define __cficu_unum_open unum_open 102 | #define __cficu_unum_parse unum_parse 103 | #define __cficu_unum_parseDecimal unum_parseDecimal 104 | #define __cficu_unum_setAttribute unum_setAttribute 105 | #define __cficu_unum_setDoubleAttribute unum_setDoubleAttribute 106 | #define __cficu_unum_setSymbol unum_setSymbol 107 | #define __cficu_unum_setTextAttribute unum_setTextAttribute 108 | #define __cficu_unum_toPattern unum_toPattern 109 | #define __cficu_udat_setContext udat_setContext 110 | #define __cficu_udat_getContext udat_getContext 111 | // ucurr 112 | #define __cficu_ucurr_getDefaultFractionDigits ucurr_getDefaultFractionDigits 113 | #define __cficu_ucurr_getRoundingIncrement ucurr_getRoundingIncrement 114 | // unum 115 | #define __cficu_unum_setContext unum_setContext 116 | #define __cficu_unum_getContext unum_getContext 117 | 118 | #endif 119 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFLogUtilities.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFLogUtilities.h 25 | Copyright (c) 2004-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | /* 29 | APPLE SPI: NOT TO BE USED OUTSIDE APPLE! 30 | */ 31 | 32 | #if !defined(__COREFOUNDATION_CFLOGUTILITIES__) 33 | #define __COREFOUNDATION_CFLOGUTILITIES__ 1 34 | 35 | #include 36 | #include 37 | 38 | CF_EXTERN_C_BEGIN 39 | 40 | 41 | enum { // Legal level values for CFLog() 42 | kCFLogLevelEmergency = 0, 43 | kCFLogLevelAlert = 1, 44 | kCFLogLevelCritical = 2, 45 | kCFLogLevelError = 3, 46 | kCFLogLevelWarning = 4, 47 | kCFLogLevelNotice = 5, 48 | kCFLogLevelInfo = 6, 49 | kCFLogLevelDebug = 7, 50 | }; 51 | 52 | CF_EXPORT void CFLog(int32_t level, CFStringRef format, ...); 53 | /* Passing in a level value which is outside the range of 0-7 will cause the the call to do nothing. 54 | CFLog() logs the message using the asl.h API, and uses the level parameter as the log level. 55 | Note that the asl subsystem ignores some log levels by default. 56 | CFLog() is not fast, and is not going to be guaranteed to be fast. 57 | Even "no-op" CFLogs are not necessarily fast. 58 | If you care about performance, you shouldn't be logging. 59 | */ 60 | 61 | CF_EXTERN_C_END 62 | 63 | #endif /* ! __COREFOUNDATION_CFLOGUTILITIES__ */ 64 | 65 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFMachPort.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFMachPort.h 25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFMACHPORT__) 29 | #define __COREFOUNDATION_CFMACHPORT__ 1 30 | 31 | #include 32 | #include 33 | 34 | CF_IMPLICIT_BRIDGING_ENABLED 35 | CF_EXTERN_C_BEGIN 36 | 37 | typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMachPort) __CFMachPort * CFMachPortRef; 38 | 39 | typedef struct { 40 | CFIndex version; 41 | void * info; 42 | const void *(*retain)(const void *info); 43 | void (*release)(const void *info); 44 | CFStringRef (*copyDescription)(const void *info); 45 | } CFMachPortContext; 46 | 47 | typedef void (*CFMachPortCallBack)(CFMachPortRef port, void *msg, CFIndex size, void *info); 48 | typedef void (*CFMachPortInvalidationCallBack)(CFMachPortRef port, void *info); 49 | 50 | CF_EXPORT CFTypeID CFMachPortGetTypeID(void); 51 | 52 | CF_EXPORT CFMachPortRef CFMachPortCreate(CFAllocatorRef allocator, CFMachPortCallBack callout, CFMachPortContext *context, Boolean *shouldFreeInfo); 53 | CF_EXPORT CFMachPortRef CFMachPortCreateWithPort(CFAllocatorRef allocator, mach_port_t portNum, CFMachPortCallBack callout, CFMachPortContext *context, Boolean *shouldFreeInfo); 54 | 55 | CF_EXPORT mach_port_t CFMachPortGetPort(CFMachPortRef port); 56 | CF_EXPORT void CFMachPortGetContext(CFMachPortRef port, CFMachPortContext *context); 57 | CF_EXPORT void CFMachPortInvalidate(CFMachPortRef port); 58 | CF_EXPORT Boolean CFMachPortIsValid(CFMachPortRef port); 59 | CF_EXPORT CFMachPortInvalidationCallBack CFMachPortGetInvalidationCallBack(CFMachPortRef port); 60 | CF_EXPORT void CFMachPortSetInvalidationCallBack(CFMachPortRef port, CFMachPortInvalidationCallBack callout); 61 | 62 | CF_EXPORT CFRunLoopSourceRef CFMachPortCreateRunLoopSource(CFAllocatorRef allocator, CFMachPortRef port, CFIndex order); 63 | 64 | CF_EXTERN_C_END 65 | CF_IMPLICIT_BRIDGING_DISABLED 66 | 67 | #endif /* ! __COREFOUNDATION_CFMACHPORT__ */ 68 | 69 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFMessagePort.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFMessagePort.h 25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFMESSAGEPORT__) 29 | #define __COREFOUNDATION_CFMESSAGEPORT__ 1 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | CF_IMPLICIT_BRIDGING_ENABLED 36 | CF_EXTERN_C_BEGIN 37 | 38 | typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMessagePort) __CFMessagePort * CFMessagePortRef; 39 | 40 | enum { 41 | kCFMessagePortSuccess = 0, 42 | kCFMessagePortSendTimeout = -1, 43 | kCFMessagePortReceiveTimeout = -2, 44 | kCFMessagePortIsInvalid = -3, 45 | kCFMessagePortTransportError = -4, 46 | kCFMessagePortBecameInvalidError = -5 47 | }; 48 | 49 | typedef struct { 50 | CFIndex version; 51 | void * info; 52 | const void *(*retain)(const void *info); 53 | void (*release)(const void *info); 54 | CFStringRef (*copyDescription)(const void *info); 55 | } CFMessagePortContext; 56 | 57 | typedef CFDataRef (*CFMessagePortCallBack)(CFMessagePortRef local, SInt32 msgid, CFDataRef data, void *info); 58 | /* If callout wants to keep a hold of the data past the return of the callout, it must COPY the data. This includes the case where the data is given to some routine which _might_ keep a hold of it; System will release returned CFData. */ 59 | typedef void (*CFMessagePortInvalidationCallBack)(CFMessagePortRef ms, void *info); 60 | 61 | CF_EXPORT CFTypeID CFMessagePortGetTypeID(void); 62 | 63 | CF_EXPORT CFMessagePortRef CFMessagePortCreateLocal(CFAllocatorRef allocator, CFStringRef name, CFMessagePortCallBack callout, CFMessagePortContext *context, Boolean *shouldFreeInfo); 64 | CF_EXPORT CFMessagePortRef CFMessagePortCreateRemote(CFAllocatorRef allocator, CFStringRef name); 65 | 66 | CF_EXPORT Boolean CFMessagePortIsRemote(CFMessagePortRef ms); 67 | CF_EXPORT CFStringRef CFMessagePortGetName(CFMessagePortRef ms); 68 | CF_EXPORT Boolean CFMessagePortSetName(CFMessagePortRef ms, CFStringRef newName); 69 | CF_EXPORT void CFMessagePortGetContext(CFMessagePortRef ms, CFMessagePortContext *context); 70 | CF_EXPORT void CFMessagePortInvalidate(CFMessagePortRef ms); 71 | CF_EXPORT Boolean CFMessagePortIsValid(CFMessagePortRef ms); 72 | CF_EXPORT CFMessagePortInvalidationCallBack CFMessagePortGetInvalidationCallBack(CFMessagePortRef ms); 73 | CF_EXPORT void CFMessagePortSetInvalidationCallBack(CFMessagePortRef ms, CFMessagePortInvalidationCallBack callout); 74 | 75 | /* NULL replyMode argument means no return value expected, dont wait for it */ 76 | CF_EXPORT SInt32 CFMessagePortSendRequest(CFMessagePortRef remote, SInt32 msgid, CFDataRef data, CFTimeInterval sendTimeout, CFTimeInterval rcvTimeout, CFStringRef replyMode, CFDataRef *returnData); 77 | 78 | CF_EXPORT CFRunLoopSourceRef CFMessagePortCreateRunLoopSource(CFAllocatorRef allocator, CFMessagePortRef local, CFIndex order); 79 | 80 | CF_EXTERN_C_END 81 | CF_IMPLICIT_BRIDGING_DISABLED 82 | 83 | #endif /* ! __COREFOUNDATION_CFMESSAGEPORT__ */ 84 | 85 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFNumber.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFNumber.h 25 | Copyright (c) 1999-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFNUMBER__) 29 | #define __COREFOUNDATION_CFNUMBER__ 1 30 | 31 | #include 32 | 33 | CF_IMPLICIT_BRIDGING_ENABLED 34 | CF_EXTERN_C_BEGIN 35 | 36 | typedef const struct CF_BRIDGED_TYPE(NSNumber) __CFBoolean * CFBooleanRef; 37 | 38 | CF_EXPORT 39 | const CFBooleanRef kCFBooleanTrue; 40 | CF_EXPORT 41 | const CFBooleanRef kCFBooleanFalse; 42 | 43 | CF_EXPORT 44 | CFTypeID CFBooleanGetTypeID(void); 45 | 46 | CF_EXPORT 47 | Boolean CFBooleanGetValue(CFBooleanRef boolean); 48 | 49 | typedef CF_ENUM(CFIndex, CFNumberType) { 50 | /* Fixed-width types */ 51 | kCFNumberSInt8Type = 1, 52 | kCFNumberSInt16Type = 2, 53 | kCFNumberSInt32Type = 3, 54 | kCFNumberSInt64Type = 4, 55 | kCFNumberFloat32Type = 5, 56 | kCFNumberFloat64Type = 6, /* 64-bit IEEE 754 */ 57 | /* Basic C types */ 58 | kCFNumberCharType = 7, 59 | kCFNumberShortType = 8, 60 | kCFNumberIntType = 9, 61 | kCFNumberLongType = 10, 62 | kCFNumberLongLongType = 11, 63 | kCFNumberFloatType = 12, 64 | kCFNumberDoubleType = 13, 65 | /* Other */ 66 | kCFNumberCFIndexType = 14, 67 | kCFNumberNSIntegerType CF_ENUM_AVAILABLE(10_5, 2_0) = 15, 68 | kCFNumberCGFloatType CF_ENUM_AVAILABLE(10_5, 2_0) = 16, 69 | kCFNumberMaxType = 16 70 | }; 71 | 72 | typedef const struct CF_BRIDGED_TYPE(NSNumber) __CFNumber * CFNumberRef; 73 | 74 | CF_EXPORT 75 | const CFNumberRef kCFNumberPositiveInfinity; 76 | CF_EXPORT 77 | const CFNumberRef kCFNumberNegativeInfinity; 78 | CF_EXPORT 79 | const CFNumberRef kCFNumberNaN; 80 | 81 | CF_EXPORT 82 | CFTypeID CFNumberGetTypeID(void); 83 | 84 | /* 85 | Creates a CFNumber with the given value. The type of number pointed 86 | to by the valuePtr is specified by type. If type is a floating point 87 | type and the value represents one of the infinities or NaN, the 88 | well-defined CFNumber for that value is returned. If either of 89 | valuePtr or type is an invalid value, the result is undefined. 90 | */ 91 | CF_EXPORT 92 | CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr); 93 | 94 | /* 95 | Returns the storage format of the CFNumber's value. Note that 96 | this is not necessarily the type provided in CFNumberCreate(). 97 | */ 98 | CF_EXPORT 99 | CFNumberType CFNumberGetType(CFNumberRef number); 100 | 101 | /* 102 | Returns the size in bytes of the type of the number. 103 | */ 104 | CF_EXPORT 105 | CFIndex CFNumberGetByteSize(CFNumberRef number); 106 | 107 | /* 108 | Returns true if the type of the CFNumber's value is one of 109 | the defined floating point types. 110 | */ 111 | CF_EXPORT 112 | Boolean CFNumberIsFloatType(CFNumberRef number); 113 | 114 | /* 115 | Copies the CFNumber's value into the space pointed to by 116 | valuePtr, as the specified type. If conversion needs to take 117 | place, the conversion rules follow human expectation and not 118 | C's promotion and truncation rules. If the conversion is 119 | lossy, or the value is out of range, false is returned. Best 120 | attempt at conversion will still be in *valuePtr. 121 | */ 122 | CF_EXPORT 123 | Boolean CFNumberGetValue(CFNumberRef number, CFNumberType theType, void *valuePtr); 124 | 125 | /* 126 | Compares the two CFNumber instances. If conversion of the 127 | types of the values is needed, the conversion and comparison 128 | follow human expectations and not C's promotion and comparison 129 | rules. Negative zero compares less than positive zero. 130 | Positive infinity compares greater than everything except 131 | itself, to which it compares equal. Negative infinity compares 132 | less than everything except itself, to which it compares equal. 133 | Unlike standard practice, if both numbers are NaN, then they 134 | compare equal; if only one of the numbers is NaN, then the NaN 135 | compares greater than the other number if it is negative, and 136 | smaller than the other number if it is positive. (Note that in 137 | CFEqual() with two CFNumbers, if either or both of the numbers 138 | is NaN, true is returned.) 139 | */ 140 | CF_EXPORT 141 | CFComparisonResult CFNumberCompare(CFNumberRef number, CFNumberRef otherNumber, void *context); 142 | 143 | CF_EXTERN_C_END 144 | CF_IMPLICIT_BRIDGING_DISABLED 145 | 146 | #endif /* ! __COREFOUNDATION_CFNUMBER__ */ 147 | 148 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFPlugInCOM.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFPlugInCOM.h 25 | Copyright (c) 1999-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFPLUGINCOM__) 29 | #define __COREFOUNDATION_CFPLUGINCOM__ 1 30 | 31 | #include 32 | 33 | CF_EXTERN_C_BEGIN 34 | 35 | /* ================= IUnknown definition (C struct) ================= */ 36 | 37 | /* All interface structs must have an IUnknownStruct at the beginning. */ 38 | /* The _reserved field is part of the Microsoft COM binary standard on Macintosh. */ 39 | /* You can declare new C struct interfaces by defining a new struct that includes "IUNKNOWN_C_GUTS;" before the first field of the struct. */ 40 | 41 | typedef SInt32 HRESULT; 42 | typedef UInt32 ULONG; 43 | typedef void *LPVOID; 44 | typedef CFUUIDBytes REFIID; 45 | 46 | #define SUCCEEDED(Status) ((HRESULT)(Status) >= 0) 47 | #define FAILED(Status) ((HRESULT)(Status)<0) 48 | 49 | /* Macros for more detailed HRESULT analysis */ 50 | #define IS_ERROR(Status) ((unsigned long)(Status) >> 31 == SEVERITY_ERROR) 51 | #define HRESULT_CODE(hr) ((hr) & 0xFFFF) 52 | #define HRESULT_FACILITY(hr) (((hr) >> 16) & 0x1fff) 53 | #define HRESULT_SEVERITY(hr) (((hr) >> 31) & 0x1) 54 | #define SEVERITY_SUCCESS 0 55 | #define SEVERITY_ERROR 1 56 | 57 | /* Creating an HRESULT from its component pieces */ 58 | #define MAKE_HRESULT(sev,fac,code) ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) ) 59 | 60 | /* Pre-defined success HRESULTS */ 61 | #define S_OK ((HRESULT)0x00000000L) 62 | #define S_FALSE ((HRESULT)0x00000001L) 63 | 64 | /* Common error HRESULTS */ 65 | #define E_UNEXPECTED ((HRESULT)0x8000FFFFL) 66 | #define E_NOTIMPL ((HRESULT)0x80000001L) 67 | #define E_OUTOFMEMORY ((HRESULT)0x80000002L) 68 | #define E_INVALIDARG ((HRESULT)0x80000003L) 69 | #define E_NOINTERFACE ((HRESULT)0x80000004L) 70 | #define E_POINTER ((HRESULT)0x80000005L) 71 | #define E_HANDLE ((HRESULT)0x80000006L) 72 | #define E_ABORT ((HRESULT)0x80000007L) 73 | #define E_FAIL ((HRESULT)0x80000008L) 74 | #define E_ACCESSDENIED ((HRESULT)0x80000009L) 75 | 76 | /* This macro should be used when defining all interface functions (as it is for the IUnknown functions below). */ 77 | #define STDMETHODCALLTYPE 78 | 79 | /* The __RPC_FAR macro is for COM source compatibility only. This macro is used a lot in COM interface definitions. If your CFPlugIn interfaces need to be COM interfaces as well, you can use this macro to get better source compatibility. It is not used in the IUnknown definition below, because when doing COM, you will be using the Microsoft supplied IUnknown interface anyway. */ 80 | #define __RPC_FAR 81 | 82 | /* The IUnknown interface */ 83 | #define IUnknownUUID CFUUIDGetConstantUUIDWithBytes(kCFAllocatorSystemDefault, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46) 84 | 85 | #define IUNKNOWN_C_GUTS \ 86 | void *_reserved; \ 87 | HRESULT (STDMETHODCALLTYPE *QueryInterface)(void *thisPointer, REFIID iid, LPVOID *ppv); \ 88 | ULONG (STDMETHODCALLTYPE *AddRef)(void *thisPointer); \ 89 | ULONG (STDMETHODCALLTYPE *Release)(void *thisPointer) 90 | 91 | typedef struct IUnknownVTbl { 92 | IUNKNOWN_C_GUTS; 93 | } IUnknownVTbl; 94 | 95 | CF_EXTERN_C_END 96 | 97 | 98 | /* C++ specific stuff */ 99 | #if defined(__cplusplus) 100 | /* ================= IUnknown definition (C++ class) ================= */ 101 | 102 | /* This is a definition of IUnknown as a pure abstract virtual C++ class. This class will work only with compilers that can produce COM-compatible object layouts for C++ classes. egcs can not do this. MetroWerks can do this (if you subclass from __comobject) */ 103 | 104 | class IUnknown 105 | #if defined(__MWERKS__) && TARGET_OS_WIN32 106 | : __comobject 107 | #endif 108 | { 109 | public: 110 | virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) = 0; 111 | virtual ULONG STDMETHODCALLTYPE AddRef(void) = 0; 112 | virtual ULONG STDMETHODCALLTYPE Release(void) = 0; 113 | }; 114 | 115 | #endif /* __cplusplus */ 116 | 117 | #endif /* ! __COREFOUNDATION_CFPLUGINCOM__ */ 118 | 119 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFPlugIn_Factory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFPlugIn_Factory.h 25 | Copyright (c) 1999-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFPLUGIN_FACTORY__) 29 | #define __COREFOUNDATION_CFPLUGIN_FACTORY__ 1 30 | 31 | #include "CFBundle_Internal.h" 32 | 33 | CF_EXTERN_C_BEGIN 34 | 35 | typedef struct __CFPFactory *_CFPFactoryRef; 36 | 37 | extern _CFPFactoryRef _CFPFactoryCreate(CFAllocatorRef allocator, CFUUIDRef factoryID, CFPlugInFactoryFunction func); 38 | extern _CFPFactoryRef _CFPFactoryCreateByName(CFAllocatorRef allocator, CFUUIDRef factoryID, CFPlugInRef plugIn, CFStringRef funcName); 39 | 40 | extern _CFPFactoryRef _CFPFactoryFind(CFUUIDRef factoryID, Boolean enabled); 41 | 42 | extern CFUUIDRef _CFPFactoryCopyFactoryID(_CFPFactoryRef factory); 43 | extern CFPlugInRef _CFPFactoryCopyPlugIn(_CFPFactoryRef factory); 44 | 45 | extern void *_CFPFactoryCreateInstance(CFAllocatorRef allocator, _CFPFactoryRef factory, CFUUIDRef typeID); 46 | extern void _CFPFactoryDisable(_CFPFactoryRef factory); 47 | 48 | extern void _CFPFactoryFlushFunctionCache(_CFPFactoryRef factory); 49 | 50 | extern void _CFPFactoryAddType(_CFPFactoryRef factory, CFUUIDRef typeID); 51 | extern void _CFPFactoryRemoveType(_CFPFactoryRef factory, CFUUIDRef typeID); 52 | 53 | extern Boolean _CFPFactorySupportsType(_CFPFactoryRef factory, CFUUIDRef typeID); 54 | extern CFArrayRef _CFPFactoryFindCopyForType(CFUUIDRef typeID); 55 | 56 | /* These methods are called by CFPlugInInstance when an instance is created or destroyed. If a factory's instance count goes to 0 and the factory has been disabled, the factory is destroyed. */ 57 | extern void _CFPFactoryAddInstance(_CFPFactoryRef factory); 58 | extern void _CFPFactoryRemoveInstance(_CFPFactoryRef factory); 59 | 60 | CF_EXTERN_C_END 61 | 62 | #endif /* ! __COREFOUNDATION_CFPLUGIN_FACTORY__ */ 63 | 64 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFStreamInternal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | #if !defined(__COREFOUNDATION_CFSTREAMINTERNAL__) 25 | #define __COREFOUNDATION_CFSTREAMINTERNAL__ 1 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | CF_EXTERN_C_BEGIN 33 | 34 | 35 | // Older versions of the callbacks; v0 callbacks match v1 callbacks, except that create, finalize, and copyDescription are missing. 36 | typedef Boolean (*_CFStreamCBOpenV1)(struct _CFStream *stream, CFStreamError *error, Boolean *openComplete, void *info); 37 | typedef Boolean (*_CFStreamCBOpenCompletedV1)(struct _CFStream *stream, CFStreamError *error, void *info); 38 | typedef CFIndex (*_CFStreamCBReadV1)(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, Boolean *atEOF, void *info); 39 | typedef const UInt8 *(*_CFStreamCBGetBufferV1)(CFReadStreamRef sream, CFIndex maxBytesToRead, CFIndex *numBytesRead, CFStreamError *error, Boolean *atEOF, void *info); 40 | typedef Boolean (*_CFStreamCBCanReadV1)(CFReadStreamRef, void *info); 41 | typedef CFIndex (*_CFStreamCBWriteV1)(CFWriteStreamRef, const UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, void *info); 42 | typedef Boolean (*_CFStreamCBCanWriteV1)(CFWriteStreamRef, void *info); 43 | 44 | struct _CFStreamCallBacksV1 { 45 | CFIndex version; 46 | void *(*create)(struct _CFStream *stream, void *info); 47 | void (*finalize)(struct _CFStream *stream, void *info); 48 | CFStringRef (*copyDescription)(struct _CFStream *stream, void *info); 49 | 50 | _CFStreamCBOpenV1 open; 51 | _CFStreamCBOpenCompletedV1 openCompleted; 52 | _CFStreamCBReadV1 read; 53 | _CFStreamCBGetBufferV1 getBuffer; 54 | _CFStreamCBCanReadV1 canRead; 55 | _CFStreamCBWriteV1 write; 56 | _CFStreamCBCanWriteV1 canWrite; 57 | void (*close)(struct _CFStream *stream, void *info); 58 | 59 | CFTypeRef (*copyProperty)(struct _CFStream *stream, CFStringRef propertyName, void *info); 60 | Boolean (*setProperty)(struct _CFStream *stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info); 61 | void (*requestEvents)(struct _CFStream *stream, CFOptionFlags events, void *info); 62 | void (*schedule)(struct _CFStream *stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); 63 | void (*unschedule)(struct _CFStream *stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); 64 | }; 65 | 66 | // These two are defined in CFSocketStream.c because that's where the glue for CFNetwork is. 67 | CF_PRIVATE CFErrorRef _CFErrorFromStreamError(CFAllocatorRef alloc, CFStreamError *err); 68 | CF_PRIVATE CFStreamError _CFStreamErrorFromError(CFErrorRef error); 69 | 70 | CF_EXTERN_C_END 71 | 72 | #endif /* ! __COREFOUNDATION_CFSTREAMINTERNAL__ */ 73 | 74 | 75 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFStringDefaultEncoding.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFStringDefaultEncoding.h 25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFSTRINGDEFAULTENCODING__) 29 | #define __COREFOUNDATION_CFSTRINGDEFAULTENCODING__ 1 30 | 31 | #include 32 | 33 | #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | CF_EXTERN_C_BEGIN 44 | 45 | #define __kCFUserEncodingEnvVariableName ("__CF_USER_TEXT_ENCODING") 46 | #define __kCFMaxDefaultEncodingFileLength (64) 47 | #define __kCFUserEncodingFileName ("/.CFUserTextEncoding") 48 | 49 | CF_EXPORT void _CFStringGetUserDefaultEncoding(UInt32 *oScriptValue, UInt32 *oRegionValue); 50 | CF_EXPORT void _CFStringGetInstallationEncodingAndRegion(uint32_t *encoding, uint32_t *region); 51 | CF_EXPORT Boolean _CFStringSaveUserDefaultEncoding(UInt32 iScriptValue, UInt32 iRegionValue); 52 | 53 | CF_INLINE void __CFStringGetUserDefaultEncoding(UInt32 *oScriptValue, UInt32 *oRegionValue) { _CFStringGetUserDefaultEncoding(oScriptValue, oRegionValue); } 54 | CF_INLINE void __CFStringGetInstallationEncodingAndRegion(uint32_t *encoding, uint32_t *region) { _CFStringGetInstallationEncodingAndRegion(encoding, region); } 55 | CF_INLINE void __CFStringSaveUserDefaultEncoding(UInt32 iScriptValue, UInt32 iRegionValue) { _CFStringSaveUserDefaultEncoding(iScriptValue, iRegionValue); } 56 | 57 | CF_EXTERN_C_END 58 | 59 | #endif 60 | 61 | #endif /* ! __COREFOUNDATION_CFSTRINGDEFAULTENCODING__ */ 62 | 63 | 64 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFStringEncodingConverterPriv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFStringEncodingConverterPriv.h 25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFSTRINGENCODINGCONVERTERPRIV__) 29 | #define __COREFOUNDATION_CFSTRINGENCODINGCONVERTERPRIV__ 1 30 | 31 | #include 32 | #include "CFStringEncodingConverterExt.h" 33 | 34 | extern const CFStringEncodingConverter __CFConverterASCII; 35 | extern const CFStringEncodingConverter __CFConverterISOLatin1; 36 | extern const CFStringEncodingConverter __CFConverterMacRoman; 37 | extern const CFStringEncodingConverter __CFConverterWinLatin1; 38 | extern const CFStringEncodingConverter __CFConverterNextStepLatin; 39 | extern const CFStringEncodingConverter __CFConverterUTF8; 40 | 41 | extern CFStringEncoding *__CFStringEncodingCreateListOfAvailablePlatformConverters(CFAllocatorRef allocator, CFIndex *numberOfConverters); 42 | extern const CFStringEncodingConverter *__CFStringEncodingGetExternalConverter(uint32_t encoding); 43 | extern CFIndex __CFStringEncodingPlatformUnicodeToBytes(uint32_t encoding, uint32_t flags, const UniChar *characters, CFIndex numChars, CFIndex *usedCharLen, uint8_t *bytes, CFIndex maxByteLen, CFIndex *usedByteLen); 44 | extern CFIndex __CFStringEncodingPlatformBytesToUnicode(uint32_t encoding, uint32_t flags, const uint8_t *bytes, CFIndex numBytes, CFIndex *usedByteLen, UniChar *characters, CFIndex maxCharLen, CFIndex *usedCharLen); 45 | extern CFIndex __CFStringEncodingPlatformCharLengthForBytes(uint32_t encoding, uint32_t flags, const uint8_t *bytes, CFIndex numBytes); 46 | extern CFIndex __CFStringEncodingPlatformByteLengthForCharacters(uint32_t encoding, uint32_t flags, const UniChar *characters, CFIndex numChars); 47 | 48 | #endif /* ! __COREFOUNDATION_CFSTRINGENCODINGCONVERTERPRIV__ */ 49 | 50 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFStringEncodingDatabase.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* 25 | * CFStringEncodingDatabase.h 26 | * CoreFoundation 27 | * 28 | * Created by Aki Inoue on 07/12/05. 29 | * Copyright (c) 2007-2014, Apple Inc. All rights reserved. 30 | * 31 | */ 32 | 33 | #include 34 | 35 | CF_PRIVATE uint16_t __CFStringEncodingGetWindowsCodePage(CFStringEncoding encoding); 36 | CF_PRIVATE CFStringEncoding __CFStringEncodingGetFromWindowsCodePage(uint16_t codepage); 37 | 38 | CF_PRIVATE bool __CFStringEncodingGetCanonicalName(CFStringEncoding encoding, char *buffer, CFIndex bufferSize); 39 | CF_PRIVATE CFStringEncoding __CFStringEncodingGetFromCanonicalName(const char *canonicalName); 40 | 41 | CF_PRIVATE CFStringEncoding __CFStringEncodingGetMostCompatibleMacScript(CFStringEncoding encoding); 42 | 43 | CF_PRIVATE const char *__CFStringEncodingGetName(CFStringEncoding encoding); // Returns simple non-localizd name 44 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFTimeZone.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFTimeZone.h 25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFTIMEZONE__) 29 | #define __COREFOUNDATION_CFTIMEZONE__ 1 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | CF_IMPLICIT_BRIDGING_ENABLED 39 | CF_EXTERN_C_BEGIN 40 | 41 | CF_EXPORT 42 | CFTypeID CFTimeZoneGetTypeID(void); 43 | 44 | CF_EXPORT 45 | CFTimeZoneRef CFTimeZoneCopySystem(void); 46 | 47 | CF_EXPORT 48 | void CFTimeZoneResetSystem(void); 49 | 50 | CF_EXPORT 51 | CFTimeZoneRef CFTimeZoneCopyDefault(void); 52 | 53 | CF_EXPORT 54 | void CFTimeZoneSetDefault(CFTimeZoneRef tz); 55 | 56 | CF_EXPORT 57 | CFArrayRef CFTimeZoneCopyKnownNames(void); 58 | 59 | CF_EXPORT 60 | CFDictionaryRef CFTimeZoneCopyAbbreviationDictionary(void); 61 | 62 | CF_EXPORT 63 | void CFTimeZoneSetAbbreviationDictionary(CFDictionaryRef dict); 64 | 65 | CF_EXPORT 66 | CFTimeZoneRef CFTimeZoneCreate(CFAllocatorRef allocator, CFStringRef name, CFDataRef data); 67 | 68 | CF_EXPORT 69 | CFTimeZoneRef CFTimeZoneCreateWithTimeIntervalFromGMT(CFAllocatorRef allocator, CFTimeInterval ti); 70 | 71 | CF_EXPORT 72 | CFTimeZoneRef CFTimeZoneCreateWithName(CFAllocatorRef allocator, CFStringRef name, Boolean tryAbbrev); 73 | 74 | CF_EXPORT 75 | CFStringRef CFTimeZoneGetName(CFTimeZoneRef tz); 76 | 77 | CF_EXPORT 78 | CFDataRef CFTimeZoneGetData(CFTimeZoneRef tz); 79 | 80 | CF_EXPORT 81 | CFTimeInterval CFTimeZoneGetSecondsFromGMT(CFTimeZoneRef tz, CFAbsoluteTime at); 82 | 83 | CF_EXPORT 84 | CFStringRef CFTimeZoneCopyAbbreviation(CFTimeZoneRef tz, CFAbsoluteTime at); 85 | 86 | CF_EXPORT 87 | Boolean CFTimeZoneIsDaylightSavingTime(CFTimeZoneRef tz, CFAbsoluteTime at); 88 | 89 | CF_EXPORT 90 | CFTimeInterval CFTimeZoneGetDaylightSavingTimeOffset(CFTimeZoneRef tz, CFAbsoluteTime at) CF_AVAILABLE(10_5, 2_0); 91 | 92 | CF_EXPORT 93 | CFAbsoluteTime CFTimeZoneGetNextDaylightSavingTimeTransition(CFTimeZoneRef tz, CFAbsoluteTime at) CF_AVAILABLE(10_5, 2_0); 94 | 95 | typedef CF_ENUM(CFIndex, CFTimeZoneNameStyle) { 96 | kCFTimeZoneNameStyleStandard, 97 | kCFTimeZoneNameStyleShortStandard, 98 | kCFTimeZoneNameStyleDaylightSaving, 99 | kCFTimeZoneNameStyleShortDaylightSaving, 100 | kCFTimeZoneNameStyleGeneric, 101 | kCFTimeZoneNameStyleShortGeneric 102 | } CF_ENUM_AVAILABLE(10_5, 2_0); 103 | 104 | CF_EXPORT 105 | CFStringRef CFTimeZoneCopyLocalizedName(CFTimeZoneRef tz, CFTimeZoneNameStyle style, CFLocaleRef locale) CF_AVAILABLE(10_5, 2_0); 106 | 107 | CF_EXPORT 108 | const CFStringRef kCFTimeZoneSystemTimeZoneDidChangeNotification CF_AVAILABLE(10_5, 2_0); 109 | 110 | CF_EXTERN_C_END 111 | CF_IMPLICIT_BRIDGING_DISABLED 112 | 113 | #endif /* ! __COREFOUNDATION_CFTIMEZONE__ */ 114 | 115 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFUUID.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFUUID.h 25 | Copyright (c) 1999-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFUUID__) 29 | #define __COREFOUNDATION_CFUUID__ 1 30 | 31 | #include 32 | #include 33 | 34 | CF_IMPLICIT_BRIDGING_ENABLED 35 | CF_EXTERN_C_BEGIN 36 | 37 | typedef const struct __CFUUID * CFUUIDRef; 38 | 39 | typedef struct { 40 | UInt8 byte0; 41 | UInt8 byte1; 42 | UInt8 byte2; 43 | UInt8 byte3; 44 | UInt8 byte4; 45 | UInt8 byte5; 46 | UInt8 byte6; 47 | UInt8 byte7; 48 | UInt8 byte8; 49 | UInt8 byte9; 50 | UInt8 byte10; 51 | UInt8 byte11; 52 | UInt8 byte12; 53 | UInt8 byte13; 54 | UInt8 byte14; 55 | UInt8 byte15; 56 | } CFUUIDBytes; 57 | /* The CFUUIDBytes struct is a 128-bit struct that contains the 58 | raw UUID. A CFUUIDRef can provide such a struct from the 59 | CFUUIDGetUUIDBytes() function. This struct is suitable for 60 | passing to APIs that expect a raw UUID. 61 | */ 62 | 63 | CF_EXPORT 64 | CFTypeID CFUUIDGetTypeID(void); 65 | 66 | CF_EXPORT 67 | CFUUIDRef CFUUIDCreate(CFAllocatorRef alloc); 68 | /* Create and return a brand new unique identifier */ 69 | 70 | CF_EXPORT 71 | CFUUIDRef CFUUIDCreateWithBytes(CFAllocatorRef alloc, UInt8 byte0, UInt8 byte1, UInt8 byte2, UInt8 byte3, UInt8 byte4, UInt8 byte5, UInt8 byte6, UInt8 byte7, UInt8 byte8, UInt8 byte9, UInt8 byte10, UInt8 byte11, UInt8 byte12, UInt8 byte13, UInt8 byte14, UInt8 byte15); 72 | /* Create and return an identifier with the given contents. This may return an existing instance with its ref count bumped because of uniquing. */ 73 | 74 | CF_EXPORT 75 | CFUUIDRef CFUUIDCreateFromString(CFAllocatorRef alloc, CFStringRef uuidStr); 76 | /* Converts from a string representation to the UUID. This may return an existing instance with its ref count bumped because of uniquing. */ 77 | 78 | CF_EXPORT 79 | CFStringRef CFUUIDCreateString(CFAllocatorRef alloc, CFUUIDRef uuid); 80 | /* Converts from a UUID to its string representation. */ 81 | 82 | CF_EXPORT 83 | CFUUIDRef CFUUIDGetConstantUUIDWithBytes(CFAllocatorRef alloc, UInt8 byte0, UInt8 byte1, UInt8 byte2, UInt8 byte3, UInt8 byte4, UInt8 byte5, UInt8 byte6, UInt8 byte7, UInt8 byte8, UInt8 byte9, UInt8 byte10, UInt8 byte11, UInt8 byte12, UInt8 byte13, UInt8 byte14, UInt8 byte15); 84 | /* This returns an immortal CFUUIDRef that should not be released. It can be used in headers to declare UUID constants with #define. */ 85 | 86 | CF_EXPORT 87 | CFUUIDBytes CFUUIDGetUUIDBytes(CFUUIDRef uuid); 88 | 89 | CF_EXPORT 90 | CFUUIDRef CFUUIDCreateFromUUIDBytes(CFAllocatorRef alloc, CFUUIDBytes bytes); 91 | 92 | CF_EXTERN_C_END 93 | CF_IMPLICIT_BRIDGING_DISABLED 94 | 95 | #endif /* ! __COREFOUNDATION_CFUUID__ */ 96 | 97 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFUniCharPriv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFUniCharPriv.h 25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFUNICHARPRIV__) 29 | #define __COREFOUNDATION_CFUNICHARPRIV__ 1 30 | 31 | #include 32 | #include 33 | 34 | #define kCFUniCharRecursiveDecompositionFlag (1UL << 30) 35 | #define kCFUniCharNonBmpFlag (1UL << 31) 36 | #define CFUniCharConvertCountToFlag(count) ((count & 0x1F) << 24) 37 | #define CFUniCharConvertFlagToCount(flag) ((flag >> 24) & 0x1F) 38 | 39 | enum { 40 | kCFUniCharCanonicalDecompMapping = (kCFUniCharCaseFold + 1), 41 | kCFUniCharCanonicalPrecompMapping, 42 | kCFUniCharCompatibilityDecompMapping 43 | }; 44 | 45 | CF_EXPORT const void *CFUniCharGetMappingData(uint32_t type); 46 | 47 | #endif /* ! __COREFOUNDATION_CFUNICHARPRIV__ */ 48 | 49 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFUnicodeDecomposition.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* 25 | * CFUnicodeDecomposition.h 26 | * CoreFoundation 27 | * 28 | * Created by aki on Wed Oct 03 2001. 29 | * Copyright (c) 2001-2014, Apple Inc. All rights reserved. 30 | * 31 | */ 32 | 33 | #if !defined(__COREFOUNDATION_CFUNICODEDECOMPOSITION__) 34 | #define __COREFOUNDATION_CFUNICODEDECOMPOSITION__ 1 35 | 36 | #include 37 | 38 | CF_EXTERN_C_BEGIN 39 | 40 | CF_INLINE bool CFUniCharIsDecomposableCharacter(UTF32Char character, bool isHFSPlusCanonical) { 41 | if (isHFSPlusCanonical && !isHFSPlusCanonical) return false; // hack to get rid of "unused" warning 42 | if (character < 0x80) return false; 43 | return CFUniCharIsMemberOf(character, kCFUniCharHFSPlusDecomposableCharacterSet); 44 | } 45 | 46 | CF_EXPORT CFIndex CFUniCharDecomposeCharacter(UTF32Char character, UTF32Char *convertedChars, CFIndex maxBufferLength); 47 | CF_EXPORT CFIndex CFUniCharCompatibilityDecompose(UTF32Char *convertedChars, CFIndex length, CFIndex maxBufferLength); 48 | 49 | CF_EXPORT bool CFUniCharDecompose(const UTF16Char *src, CFIndex length, CFIndex *consumedLength, void *dst, CFIndex maxLength, CFIndex *filledLength, bool needToReorder, uint32_t dstFormat, bool isHFSPlus); 50 | 51 | CF_EXPORT void CFUniCharPrioritySort(UTF32Char *characters, CFIndex length); 52 | 53 | CF_EXTERN_C_END 54 | 55 | #endif /* ! __COREFOUNDATION_CFUNICODEDECOMPOSITION__ */ 56 | 57 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFUnicodePrecomposition.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* 25 | * CFUnicodePrecomposition.h 26 | * CoreFoundation 27 | * 28 | * Created by aki on Wed Oct 03 2001. 29 | * Copyright (c) 2001-2014, Apple Inc. All rights reserved. 30 | * 31 | */ 32 | 33 | #if !defined(__COREFOUNDATION_CFUNICODEPRECOMPOSITION__) 34 | #define __COREFOUNDATION_CFUNICODEPRECOMPOSITION__ 1 35 | 36 | #include 37 | 38 | CF_EXTERN_C_BEGIN 39 | 40 | // As you can see, this function cannot precompose Hangul Jamo 41 | CF_EXPORT UTF32Char CFUniCharPrecomposeCharacter(UTF32Char base, UTF32Char combining); 42 | 43 | CF_EXPORT bool CFUniCharPrecompose(const UTF16Char *characters, CFIndex length, CFIndex *consumedLength, UTF16Char *precomposed, CFIndex maxLength, CFIndex *filledLength); 44 | 45 | CF_EXTERN_C_END 46 | 47 | #endif /* ! __COREFOUNDATION_CFUNICODEPRECOMPOSITION__ */ 48 | 49 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CFUtilities.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CFUtilities.h 25 | Copyright (c) 2005-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_CFUTILITIES__) 29 | #define __COREFOUNDATION_CFUTILITIES__ 1 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | CF_IMPLICIT_BRIDGING_ENABLED 36 | CF_EXTERN_C_BEGIN 37 | 38 | CF_EXPORT 39 | CFURLRef CFCopyHomeDirectoryURL(void) CF_AVAILABLE_IOS(5_0); 40 | 41 | CF_EXTERN_C_END 42 | CF_IMPLICIT_BRIDGING_DISABLED 43 | 44 | #endif /* ! __COREFOUNDATION_CFUTILITIES__ */ 45 | 46 | -------------------------------------------------------------------------------- /Apple/include/Apple/CoreFoundation/CoreFoundation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. Please obtain a copy of the License at 10 | * http://www.opensource.apple.com/apsl/ and read it before using this 11 | * file. 12 | * 13 | * The Original Code and all software distributed under the License are 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 | * Please see the License for the specific language governing rights and 19 | * limitations under the License. 20 | * 21 | * @APPLE_LICENSE_HEADER_END@ 22 | */ 23 | 24 | /* CoreFoundation.h 25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved. 26 | */ 27 | 28 | #if !defined(__COREFOUNDATION_COREFOUNDATION__) 29 | #define __COREFOUNDATION_COREFOUNDATION__ 1 30 | #define __COREFOUNDATION__ 1 31 | 32 | #if !defined(CF_EXCLUDE_CSTD_HEADERS) 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | 51 | #if defined(__STDC_VERSION__) && (199901L <= __STDC_VERSION__) 52 | 53 | #include 54 | #include 55 | #include 56 | 57 | #endif 58 | 59 | #endif 60 | 61 | #include 62 | #include 63 | #include 64 | #include 65 | #include 66 | #include 67 | #include 68 | #include 69 | #include 70 | #include 71 | #include 72 | #include 73 | #include 74 | #include 75 | #include 76 | #include 77 | #include 78 | #include 79 | #include 80 | #include 81 | #include 82 | #include 83 | #include 84 | #include 85 | #include 86 | #include 87 | #include 88 | 89 | #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) || TARGET_OS_WIN32 90 | #include 91 | #include 92 | #include 93 | #include 94 | #include 95 | #include 96 | 97 | 98 | #endif 99 | 100 | #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) 101 | #endif 102 | 103 | #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) 104 | #include 105 | #include 106 | #include 107 | #endif 108 | 109 | 110 | #endif /* ! __COREFOUNDATION_COREFOUNDATION__ */ 111 | 112 | -------------------------------------------------------------------------------- /Apple/include/Apple/TargetConditionals.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header TargetConditionals.h 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @description OS X version does not know about WIN64... So let's define 29 | * everything for WIN32 and WIN64. 30 | * Note: __i386__ and __x86_64__ are also defined if needed, so 31 | * CFBase.h can correctly guess the system's endianness. 32 | */ 33 | 34 | #ifdef _WIN32 35 | 36 | #define TARGET_OS_MAC 0 37 | #define TARGET_OS_WIN32 1 38 | #define TARGET_OS_UNIX 0 39 | #define TARGET_OS_IPHONE 0 40 | #define TARGET_OS_IOS 0 41 | #define TARGET_OS_WATCH 0 42 | #define TARGET_OS_TV 0 43 | #define TARGET_OS_SIMULATOR 0 44 | #define TARGET_OS_EMBEDDED 0 45 | #define TARGET_IPHONE_SIMULATOR TARGET_OS_SIMULATOR /* deprecated */ 46 | #define TARGET_OS_NANO TARGET_OS_WATCH /* deprecated */ 47 | 48 | #ifdef _WIN64 49 | 50 | #ifndef __x86_64__ 51 | #define __x86_64__ 1 52 | #endif 53 | 54 | #define TARGET_CPU_PPC 0 55 | #define TARGET_CPU_PPC64 0 56 | #define TARGET_CPU_68K 0 57 | #define TARGET_CPU_X86 0 58 | #define TARGET_CPU_X86_64 1 59 | #define TARGET_CPU_ARM 0 60 | #define TARGET_CPU_ARM64 0 61 | #define TARGET_CPU_MIPS 0 62 | #define TARGET_CPU_SPARC 0 63 | #define TARGET_CPU_ALPHA 0 64 | #define TARGET_RT_MAC_CFM 0 65 | #define TARGET_RT_MAC_MACHO 1 66 | #define TARGET_RT_LITTLE_ENDIAN 1 67 | #define TARGET_RT_BIG_ENDIAN 0 68 | #define TARGET_RT_64_BIT 1 69 | 70 | #else 71 | 72 | #ifndef __i386__ 73 | #define __i386__ 1 74 | #endif 75 | 76 | #define TARGET_CPU_PPC 0 77 | #define TARGET_CPU_PPC64 0 78 | #define TARGET_CPU_68K 0 79 | #define TARGET_CPU_X86 1 80 | #define TARGET_CPU_X86_64 0 81 | #define TARGET_CPU_ARM 0 82 | #define TARGET_CPU_ARM64 0 83 | #define TARGET_CPU_MIPS 0 84 | #define TARGET_CPU_SPARC 0 85 | #define TARGET_CPU_ALPHA 0 86 | #define TARGET_RT_MAC_CFM 0 87 | #define TARGET_RT_MAC_MACHO 1 88 | #define TARGET_RT_LITTLE_ENDIAN 1 89 | #define TARGET_RT_BIG_ENDIAN 0 90 | #define TARGET_RT_64_BIT 0 91 | 92 | #endif 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /Apple/lib/win32/CoreFoundation.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/macmade/CFPP/62bf09d13db52fd4ba2682e8f48afdae972a1ee3/Apple/lib/win32/CoreFoundation.exp -------------------------------------------------------------------------------- /Apple/lib/win32/CoreFoundation.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/macmade/CFPP/62bf09d13db52fd4ba2682e8f48afdae972a1ee3/Apple/lib/win32/CoreFoundation.lib -------------------------------------------------------------------------------- /Apple/lib/win32/desktop.ini: -------------------------------------------------------------------------------- 1 | [LocalizedFileNames] 2 | Command Prompt.lnk=@%SystemRoot%\system32\shell32.dll,-22022 3 | -------------------------------------------------------------------------------- /Apple/lib/win64/CoreFoundation.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/macmade/CFPP/62bf09d13db52fd4ba2682e8f48afdae972a1ee3/Apple/lib/win64/CoreFoundation.exp -------------------------------------------------------------------------------- /Apple/lib/win64/CoreFoundation.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/macmade/CFPP/62bf09d13db52fd4ba2682e8f48afdae972a1ee3/Apple/lib/win64/CoreFoundation.lib -------------------------------------------------------------------------------- /Build/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /CF++/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSHumanReadableCopyright 26 | Copyright © 2014 XS-Labs. All rights reserved. 27 | NSPrincipalClass 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /CF++/include/CF++.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CF++.h 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ main header file 29 | */ 30 | 31 | #ifndef CFPP 32 | #define CFPP 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | /* 42 | * Disable warnings about class members not having DLL-interface. 43 | * Eg: std::shared_ptr 44 | */ 45 | #ifdef _WIN32 46 | #pragma warning( push ) 47 | #pragma warning( disable: 4251 ) 48 | #endif 49 | 50 | #ifdef _WIN32 51 | #ifdef CFPP_DLL_BUILD 52 | #define CFPP_EXPORT __declspec( dllexport ) 53 | #else 54 | #define CFPP_EXPORT __declspec( dllimport ) 55 | #endif 56 | #else 57 | #define CFPP_EXPORT 58 | #endif 59 | 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | #include 66 | #include 67 | #include 68 | #include 69 | #include 70 | #include 71 | #include 72 | #include 73 | #include 74 | #include 75 | #include 76 | #include 77 | #include 78 | #include 79 | #include 80 | #include 81 | #include 82 | 83 | #ifdef _WIN32 84 | #pragma warning( pop ) 85 | #endif 86 | 87 | #endif /* CFPP */ 88 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-AnyObject.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-AnyObject.hpp 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ generic container for CF types 29 | */ 30 | 31 | #ifndef CFPP_ANY_OBJECT_H 32 | #define CFPP_ANY_OBJECT_H 33 | 34 | #include 35 | 36 | namespace CF 37 | { 38 | class CFPP_EXPORT AnyObject: public Type 39 | { 40 | public: 41 | 42 | AnyObject( void ); 43 | AnyObject( const AnyObject & value ); 44 | AnyObject( const AutoPointer & value ); 45 | AnyObject( CFTypeRef value ); 46 | AnyObject( std::nullptr_t ); 47 | AnyObject( AnyObject && value ) noexcept; 48 | 49 | virtual ~AnyObject( void ); 50 | 51 | AnyObject & operator = ( AnyObject value ); 52 | AnyObject & operator = ( const AutoPointer & value ); 53 | AnyObject & operator = ( CFTypeRef value ); 54 | AnyObject & operator = ( std::nullptr_t ); 55 | 56 | virtual CFTypeID GetTypeID( void ) const; 57 | virtual CFTypeRef GetCFObject( void ) const; 58 | 59 | template< typename T > 60 | T As( void ) const 61 | { 62 | return static_cast< T >( const_cast< void * >( this->GetCFObject() ) ); 63 | } 64 | 65 | friend void swap( AnyObject & v1, AnyObject & v2 ) noexcept; 66 | 67 | protected: 68 | 69 | CFTypeRef _cfObject; 70 | }; 71 | } 72 | 73 | #endif /* CFPP_ANY_OBJECT_H */ 74 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-AnyPropertyListType.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-AnyPropertyListType.h 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ generic wrapper for CF property list types 29 | */ 30 | 31 | #ifndef CFPP_ANY_PROPERTY_LIST_TYPE_H 32 | #define CFPP_ANY_PROPERTY_LIST_TYPE_H 33 | 34 | namespace CF 35 | { 36 | class Data; 37 | 38 | class CFPP_EXPORT AnyPropertyListType: public PropertyListBase 39 | { 40 | public: 41 | 42 | static AnyPropertyListType FromPropertyList( const std::string & path ); 43 | static AnyPropertyListType FromPropertyListString( const std::string & plist ); 44 | static AnyPropertyListType FromPropertyListData( const Data & plist ); 45 | 46 | AnyPropertyListType( PropertyListFormat format ); 47 | AnyPropertyListType( const AnyPropertyListType & value ); 48 | AnyPropertyListType( const AutoPointer & value, PropertyListFormat format ); 49 | AnyPropertyListType( CFTypeRef value, PropertyListFormat format ); 50 | AnyPropertyListType( std::nullptr_t, PropertyListFormat format ); 51 | AnyPropertyListType( AnyPropertyListType && value ) noexcept; 52 | 53 | virtual ~AnyPropertyListType( void ); 54 | 55 | AnyPropertyListType & operator = ( AnyPropertyListType value ); 56 | AnyPropertyListType & operator = ( const AutoPointer & value ); 57 | AnyPropertyListType & operator = ( CFTypeRef value ); 58 | AnyPropertyListType & operator = ( std::nullptr_t value ); 59 | 60 | bool IsValidPropertyList( void ) const; 61 | 62 | virtual CFTypeID GetTypeID( void ) const; 63 | virtual CFTypeRef GetCFObject( void ) const; 64 | 65 | PropertyListFormat GetFormat( void ) const; 66 | 67 | friend void swap( AnyPropertyListType & v1, AnyPropertyListType & v2 ) noexcept; 68 | 69 | protected: 70 | 71 | CFTypeRef _cfObject; 72 | PropertyListFormat _format; 73 | }; 74 | } 75 | 76 | #endif /* CFPP_ANY_PROPERTY_LIST_TYPE_H */ 77 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-AutoPointer.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-AutoPointer.h 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ auto-pointer for CF types 29 | */ 30 | 31 | #ifndef CFPP_AUTO_POINTER_H 32 | #define CFPP_AUTO_POINTER_H 33 | 34 | #include 35 | 36 | namespace CF 37 | { 38 | class CFPP_EXPORT AutoPointer: public Type 39 | { 40 | public: 41 | 42 | AutoPointer( void ); 43 | AutoPointer( const AutoPointer & value ); 44 | AutoPointer( CFTypeRef value ); 45 | AutoPointer( AutoPointer && value ) noexcept; 46 | 47 | virtual ~AutoPointer( void ); 48 | 49 | AutoPointer & operator = ( AutoPointer value ); 50 | AutoPointer & operator = ( CFTypeRef value ); 51 | 52 | virtual CFTypeID GetTypeID( void ) const; 53 | virtual CFTypeRef GetCFObject( void ) const; 54 | 55 | template< typename T > 56 | T As( void ) const 57 | { 58 | return static_cast< T >( const_cast< void * >( this->GetCFObject() ) ); 59 | } 60 | 61 | friend void swap( AutoPointer & v1, AutoPointer & v2 ) noexcept; 62 | 63 | protected: 64 | 65 | CFTypeRef _cfObject; 66 | }; 67 | } 68 | 69 | #endif /* CFPP_AUTO_POINTER_H */ 70 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-Boolean.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-Boolean.h 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ CFBooleanRef wrapper 29 | */ 30 | 31 | #ifndef CFPP_BOOLEAN_H 32 | #define CFPP_BOOLEAN_H 33 | 34 | namespace CF 35 | { 36 | class CFPP_EXPORT Boolean: public PropertyListType< Boolean > 37 | { 38 | public: 39 | 40 | Boolean( const Boolean & value ); 41 | Boolean( const AutoPointer & value ); 42 | Boolean( CFTypeRef cfObject ); 43 | Boolean( CFBooleanRef cfObject ); 44 | Boolean( std::nullptr_t ); 45 | Boolean( const AutoPointer & value, bool defaultValueIfNULL ); 46 | Boolean( CFTypeRef cfObject, bool defaultValueIfNULL ); 47 | Boolean( CFBooleanRef cfObject, bool defaultValueIfNULL ); 48 | Boolean( bool value = false ); 49 | Boolean( Boolean && value ) noexcept; 50 | 51 | virtual ~Boolean( void ); 52 | 53 | Boolean & operator = ( Boolean value ); 54 | Boolean & operator = ( const AutoPointer & value ); 55 | Boolean & operator = ( CFTypeRef value ); 56 | Boolean & operator = ( CFBooleanRef value ); 57 | Boolean & operator = ( std::nullptr_t ); 58 | Boolean & operator = ( bool value ); 59 | 60 | bool operator == ( const Boolean & value ) const; 61 | bool operator == ( bool value ) const; 62 | bool operator == ( CFTypeRef value ) const; 63 | bool operator == ( CFBooleanRef value ) const; 64 | 65 | bool operator != ( const Boolean & value ) const; 66 | bool operator != ( bool value ) const; 67 | bool operator != ( CFTypeRef value ) const; 68 | bool operator != ( CFBooleanRef value ) const; 69 | 70 | operator bool () const; 71 | 72 | virtual CFTypeID GetTypeID( void ) const; 73 | virtual CFTypeRef GetCFObject( void ) const; 74 | 75 | bool GetValue( void ) const; 76 | void SetValue( bool value ); 77 | 78 | friend void swap( Boolean & v1, Boolean & v2 ) noexcept; 79 | 80 | private: 81 | 82 | CFBooleanRef _cfObject; 83 | }; 84 | } 85 | 86 | #endif /* CFPP_BOOLEAN_H */ 87 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-Date.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-Date.h 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ CFDateRef wrapper 29 | */ 30 | 31 | #ifndef CFPP_DATE_H 32 | #define CFPP_DATE_H 33 | 34 | namespace CF 35 | { 36 | class CFPP_EXPORT Date: public PropertyListType< Date > 37 | { 38 | public: 39 | 40 | static Date CurrentDate( void ); 41 | 42 | Date( void ); 43 | Date( const Date & value ); 44 | Date( const AutoPointer & value ); 45 | Date( CFTypeRef value ); 46 | Date( CFDateRef value ); 47 | Date( std::nullptr_t ); 48 | Date( CFAbsoluteTime value ); 49 | Date( Date && value ) noexcept; 50 | 51 | virtual ~Date( void ); 52 | 53 | Date & operator = ( Date value ); 54 | Date & operator = ( const AutoPointer & value ); 55 | Date & operator = ( CFTypeRef value ); 56 | Date & operator = ( CFDateRef value ); 57 | Date & operator = ( std::nullptr_t ); 58 | Date & operator = ( CFAbsoluteTime value ); 59 | 60 | bool operator == ( const Date & value ) const; 61 | bool operator == ( CFTypeRef value ) const; 62 | bool operator == ( CFDateRef value ) const; 63 | bool operator == ( CFAbsoluteTime value ) const; 64 | 65 | bool operator != ( const Date & value ) const; 66 | bool operator != ( CFTypeRef value ) const; 67 | bool operator != ( CFDateRef value ) const; 68 | bool operator != ( CFAbsoluteTime value ) const; 69 | 70 | bool operator >= ( const Date & value ) const; 71 | bool operator >= ( CFDateRef value ) const; 72 | bool operator >= ( CFAbsoluteTime value ) const; 73 | 74 | bool operator <= ( const Date & value ) const; 75 | bool operator <= ( CFDateRef value ) const; 76 | bool operator <= ( CFAbsoluteTime value ) const; 77 | 78 | bool operator > ( const Date & value ) const; 79 | bool operator > ( CFDateRef value ) const; 80 | bool operator > ( CFAbsoluteTime value ) const; 81 | 82 | bool operator < ( const Date & value ) const; 83 | bool operator < ( CFDateRef value ) const; 84 | bool operator < ( CFAbsoluteTime value ) const; 85 | 86 | Date & operator += ( const Date & value ); 87 | Date & operator += ( CFDateRef value ); 88 | Date & operator += ( CFAbsoluteTime value ); 89 | 90 | Date & operator -= ( const Date & value ); 91 | Date & operator -= ( CFDateRef value ); 92 | Date & operator -= ( CFAbsoluteTime value ); 93 | 94 | Date operator + ( const Date & value ); 95 | Date operator + ( CFDateRef value ); 96 | Date operator + ( CFAbsoluteTime value ); 97 | 98 | Date operator - ( const Date & value ); 99 | Date operator - ( CFDateRef value ); 100 | Date operator - ( CFAbsoluteTime value ); 101 | 102 | Date & operator ++ ( void ); 103 | Date operator ++ ( int ); 104 | Date & operator -- ( void ); 105 | Date operator -- ( int ); 106 | 107 | operator CFAbsoluteTime () const; 108 | 109 | virtual CFTypeID GetTypeID( void ) const; 110 | virtual CFTypeRef GetCFObject( void ) const; 111 | 112 | CFAbsoluteTime GetValue( void ) const; 113 | void SetValue( CFAbsoluteTime value ); 114 | 115 | friend void swap( Date & v1, Date & v2 ) noexcept; 116 | 117 | protected: 118 | 119 | CFDateRef _cfObject; 120 | }; 121 | } 122 | 123 | #endif /* CFPP_DATE_H */ 124 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-Error.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-Error.h 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ CFErrorRef wrapper 29 | */ 30 | 31 | #ifndef CFPP_ERROR_H 32 | #define CFPP_ERROR_H 33 | 34 | namespace CF 35 | { 36 | class CFPP_EXPORT Error: public Type 37 | { 38 | public: 39 | 40 | Error( void ); 41 | Error( const Error & value ); 42 | Error( const AutoPointer & value ); 43 | Error( CFTypeRef value ); 44 | Error( CFErrorRef value ); 45 | Error( std::nullptr_t ); 46 | Error( const String & domain, const Number & code ); 47 | Error( const String & domain, const Number & code, const Dictionary & userInfo ); 48 | Error( CFStringRef domain, CFIndex code ); 49 | Error( CFStringRef domain, CFIndex code, CFDictionaryRef userInfo ); 50 | Error( const std::string & domain, CFIndex code ); 51 | Error( const std::string & domain, CFIndex code, const Dictionary & userInfo ); 52 | Error( const char * domain, CFIndex code ); 53 | Error( const char * domain, CFIndex code, const Dictionary & userInfo ); 54 | Error( Error && value ) noexcept; 55 | 56 | virtual ~Error( void ); 57 | 58 | Error & operator = ( Error value ); 59 | Error & operator = ( const AutoPointer & value ); 60 | Error & operator = ( CFTypeRef value ); 61 | Error & operator = ( CFErrorRef value ); 62 | Error & operator = ( std::nullptr_t ); 63 | 64 | virtual CFTypeID GetTypeID( void ) const; 65 | virtual CFTypeRef GetCFObject( void ) const; 66 | 67 | String GetDomain( void ) const; 68 | Number GetCode( void ) const; 69 | Dictionary GetUserInfo( void ) const; 70 | String GetDescription( void ) const; 71 | String GetFailureReason( void ) const; 72 | String GetRecoverySuggestion( void ) const; 73 | 74 | friend void swap( Error & v1, Error & v2 ) noexcept; 75 | 76 | private: 77 | 78 | CFErrorRef _cfObject; 79 | }; 80 | } 81 | 82 | #endif /* CFPP_ERROR_H */ 83 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-Null.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-Null.hpp 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ CFNullRef wrapper 29 | */ 30 | 31 | #ifndef CFPP_NULL_H 32 | #define CFPP_NULL_H 33 | 34 | #include 35 | 36 | namespace CF 37 | { 38 | class CFPP_EXPORT Null: public Type 39 | { 40 | public: 41 | 42 | Null( void ); 43 | Null( const Null & value ); 44 | Null( CFTypeRef value ); 45 | Null( Null && value ) noexcept; 46 | 47 | virtual ~Null( void ); 48 | 49 | Null & operator = ( Null value ); 50 | Null & operator = ( CFTypeRef value ); 51 | 52 | virtual CFTypeID GetTypeID( void ) const; 53 | virtual CFTypeRef GetCFObject( void ) const; 54 | 55 | friend void swap( Null & v1, Null & v2 ) noexcept; 56 | 57 | protected: 58 | 59 | CFNullRef _cfObject; 60 | }; 61 | } 62 | 63 | #endif /* CFPP_NULL_H */ 64 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-Object.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-Object.hpp 27 | * @copyright (c) 2019 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ generic container for CF types 29 | */ 30 | 31 | #ifndef CFPP_OBJECT_H 32 | #define CFPP_OBJECT_H 33 | 34 | namespace CF 35 | { 36 | template< typename _T_ > 37 | class CFPP_EXPORT Object: public Type 38 | { 39 | public: 40 | 41 | Object( void ): _cfObject( nullptr ) 42 | {} 43 | 44 | Object( const Object< _T_ > & value ): _cfObject( nullptr ) 45 | { 46 | if( value._cfObject != nullptr ) 47 | { 48 | this->_cfObject = reinterpret_cast< _T_ >( const_cast< void * >( CFRetain( value._cfObject ) ) ); 49 | } 50 | } 51 | 52 | Object( const AutoPointer & value ): _cfObject( nullptr ) 53 | { 54 | if( value.IsValid() ) 55 | { 56 | this->_cfObject = static_cast< _T_ >( const_cast< void * >( CFRetain( value ) ) ); 57 | } 58 | } 59 | 60 | Object( _T_ value ): _cfObject( nullptr ) 61 | { 62 | if( value != nullptr ) 63 | { 64 | this->_cfObject = reinterpret_cast< _T_ >( const_cast< void * >( CFRetain( value ) ) ); 65 | } 66 | } 67 | 68 | Object( Object && value ) noexcept 69 | { 70 | this->_cfObject = value._cfObject; 71 | value._cfObject = nullptr; 72 | } 73 | 74 | virtual ~Object( void ) 75 | { 76 | if( this->_cfObject != nullptr ) 77 | { 78 | CFRelease( this->_cfObject ); 79 | 80 | this->_cfObject = nullptr; 81 | } 82 | } 83 | 84 | Object< _T_ > & operator = ( Object< _T_ > value ) 85 | { 86 | swap( *( this ), value ); 87 | 88 | return *( this ); 89 | } 90 | 91 | Object< _T_ > & operator = ( const AutoPointer & value ) 92 | { 93 | return operator =( Object< _T_ >( value ) ); 94 | } 95 | 96 | Object< _T_ > & operator = ( _T_ value ) 97 | { 98 | return operator =( Object< _T_ >( value ) ); 99 | } 100 | 101 | virtual CFTypeID GetTypeID( void ) const 102 | { 103 | if( this->_cfObject != nullptr ) 104 | { 105 | return CFGetTypeID( this->_cfObject ); 106 | } 107 | 108 | return 0; 109 | } 110 | 111 | virtual CFTypeRef GetCFObject( void ) const 112 | { 113 | return this->_cfObject; 114 | } 115 | 116 | friend void swap( Object< _T_ > & v1, Object< _T_ > & v2 ) noexcept 117 | { 118 | using std::swap; 119 | 120 | swap( v1._cfObject, v2._cfObject ); 121 | } 122 | 123 | protected: 124 | 125 | _T_ _cfObject; 126 | }; 127 | } 128 | 129 | #endif /* CFPP_OBJECT_H */ 130 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-Pair.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-Pair.h 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ pair of CFTypeRef 29 | */ 30 | 31 | #ifndef CFPP_PAIR_H 32 | #define CFPP_PAIR_H 33 | 34 | namespace CF 35 | { 36 | class CFPP_EXPORT Pair 37 | { 38 | public: 39 | 40 | Pair( CFTypeRef key, CFTypeRef value ); 41 | Pair( const Pair & value ); 42 | Pair( const String & key, CFTypeRef value ); 43 | Pair( const char * key, CFTypeRef value ); 44 | Pair( const String & key, const String & value ); 45 | Pair( const char * key, const String & value ); 46 | Pair( const String & key, const char * value ); 47 | Pair( const char * key, const char * value ); 48 | Pair( Pair && value ) noexcept; 49 | 50 | virtual ~Pair( void ); 51 | 52 | Pair & operator = ( Pair value ); 53 | 54 | CFTypeRef GetKey( void ) const; 55 | CFTypeRef GetValue( void ) const; 56 | CFTypeID GetKeyTypeID( void ) const; 57 | CFTypeID GetValueTypeID( void ) const; 58 | void SetKey( CFTypeRef key ); 59 | void SetValue( CFTypeRef value ); 60 | 61 | friend void swap( Pair & v1, Pair & v2 ) noexcept; 62 | 63 | protected: 64 | 65 | CFTypeRef _key; 66 | CFTypeRef _value; 67 | }; 68 | } 69 | 70 | #endif /* CFPP_PAIR_H */ 71 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-PropertyListBase.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-PropertyListBase.h 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ base class for property list compatible types 29 | */ 30 | 31 | #ifndef CFPP_PROPERTY_LIST_BASE_H 32 | #define CFPP_PROPERTY_LIST_BASE_H 33 | 34 | namespace CF 35 | { 36 | class Data; 37 | 38 | class CFPP_EXPORT PropertyListBase: public Type 39 | { 40 | public: 41 | 42 | bool ToPropertyList( const std::string & path, PropertyListFormat format = PropertyListFormatXML ) const; 43 | Data ToPropertyList( PropertyListFormat format = PropertyListFormatXML ) const; 44 | }; 45 | } 46 | 47 | #endif /* CFPP_PROPERTY_LIST_TYPE_H */ 48 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-PropertyListType-Definition.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-PropertyListType-Definition.h 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ base class for property list compatible types 29 | */ 30 | 31 | #ifndef CFPP_PROPERTY_LIST_TYPE_DEFINITION_H 32 | #define CFPP_PROPERTY_LIST_TYPE_DEFINITION_H 33 | 34 | namespace CF 35 | { 36 | template < class T > 37 | T PropertyListType< T >::FromPropertyList( const std::string & path ) 38 | { 39 | Data data; 40 | URL url; 41 | ReadStream stream; 42 | AutoPointer ap; 43 | 44 | if( path.length() == 0 ) 45 | { 46 | return static_cast< CFTypeRef >( nullptr ); 47 | } 48 | 49 | url = URL::FileSystemURL( path ); 50 | 51 | if( stream.Open( url ) == false ) 52 | { 53 | return static_cast< CFTypeRef >( nullptr ); 54 | } 55 | 56 | data = stream.Read(); 57 | ap = CFPropertyListCreateWithData( static_cast< CFAllocatorRef >( nullptr ), data, 0, nullptr, nullptr ); 58 | 59 | stream.Close(); 60 | 61 | return ap.As< T >(); 62 | } 63 | 64 | template < class T > 65 | T PropertyListType< T >::FromPropertyListString( const std::string & plist ) 66 | { 67 | if( plist.length() == 0 ) 68 | { 69 | return static_cast< CFTypeRef >( nullptr ); 70 | } 71 | 72 | return FromPropertyListData( Data( plist ) ); 73 | } 74 | 75 | template < class T > 76 | T PropertyListType< T >::FromPropertyListData( const Data & plist ) 77 | { 78 | AutoPointer ap; 79 | 80 | if( plist.GetLength() == 0 ) 81 | { 82 | return static_cast< CFTypeRef >( nullptr ); 83 | } 84 | 85 | ap = CFPropertyListCreateWithData( static_cast< CFAllocatorRef >( nullptr ), plist, 0, nullptr, nullptr ); 86 | 87 | return ap.As< T >(); 88 | } 89 | } 90 | 91 | #endif /* CFPP_PROPERTY_LIST_TYPE_DEFINITION_H */ 92 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-PropertyListType.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-PropertyListType.h 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ base class for property list compatible types 29 | */ 30 | 31 | #ifndef CFPP_PROPERTY_LIST_TYPE_H 32 | #define CFPP_PROPERTY_LIST_TYPE_H 33 | 34 | namespace CF 35 | { 36 | class Data; 37 | 38 | template < class T > 39 | class CFPP_EXPORT PropertyListType: public PropertyListBase 40 | { 41 | public: 42 | 43 | static T FromPropertyList( const std::string & path ); 44 | static T FromPropertyListString( const std::string & plist ); 45 | static T FromPropertyListData( const Data & plist ); 46 | }; 47 | } 48 | 49 | #endif /* CFPP_PROPERTY_LIST_TYPE_H */ 50 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-Type.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-Type.h 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ base abstract class for CF wrappers 29 | */ 30 | 31 | #ifndef CFPP_TYPE_H 32 | #define CFPP_TYPE_H 33 | 34 | namespace CF 35 | { 36 | typedef enum 37 | { 38 | PropertyListFormatXML = 0x00, 39 | PropertyListFormatBinary = 0x01 40 | } 41 | PropertyListFormat; 42 | 43 | class CFPP_EXPORT Type 44 | { 45 | public: 46 | 47 | virtual ~Type( void ); 48 | 49 | virtual CFTypeID GetTypeID( void ) const = 0; 50 | virtual CFTypeRef GetCFObject( void ) const = 0; 51 | 52 | bool operator == ( const Type & value ) const; 53 | bool operator != ( const Type & value ) const; 54 | 55 | operator CFTypeRef () const; 56 | operator CFBooleanRef () const; 57 | operator CFNumberRef () const; 58 | operator CFDateRef () const; 59 | operator CFStringRef () const; 60 | operator CFMutableStringRef () const; 61 | operator CFURLRef () const; 62 | operator CFDataRef () const; 63 | operator CFMutableDataRef () const; 64 | operator CFArrayRef () const; 65 | operator CFMutableArrayRef () const; 66 | operator CFDictionaryRef () const; 67 | operator CFMutableDictionaryRef () const; 68 | operator CFUUIDRef () const; 69 | operator CFErrorRef () const; 70 | operator CFReadStreamRef () const; 71 | operator CFWriteStreamRef () const; 72 | 73 | std::string Description( void ) const; 74 | CFHashCode Hash( void ) const; 75 | void Show( void ) const; 76 | CFIndex GetRetainCount( void ) const; 77 | 78 | bool IsValid( void ) const; 79 | bool IsValidPropertyList( PropertyListFormat format ) const; 80 | bool IsBoolean( void ) const; 81 | bool IsNumber( void ) const; 82 | bool IsDate( void ) const; 83 | bool IsString( void ) const; 84 | bool IsURL( void ) const; 85 | bool IsData( void ) const; 86 | bool IsArray( void ) const; 87 | bool IsDictionary( void ) const; 88 | bool IsUUID( void ) const; 89 | bool IsError( void ) const; 90 | bool IsReadStream( void ) const; 91 | bool IsWriteStream( void ) const; 92 | 93 | friend std::ostream & operator << ( std::ostream & os, const Type & obj ); 94 | }; 95 | } 96 | 97 | #endif /* CFPP_TYPE_H */ 98 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-UUID.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-UUID.h 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ CFUUIDRef wrapper 29 | */ 30 | 31 | #ifndef CFPP_UUID_H 32 | #define CFPP_UUID_H 33 | 34 | namespace CF 35 | { 36 | class CFPP_EXPORT UUID: public Type 37 | { 38 | public: 39 | 40 | UUID( void ); 41 | UUID( const UUID & value ); 42 | UUID( const AutoPointer & value ); 43 | UUID( CFTypeRef value ); 44 | UUID( CFUUIDRef value ); 45 | UUID( std::nullptr_t ); 46 | UUID( const std::string & value ); 47 | UUID( const Data & value ); 48 | UUID( UUID && value ) noexcept; 49 | 50 | virtual ~UUID( void ); 51 | 52 | UUID & operator = ( UUID value ); 53 | UUID & operator = ( const AutoPointer & value ); 54 | UUID & operator = ( CFTypeRef value ); 55 | UUID & operator = ( CFUUIDRef value ); 56 | UUID & operator = ( std::nullptr_t ); 57 | UUID & operator = ( const std::string & value ); 58 | UUID & operator = ( const Data & value ); 59 | 60 | bool operator == ( const UUID & value ) const; 61 | bool operator == ( CFTypeRef value ) const; 62 | bool operator == ( CFUUIDRef value ) const; 63 | bool operator == ( const std::string & value ) const; 64 | bool operator == ( const Data & value ) const; 65 | 66 | bool operator != ( const UUID & value ) const; 67 | bool operator != ( CFTypeRef value ) const; 68 | bool operator != ( CFUUIDRef value ) const; 69 | bool operator != ( const std::string & value ) const; 70 | bool operator != ( const Data & value ) const; 71 | 72 | operator std::string () const; 73 | 74 | virtual CFTypeID GetTypeID( void ) const; 75 | virtual CFTypeRef GetCFObject( void ) const; 76 | 77 | String GetString( void ) const; 78 | Data GetData( void ) const; 79 | Data GetBytes( void ) const; 80 | 81 | friend void swap( UUID & v1, UUID & v2 ) noexcept; 82 | 83 | private: 84 | 85 | CFUUIDRef _cfObject; 86 | }; 87 | } 88 | 89 | #endif /* CFPP_UUID_H */ 90 | -------------------------------------------------------------------------------- /CF++/include/CF++/CFPP-WriteStream.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header CFPP-WriteStream.h 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ CFWriteStreamRef wrapper 29 | */ 30 | 31 | #ifndef CFPP_WRITE_STREAM_H 32 | #define CFPP_WRITE_STREAM_H 33 | 34 | namespace CF 35 | { 36 | class CFPP_EXPORT WriteStream: public Type 37 | { 38 | public: 39 | 40 | WriteStream( void ); 41 | WriteStream( const std::string & path ); 42 | WriteStream( const char * path ); 43 | WriteStream( URL url ); 44 | WriteStream( const WriteStream & value ); 45 | WriteStream( const AutoPointer & value ); 46 | WriteStream( CFTypeRef value ); 47 | WriteStream( CFWriteStreamRef value ); 48 | WriteStream( std::nullptr_t ); 49 | WriteStream( WriteStream && value ) noexcept; 50 | 51 | virtual ~WriteStream( void ); 52 | 53 | WriteStream & operator = ( WriteStream value ); 54 | WriteStream & operator = ( const AutoPointer & value ); 55 | WriteStream & operator = ( CFTypeRef value ); 56 | WriteStream & operator = ( CFWriteStreamRef value ); 57 | WriteStream & operator = ( std::nullptr_t ); 58 | 59 | virtual CFTypeID GetTypeID( void ) const; 60 | virtual CFTypeRef GetCFObject( void ) const; 61 | 62 | bool Open( void ) const; 63 | bool Open( const std::string & path ); 64 | bool Open( const char * path ); 65 | bool Open( const URL & url ); 66 | void Close( void ) const; 67 | bool CanAcceptBytes( void ) const; 68 | CFStreamStatus GetStatus( void ) const; 69 | Error GetError( void ) const; 70 | CFIndex Write( const Data::Byte * buffer, CFIndex length ) const; 71 | CFIndex Write( const Data & data ) const; 72 | bool WriteAll( const Data::Byte * buffer, CFIndex length ) const; 73 | bool WriteAll( const Data & data ) const; 74 | AutoPointer GetProperty( const String & name ); 75 | bool SetProperty( const String & name, CFTypeRef value ); 76 | bool SetClient( CFOptionFlags events, CFWriteStreamClientCallBack callback, CFStreamClientContext * context ); 77 | void ScheduleWithRunLoop( CFRunLoopRef runLoop, CF::String mode ); 78 | void UnscheduleFromRunLoop( CFRunLoopRef runLoop, CF::String mode ); 79 | 80 | friend void swap( WriteStream & v1, WriteStream & v2 ) noexcept; 81 | 82 | private: 83 | 84 | CFWriteStreamRef _cfObject; 85 | }; 86 | } 87 | 88 | #endif /* CFPP_WRITE_STREAM_H */ 89 | -------------------------------------------------------------------------------- /CF++/source/CFPP-AnyObject.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @file CFPP-AnyObject.cpp 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ generic container for CF types 29 | */ 30 | 31 | #include 32 | 33 | namespace CF 34 | { 35 | AnyObject::AnyObject( void ): _cfObject( nullptr ) 36 | {} 37 | 38 | AnyObject::AnyObject( const AnyObject & value ): _cfObject( value._cfObject ) 39 | { 40 | if( this->_cfObject != nullptr ) 41 | { 42 | CFRetain( this->_cfObject ); 43 | } 44 | } 45 | 46 | AnyObject::AnyObject( const AutoPointer & value ): _cfObject( value.GetCFObject() ) 47 | { 48 | if( this->_cfObject != nullptr ) 49 | { 50 | CFRetain( this->_cfObject ); 51 | } 52 | } 53 | 54 | AnyObject::AnyObject( CFTypeRef value ): _cfObject( value ) 55 | { 56 | if( value != nullptr ) 57 | { 58 | CFRetain( value ); 59 | } 60 | } 61 | 62 | AnyObject::AnyObject( std::nullptr_t ): AnyObject() 63 | {} 64 | 65 | AnyObject::AnyObject( AnyObject && value ) noexcept 66 | { 67 | this->_cfObject = value._cfObject; 68 | value._cfObject = nullptr; 69 | } 70 | 71 | AnyObject::~AnyObject( void ) 72 | { 73 | if( this->_cfObject != nullptr ) 74 | { 75 | CFRelease( this->_cfObject ); 76 | 77 | this->_cfObject = nullptr; 78 | } 79 | } 80 | 81 | AnyObject & AnyObject::operator = ( AnyObject value ) 82 | { 83 | swap( *( this ), value ); 84 | 85 | return *( this ); 86 | } 87 | 88 | AnyObject & AnyObject::operator = ( const AutoPointer & value ) 89 | { 90 | return operator =( AnyObject( value ) ); 91 | } 92 | 93 | AnyObject & AnyObject::operator = ( CFTypeRef value ) 94 | { 95 | return operator =( AnyObject( value ) ); 96 | } 97 | 98 | AnyObject & AnyObject::operator = ( std::nullptr_t ) 99 | { 100 | return operator =( AnyObject( nullptr ) ); 101 | } 102 | 103 | CFTypeID AnyObject::GetTypeID( void ) const 104 | { 105 | if( this->_cfObject == nullptr ) 106 | { 107 | return 0; 108 | } 109 | 110 | return CFGetTypeID( this->_cfObject ); 111 | } 112 | 113 | CFTypeRef AnyObject::GetCFObject( void ) const 114 | { 115 | return this->_cfObject; 116 | } 117 | 118 | void swap( AnyObject & v1, AnyObject & v2 ) noexcept 119 | { 120 | using std::swap; 121 | 122 | swap( v1._cfObject, v2._cfObject ); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /CF++/source/CFPP-AutoPointer.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @file CFPP-AutoPointer.cpp 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ auto-pointer for CF types 29 | */ 30 | 31 | #include 32 | 33 | namespace CF 34 | { 35 | AutoPointer::AutoPointer( void ): _cfObject( nullptr ) 36 | {} 37 | 38 | AutoPointer::AutoPointer( const AutoPointer & value ): _cfObject( nullptr ) 39 | { 40 | if( value._cfObject != nullptr ) 41 | { 42 | CFRetain( value._cfObject ); 43 | } 44 | 45 | this->_cfObject = value._cfObject; 46 | } 47 | 48 | AutoPointer::AutoPointer( CFTypeRef value ): _cfObject( nullptr ) 49 | { 50 | this->_cfObject = value; 51 | } 52 | 53 | AutoPointer::AutoPointer( AutoPointer && value ) noexcept 54 | { 55 | this->_cfObject = value._cfObject; 56 | value._cfObject = nullptr; 57 | } 58 | 59 | AutoPointer::~AutoPointer( void ) 60 | { 61 | if( this->_cfObject != nullptr ) 62 | { 63 | CFRelease( this->_cfObject ); 64 | 65 | this->_cfObject = nullptr; 66 | } 67 | } 68 | 69 | AutoPointer & AutoPointer::operator = ( AutoPointer value ) 70 | { 71 | swap( *( this ), value ); 72 | 73 | return *( this ); 74 | } 75 | 76 | AutoPointer & AutoPointer::operator = ( CFTypeRef value ) 77 | { 78 | return operator =( AutoPointer( value ) ); 79 | } 80 | 81 | CFTypeID AutoPointer::GetTypeID( void ) const 82 | { 83 | if( this->_cfObject == nullptr ) 84 | { 85 | return 0; 86 | } 87 | 88 | return CFGetTypeID( this->_cfObject ); 89 | } 90 | 91 | CFTypeRef AutoPointer::GetCFObject( void ) const 92 | { 93 | return this->_cfObject; 94 | } 95 | 96 | void swap( AutoPointer & v1, AutoPointer & v2 ) noexcept 97 | { 98 | using std::swap; 99 | 100 | swap( v1._cfObject, v2._cfObject ); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /CF++/source/CFPP-Null.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @file CFPP-Null.cpp 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ CFNullRef wrapper 29 | */ 30 | 31 | #include 32 | 33 | #ifdef _WIN32 34 | 35 | #include 36 | 37 | static bool __hasCFNull = false; 38 | static CFNullRef __cfNull = nullptr; 39 | 40 | static void __loadCFNull( void ) 41 | { 42 | HMODULE cfModule; 43 | 44 | if( __hasCFNull == true ) 45 | { 46 | return; 47 | } 48 | 49 | cfModule = GetModuleHandle( L"CoreFoundation.dll" ); 50 | 51 | if( cfModule != nullptr ) 52 | { 53 | __hasCFNull = true; 54 | __cfNull = *( ( CFNullRef * )GetProcAddress( cfModule, "kCFNull" ) ); 55 | } 56 | } 57 | 58 | #endif 59 | 60 | namespace CF 61 | { 62 | Null::Null( void ): _cfObject( nullptr ) 63 | { 64 | #ifdef _WIN32 65 | 66 | __loadCFNull(); 67 | 68 | this->_cfObject = __cfNull; 69 | 70 | #else 71 | 72 | this->_cfObject = kCFNull; 73 | 74 | #endif 75 | } 76 | 77 | Null::Null( const Null & value ): _cfObject( value._cfObject ) 78 | {} 79 | 80 | Null::Null( CFTypeRef value ): _cfObject( nullptr ) 81 | { 82 | if( value != nullptr && CFGetTypeID( value ) == this->GetTypeID() ) 83 | { 84 | _cfObject = static_cast< CFNullRef >( value ); 85 | } 86 | } 87 | 88 | Null::Null( Null && value ) noexcept 89 | { 90 | this->_cfObject = value._cfObject; 91 | value._cfObject = nullptr; 92 | } 93 | 94 | Null::~Null( void ) 95 | {} 96 | 97 | Null & Null::operator = ( Null value ) 98 | { 99 | swap( *( this ), value ); 100 | 101 | return *( this ); 102 | } 103 | 104 | Null & Null::operator = ( CFTypeRef value ) 105 | { 106 | return operator =( Null( value ) ); 107 | } 108 | 109 | CFTypeID Null::GetTypeID( void ) const 110 | { 111 | return CFNullGetTypeID(); 112 | } 113 | 114 | CFTypeRef Null::GetCFObject( void ) const 115 | { 116 | return this->_cfObject; 117 | } 118 | 119 | void swap( Null & v1, Null & v2 ) noexcept 120 | { 121 | using std::swap; 122 | 123 | swap( v1._cfObject, v2._cfObject ); 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /CF++/source/CFPP-PropertyListBase.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @file CFPP-PropertyListBase.cpp 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract CoreFoundation++ CFNumberRef wrapper 29 | */ 30 | 31 | #include 32 | 33 | #ifdef __clang__ 34 | #pragma clang diagnostic ignored "-Wc++11-long-long" /* Do not warn about long long in C++98 */ 35 | #endif 36 | 37 | namespace CF 38 | { 39 | bool PropertyListBase::ToPropertyList( const std::string & path, PropertyListFormat format ) const 40 | { 41 | URL url; 42 | Data d; 43 | WriteStream stream; 44 | bool ret; 45 | 46 | if( this->IsValid() == false ) 47 | { 48 | return false; 49 | } 50 | 51 | url = URL::FileSystemURL( path ); 52 | d = this->ToPropertyList( format ); 53 | 54 | if( d.GetLength() == 0 ) 55 | { 56 | return false; 57 | } 58 | 59 | if( stream.Open( url ) == false ) 60 | { 61 | return false; 62 | } 63 | 64 | ret = stream.WriteAll( d ); 65 | 66 | stream.Close(); 67 | 68 | return ret; 69 | } 70 | 71 | Data PropertyListBase::ToPropertyList( PropertyListFormat format ) const 72 | { 73 | AutoPointer data; 74 | CFPropertyListFormat cfFormat; 75 | 76 | if( this->IsValid() == false ) 77 | { 78 | return static_cast< CFDataRef >( nullptr ); 79 | } 80 | 81 | cfFormat = kCFPropertyListXMLFormat_v1_0; 82 | 83 | if( format == PropertyListFormatBinary ) 84 | { 85 | cfFormat = kCFPropertyListBinaryFormat_v1_0; 86 | } 87 | 88 | data = CFPropertyListCreateData( static_cast< CFAllocatorRef >( nullptr ), this->GetCFObject(), cfFormat, 0, nullptr ); 89 | 90 | return data.As< CFDataRef >(); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | xs-labs.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /CoreFoundation++.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31903.59 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "All", "VisualStudio\All.vcxproj", "{03894C8D-A589-4679-BBDA-E4D4BCC9F990}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {C00C831C-7144-46DC-8DA7-079265428614} = {C00C831C-7144-46DC-8DA7-079265428614} 9 | {1A0E1B1F-158B-4A5D-B9C3-B355A41B7169} = {1A0E1B1F-158B-4A5D-B9C3-B355A41B7169} 10 | {3E11C949-1A5A-4F79-92B3-3249712CE5E3} = {3E11C949-1A5A-4F79-92B3-3249712CE5E3} 11 | {D27326C5-385F-4465-B979-0CF02CD8DFCE} = {D27326C5-385F-4465-B979-0CF02CD8DFCE} 12 | EndProjectSection 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CF++ DLL VC142", "VisualStudio\CF++ DLL VC142.vcxproj", "{C00C831C-7144-46DC-8DA7-079265428614}" 15 | EndProject 16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CF++ Static VC142", "VisualStudio\CF++ Static VC142.vcxproj", "{D27326C5-385F-4465-B979-0CF02CD8DFCE}" 17 | EndProject 18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CF++ DLL VC143", "VisualStudio\CF++ DLL VC143.vcxproj", "{1A0E1B1F-158B-4A5D-B9C3-B355A41B7169}" 19 | EndProject 20 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CF++ Static VC143", "VisualStudio\CF++ Static VC143.vcxproj", "{3E11C949-1A5A-4F79-92B3-3249712CE5E3}" 21 | EndProject 22 | Global 23 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 24 | Debug|x64 = Debug|x64 25 | Debug|x86 = Debug|x86 26 | Release|x64 = Release|x64 27 | Release|x86 = Release|x86 28 | EndGlobalSection 29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 30 | {03894C8D-A589-4679-BBDA-E4D4BCC9F990}.Debug|x64.ActiveCfg = Debug|x64 31 | {03894C8D-A589-4679-BBDA-E4D4BCC9F990}.Debug|x64.Build.0 = Debug|x64 32 | {03894C8D-A589-4679-BBDA-E4D4BCC9F990}.Debug|x86.ActiveCfg = Debug|Win32 33 | {03894C8D-A589-4679-BBDA-E4D4BCC9F990}.Debug|x86.Build.0 = Debug|Win32 34 | {03894C8D-A589-4679-BBDA-E4D4BCC9F990}.Release|x64.ActiveCfg = Release|x64 35 | {03894C8D-A589-4679-BBDA-E4D4BCC9F990}.Release|x64.Build.0 = Release|x64 36 | {03894C8D-A589-4679-BBDA-E4D4BCC9F990}.Release|x86.ActiveCfg = Release|Win32 37 | {03894C8D-A589-4679-BBDA-E4D4BCC9F990}.Release|x86.Build.0 = Release|Win32 38 | {C00C831C-7144-46DC-8DA7-079265428614}.Debug|x64.ActiveCfg = Debug|x64 39 | {C00C831C-7144-46DC-8DA7-079265428614}.Debug|x64.Build.0 = Debug|x64 40 | {C00C831C-7144-46DC-8DA7-079265428614}.Debug|x86.ActiveCfg = Debug|Win32 41 | {C00C831C-7144-46DC-8DA7-079265428614}.Debug|x86.Build.0 = Debug|Win32 42 | {C00C831C-7144-46DC-8DA7-079265428614}.Release|x64.ActiveCfg = Release|x64 43 | {C00C831C-7144-46DC-8DA7-079265428614}.Release|x64.Build.0 = Release|x64 44 | {C00C831C-7144-46DC-8DA7-079265428614}.Release|x86.ActiveCfg = Release|Win32 45 | {C00C831C-7144-46DC-8DA7-079265428614}.Release|x86.Build.0 = Release|Win32 46 | {D27326C5-385F-4465-B979-0CF02CD8DFCE}.Debug|x64.ActiveCfg = Debug|x64 47 | {D27326C5-385F-4465-B979-0CF02CD8DFCE}.Debug|x64.Build.0 = Debug|x64 48 | {D27326C5-385F-4465-B979-0CF02CD8DFCE}.Debug|x86.ActiveCfg = Debug|Win32 49 | {D27326C5-385F-4465-B979-0CF02CD8DFCE}.Debug|x86.Build.0 = Debug|Win32 50 | {D27326C5-385F-4465-B979-0CF02CD8DFCE}.Release|x64.ActiveCfg = Release|x64 51 | {D27326C5-385F-4465-B979-0CF02CD8DFCE}.Release|x64.Build.0 = Release|x64 52 | {D27326C5-385F-4465-B979-0CF02CD8DFCE}.Release|x86.ActiveCfg = Release|Win32 53 | {D27326C5-385F-4465-B979-0CF02CD8DFCE}.Release|x86.Build.0 = Release|Win32 54 | {1A0E1B1F-158B-4A5D-B9C3-B355A41B7169}.Debug|x64.ActiveCfg = Debug|x64 55 | {1A0E1B1F-158B-4A5D-B9C3-B355A41B7169}.Debug|x64.Build.0 = Debug|x64 56 | {1A0E1B1F-158B-4A5D-B9C3-B355A41B7169}.Debug|x86.ActiveCfg = Debug|Win32 57 | {1A0E1B1F-158B-4A5D-B9C3-B355A41B7169}.Debug|x86.Build.0 = Debug|Win32 58 | {1A0E1B1F-158B-4A5D-B9C3-B355A41B7169}.Release|x64.ActiveCfg = Release|x64 59 | {1A0E1B1F-158B-4A5D-B9C3-B355A41B7169}.Release|x64.Build.0 = Release|x64 60 | {1A0E1B1F-158B-4A5D-B9C3-B355A41B7169}.Release|x86.ActiveCfg = Release|Win32 61 | {1A0E1B1F-158B-4A5D-B9C3-B355A41B7169}.Release|x86.Build.0 = Release|Win32 62 | {3E11C949-1A5A-4F79-92B3-3249712CE5E3}.Debug|x64.ActiveCfg = Debug|x64 63 | {3E11C949-1A5A-4F79-92B3-3249712CE5E3}.Debug|x64.Build.0 = Debug|x64 64 | {3E11C949-1A5A-4F79-92B3-3249712CE5E3}.Debug|x86.ActiveCfg = Debug|Win32 65 | {3E11C949-1A5A-4F79-92B3-3249712CE5E3}.Debug|x86.Build.0 = Debug|Win32 66 | {3E11C949-1A5A-4F79-92B3-3249712CE5E3}.Release|x64.ActiveCfg = Release|x64 67 | {3E11C949-1A5A-4F79-92B3-3249712CE5E3}.Release|x64.Build.0 = Release|x64 68 | {3E11C949-1A5A-4F79-92B3-3249712CE5E3}.Release|x86.ActiveCfg = Release|Win32 69 | {3E11C949-1A5A-4F79-92B3-3249712CE5E3}.Release|x86.Build.0 = Release|Win32 70 | EndGlobalSection 71 | GlobalSection(SolutionProperties) = preSolution 72 | HideSolutionNode = FALSE 73 | EndGlobalSection 74 | GlobalSection(ExtensibilityGlobals) = postSolution 75 | SolutionGuid = {BF8ECDB5-C3ED-42A9-9FD8-8D52113D78BC} 76 | EndGlobalSection 77 | EndGlobal 78 | -------------------------------------------------------------------------------- /CoreFoundation++.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CoreFoundation++.xcodeproj/project.xcworkspace/xcshareddata/CoreFoundation++.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "B1764083CD350F39D0754DBF900B411F37563D7B", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "5F4838C7A83B1ADE0F5BF4DE9B5E20ECCA89600B" : 9223372036854775807, 8 | "A59B79241FF48B87B8A2D6239F13C873F14163E3" : 0, 9 | "B1764083CD350F39D0754DBF900B411F37563D7B" : 0, 10 | "ADCA9195A868291B07F204C2B3711DB7BA58BF77" : 9223372036854775807 11 | }, 12 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "0F11F6D1-5DBA-4A16-BB09-9B71B34927A5", 13 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 14 | "5F4838C7A83B1ADE0F5BF4DE9B5E20ECCA89600B" : "..\/..", 15 | "A59B79241FF48B87B8A2D6239F13C873F14163E3" : "CFPP\/Submodules\/gmock-xcode\/", 16 | "B1764083CD350F39D0754DBF900B411F37563D7B" : "CFPP\/", 17 | "ADCA9195A868291B07F204C2B3711DB7BA58BF77" : ".." 18 | }, 19 | "DVTSourceControlWorkspaceBlueprintNameKey" : "CoreFoundation++", 20 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 21 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "CoreFoundation++.xcodeproj", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 23 | { 24 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:DigiDNA\/iMazing-Mac.git", 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "5F4838C7A83B1ADE0F5BF4DE9B5E20ECCA89600B" 27 | }, 28 | { 29 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/macmade\/gmock-xcode.git", 30 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 31 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "A59B79241FF48B87B8A2D6239F13C873F14163E3" 32 | }, 33 | { 34 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/DigiDNA\/DDNAToolKit.git", 35 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 36 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "ADCA9195A868291B07F204C2B3711DB7BA58BF77" 37 | }, 38 | { 39 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:macmade\/CFPP.git", 40 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 41 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "B1764083CD350F39D0754DBF900B411F37563D7B" 42 | } 43 | ] 44 | } -------------------------------------------------------------------------------- /CoreFoundation++.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CoreFoundation++.xcodeproj/xcshareddata/xcschemes/CF++ Mac Dynamic Library.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 33 | 34 | 40 | 41 | 42 | 43 | 45 | 51 | 52 | 53 | 54 | 55 | 69 | 70 | 76 | 77 | 78 | 79 | 85 | 86 | 92 | 93 | 94 | 95 | 97 | 98 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /CoreFoundation++.xcodeproj/xcshareddata/xcschemes/CF++ Mac Framework.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 33 | 34 | 40 | 41 | 42 | 43 | 45 | 51 | 52 | 53 | 54 | 55 | 69 | 70 | 76 | 77 | 78 | 79 | 85 | 86 | 92 | 93 | 94 | 95 | 97 | 98 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /CoreFoundation++.xcodeproj/xcshareddata/xcschemes/CF++ Mac Static Library.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 33 | 34 | 40 | 41 | 42 | 43 | 45 | 51 | 52 | 53 | 54 | 55 | 71 | 72 | 78 | 79 | 80 | 81 | 87 | 88 | 94 | 95 | 96 | 97 | 99 | 100 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /CoreFoundation++.xcodeproj/xcshareddata/xcschemes/CF++ Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 33 | 34 | 40 | 41 | 42 | 43 | 45 | 51 | 52 | 53 | 54 | 55 | 69 | 70 | 76 | 77 | 78 | 79 | 85 | 86 | 92 | 93 | 94 | 95 | 97 | 98 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /CoreFoundation++.xcodeproj/xcshareddata/xcschemes/CF++ iOS Static Library.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 33 | 34 | 40 | 41 | 42 | 43 | 45 | 51 | 52 | 53 | 54 | 55 | 69 | 70 | 76 | 77 | 78 | 79 | 85 | 86 | 92 | 93 | 94 | 95 | 97 | 98 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Unit-Tests/Constants.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @file Constants.cpp 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | */ 29 | 30 | #include "Constants.hpp" 31 | 32 | #ifndef _WIN32 33 | 34 | #define GET_CONST( _type_, _const_, _func_ ) \ 35 | _type_ _func_( void ) \ 36 | { \ 37 | return _const_; \ 38 | } 39 | 40 | #else 41 | 42 | #include 43 | 44 | static HMODULE mod = nullptr; 45 | 46 | #define GET_CONST( _type_, _const_, _func_ ) \ 47 | _type_ _func_( void ) \ 48 | { \ 49 | if( mod == nullptr ) \ 50 | { \ 51 | mod = GetModuleHandleA( "CoreFoundation.dll" ); \ 52 | } \ 53 | \ 54 | static _type_ value = nullptr; \ 55 | \ 56 | if( value == nullptr ) \ 57 | { \ 58 | value = *( reinterpret_cast< _type_ * >( GetProcAddress( mod, #_const_ ) ) ); \ 59 | } \ 60 | \ 61 | return value; \ 62 | } 63 | 64 | #endif 65 | 66 | GET_CONST( CFBooleanRef, kCFBooleanTrue, GetCFBooleanTrue ) 67 | GET_CONST( CFBooleanRef, kCFBooleanFalse, GetCFBooleanFalse ) 68 | GET_CONST( CFStringRef, kCFErrorLocalizedDescriptionKey, GetCFErrorLocalizedDescriptionKey ) 69 | GET_CONST( CFStringRef, kCFErrorLocalizedFailureReasonKey, GetCFErrorLocalizedFailureReasonKey ) 70 | GET_CONST( CFStringRef, kCFErrorLocalizedRecoverySuggestionKey, GetCFErrorLocalizedRecoverySuggestionKey ) 71 | 72 | -------------------------------------------------------------------------------- /Unit-Tests/Constants.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header Constants.hpp 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | */ 29 | 30 | #ifndef CFPP_TEST_CONSTANTS_HPP 31 | #define CFPP_TEST_CONSTANTS_HPP 32 | 33 | #include 34 | 35 | CFBooleanRef GetCFBooleanTrue( void ); 36 | CFBooleanRef GetCFBooleanFalse( void ); 37 | CFStringRef GetCFErrorLocalizedDescriptionKey( void ); 38 | CFStringRef GetCFErrorLocalizedFailureReasonKey( void ); 39 | CFStringRef GetCFErrorLocalizedRecoverySuggestionKey( void ); 40 | 41 | #endif /* CFPP_TEST_CONSTANTS_HPP */ 42 | -------------------------------------------------------------------------------- /Unit-Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Unit-Tests/Test-CFPP-Null.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @file Test-CFPP-Null.cpp 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract Unit tests for CF::Null 29 | */ 30 | 31 | #include 32 | 33 | #define XSTEST_GTEST_COMPAT 34 | #include 35 | 36 | TEST( CFPP_Null, CTOR ) 37 | { 38 | CF::Null n; 39 | 40 | ASSERT_TRUE( n.IsValid() ); 41 | 42 | #ifndef _WIN32 43 | ASSERT_EQ( n.GetCFObject(), kCFNull ); 44 | #endif 45 | } 46 | 47 | TEST( CFPP_Null, CCTOR ) 48 | { 49 | CF::Null n1; 50 | CF::Null n2( n1 ); 51 | CF::Null n3( CF::Null( static_cast< CFNullRef >( nullptr ) ) ); 52 | 53 | ASSERT_TRUE( n1.IsValid() ); 54 | ASSERT_TRUE( n2.IsValid() ); 55 | ASSERT_FALSE( n3.IsValid() ); 56 | } 57 | 58 | TEST( CFPP_Null, CTOR_CFTypeRef ) 59 | { 60 | CF::Null n1( kCFNull ); 61 | CF::Null n2( static_cast< CFTypeRef >( nullptr ) ); 62 | CF::Null n3( static_cast< CFTypeRef >( CF::Array() ) ); 63 | 64 | ASSERT_TRUE( n1.IsValid() ); 65 | ASSERT_FALSE( n2.IsValid() ); 66 | ASSERT_FALSE( n3.IsValid() ); 67 | } 68 | 69 | TEST( CFPP_Null, MCTOR ) 70 | { 71 | CF::Null n1; 72 | CF::Null n2( std::move( n1 ) ); 73 | 74 | ASSERT_TRUE( n2.IsValid() ); 75 | } 76 | 77 | TEST( CFPP_Null, OperatorAssign ) 78 | { 79 | CF::Null n1; 80 | CF::Null n2( CF::Null( static_cast< CFNullRef >( nullptr ) ) ); 81 | 82 | ASSERT_TRUE( n1.IsValid() ); 83 | ASSERT_FALSE( n2.IsValid() ); 84 | 85 | n2 = n1; 86 | 87 | ASSERT_TRUE( n1.IsValid() ); 88 | ASSERT_TRUE( n2.IsValid() ); 89 | } 90 | 91 | TEST( CFPP_Null, OperatorAssign_CFTypeRef ) 92 | { 93 | CF::Null n( static_cast< CFTypeRef >( nullptr ) ); 94 | 95 | ASSERT_FALSE( n.IsValid() ); 96 | 97 | n = static_cast< CFTypeRef >( kCFNull ); 98 | 99 | ASSERT_TRUE( n.IsValid() ); 100 | 101 | n = static_cast< CFTypeRef >( nullptr ); 102 | 103 | ASSERT_FALSE( n.IsValid() ); 104 | } 105 | 106 | TEST( CFPP_Null, GetTypeID ) 107 | { 108 | CF::Null n; 109 | 110 | ASSERT_EQ( n.GetTypeID(), CFNullGetTypeID() ); 111 | } 112 | 113 | TEST( CFPP_Null, GetCFObject ) 114 | { 115 | CF::Null n1; 116 | CF::Null n2( static_cast< CFTypeRef >( nullptr ) ); 117 | 118 | ASSERT_TRUE( n1.GetCFObject() != nullptr ); 119 | ASSERT_TRUE( n2.GetCFObject() == nullptr ); 120 | } 121 | 122 | TEST( CFPP_Null, Swap ) 123 | { 124 | CF::Null n1; 125 | CF::Null n2( static_cast< CFTypeRef >( nullptr ) ); 126 | 127 | ASSERT_TRUE( n1.IsValid() ); 128 | ASSERT_FALSE( n2.IsValid() ); 129 | 130 | swap( n1, n2 ); 131 | 132 | ASSERT_TRUE( n2.IsValid() ); 133 | ASSERT_FALSE( n1.IsValid() ); 134 | } 135 | -------------------------------------------------------------------------------- /Unit-Tests/Win32-Init.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Jean-David Gadina - www.xs-labs.com / www.digidna.net 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @file Win32-Init.cpp 27 | * @copyright (c) 2014 - Jean-David Gadina - www.xs-labs.com / www.digidna.net 28 | * @abstract Win32 initialization routines 29 | */ 30 | 31 | #include 32 | #include 33 | 34 | struct CFPP_Win32Init 35 | { 36 | CFPP_Win32Init( void ) 37 | { 38 | char * commonProgFiles; 39 | std::string mobileSupport; 40 | std::string appleSupport; 41 | 42 | #ifdef _WIN64 43 | commonProgFiles = nullptr; 44 | #else 45 | commonProgFiles = getenv( "COMMONPROGRAMFILES(x86)" ); 46 | #endif 47 | 48 | if( commonProgFiles == nullptr ) 49 | { 50 | commonProgFiles = getenv( "COMMONPROGRAMFILES" ); 51 | } 52 | 53 | mobileSupport = std::string( commonProgFiles ) + "\\Apple\\Mobile Device Support"; 54 | appleSupport = std::string( commonProgFiles ) + "\\Apple\\Apple Application Support"; 55 | 56 | SetDllDirectoryA( mobileSupport.c_str() ); 57 | SetDllDirectoryA( appleSupport.c_str() ); 58 | } 59 | }; 60 | 61 | static struct CFPP_Win32Init init; 62 | -------------------------------------------------------------------------------- /VisualStudio/All.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | --------------------------------------------------------------------------------