├── .gitignore ├── .gitlab.yml ├── .travis.yml ├── Acknowledgements.markdown ├── CDCoreDataModelParser.h ├── CDCoreDataModelParser.m ├── CDCoreDataModelProcessor.h ├── CDCoreDataModelProcessor.m ├── CDUnitTests-Info.plist ├── CDXMLParserSharedBase.h ├── CDXMLParserSharedBase.m ├── CDXibStoryBoardProcessor.h ├── CDXibStoryBoardProcessor.m ├── CHANGELOG.md ├── External ├── GData │ └── lib │ │ ├── GDataXMLNode.h │ │ └── GDataXMLNode.m └── ahocorasick │ ├── AUTHOR │ ├── CHANGELOG │ ├── COPYING │ ├── COPYING.LESSER │ ├── README │ ├── actypes.h │ ├── ahocorasick.c │ ├── ahocorasick.h │ ├── node.c │ └── node.h ├── Info.plist ├── MachObjC-Prefix.pch ├── Makefile ├── Podfile ├── Podfile.lock ├── Pods support ├── CDPbxProjectParser.h ├── CDPbxProjectParser.m ├── CDPbxProjectProcessor.h ├── CDPbxProjectProcessor.m ├── CDPbxProjectTarget.h ├── CDPbxProjectTarget.m ├── CDPodsFileProcessor.h └── CDPodsFileProcessor.m ├── Pods ├── Headers │ └── Public │ │ └── Kiwi │ │ ├── KWAfterAllNode.h │ │ ├── KWAfterEachNode.h │ │ ├── KWAny.h │ │ ├── KWAsyncVerifier.h │ │ ├── KWBeBetweenMatcher.h │ │ ├── KWBeEmptyMatcher.h │ │ ├── KWBeIdenticalToMatcher.h │ │ ├── KWBeKindOfClassMatcher.h │ │ ├── KWBeMemberOfClassMatcher.h │ │ ├── KWBeSubclassOfClassMatcher.h │ │ ├── KWBeTrueMatcher.h │ │ ├── KWBeWithinMatcher.h │ │ ├── KWBeZeroMatcher.h │ │ ├── KWBeforeAllNode.h │ │ ├── KWBeforeEachNode.h │ │ ├── KWBlock.h │ │ ├── KWBlockNode.h │ │ ├── KWBlockRaiseMatcher.h │ │ ├── KWCallSite.h │ │ ├── KWCaptureSpy.h │ │ ├── KWChangeMatcher.h │ │ ├── KWConformToProtocolMatcher.h │ │ ├── KWContainMatcher.h │ │ ├── KWContainStringMatcher.h │ │ ├── KWContextNode.h │ │ ├── KWCountType.h │ │ ├── KWDeviceInfo.h │ │ ├── KWEqualMatcher.h │ │ ├── KWExample.h │ │ ├── KWExampleDelegate.h │ │ ├── KWExampleNode.h │ │ ├── KWExampleNodeVisitor.h │ │ ├── KWExampleSuite.h │ │ ├── KWExampleSuiteBuilder.h │ │ ├── KWExistVerifier.h │ │ ├── KWExpectationType.h │ │ ├── KWFailure.h │ │ ├── KWFormatter.h │ │ ├── KWFutureObject.h │ │ ├── KWGenericMatchEvaluator.h │ │ ├── KWGenericMatcher.h │ │ ├── KWGenericMatchingAdditions.h │ │ ├── KWHaveMatcher.h │ │ ├── KWHaveValueMatcher.h │ │ ├── KWInequalityMatcher.h │ │ ├── KWIntercept.h │ │ ├── KWInvocationCapturer.h │ │ ├── KWItNode.h │ │ ├── KWLet.h │ │ ├── KWLetNode.h │ │ ├── KWMatchVerifier.h │ │ ├── KWMatcher.h │ │ ├── KWMatcherFactory.h │ │ ├── KWMatchers.h │ │ ├── KWMatching.h │ │ ├── KWMessagePattern.h │ │ ├── KWMessageSpying.h │ │ ├── KWMessageTracker.h │ │ ├── KWMock.h │ │ ├── KWNilMatcher.h │ │ ├── KWNotificationMatcher.h │ │ ├── KWNull.h │ │ ├── KWObjCUtilities.h │ │ ├── KWPendingNode.h │ │ ├── KWProbe.h │ │ ├── KWProbePoller.h │ │ ├── KWReceiveMatcher.h │ │ ├── KWRegisterMatchersNode.h │ │ ├── KWRegularExpressionPatternMatcher.h │ │ ├── KWReporting.h │ │ ├── KWRespondToSelectorMatcher.h │ │ ├── KWSpec.h │ │ ├── KWStringContainsMatcher.h │ │ ├── KWStringPrefixMatcher.h │ │ ├── KWStringUtilities.h │ │ ├── KWStub.h │ │ ├── KWSuiteConfigurationBase.h │ │ ├── KWSymbolicator.h │ │ ├── KWUserDefinedMatcher.h │ │ ├── KWValue.h │ │ ├── KWVerifying.h │ │ ├── KWWorkarounds.h │ │ ├── Kiwi.h │ │ ├── KiwiBlockMacros.h │ │ ├── KiwiConfiguration.h │ │ ├── KiwiMacros.h │ │ ├── NSInvocation+KiwiAdditions.h │ │ ├── NSInvocation+OCMAdditions.h │ │ ├── NSMethodSignature+KiwiAdditions.h │ │ ├── NSNumber+KiwiAdditions.h │ │ ├── NSObject+KiwiMockAdditions.h │ │ ├── NSObject+KiwiSpyAdditions.h │ │ ├── NSObject+KiwiStubAdditions.h │ │ ├── NSObject+KiwiVerifierAdditions.h │ │ ├── NSProxy+KiwiVerifierAdditions.h │ │ └── NSValue+KiwiAdditions.h ├── Kiwi │ ├── Classes │ │ ├── Config │ │ │ ├── KWAllTestsSuite.m │ │ │ ├── KWSuiteConfigurationBase.h │ │ │ └── KWSuiteConfigurationBase.m │ │ ├── Core │ │ │ ├── KWAny.h │ │ │ ├── KWAny.m │ │ │ ├── KWBlock.h │ │ │ ├── KWBlock.m │ │ │ ├── KWCallSite.h │ │ │ ├── KWCallSite.m │ │ │ ├── KWCaptureSpy.h │ │ │ ├── KWCaptureSpy.m │ │ │ ├── KWCountType.h │ │ │ ├── KWDeviceInfo.h │ │ │ ├── KWDeviceInfo.m │ │ │ ├── KWExample.h │ │ │ ├── KWExample.m │ │ │ ├── KWExampleDelegate.h │ │ │ ├── KWExampleNodeVisitor.h │ │ │ ├── KWExampleSuite.h │ │ │ ├── KWExampleSuite.m │ │ │ ├── KWExampleSuiteBuilder.h │ │ │ ├── KWExampleSuiteBuilder.m │ │ │ ├── KWExpectationType.h │ │ │ ├── KWFailure.h │ │ │ ├── KWFailure.m │ │ │ ├── KWFormatter.h │ │ │ ├── KWFormatter.m │ │ │ ├── KWFutureObject.h │ │ │ ├── KWFutureObject.m │ │ │ ├── KWInvocationCapturer.h │ │ │ ├── KWInvocationCapturer.m │ │ │ ├── KWLet.h │ │ │ ├── KWMatcher.h │ │ │ ├── KWMatcher.m │ │ │ ├── KWMatcherFactory.h │ │ │ ├── KWMatcherFactory.m │ │ │ ├── KWMatchers.h │ │ │ ├── KWMatchers.m │ │ │ ├── KWMatching.h │ │ │ ├── KWMessagePattern.h │ │ │ ├── KWMessagePattern.m │ │ │ ├── KWMessageSpying.h │ │ │ ├── KWMessageTracker.h │ │ │ ├── KWMessageTracker.m │ │ │ ├── KWNull.h │ │ │ ├── KWNull.m │ │ │ ├── KWObjCUtilities.h │ │ │ ├── KWObjCUtilities.m │ │ │ ├── KWProbe.h │ │ │ ├── KWProbePoller.h │ │ │ ├── KWProbePoller.m │ │ │ ├── KWReporting.h │ │ │ ├── KWSpec.h │ │ │ ├── KWSpec.m │ │ │ ├── KWStringUtilities.h │ │ │ ├── KWStringUtilities.m │ │ │ ├── KWSymbolicator.h │ │ │ ├── KWSymbolicator.m │ │ │ ├── KWValue.h │ │ │ ├── KWValue.m │ │ │ ├── KWWorkarounds.h │ │ │ ├── KWWorkarounds.m │ │ │ ├── Kiwi.h │ │ │ ├── KiwiBlockMacros.h │ │ │ ├── KiwiConfiguration.h │ │ │ ├── KiwiMacros.h │ │ │ ├── NSInvocation+KiwiAdditions.h │ │ │ ├── NSInvocation+KiwiAdditions.m │ │ │ ├── NSInvocation+OCMAdditions.h │ │ │ ├── NSInvocation+OCMAdditions.m │ │ │ ├── NSMethodSignature+KiwiAdditions.h │ │ │ ├── NSMethodSignature+KiwiAdditions.m │ │ │ ├── NSNumber+KiwiAdditions.h │ │ │ ├── NSNumber+KiwiAdditions.m │ │ │ ├── NSObject+KiwiSpyAdditions.h │ │ │ ├── NSObject+KiwiSpyAdditions.m │ │ │ ├── NSObject+KiwiVerifierAdditions.h │ │ │ ├── NSObject+KiwiVerifierAdditions.m │ │ │ ├── NSProxy+KiwiVerifierAdditions.h │ │ │ ├── NSProxy+KiwiVerifierAdditions.m │ │ │ ├── NSValue+KiwiAdditions.h │ │ │ └── NSValue+KiwiAdditions.m │ │ ├── Matchers │ │ │ ├── KWBeBetweenMatcher.h │ │ │ ├── KWBeBetweenMatcher.m │ │ │ ├── KWBeEmptyMatcher.h │ │ │ ├── KWBeEmptyMatcher.m │ │ │ ├── KWBeIdenticalToMatcher.h │ │ │ ├── KWBeIdenticalToMatcher.m │ │ │ ├── KWBeKindOfClassMatcher.h │ │ │ ├── KWBeKindOfClassMatcher.m │ │ │ ├── KWBeMemberOfClassMatcher.h │ │ │ ├── KWBeMemberOfClassMatcher.m │ │ │ ├── KWBeSubclassOfClassMatcher.h │ │ │ ├── KWBeSubclassOfClassMatcher.m │ │ │ ├── KWBeTrueMatcher.h │ │ │ ├── KWBeTrueMatcher.m │ │ │ ├── KWBeWithinMatcher.h │ │ │ ├── KWBeWithinMatcher.m │ │ │ ├── KWBeZeroMatcher.h │ │ │ ├── KWBeZeroMatcher.m │ │ │ ├── KWBlockRaiseMatcher.h │ │ │ ├── KWBlockRaiseMatcher.m │ │ │ ├── KWChangeMatcher.h │ │ │ ├── KWChangeMatcher.m │ │ │ ├── KWConformToProtocolMatcher.h │ │ │ ├── KWConformToProtocolMatcher.m │ │ │ ├── KWContainMatcher.h │ │ │ ├── KWContainMatcher.m │ │ │ ├── KWContainStringMatcher.h │ │ │ ├── KWContainStringMatcher.m │ │ │ ├── KWEqualMatcher.h │ │ │ ├── KWEqualMatcher.m │ │ │ ├── KWGenericMatchEvaluator.h │ │ │ ├── KWGenericMatchEvaluator.m │ │ │ ├── KWGenericMatcher.h │ │ │ ├── KWGenericMatcher.m │ │ │ ├── KWGenericMatchingAdditions.h │ │ │ ├── KWGenericMatchingAdditions.m │ │ │ ├── KWHaveMatcher.h │ │ │ ├── KWHaveMatcher.m │ │ │ ├── KWHaveValueMatcher.h │ │ │ ├── KWHaveValueMatcher.m │ │ │ ├── KWInequalityMatcher.h │ │ │ ├── KWInequalityMatcher.m │ │ │ ├── KWNilMatcher.h │ │ │ ├── KWNilMatcher.m │ │ │ ├── KWNotificationMatcher.h │ │ │ ├── KWNotificationMatcher.m │ │ │ ├── KWReceiveMatcher.h │ │ │ ├── KWReceiveMatcher.m │ │ │ ├── KWRegularExpressionPatternMatcher.h │ │ │ ├── KWRegularExpressionPatternMatcher.m │ │ │ ├── KWRespondToSelectorMatcher.h │ │ │ ├── KWRespondToSelectorMatcher.m │ │ │ ├── KWStringContainsMatcher.h │ │ │ ├── KWStringContainsMatcher.m │ │ │ ├── KWStringPrefixMatcher.h │ │ │ ├── KWStringPrefixMatcher.m │ │ │ ├── KWUserDefinedMatcher.h │ │ │ └── KWUserDefinedMatcher.m │ │ ├── Mocking │ │ │ ├── KWMock.h │ │ │ ├── KWMock.m │ │ │ ├── NSObject+KiwiMockAdditions.h │ │ │ └── NSObject+KiwiMockAdditions.m │ │ ├── Nodes │ │ │ ├── KWAfterAllNode.h │ │ │ ├── KWAfterAllNode.m │ │ │ ├── KWAfterEachNode.h │ │ │ ├── KWAfterEachNode.m │ │ │ ├── KWBeforeAllNode.h │ │ │ ├── KWBeforeAllNode.m │ │ │ ├── KWBeforeEachNode.h │ │ │ ├── KWBeforeEachNode.m │ │ │ ├── KWBlockNode.h │ │ │ ├── KWBlockNode.m │ │ │ ├── KWContextNode.h │ │ │ ├── KWContextNode.m │ │ │ ├── KWExampleNode.h │ │ │ ├── KWItNode.h │ │ │ ├── KWItNode.m │ │ │ ├── KWLetNode.h │ │ │ ├── KWLetNode.m │ │ │ ├── KWPendingNode.h │ │ │ ├── KWPendingNode.m │ │ │ ├── KWRegisterMatchersNode.h │ │ │ └── KWRegisterMatchersNode.m │ │ ├── Stubbing │ │ │ ├── KWIntercept.h │ │ │ ├── KWIntercept.m │ │ │ ├── KWStub.h │ │ │ ├── KWStub.m │ │ │ ├── NSObject+KiwiStubAdditions.h │ │ │ └── NSObject+KiwiStubAdditions.m │ │ └── Verifiers │ │ │ ├── KWAsyncVerifier.h │ │ │ ├── KWAsyncVerifier.m │ │ │ ├── KWExistVerifier.h │ │ │ ├── KWExistVerifier.m │ │ │ ├── KWMatchVerifier.h │ │ │ ├── KWMatchVerifier.m │ │ │ └── KWVerifying.h │ ├── License.txt │ └── Readme.md ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj └── Target Support Files │ ├── Pods-UnitTests-Kiwi │ ├── Pods-UnitTests-Kiwi-Private.xcconfig │ ├── Pods-UnitTests-Kiwi-dummy.m │ ├── Pods-UnitTests-Kiwi-prefix.pch │ └── Pods-UnitTests-Kiwi.xcconfig │ └── Pods-UnitTests │ ├── Pods-UnitTests-acknowledgements.markdown │ ├── Pods-UnitTests-acknowledgements.plist │ ├── Pods-UnitTests-dummy.m │ ├── Pods-UnitTests-environment.h │ ├── Pods-UnitTests-resources.sh │ ├── Pods-UnitTests.debug.xcconfig │ └── Pods-UnitTests.release.xcconfig ├── README.md ├── Source ├── CDBalanceFormatter.h ├── CDBalanceFormatter.m ├── CDClassDump.h ├── CDClassDump.m ├── CDClassDumpVisitor.h ├── CDClassDumpVisitor.m ├── CDClassFrameworkVisitor.h ├── CDClassFrameworkVisitor.m ├── CDDataCursor.h ├── CDDataCursor.m ├── CDExtensions.h ├── CDFatArch.h ├── CDFatArch.m ├── CDFatFile.h ├── CDFatFile.m ├── CDFile.h ├── CDFile.m ├── CDFindMethodVisitor.h ├── CDFindMethodVisitor.m ├── CDLCDataInCode.h ├── CDLCDataInCode.m ├── CDLCDyldInfo.h ├── CDLCDyldInfo.m ├── CDLCDylib.h ├── CDLCDylib.m ├── CDLCDylinker.h ├── CDLCDylinker.m ├── CDLCDynamicSymbolTable.h ├── CDLCDynamicSymbolTable.m ├── CDLCEncryptionInfo.h ├── CDLCEncryptionInfo.m ├── CDLCFunctionStarts.h ├── CDLCFunctionStarts.m ├── CDLCLinkeditData.h ├── CDLCLinkeditData.m ├── CDLCMain.h ├── CDLCMain.m ├── CDLCPrebindChecksum.h ├── CDLCPrebindChecksum.m ├── CDLCPreboundDylib.h ├── CDLCPreboundDylib.m ├── CDLCRoutines32.h ├── CDLCRoutines32.m ├── CDLCRoutines64.h ├── CDLCRoutines64.m ├── CDLCRunPath.h ├── CDLCRunPath.m ├── CDLCSegment.h ├── CDLCSegment.m ├── CDLCSourceVersion.h ├── CDLCSourceVersion.m ├── CDLCSubClient.h ├── CDLCSubClient.m ├── CDLCSubFramework.h ├── CDLCSubFramework.m ├── CDLCSubLibrary.h ├── CDLCSubLibrary.m ├── CDLCSubUmbrella.h ├── CDLCSubUmbrella.m ├── CDLCSymbolTable.h ├── CDLCSymbolTable.m ├── CDLCTwoLevelHints.h ├── CDLCTwoLevelHints.m ├── CDLCUUID.h ├── CDLCUUID.m ├── CDLCUnixThread.h ├── CDLCUnixThread.m ├── CDLCUnknown.h ├── CDLCUnknown.m ├── CDLCVersionMinimum.h ├── CDLCVersionMinimum.m ├── CDLoadCommand.h ├── CDLoadCommand.m ├── CDMachOFile.h ├── CDMachOFile.m ├── CDMachOFileDataCursor.h ├── CDMachOFileDataCursor.m ├── CDMethodType.h ├── CDMethodType.m ├── CDMultiFileVisitor.h ├── CDMultiFileVisitor.m ├── CDOCCategory.h ├── CDOCCategory.m ├── CDOCClass.h ├── CDOCClass.m ├── CDOCClassReference.h ├── CDOCClassReference.m ├── CDOCInstanceVariable.h ├── CDOCInstanceVariable.m ├── CDOCMethod.h ├── CDOCMethod.m ├── CDOCModule.h ├── CDOCModule.m ├── CDOCProperty.h ├── CDOCProperty.m ├── CDOCProtocol.h ├── CDOCProtocol.m ├── CDOCSymtab.h ├── CDOCSymtab.m ├── CDObjectiveC1Processor.h ├── CDObjectiveC1Processor.m ├── CDObjectiveC2Processor.h ├── CDObjectiveC2Processor.m ├── CDObjectiveCProcessor.h ├── CDObjectiveCProcessor.m ├── CDProtocolUniquer.h ├── CDProtocolUniquer.m ├── CDRelocationInfo.h ├── CDRelocationInfo.m ├── CDSearchPathState.h ├── CDSearchPathState.m ├── CDSection.h ├── CDSection.m ├── CDStructureInfo.h ├── CDStructureInfo.m ├── CDStructureTable.h ├── CDStructureTable.m ├── CDSymbol.h ├── CDSymbol.m ├── CDSymbolsGeneratorVisitor.h ├── CDSymbolsGeneratorVisitor.m ├── CDTextClassDumpVisitor.h ├── CDTextClassDumpVisitor.m ├── CDTopoSortNode.h ├── CDTopoSortNode.m ├── CDTopologicalSortProtocol.h ├── CDType.h ├── CDType.m ├── CDTypeController.h ├── CDTypeController.m ├── CDTypeFormatter.h ├── CDTypeFormatter.m ├── CDTypeLexer.h ├── CDTypeLexer.m ├── CDTypeName.h ├── CDTypeName.m ├── CDTypeParser.h ├── CDTypeParser.m ├── CDVisitor.h ├── CDVisitor.m ├── CDVisitorPropertyState.h ├── CDVisitorPropertyState.m ├── CDXibStoryboardParser.h ├── CDXibStoryboardParser.m ├── NSArray-CDExtensions.h ├── NSArray-CDExtensions.m ├── NSData-CDExtensions.h ├── NSData-CDExtensions.m ├── NSError-CDExtensions.h ├── NSError-CDExtensions.m ├── NSScanner-CDExtensions.h ├── NSScanner-CDExtensions.m ├── NSString-CDExtensions.h ├── NSString-CDExtensions.m ├── ULEB128.h ├── ULEB128.m └── cd_objc2.h ├── Symbol mapping ├── CDSymbolMapper.h └── CDSymbolMapper.m ├── System Protocols Dumping ├── CDSystemProtocolsProcessor.h └── CDSystemProtocolsProcessor.m ├── Tests ├── doTests.py └── showdiff ├── UnitTests.old ├── AllTests.h ├── AllTests.m ├── CDPathUnitTest.h ├── CDPathUnitTest.m ├── CDStructHandlingUnitTest.h ├── CDStructHandlingUnitTest.m ├── CDTypeFormatterUnitTest.h ├── CDTypeFormatterUnitTest.m ├── CDTypeLexerUnitTest.h ├── CDTypeLexerUnitTest.m ├── CDTypeParserUnitTest.h ├── CDTypeParserUnitTest.m ├── method-001.txt ├── otest-all ├── shud01-in.txt ├── shud01-out.txt ├── shud02-in.txt ├── shud02-out.txt ├── shud04-in.txt ├── shud04-out.txt ├── shud05-in.txt ├── shud05-out.txt ├── shud06-in.txt ├── shud06-out.txt ├── shud07-in.txt ├── shud07-out.txt ├── shud08-in.txt ├── shud08-out.txt ├── shud09-in.txt ├── shud09-out.txt ├── shud10-in.txt ├── shud10-out.txt ├── shud11-in.txt ├── shud11-out.txt ├── shud13-in.txt ├── shud13-out.txt ├── shud14-in.txt ├── shud14-out.txt ├── shud15-in.txt ├── shud15-out.txt ├── shud16-in.txt ├── shud16-out.txt ├── var-001.txt ├── var-002.txt ├── var-003.txt ├── var-004.txt └── var-005.txt ├── UnitTests ├── TestBlockSignature.m ├── TestCDArchFromName.m ├── TestCDArchUses64BitABI.m ├── TestCDNameForCPUType.m ├── TestFatFile_Intel32_64.m ├── TestFatFile_Intel32_64_lib64.m ├── TestFatFile_Intel64_32.m ├── TestFatFile_armv7_v7s.m ├── TestThinFile_Intel64.m ├── TestThinFile_Intel64_lib64.m ├── UnitTests-Info.plist ├── UnitTests-Prefix.pch └── en.lproj │ └── InfoPlist.strings ├── class-dump.m ├── contrib └── obfuscate_project ├── dSYM deobfuscating ├── CDdSYMProcessor.h └── CDdSYMProcessor.m ├── deprotect-Prefix.pch ├── deprotect.m ├── formatType-Prefix.pch ├── formatType.m ├── install.sh ├── ios-class-guard Spec ├── CDCoreDataModelParserSpec.m ├── CDPbxProjectParserSpec.m ├── CDSymbolsMapperSpec.m ├── CDSymoblsGeneratorVisitorSpec.m ├── CDSystemProtocolsProcessorSpec.m ├── CDXibStoryboardParserSpec.m ├── CDdSYMProcessorSpec.m ├── CustomCellTableViewCell_xib.txt ├── Main_iPhone_storyboard.txt ├── contents └── podsProject.json ├── ios-class-guard-Prefix.pch ├── ios-class-guard.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── class-dump.xccheckout └── xcshareddata │ └── xcschemes │ ├── MachObjC.xcscheme │ └── ios-class-guard.xcscheme ├── ios-class-guard.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── ios-class-guard.xccheckout └── keys.txt /.gitignore: -------------------------------------------------------------------------------- 1 | xcuserdata 2 | *.xcarchive/ 3 | .idea 4 | Pods/BuildHeaders 5 | build 6 | -------------------------------------------------------------------------------- /.gitlab.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | script: 3 | - gem install cocoapods 4 | - pod install 5 | - xcodebuild -workspace ios-class-guard.xcworkspace -configuration Release -scheme 'All tests' test 6 | xcode: 7 | - v1.5 8 | - v1.6 9 | env: 10 | - V=10 11 | - V=20 12 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | xcode_sdk: macosx10.9 3 | xcode_workspace: ios-class-guard.xcworkspace 4 | xcode_scheme: ios-class-guard 5 | -------------------------------------------------------------------------------- /Acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## GDataXML-HTML 5 | 6 | Original GDataXML: Copyright (c) 2008 Google Inc 7 | 8 | Example project and HTML addons: Copyright (c) 2012 Simon Grätzer 9 | 10 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 14 | Generated by CocoaPods - http://cocoapods.org 15 | -------------------------------------------------------------------------------- /CDCoreDataModelParser.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CDXMLParserSharedBase.h" 3 | 4 | @class GDataXMLElement; 5 | 6 | 7 | @interface CDCoreDataModelParser : CDXMLParserSharedBase 8 | @end 9 | -------------------------------------------------------------------------------- /CDCoreDataModelParser.m: -------------------------------------------------------------------------------- 1 | #import "CDCoreDataModelParser.h" 2 | #import "GDataXMLNode.h" 3 | 4 | 5 | @implementation CDCoreDataModelParser 6 | 7 | - (void)addSymbolsFromNode:(GDataXMLElement *)element toArray:(NSMutableArray *)symbolsArray { 8 | NSArray *childNodes = element.children; 9 | 10 | // Get the class name 11 | GDataXMLNode *className = [element attributeForName:@"representedClassName"]; 12 | if (className) { 13 | [symbolsArray addObject:[NSString stringWithFormat:@"!%@", className.stringValue]]; 14 | } 15 | 16 | // Get the class name 17 | GDataXMLNode *parentClassName = [element attributeForName:@"parentEntity"]; 18 | if (parentClassName) { 19 | [symbolsArray addObject:[NSString stringWithFormat:@"!%@", parentClassName.stringValue]]; 20 | } 21 | 22 | // Recursively process rest of the elements 23 | for (GDataXMLElement *childNode in childNodes) { 24 | // Skip comments 25 | if ([childNode isKindOfClass:[GDataXMLElement class]]) { 26 | [self addSymbolsFromNode:childNode toArray:symbolsArray]; 27 | } 28 | } 29 | } 30 | 31 | - (void)obfuscateElement:(GDataXMLElement *)element usingSymbols:(NSDictionary *)symbols { 32 | // TODO implement later 33 | } 34 | 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /CDCoreDataModelProcessor.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface CDCoreDataModelProcessor : NSObject 5 | - (NSArray *)coreDataModelSymbolsToExclude; 6 | @end 7 | -------------------------------------------------------------------------------- /CDUnitTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.stevenygard.CDUnitTests 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /CDXMLParserSharedBase.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class GDataXMLElement; 4 | 5 | @interface CDXMLParserSharedBase : NSObject 6 | - (NSArray *)symbolsInData:(NSData *)data; 7 | 8 | - (NSData *)obfuscatedXmlData:(NSData *)data symbols:(NSDictionary *)symbols; 9 | 10 | - (void)addSymbolsFromNode:(GDataXMLElement *)xmlDictionary toArray:(NSMutableArray *)symbolsArray; 11 | - (void)obfuscateElement:(GDataXMLElement *)element usingSymbols:(NSDictionary *)symbols; 12 | @end 13 | -------------------------------------------------------------------------------- /CDXMLParserSharedBase.m: -------------------------------------------------------------------------------- 1 | #import "CDXMLParserSharedBase.h" 2 | #import "GDataXMLNode.h" 3 | 4 | 5 | @implementation CDXMLParserSharedBase 6 | 7 | - (NSArray *)symbolsInData:(NSData *)data { 8 | NSMutableArray *array = [NSMutableArray array]; 9 | 10 | GDataXMLDocument *doc = [[GDataXMLDocument alloc] initWithData:data error:nil]; 11 | 12 | [self addSymbolsFromNode:doc.rootElement toArray:array]; 13 | 14 | return array; 15 | } 16 | 17 | - (NSData *)obfuscatedXmlData:(NSData *)data symbols:(NSDictionary *)symbols { 18 | GDataXMLDocument *doc = [[GDataXMLDocument alloc] initWithData:data error:nil]; 19 | 20 | [self obfuscateElement:doc.rootElement usingSymbols:symbols]; 21 | 22 | return doc.XMLData; 23 | } 24 | 25 | - (void)addSymbolsFromNode:(GDataXMLElement *)xmlDictionary toArray:(NSMutableArray *)symbolsArray {} 26 | - (void)obfuscateElement:(GDataXMLElement *)element usingSymbols:(NSDictionary *)symbols {} 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /CDXibStoryBoardProcessor.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface CDXibStoryBoardProcessor : NSObject 5 | @property(nonatomic, copy) NSString *xibBaseDirectory; 6 | 7 | - (void)obfuscateFilesUsingSymbols:(NSDictionary *)symbols; 8 | @end 9 | -------------------------------------------------------------------------------- /External/ahocorasick/AUTHOR: -------------------------------------------------------------------------------- 1 | AUTHOR 2 | ------ 3 | 4 | Kamiar Kanani 5 | 6 | -------------------------------------------------------------------------------- /External/ahocorasick/README: -------------------------------------------------------------------------------- 1 | Aho-Corasick Library 1.6 2 | ------------------------ 3 | 4 | This folder contain the implementation of Aho-Corasick library. 5 | 6 | The Aho–Corasick algorithm is a string searching algorithm invented by 7 | Alfred V. Aho and Margaret J. Corasick. It is a kind of dictionary-matching algorithm that 8 | locates elements of a finite set of strings (the "dictionary") within an input text. 9 | It matches all patterns simultaneously. 10 | 11 | 12 | COMPILE 13 | ------- 14 | $ cd ahocorasick 15 | $ make 16 | 17 | 18 | HOW TO USE 19 | ---------- 20 | See example0, example1 and example2 to find out how to use the ahocorasick library. 21 | you could also find more practical guides in the multifast program. 22 | it is recommended to read the comments in the actypes.h and ahocorasick.c 23 | to get a better understanding of its internals. 24 | -------------------------------------------------------------------------------- /Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.stevenygard.class-dump 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundleName 12 | class-dump 13 | 14 | 15 | -------------------------------------------------------------------------------- /MachObjC-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'libMachObjC' target in the 'class-dump' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import "CDExtensions.h" 8 | #define __cmd __PRETTY_FUNCTION__ 9 | #endif 10 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | BRANCH := $(shell git rev-parse --abbrev-ref HEAD) 2 | 3 | all: 4 | # make ios-class-guard 5 | # make ios-class-guard-commit 6 | 7 | ios-class-guard: 8 | xctool -project ios-class-guard.xcodeproj -scheme ios-class-guard -configuration Release clean build OBJROOT=build/ SYMROOT=build/ 9 | 10 | ios-class-guard-commit: ios-class-guard 11 | git checkout gh-pages 12 | cp build/Release/ios-class-guard ios-class-guard 13 | git add ios-class-guard 14 | git commit -m "Compiled on $(shell date)" 15 | git checkout $(BRANCH) 16 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.8' 2 | 3 | target :UnitTests do 4 | pod 'Kiwi' 5 | end 6 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Kiwi (2.3.0) 3 | 4 | DEPENDENCIES: 5 | - Kiwi 6 | 7 | SPEC CHECKSUMS: 8 | Kiwi: 54bece5b35564d9b8e03c608d926f1a22fcfc589 9 | 10 | COCOAPODS: 0.35.0 11 | -------------------------------------------------------------------------------- /Pods support/CDPbxProjectParser.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface CDPbxProjectParser : NSObject 5 | 6 | - (instancetype)initWithJsonDictionary:(NSDictionary *)project; 7 | - (NSSet *)findTargets; 8 | @end 9 | -------------------------------------------------------------------------------- /Pods support/CDPbxProjectProcessor.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface CDPbxProjectProcessor : NSObject 5 | - (void)processPodsProjectAtPath:(NSString *)podsPath symbolsFilePath:(NSString *)symbolsPath; 6 | @end 7 | -------------------------------------------------------------------------------- /Pods support/CDPbxProjectTarget.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface CDPbxProjectTarget : NSObject 5 | 6 | @property(nonatomic, readonly) NSString *targetName; 7 | 8 | @property(nonatomic, readonly) NSString *headerName; 9 | 10 | @property(nonatomic, readonly) NSString *configFile; 11 | 12 | - (instancetype)initWithTargetName:(NSString *)targetName precompiledHeaderName:(NSString *)precompiledHeader configurationFile:(NSString *)configurationFile; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Pods support/CDPodsFileProcessor.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class CDPbxProjectTarget; 4 | 5 | 6 | @interface CDPodsFileProcessor : NSObject 7 | - (void)processTarget:(CDPbxProjectTarget *)target symbolsFilePath:(NSString *)symbolsFilePath; 8 | @end 9 | -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWAfterAllNode.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Nodes/KWAfterAllNode.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWAfterEachNode.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Nodes/KWAfterEachNode.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWAny.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWAny.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWAsyncVerifier.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Verifiers/KWAsyncVerifier.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWBeBetweenMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWBeBetweenMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWBeEmptyMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWBeEmptyMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWBeIdenticalToMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWBeIdenticalToMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWBeKindOfClassMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWBeKindOfClassMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWBeMemberOfClassMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWBeMemberOfClassMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWBeSubclassOfClassMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWBeSubclassOfClassMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWBeTrueMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWBeTrueMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWBeWithinMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWBeWithinMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWBeZeroMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWBeZeroMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWBeforeAllNode.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Nodes/KWBeforeAllNode.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWBeforeEachNode.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Nodes/KWBeforeEachNode.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWBlock.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWBlock.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWBlockNode.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Nodes/KWBlockNode.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWBlockRaiseMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWBlockRaiseMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWCallSite.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWCallSite.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWCaptureSpy.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWCaptureSpy.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWChangeMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWChangeMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWConformToProtocolMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWConformToProtocolMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWContainMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWContainMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWContainStringMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWContainStringMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWContextNode.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Nodes/KWContextNode.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWCountType.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWCountType.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWDeviceInfo.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWDeviceInfo.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWEqualMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWEqualMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWExample.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWExample.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWExampleDelegate.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWExampleDelegate.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWExampleNode.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Nodes/KWExampleNode.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWExampleNodeVisitor.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWExampleNodeVisitor.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWExampleSuite.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWExampleSuite.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWExampleSuiteBuilder.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWExampleSuiteBuilder.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWExistVerifier.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Verifiers/KWExistVerifier.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWExpectationType.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWExpectationType.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWFailure.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWFailure.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWFormatter.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWFormatter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWFutureObject.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWFutureObject.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWGenericMatchEvaluator.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWGenericMatchEvaluator.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWGenericMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWGenericMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWGenericMatchingAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWGenericMatchingAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWHaveMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWHaveMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWHaveValueMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWHaveValueMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWInequalityMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWInequalityMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWIntercept.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Stubbing/KWIntercept.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWInvocationCapturer.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWInvocationCapturer.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWItNode.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Nodes/KWItNode.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWLet.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWLet.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWLetNode.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Nodes/KWLetNode.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWMatchVerifier.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Verifiers/KWMatchVerifier.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWMatcherFactory.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWMatcherFactory.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWMatchers.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWMatchers.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWMatching.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWMatching.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWMessagePattern.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWMessagePattern.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWMessageSpying.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWMessageSpying.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWMessageTracker.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWMessageTracker.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWMock.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Mocking/KWMock.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWNilMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWNilMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWNotificationMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWNotificationMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWNull.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWNull.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWObjCUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWObjCUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWPendingNode.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Nodes/KWPendingNode.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWProbe.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWProbe.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWProbePoller.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWProbePoller.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWReceiveMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWReceiveMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWRegisterMatchersNode.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Nodes/KWRegisterMatchersNode.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWRegularExpressionPatternMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWRegularExpressionPatternMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWReporting.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWReporting.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWRespondToSelectorMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWRespondToSelectorMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWSpec.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWSpec.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWStringContainsMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWStringContainsMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWStringPrefixMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWStringPrefixMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWStringUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWStringUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWStub.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Stubbing/KWStub.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWSuiteConfigurationBase.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Config/KWSuiteConfigurationBase.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWSymbolicator.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWSymbolicator.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWUserDefinedMatcher.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Matchers/KWUserDefinedMatcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWValue.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWValue.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWVerifying.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Verifiers/KWVerifying.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KWWorkarounds.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KWWorkarounds.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/Kiwi.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/Kiwi.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KiwiBlockMacros.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KiwiBlockMacros.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KiwiConfiguration.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KiwiConfiguration.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/KiwiMacros.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/KiwiMacros.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/NSInvocation+KiwiAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/NSInvocation+KiwiAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/NSInvocation+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/NSInvocation+OCMAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/NSMethodSignature+KiwiAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/NSMethodSignature+KiwiAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/NSNumber+KiwiAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/NSNumber+KiwiAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/NSObject+KiwiMockAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Mocking/NSObject+KiwiMockAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/NSObject+KiwiSpyAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/NSObject+KiwiSpyAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/NSObject+KiwiStubAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Stubbing/NSObject+KiwiStubAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/NSObject+KiwiVerifierAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/NSObject+KiwiVerifierAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/NSProxy+KiwiVerifierAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/NSProxy+KiwiVerifierAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Kiwi/NSValue+KiwiAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Kiwi/Classes/Core/NSValue+KiwiAdditions.h -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Config/KWSuiteConfigurationBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWSuiteConfigurationBase.h 3 | // Kiwi 4 | // 5 | // Created by Adam Sharp on 14/12/2013. 6 | // Copyright (c) 2013 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface KWSuiteConfigurationBase : NSObject 12 | 13 | + (instancetype)defaultConfiguration; 14 | 15 | - (void)configureSuite; 16 | 17 | - (void)setUp; 18 | - (void)tearDown; 19 | 20 | @property (nonatomic, copy) void (^beforeAllSpecsBlock)(void); 21 | @property (nonatomic, copy) void (^afterAllSpecsBlock)(void); 22 | 23 | @end 24 | 25 | void beforeAllSpecs(void (^block)(void)); 26 | void afterAllSpecs(void (^block)(void)); 27 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWAny.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | // KWAny exists to determine arguments in a message pattern that should 10 | // match any value. Used for pointers as well as for scalar values. 11 | @interface KWAny : NSObject 12 | 13 | #pragma mark - Initializing 14 | 15 | + (id)any; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWAny.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWAny.h" 8 | 9 | @implementation KWAny 10 | 11 | #pragma mark - Initializing 12 | 13 | + (id)any { 14 | static KWAny *sharedAny = nil; 15 | static dispatch_once_t onceToken; 16 | dispatch_once(&onceToken, ^{ 17 | sharedAny = [self new]; 18 | 19 | }); 20 | return sharedAny; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWBlock.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @interface KWBlock : NSObject 10 | 11 | #pragma mark - Initializing 12 | - (id)initWithBlock:(void (^)(void))block; 13 | 14 | + (id)blockWithBlock:(void (^)(void))block; 15 | 16 | #pragma mark - Calling Blocks 17 | 18 | - (void)call; 19 | 20 | @end 21 | 22 | #pragma mark - Creating Blocks 23 | 24 | KWBlock *theBlock(void (^block)(void)); 25 | KWBlock *lambda(void (^block)(void)); 26 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWBlock.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWBlock.h" 8 | 9 | @interface KWBlock() 10 | 11 | #pragma mark - Properties 12 | 13 | @property (nonatomic, readonly, copy) void (^block)(void); 14 | 15 | @end 16 | 17 | @implementation KWBlock 18 | 19 | #pragma mark - Initializing 20 | 21 | - (id)initWithBlock:(void (^)(void))block { 22 | self = [super init]; 23 | if (self) { 24 | _block = [block copy]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | + (id)blockWithBlock:(void (^)(void))aBlock { 31 | return [[self alloc] initWithBlock:aBlock]; 32 | } 33 | 34 | #pragma mark - Calling Blocks 35 | 36 | - (void)call { 37 | self.block(); 38 | } 39 | 40 | @end 41 | 42 | #pragma mark - Creating Blocks 43 | 44 | KWBlock *theBlock(void (^block)(void)) { 45 | return lambda(block); 46 | } 47 | 48 | KWBlock *lambda(void (^block)(void)) { 49 | return [KWBlock blockWithBlock:block]; 50 | } 51 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWCallSite.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @interface KWCallSite : NSObject 10 | 11 | #pragma mark - Initializing 12 | 13 | - (id)initWithFilename:(NSString *)aFilename lineNumber:(NSUInteger)aLineNumber; 14 | 15 | + (id)callSiteWithFilename:(NSString *)aFilename lineNumber:(NSUInteger)aLineNumber; 16 | 17 | #pragma mark - Properties 18 | 19 | @property (nonatomic, readonly, copy) NSString *filename; 20 | @property (nonatomic, readonly) NSUInteger lineNumber; 21 | 22 | #pragma mark - Identifying and Comparing 23 | 24 | - (BOOL)isEqualToCallSite:(KWCallSite *)aCallSite; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWCallSite.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWCallSite.h" 8 | 9 | @implementation KWCallSite 10 | 11 | #pragma mark - Initializing 12 | 13 | - (id)initWithFilename:(NSString *)aFilename lineNumber:(NSUInteger)aLineNumber { 14 | self = [super init]; 15 | if (self) { 16 | _filename = [aFilename copy]; 17 | _lineNumber = aLineNumber; 18 | } 19 | 20 | return self; 21 | } 22 | 23 | + (id)callSiteWithFilename:(NSString *)aFilename lineNumber:(NSUInteger)aLineNumber { 24 | return [[self alloc] initWithFilename:aFilename lineNumber:aLineNumber]; 25 | } 26 | 27 | #pragma mark - Identifying and Comparing 28 | 29 | - (NSUInteger)hash { 30 | return [[NSString stringWithFormat:@"%@%u", self.filename, (unsigned)self.lineNumber] hash]; 31 | } 32 | 33 | - (BOOL)isEqual:(id)anObject { 34 | if (![anObject isKindOfClass:[KWCallSite class]]) 35 | return NO; 36 | 37 | return [self isEqualToCallSite:anObject]; 38 | } 39 | 40 | - (BOOL)isEqualToCallSite:(KWCallSite *)aCallSite { 41 | return [self.filename isEqualToString:aCallSite.filename] && (self.lineNumber == aCallSite.lineNumber); 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWCaptureSpy.h: -------------------------------------------------------------------------------- 1 | #import "KWMessageSpying.h" 2 | 3 | @interface KWCaptureSpy : NSObject 4 | 5 | @property (nonatomic, strong, readonly) id argument; 6 | 7 | - (id)initWithArgumentIndex:(NSUInteger)index; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWCountType.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | enum { 10 | KWCountTypeExact, 11 | KWCountTypeAtLeast, 12 | KWCountTypeAtMost 13 | }; 14 | 15 | typedef NSUInteger KWCountType; 16 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWDeviceInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @interface KWDeviceInfo : NSObject 10 | 11 | #pragma mark - Getting the Device Type 12 | 13 | + (BOOL)isSimulator; 14 | + (BOOL)isPhysical; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWDeviceInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWDeviceInfo.h" 8 | 9 | #if TARGET_IPHONE_SIMULATOR 10 | 11 | #import 12 | 13 | #endif // #if TARGET_IPHONE_SIMULATOR 14 | 15 | @implementation KWDeviceInfo 16 | 17 | #pragma mark - Getting the Device Type 18 | 19 | + (BOOL)isSimulator { 20 | #if TARGET_IPHONE_SIMULATOR 21 | return YES; 22 | #else 23 | return NO; 24 | #endif // #if TARGET_IPHONE_SIMULATOR 25 | } 26 | 27 | + (BOOL)isPhysical { 28 | return ![self isSimulator]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWExampleDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWExampleGroupDelegate.h 3 | // Kiwi 4 | // 5 | // Created by Luke Redpath on 08/09/2011. 6 | // Copyright 2011 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class KWExample; 12 | @class KWFailure; 13 | 14 | @protocol KWExampleDelegate 15 | 16 | - (void)example:(KWExample *)example didFailWithFailure:(KWFailure *)failure; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWExampleNodeVisitor.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @class KWAfterAllNode; 10 | @class KWAfterEachNode; 11 | @class KWBeforeAllNode; 12 | @class KWBeforeEachNode; 13 | @class KWContextNode; 14 | @class KWLetNode; 15 | @class KWItNode; 16 | @class KWPendingNode; 17 | @class KWRegisterMatchersNode; 18 | 19 | @protocol KWExampleNodeVisitor 20 | 21 | #pragma mark - Visiting Nodes 22 | 23 | @optional 24 | 25 | - (void)visitContextNode:(KWContextNode *)aNode; 26 | - (void)visitRegisterMatchersNode:(KWRegisterMatchersNode *)aNode; 27 | - (void)visitBeforeAllNode:(KWBeforeAllNode *)aNode; 28 | - (void)visitAfterAllNode:(KWAfterAllNode *)aNode; 29 | - (void)visitBeforeEachNode:(KWBeforeEachNode *)aNode; 30 | - (void)visitAfterEachNode:(KWAfterEachNode *)aNode; 31 | - (void)visitLetNode:(KWLetNode *)aNode; 32 | - (void)visitItNode:(KWItNode *)aNode; 33 | - (void)visitPendingNode:(KWPendingNode *)aNode; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWExampleSuite.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWExampleSuite.h 3 | // Kiwi 4 | // 5 | // Created by Luke Redpath on 17/10/2011. 6 | // Copyright (c) 2011 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KWExampleNodeVisitor.h" 11 | 12 | @class KWContextNode; 13 | @class KWExample; 14 | 15 | @interface KWExampleSuite : NSObject 16 | 17 | - (id)initWithRootNode:(KWContextNode *)contextNode; 18 | - (void)addExample:(KWExample *)example; 19 | - (void)markLastExampleAsLastInContext:(KWContextNode *)context; 20 | - (NSArray *)invocationsForTestCase; 21 | @end 22 | 23 | @interface NSInvocation (KWExampleGroup) 24 | @property (nonatomic, setter = kw_setExample:) KWExample *kw_example; 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWExpectationType.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | enum { 10 | KWExpectationTypeShould, 11 | KWExpectationTypeShouldNot, 12 | KWExpectationTypeMaybe 13 | }; 14 | 15 | typedef NSUInteger KWExpectationType; 16 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWFailure.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @class KWCallSite; 10 | 11 | @interface KWFailure : NSObject 12 | 13 | #pragma mark - Initializing 14 | 15 | - (id)initWithCallSite:(KWCallSite *)aCallSite message:(NSString *)aMessage; 16 | - (id)initWithCallSite:(KWCallSite *)aCallSite format:(NSString *)format, ...; 17 | 18 | + (id)failureWithCallSite:(KWCallSite *)aCallSite message:(NSString *)aMessage; 19 | + (id)failureWithCallSite:(KWCallSite *)aCallSite format:(NSString *)format, ...; 20 | 21 | #pragma mark - Properties 22 | 23 | @property (nonatomic, readonly) NSString *message; 24 | @property (nonatomic, weak, readonly) KWCallSite *callSite; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWFormatter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @interface KWFormatter : NSObject 10 | 11 | #pragma mark - Getting Descriptions 12 | 13 | + (NSString *)formatObject:(id)anObject; 14 | + (NSString *)formatObjectIncludingClass:(id)anObject; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWFutureObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWFutureObject.h 3 | // iOSFalconCore 4 | // 5 | // Created by Luke Redpath on 13/01/2011. 6 | // Copyright 2011 LJR Software Limited. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef id (^KWFutureObjectBlock)(void); 12 | 13 | @interface KWFutureObject : NSObject 14 | 15 | + (id)objectWithObjectPointer:(id *)pointer; 16 | + (id)futureObjectWithBlock:(KWFutureObjectBlock)block; 17 | - (id)initWithBlock:(KWFutureObjectBlock)aBlock; 18 | - (id)object; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWFutureObject.m: -------------------------------------------------------------------------------- 1 | // 2 | // KWFutureObject.m 3 | // iOSFalconCore 4 | // 5 | // Created by Luke Redpath on 13/01/2011. 6 | // Copyright 2011 LJR Software Limited. All rights reserved. 7 | // 8 | 9 | #import "KWFutureObject.h" 10 | 11 | @interface KWFutureObject() 12 | 13 | @property (nonatomic, strong) KWFutureObjectBlock block; 14 | 15 | @end 16 | 17 | @implementation KWFutureObject 18 | 19 | + (id)objectWithObjectPointer:(id *)pointer { 20 | return [self futureObjectWithBlock:^{ return *pointer; }]; 21 | } 22 | 23 | + (id)futureObjectWithBlock:(KWFutureObjectBlock)block { 24 | return [[self alloc] initWithBlock:block]; 25 | } 26 | 27 | - (id)initWithBlock:(KWFutureObjectBlock)aBlock { 28 | self = [super init]; 29 | if (self) { 30 | _block = [aBlock copy]; 31 | } 32 | return self; 33 | } 34 | 35 | - (id)object; { 36 | return self.block(); 37 | } 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWInvocationCapturer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @protocol KWInvocationCapturerDelegate; 10 | 11 | @interface KWInvocationCapturer : NSProxy 12 | 13 | #pragma mark - Initializing 14 | 15 | - (id)initWithDelegate:(id)aDelegate; 16 | - (id)initWithDelegate:(id)aDelegate userInfo:(NSDictionary *)aUserInfo; 17 | 18 | + (id)invocationCapturerWithDelegate:(id)aDelegate; 19 | + (id)invocationCapturerWithDelegate:(id)aDelegate userInfo:(NSDictionary *)aUserInfo; 20 | 21 | #pragma mark - Properties 22 | 23 | @property (nonatomic, weak, readonly) id delegate; 24 | @property (nonatomic, strong, readonly) NSDictionary *userInfo; 25 | 26 | @end 27 | 28 | @protocol KWInvocationCapturerDelegate 29 | 30 | #pragma mark - Capturing Invocations 31 | 32 | - (NSMethodSignature *)invocationCapturer:(KWInvocationCapturer *)anInvocationCapturer methodSignatureForSelector:(SEL)aSelector; 33 | - (void)invocationCapturer:(KWInvocationCapturer *)anInvocationCapturer didCaptureInvocation:(NSInvocation *)anInvocation; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWLet.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #if __has_feature(objc_arr) 8 | # define KW_ARC_AUTORELEASE(obj) obj 9 | #else 10 | # define KW_ARC_AUTORELEASE(obj) [obj autorelease] 11 | #endif 12 | 13 | #define KW_LET_REF(var) \ 14 | (__autoreleasing id *) \ 15 | ( (void *(^)(void)) KW_ARC_AUTORELEASE([^{ void *ref = &var; return ref; } copy]) )() 16 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatching.h" 9 | 10 | @interface KWMatcher : NSObject 11 | 12 | #pragma mark - Initializing 13 | 14 | - (id)initWithSubject:(id)anObject; 15 | 16 | + (id)matcherWithSubject:(id)anObject; 17 | 18 | #pragma mark - Properties 19 | 20 | @property (nonatomic, strong) id subject; 21 | 22 | #pragma mark - Getting Matcher Strings 23 | 24 | + (NSArray *)matcherStrings; 25 | 26 | #pragma mark - Getting Matcher Compatability 27 | 28 | + (BOOL)canMatchSubject:(id)anObject; 29 | 30 | #pragma mark - Matching 31 | 32 | - (BOOL)evaluate; 33 | 34 | #pragma mark - Getting Failure Messages 35 | 36 | - (NSString *)failureMessageForShould; 37 | - (NSString *)failureMessageForShouldNot; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWMatcherFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatching.h" 9 | 10 | @class KWFailure; 11 | @class KWMatcher; 12 | @class KWUserDefinedMatcherBuilder; 13 | 14 | @interface KWMatcherFactory : NSObject 15 | 16 | #pragma mark - Initializing 17 | 18 | - (id)init; 19 | 20 | #pragma mark - Properties 21 | 22 | @property (nonatomic, readonly) NSArray *registeredMatcherClasses; 23 | 24 | #pragma mark - Registering Matcher Classes 25 | 26 | - (void)registerMatcherClass:(Class)aClass; 27 | - (void)registerMatcherClassesWithNamespacePrefix:(NSString *)aNamespacePrefix; 28 | 29 | #pragma mark - Getting Method Signatures 30 | 31 | - (NSMethodSignature *)methodSignatureForMatcherSelector:(SEL)aSelector; 32 | 33 | #pragma mark - Getting Matchers 34 | 35 | - (KWMatcher *)matcherFromInvocation:(NSInvocation *)anInvocation subject:(id)subject; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWMatchers.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWMatchers.h 3 | // Kiwi 4 | // 5 | // Created by Luke Redpath on 17/06/2011. 6 | // Copyright 2011 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class KWUserDefinedMatcherBuilder; 12 | 13 | typedef void (^KWMatchersBuildingBlock)(KWUserDefinedMatcherBuilder *matcherBuilder); 14 | 15 | @class KWUserDefinedMatcher; 16 | 17 | @interface KWMatchers : NSObject 18 | 19 | + (id)matchers; 20 | 21 | #pragma mark - Defining Matchers 22 | 23 | + (void)defineMatcher:(NSString *)selectorString as:(KWMatchersBuildingBlock)block; 24 | - (void)defineMatcher:(NSString *)selectorString as:(KWMatchersBuildingBlock)block; 25 | - (void)addUserDefinedMatcherBuilder:(KWUserDefinedMatcherBuilder *)builder; 26 | 27 | #pragma mark - Building Matchers 28 | 29 | - (KWUserDefinedMatcher *)matcherForSelector:(SEL)selector subject:(id)subject; 30 | @end 31 | 32 | void KWDefineMatchers(NSString *selectorString, KWMatchersBuildingBlock block); 33 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWMatching.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @protocol KWMatching 10 | 11 | #pragma mark - Initializing 12 | 13 | - (id)initWithSubject:(id)anObject; 14 | 15 | #pragma mark - Getting Matcher Strings 16 | 17 | + (NSArray *)matcherStrings; 18 | 19 | #pragma mark - Getting Matcher Compatability 20 | 21 | + (BOOL)canMatchSubject:(id)anObject; 22 | 23 | #pragma mark - Matching 24 | 25 | @optional 26 | 27 | - (BOOL)isNilMatcher; 28 | - (BOOL)shouldBeEvaluatedAtEndOfExample; 29 | - (BOOL)willEvaluateMultipleTimes; 30 | - (void)setWillEvaluateMultipleTimes:(BOOL)shouldEvaluateMultipleTimes; 31 | - (void)setWillEvaluateAgainstNegativeExpectation:(BOOL)willEvaluateAgainstNegativeExpectation; 32 | 33 | @required 34 | 35 | - (BOOL)evaluate; 36 | 37 | #pragma mark - Getting Failure Messages 38 | 39 | - (NSString *)failureMessageForShould; 40 | - (NSString *)failureMessageForShouldNot; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWMessagePattern.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @interface KWMessagePattern : NSObject 10 | 11 | #pragma mark - Initializing 12 | 13 | - (id)initWithSelector:(SEL)aSelector; 14 | - (id)initWithSelector:(SEL)aSelector argumentFilters:(NSArray *)anArray; 15 | - (id)initWithSelector:(SEL)aSelector firstArgumentFilter:(id)firstArgumentFilter argumentList:(va_list)argumentList; 16 | 17 | + (id)messagePatternWithSelector:(SEL)aSelector; 18 | + (id)messagePatternWithSelector:(SEL)aSelector argumentFilters:(NSArray *)anArray; 19 | + (id)messagePatternWithSelector:(SEL)aSelector firstArgumentFilter:(id)firstArgumentFilter argumentList:(va_list)argumentList; 20 | 21 | + (id)messagePatternFromInvocation:(NSInvocation *)anInvocation; 22 | 23 | #pragma mark - Properties 24 | 25 | @property (nonatomic, readonly) SEL selector; 26 | @property (nonatomic, readonly) NSArray *argumentFilters; 27 | 28 | #pragma mark - Matching Invocations 29 | 30 | - (BOOL)matchesInvocation:(NSInvocation *)anInvocation; 31 | 32 | #pragma mark - Comparing Message Patterns 33 | 34 | - (BOOL)isEqualToMessagePattern:(KWMessagePattern *)aMessagePattern; 35 | 36 | #pragma mark - Retrieving String Representations 37 | 38 | - (NSString *)stringValue; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWMessageSpying.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @protocol KWMessageSpying 10 | 11 | #pragma mark - Spying on Messages 12 | 13 | - (void)object:(id)anObject didReceiveInvocation:(NSInvocation *)anInvocation; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWMessageTracker.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWCountType.h" 9 | #import "KWMessageSpying.h" 10 | 11 | @class KWMessagePattern; 12 | 13 | @interface KWMessageTracker : NSObject 14 | 15 | #pragma mark - Initializing 16 | 17 | - (id)initWithSubject:(id)anObject messagePattern:(KWMessagePattern *)aMessagePattern countType:(KWCountType)aCountType count:(NSUInteger)aCount; 18 | 19 | + (id)messageTrackerWithSubject:(id)anObject messagePattern:(KWMessagePattern *)aMessagePattern countType:(KWCountType)aCountType count:(NSUInteger)aCount; 20 | 21 | #pragma mark - Properties 22 | 23 | @property (nonatomic, readonly) id subject; 24 | @property (nonatomic, readonly) KWMessagePattern *messagePattern; 25 | @property (nonatomic, readonly) KWCountType countType; 26 | @property (nonatomic, readonly) NSUInteger count; 27 | 28 | #pragma mark - Stopping Tracking 29 | 30 | - (void)stopTracking; 31 | 32 | #pragma mark - Getting Message Tracker Status 33 | 34 | - (BOOL)succeeded; 35 | 36 | #pragma mark - Getting Phrases 37 | 38 | - (NSString *)expectedCountPhrase; 39 | - (NSString *)receivedCountPhrase; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWNull.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | // KWNull exists to represent the same thing as NSNull, except that Kiwi needs 10 | // to distinguish between null singletons used internally and those a user 11 | // is using as an object parameter. 12 | @interface KWNull : NSObject 13 | 14 | #pragma mark - Initializing 15 | 16 | + (id)null; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWNull.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWNull.h" 8 | 9 | @implementation KWNull 10 | 11 | #pragma mark - Initializing 12 | 13 | 14 | + (id)null { 15 | static KWNull *sharedNull = nil; 16 | static dispatch_once_t onceToken; 17 | dispatch_once(&onceToken, ^{ 18 | sharedNull = [self new]; 19 | 20 | }); 21 | 22 | return sharedNull; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWObjCUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | #pragma mark - Objective-C Type Utilities 10 | 11 | BOOL KWObjCTypeEqualToObjCType(const char *firstObjCType, const char *secondObjCType); 12 | BOOL KWObjCTypeIsNumeric(const char *objCType); 13 | BOOL KWObjCTypeIsFloatingPoint(const char *objCType); 14 | BOOL KWObjCTypeIsIntegral(const char *objCType); 15 | BOOL KWObjCTypeIsSignedIntegral(const char *objCType); 16 | BOOL KWObjCTypeIsUnsignedIntegral(const char *objCType); 17 | BOOL KWObjCTypeIsBoolean(const char *objCType); 18 | BOOL KWObjCTypeIsObject(const char *objCType); 19 | BOOL KWObjCTypeIsCharString(const char *objCType); 20 | BOOL KWObjCTypeIsClass(const char *objCType); 21 | BOOL KWObjCTypeIsSelector(const char *objCType); 22 | BOOL KWObjCTypeIsPointerToType(const char *objCType); 23 | BOOL KWObjCTypeIsPointerLike(const char *objCType); 24 | BOOL KWObjCTypeIsUnknown(const char *objCType); 25 | BOOL KWObjCTypeIsBlock(const char *objCType); 26 | 27 | NSUInteger KWObjCTypeLength(const char *objCType); 28 | 29 | #pragma mark - Selector Utlities 30 | 31 | NSUInteger KWSelectorParameterCount(SEL selector); 32 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWProbe.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWProbe.h 3 | // iOSFalconCore 4 | // 5 | // Created by Luke Redpath on 13/01/2011. 6 | // Copyright 2011 LJR Software Limited. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol KWProbe 12 | - (BOOL)isSatisfied; 13 | - (void)sample; 14 | @end 15 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWProbePoller.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWProbePoller.h 3 | // iOSFalconCore 4 | // 5 | // Created by Luke Redpath on 13/01/2011. 6 | // Copyright 2011 LJR Software Limited. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KWProbe.h" 11 | 12 | #define kKW_DEFAULT_PROBE_DELAY 0.1 13 | 14 | @interface KWProbePoller : NSObject 15 | 16 | - (id)initWithTimeout:(NSTimeInterval)theTimeout delay:(NSTimeInterval)theDelay shouldWait:(BOOL)wait; 17 | - (BOOL)check:(id)probe; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWReporting.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @class KWFailure; 10 | 11 | @protocol KWReporting 12 | 13 | #pragma mark - Reporting Failures 14 | 15 | - (void)reportFailure:(KWFailure *)failure; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWSpec.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import 9 | #import "KWExpectationType.h" 10 | #import "KWVerifying.h" 11 | #import "KWExampleDelegate.h" 12 | 13 | @class KWCallSite; 14 | 15 | @interface KWSpec : XCTestCase 16 | 17 | #pragma mark - Adding Verifiers 18 | 19 | + (id)addVerifier:(id)aVerifier; 20 | + (id)addExistVerifierWithExpectationType:(KWExpectationType)anExpectationType callSite:(KWCallSite *)aCallSite; 21 | + (id)addMatchVerifierWithExpectationType:(KWExpectationType)anExpectationType callSite:(KWCallSite *)aCallSite; 22 | + (id)addAsyncVerifierWithExpectationType:(KWExpectationType)anExpectationType callSite:(KWCallSite *)aCallSite timeout:(NSTimeInterval)timeout shouldWait:(BOOL)shouldWait; 23 | 24 | #pragma mark - Building Example Groups 25 | 26 | + (NSString *)file; 27 | + (void)buildExampleGroups; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWStringUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | #pragma mark - Checking for Case Separated Words 10 | 11 | BOOL KWStringHasWordPrefix(NSString *string, NSString *prefix); 12 | BOOL KWStringHasStrictWordPrefix(NSString *string, NSString *prefix); 13 | BOOL KWStringHasWord(NSString *string, NSString *word); 14 | 15 | #pragma mark - Getting Type Encodings 16 | 17 | NSString *KWEncodingWithObjCTypes(const char *firstType, ...) NS_REQUIRES_NIL_TERMINATION; 18 | NSString *KWEncodingForVoidMethod(void); 19 | NSString *KWEncodingForDefaultMethod(void); 20 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWSymbolicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWSymbolicator.h 3 | // Kiwi 4 | // 5 | // Created by Jerry Marino on 4/28/13. 6 | // Copyright (c) 2013 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | long kwCallerAddress(void); 12 | 13 | @interface NSString (KWShellCommand) 14 | 15 | + (NSString *)stringWithShellCommand:(NSString *)command arguments:(NSArray *)arguments; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWWorkarounds.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | #if KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 10 | 11 | #pragma mark - Invocation Exception Bug Workaround 12 | 13 | // See KiwiConfiguration.h for notes. 14 | void KWSetExceptionFromAcrossInvocationBoundary(NSException *anException); 15 | NSException *KWGetAndClearExceptionFromAcrossInvocationBoundary(void); 16 | 17 | #endif // #if KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 18 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KWWorkarounds.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWWorkarounds.h" 8 | 9 | #if KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 10 | 11 | static NSException *KWExceptionAcrossInvokeBoundary = nil; 12 | 13 | void KWSetExceptionFromAcrossInvocationBoundary(NSException *anException) { 14 | if (KWExceptionAcrossInvokeBoundary != nil) 15 | return; 16 | 17 | KWExceptionAcrossInvokeBoundary = anException; 18 | } 19 | 20 | NSException *KWGetAndClearExceptionFromAcrossInvocationBoundary(void) { 21 | NSException *exception = KWExceptionAcrossInvokeBoundary; 22 | KWExceptionAcrossInvokeBoundary = nil; 23 | return exception; 24 | } 25 | 26 | #endif // #if KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 27 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KiwiBlockMacros.h: -------------------------------------------------------------------------------- 1 | // 2 | // KiwiBlockMacros.h 3 | // Kiwi 4 | // 5 | // Created by Luke Redpath on 11/07/2011. 6 | // Copyright 2011 Allen Ding. All rights reserved. 7 | // 8 | 9 | // user defined matchers 10 | #define registerMatcher(name) \ 11 | \ 12 | @interface NSObject (KWUserDefinedMatchersDefinitions) \ 13 | - (void)name; \ 14 | @end \ 15 | 16 | #define defineMatcher(...) KWDefineMatchers(__VA_ARGS__) 17 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/KiwiConfiguration.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | // As of iPhone SDK 4 GM, exceptions thrown across an NSInvocation -invoke or 8 | // forwardInvocation: boundary in the simulator will terminate the app instead 9 | // of being caught in @catch blocks from the caller side of the -invoke. Kiwi 10 | // tries to handle this by storing the first exception that it would have 11 | // otherwise thrown in a nasty global that callers can look for and handle. 12 | // (Buggy termination is less desirable than global variables). 13 | // 14 | // Obviously, this can only handles cases where Kiwi itself would have raised 15 | // an exception. 16 | #if TARGET_IPHONE_SIMULATOR 17 | #define KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 1 18 | #endif 19 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/NSInvocation+KiwiAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @interface NSInvocation(KiwiAdditions) 10 | 11 | #pragma mark - Creating NSInvocation Objects 12 | 13 | + (NSInvocation *)invocationWithTarget:(id)anObject selector:(SEL)aSelector; 14 | + (NSInvocation *)invocationWithTarget:(id)anObject selector:(SEL)aSelector messageArguments:(const void *)firstBytes, ...; 15 | 16 | #pragma mark - Accessing Message Arguments 17 | 18 | // Message arguments are invocation arguments that begin after the target and selector arguments. These methods provide 19 | // convenient ways to access them. 20 | 21 | - (NSData *)messageArgumentDataAtIndex:(NSUInteger)anIndex; 22 | - (void)getMessageArgument:(void *)buffer atIndex:(NSUInteger)anIndex; 23 | - (void)setMessageArgument:(const void *)bytes atIndex:(NSUInteger)anIndex; 24 | - (void)setMessageArguments:(const void *)firstBytes, ...; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/NSMethodSignature+KiwiAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @interface NSMethodSignature(KiwiAdditions) 10 | 11 | #pragma mark - Getting Information on Message Arguments 12 | 13 | - (NSUInteger)numberOfMessageArguments; 14 | - (const char *)messageArgumentTypeAtIndex:(NSUInteger)anIndex; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/NSMethodSignature+KiwiAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "NSMethodSignature+KiwiAdditions.h" 8 | 9 | @implementation NSMethodSignature(KiwiAdditions) 10 | 11 | #pragma mark - Getting Information on Message Arguments 12 | 13 | - (NSUInteger)numberOfMessageArguments { 14 | return [self numberOfArguments] - 2; 15 | } 16 | 17 | - (const char *)messageArgumentTypeAtIndex:(NSUInteger)anIndex { 18 | return [self getArgumentTypeAtIndex:anIndex + 2]; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/NSNumber+KiwiAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @interface NSNumber(KiwiAdditions) 10 | 11 | #pragma mark - Creating Numbers 12 | 13 | + (id)numberWithBytes:(const void *)bytes objCType:(const char *)anObjCType; 14 | + (id)numberWithBoolBytes:(const void *)bytes; 15 | + (id)numberWithStdBoolBytes:(const void *)bytes; 16 | + (id)numberWithCharBytes:(const void *)bytes; 17 | + (id)numberWithDoubleBytes:(const void *)bytes; 18 | + (id)numberWithFloatBytes:(const void *)bytes; 19 | + (id)numberWithIntBytes:(const void *)bytes; 20 | + (id)numberWithIntegerBytes:(const void *)bytes; 21 | + (id)numberWithLongBytes:(const void *)bytes; 22 | + (id)numberWithLongLongBytes:(const void *)bytes; 23 | + (id)numberWithShortBytes:(const void *)bytes; 24 | + (id)numberWithUnsignedCharBytes:(const void *)bytes; 25 | + (id)numberWithUnsignedIntBytes:(const void *)bytes; 26 | + (id)numberWithUnsignedIntegerBytes:(const void *)bytes; 27 | + (id)numberWithUnsignedLongBytes:(const void *)bytes; 28 | + (id)numberWithUnsignedLongLongBytes:(const void *)bytes; 29 | + (id)numberWithUnsignedShortBytes:(const void *)bytes; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/NSObject+KiwiSpyAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @class KWCaptureSpy; 10 | 11 | @protocol KiwiSpyAdditions 12 | 13 | - (KWCaptureSpy *)captureArgument:(SEL)selector atIndex:(NSUInteger)index; 14 | + (KWCaptureSpy *)captureArgument:(SEL)selector atIndex:(NSUInteger)index; 15 | 16 | @end 17 | 18 | @interface NSObject (KiwiSpyAdditions) 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/NSObject+KiwiSpyAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "NSObject+KiwiSpyAdditions.h" 8 | 9 | #import "KWCaptureSpy.h" 10 | #import "KWMessagePattern.h" 11 | #import "NSObject+KiwiStubAdditions.h" 12 | 13 | @implementation NSObject (KiwiSpyAdditions) 14 | 15 | - (KWCaptureSpy *)captureArgument:(SEL)selector atIndex:(NSUInteger)index { 16 | KWCaptureSpy *spy = [[KWCaptureSpy alloc] initWithArgumentIndex:index]; 17 | KWMessagePattern *pattern = [[KWMessagePattern alloc] initWithSelector:selector]; 18 | [self addMessageSpy:spy forMessagePattern:pattern]; 19 | return spy; 20 | } 21 | 22 | + (KWCaptureSpy *)captureArgument:(SEL)selector atIndex:(NSUInteger)index { 23 | KWCaptureSpy *spy = [[KWCaptureSpy alloc] initWithArgumentIndex:index]; 24 | KWMessagePattern *pattern = [[KWMessagePattern alloc] initWithSelector:selector]; 25 | [self addMessageSpy:spy forMessagePattern:pattern]; 26 | return spy; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/NSObject+KiwiVerifierAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @protocol KWVerifying; 10 | 11 | @interface NSObject(KiwiVerifierAdditions) 12 | 13 | #pragma mark - Attaching to Verifiers 14 | 15 | - (id)attachToVerifier:(id)aVerifier; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/NSObject+KiwiVerifierAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "NSObject+KiwiVerifierAdditions.h" 8 | #import "KWVerifying.h" 9 | 10 | @implementation NSObject(KiwiVerifierAdditions) 11 | 12 | #pragma mark - Attaching to Verifiers 13 | 14 | - (id)attachToVerifier:(id)aVerifier { 15 | [aVerifier setSubject:self]; 16 | return aVerifier; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/NSProxy+KiwiVerifierAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2013 Allen Ding. All rights reserved. 5 | // 6 | // Contributed by https://github.com/dwlnetnl 7 | // 8 | 9 | #import "KiwiConfiguration.h" 10 | 11 | @protocol KWVerifying; 12 | 13 | @interface NSProxy (KiwiVerifierAdditions) 14 | 15 | #pragma mark - Attaching to Verifiers 16 | 17 | - (id)attachToVerifier:(id)aVerifier; 18 | - (id)attachToVerifier:(id)firstVerifier verifier:(id)secondVerifier; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/NSProxy+KiwiVerifierAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2013 Allen Ding. All rights reserved. 5 | // 6 | // Contributed by https://github.com/dwlnetnl 7 | // 8 | 9 | #import "NSProxy+KiwiVerifierAdditions.h" 10 | #import "KWVerifying.h" 11 | 12 | @implementation NSProxy (KiwiVerifierAdditions) 13 | 14 | #pragma mark - Attaching to Verifiers 15 | 16 | - (id)attachToVerifier:(id)aVerifier { 17 | [aVerifier setSubject:self]; 18 | return aVerifier; 19 | } 20 | 21 | - (id)attachToVerifier:(id)firstVerifier verifier:(id)secondVerifier { 22 | [firstVerifier setSubject:self]; 23 | [secondVerifier setSubject:self]; 24 | return firstVerifier; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/NSValue+KiwiAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @interface NSValue(KiwiAdditions) 10 | 11 | #pragma mark - Accessing Data 12 | 13 | - (NSData *)dataValue; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Core/NSValue+KiwiAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "NSValue+KiwiAdditions.h" 8 | #import "KWObjCUtilities.h" 9 | 10 | @implementation NSValue(KiwiAdditions) 11 | 12 | #pragma mark - Accessing Data 13 | 14 | - (NSData *)dataValue { 15 | NSUInteger length = KWObjCTypeLength([self objCType]); 16 | void *buffer = malloc(length); 17 | [self getValue:buffer]; 18 | NSData *data = [NSData dataWithBytes:buffer length:length]; 19 | free(buffer); 20 | return data; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWBeBetweenMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | 10 | @interface KWBeBetweenMatcher : KWMatcher 11 | 12 | #pragma mark - Configuring Matchers 13 | 14 | // TODO: 'and' below is a reserved word in C++ 15 | - (void)beBetween:(id)aLowerEndpoint and:(id)anUpperEndpoint; 16 | - (void)beInTheIntervalFrom:(id)aLowerEndpoint to:(id)anUpperEndpoint; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWBeEmptyMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | 10 | @interface KWBeEmptyMatcher : KWMatcher 11 | 12 | #pragma mark - Configuring Matchers 13 | 14 | - (void)beEmpty; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWBeIdenticalToMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | 10 | @interface KWBeIdenticalToMatcher : KWMatcher 11 | 12 | #pragma mark - Configuring Matchers 13 | 14 | - (void)beIdenticalTo:(id)anObject; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWBeKindOfClassMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | 10 | @interface KWBeKindOfClassMatcher : KWMatcher 11 | 12 | #pragma mark - Configuring Matchers 13 | 14 | - (void)beKindOfClass:(Class)aClass; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWBeKindOfClassMatcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWBeKindOfClassMatcher.h" 8 | #import "KWFormatter.h" 9 | 10 | @interface KWBeKindOfClassMatcher() 11 | 12 | @property (nonatomic, assign) Class targetClass; 13 | 14 | @end 15 | 16 | @implementation KWBeKindOfClassMatcher 17 | 18 | #pragma mark - Getting Matcher Strings 19 | 20 | + (NSArray *)matcherStrings { 21 | return @[@"beKindOfClass:"]; 22 | } 23 | 24 | #pragma mark - Matching 25 | 26 | - (BOOL)evaluate { 27 | return [self.subject isKindOfClass:self.targetClass]; 28 | } 29 | 30 | #pragma mark - Getting Failure Messages 31 | 32 | - (NSString *)failureMessageForShould { 33 | return [NSString stringWithFormat:@"expected subject to be kind of %@, got %@", 34 | NSStringFromClass(self.targetClass), 35 | NSStringFromClass([self.subject class])]; 36 | } 37 | 38 | - (NSString *)description { 39 | return [NSString stringWithFormat:@"be kind of %@", NSStringFromClass(self.targetClass)]; 40 | } 41 | 42 | #pragma mark - Configuring Matchers 43 | 44 | - (void)beKindOfClass:(Class)aClass { 45 | self.targetClass = aClass; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWBeMemberOfClassMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | 10 | @interface KWBeMemberOfClassMatcher : KWMatcher 11 | 12 | #pragma mark - Configuring Matchers 13 | 14 | - (void)beMemberOfClass:(Class)aClass; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWBeMemberOfClassMatcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWBeMemberOfClassMatcher.h" 8 | #import "KWFormatter.h" 9 | 10 | @interface KWBeMemberOfClassMatcher() 11 | 12 | @property (nonatomic, assign) Class targetClass; 13 | 14 | @end 15 | 16 | @implementation KWBeMemberOfClassMatcher 17 | 18 | #pragma mark - Getting Matcher Strings 19 | 20 | + (NSArray *)matcherStrings { 21 | return @[@"beMemberOfClass:"]; 22 | } 23 | 24 | #pragma mark - Matching 25 | 26 | - (BOOL)evaluate { 27 | return [self.subject isMemberOfClass:self.targetClass]; 28 | } 29 | 30 | #pragma mark - Getting Failure Messages 31 | 32 | - (NSString *)failureMessageForShould { 33 | return [NSString stringWithFormat:@"expected subject to be member of %@, got %@", 34 | NSStringFromClass(self.targetClass), 35 | NSStringFromClass([self.subject class])]; 36 | } 37 | 38 | - (NSString *)description { 39 | return [NSString stringWithFormat:@"be member of %@", 40 | NSStringFromClass(self.targetClass)]; 41 | } 42 | 43 | #pragma mark - Configuring Matchers 44 | 45 | - (void)beMemberOfClass:(Class)aClass { 46 | self.targetClass = aClass; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWBeSubclassOfClassMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | 10 | @interface KWBeSubclassOfClassMatcher : KWMatcher 11 | 12 | #pragma mark - Configuring Matchers 13 | 14 | - (void)beSubclassOfClass:(Class)aClass; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWBeTrueMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | 10 | @interface KWBeTrueMatcher : KWMatcher 11 | 12 | #pragma mark - Configuring Matchers 13 | 14 | - (void)beTrue; 15 | - (void)beFalse; 16 | - (void)beYes; 17 | - (void)beNo; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWBeWithinMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | 10 | @interface KWBeWithinMatcher : KWMatcher 11 | 12 | #pragma mark - Configuring Matchers 13 | 14 | - (void)beWithin:(id)aDistance of:(id)aValue; 15 | - (void)equal:(double)aValue withDelta:(double)aDelta; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWBeZeroMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | 10 | @interface KWBeZeroMatcher : KWMatcher 11 | 12 | #pragma mark - Configuring Matchers 13 | 14 | - (void)beZero; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWBeZeroMatcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWBeZeroMatcher.h" 8 | #import "KWFormatter.h" 9 | #import "KWValue.h" 10 | 11 | @implementation KWBeZeroMatcher 12 | 13 | #pragma mark - Getting Matcher Strings 14 | 15 | + (NSArray *)matcherStrings { 16 | return @[@"beZero"]; 17 | } 18 | 19 | #pragma mark - Matching 20 | 21 | - (BOOL)evaluate { 22 | if ([self.subject isKindOfClass:[NSNumber class]]) { 23 | return [self.subject isEqualToNumber:@0]; 24 | } 25 | 26 | if ([self.subject respondsToSelector:@selector(numberValue)]) { 27 | return [[self.subject numberValue] isEqualToNumber:@0]; 28 | } 29 | 30 | return NO; 31 | } 32 | 33 | #pragma mark - Getting Failure Messages 34 | 35 | - (NSString *)failureMessageForShould { 36 | return [NSString stringWithFormat:@"expected subject to be zero, got %@", 37 | [KWFormatter formatObject:self.subject]]; 38 | } 39 | 40 | - (NSString *)failureMessageForShouldNot { 41 | return [NSString stringWithFormat:@"expected subject not to be zero"]; 42 | } 43 | 44 | - (NSString *)description { 45 | return @"be zero"; 46 | } 47 | 48 | #pragma mark - Configuring Matchers 49 | 50 | - (void)beZero { 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWBlockRaiseMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | 10 | @interface KWBlockRaiseMatcher : KWMatcher 11 | 12 | #pragma mark - Configuring Matchers 13 | 14 | - (void)raise; 15 | - (void)raiseWithName:(NSString *)aName; 16 | - (void)raiseWithReason:(NSString *)aReason; 17 | - (void)raiseWithName:(NSString *)aName reason:(NSString *)aReason; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWChangeMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWChangeMatcher.h 3 | // Kiwi 4 | // 5 | // Copyright (c) 2013 Eloy Durán . 6 | // All rights reserved. 7 | // 8 | 9 | #import "KWMatcher.h" 10 | 11 | typedef NSInteger (^KWChangeMatcherCountBlock)(); 12 | 13 | @interface KWChangeMatcher : KWMatcher 14 | 15 | // Expect _any_ change. 16 | - (void)change:(KWChangeMatcherCountBlock)countBlock; 17 | 18 | // Expect changes by a specific amount. 19 | - (void)change:(KWChangeMatcherCountBlock)countBlock by:(NSInteger)expectedDifference; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWConformToProtocolMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | 10 | @interface KWConformToProtocolMatcher : KWMatcher 11 | 12 | #pragma mark - Configuring Matchers 13 | 14 | - (void)conformToProtocol:(Protocol *)aProtocol; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWConformToProtocolMatcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWConformToProtocolMatcher.h" 8 | #import "KWFormatter.h" 9 | 10 | @interface KWConformToProtocolMatcher() 11 | 12 | @property (nonatomic, assign) Protocol *protocol; 13 | 14 | @end 15 | 16 | @implementation KWConformToProtocolMatcher 17 | 18 | #pragma mark - Getting Matcher Strings 19 | 20 | + (NSArray *)matcherStrings { 21 | return @[@"conformToProtocol:"]; 22 | } 23 | 24 | #pragma mark - Matching 25 | 26 | - (BOOL)evaluate { 27 | return [self.subject conformsToProtocol:self.protocol]; 28 | } 29 | 30 | #pragma mark - Getting Failure Messages 31 | 32 | - (NSString *)failureMessageForShould { 33 | return [NSString stringWithFormat:@"expected subject to conform to %@ protocol", 34 | NSStringFromProtocol(self.protocol)]; 35 | } 36 | 37 | - (NSString *)description { 38 | return [NSString stringWithFormat:@"conform to %@ protocol", NSStringFromProtocol(self.protocol)]; 39 | } 40 | 41 | #pragma mark - Configuring Matchers 42 | 43 | - (void)conformToProtocol:(Protocol *)aProtocol { 44 | self.protocol = aProtocol; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWContainMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | #import "KWMatchVerifier.h" 10 | 11 | @interface KWContainMatcher : KWMatcher 12 | 13 | #pragma mark - Configuring Matchers 14 | 15 | - (void)contain:(id)anObject; 16 | - (void)containObjectsInArray:(NSArray *)anArray; 17 | 18 | @end 19 | 20 | @interface KWMatchVerifier(KWContainMatcherAdditions) 21 | 22 | #pragma mark - Verifying 23 | 24 | - (void)containObjects:(id)firstObject, ... NS_REQUIRES_NIL_TERMINATION; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWEqualMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | 10 | @interface KWEqualMatcher : KWMatcher 11 | 12 | #pragma mark - Configuring Matchers 13 | 14 | - (void)equal:(id)anObject; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWGenericMatchEvaluator.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWGenericMatcher.h 3 | // Kiwi 4 | // 5 | // Created by Allen Ding on 1/31/13. 6 | // Copyright (c) 2013 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface KWGenericMatchEvaluator : NSObject 12 | 13 | + (BOOL)isGenericMatcher:(id)object; 14 | 15 | + (BOOL)genericMatcher:(id)matcher matches:(id)object; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWGenericMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWGenericMatcher.h 3 | // Kiwi 4 | // 5 | // Created by Luke Redpath on 24/01/2011. 6 | // Copyright 2011 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KWMatcher.h" 11 | 12 | @protocol KWGenericMatching 13 | 14 | - (BOOL)matches:(id)object; 15 | 16 | @end 17 | 18 | @interface KWGenericMatcher : KWMatcher 19 | 20 | #pragma mark - Configuring Matchers 21 | 22 | - (void)match:(id)aMatcher; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWGenericMatcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // KWGenericMatcher.m 3 | // Kiwi 4 | // 5 | // Created by Luke Redpath on 24/01/2011. 6 | // Copyright 2011 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import "KWGenericMatcher.h" 10 | #import "KWGenericMatchEvaluator.h" 11 | 12 | @interface KWGenericMatcher () 13 | 14 | @property (nonatomic, strong) id matcher; 15 | 16 | @end 17 | 18 | @implementation KWGenericMatcher 19 | 20 | #pragma mark - Matching 21 | 22 | - (BOOL)evaluate { 23 | return [KWGenericMatchEvaluator genericMatcher:self.matcher matches:self.subject]; 24 | } 25 | 26 | - (NSString *)failureMessageForShould { 27 | return [NSString stringWithFormat:@"expected subject to match %@", self.matcher]; 28 | } 29 | 30 | - (NSString *)description 31 | { 32 | return [NSString stringWithFormat:@"match %@", [self.matcher description]]; 33 | } 34 | 35 | #pragma mark - Getting Matcher Strings 36 | 37 | + (NSArray *)matcherStrings { 38 | return @[@"match:"]; 39 | } 40 | 41 | #pragma mark - Configuring Matchers 42 | 43 | - (void)match:(id)aMatcher; 44 | { 45 | self.matcher = aMatcher; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWGenericMatchingAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+KiwiAdditions.h 3 | // Kiwi 4 | // 5 | // Created by Luke Redpath on 24/01/2011. 6 | // Copyright 2011 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject (KiwiGenericMatchingAdditions) 12 | 13 | - (BOOL)isEqualOrMatches:(id)object DEPRECATED_ATTRIBUTE; 14 | 15 | @end 16 | 17 | @interface NSArray (KiwiGenericMatchingAdditions) 18 | 19 | - (BOOL)containsObjectEqualToOrMatching:(id)object DEPRECATED_ATTRIBUTE; 20 | - (BOOL)containsObjectMatching:(id)matcher DEPRECATED_ATTRIBUTE; 21 | 22 | @end 23 | 24 | @interface NSSet (KiwiGenericMatchingAdditions) 25 | 26 | - (BOOL)containsObjectEqualToOrMatching:(id)object DEPRECATED_ATTRIBUTE; 27 | 28 | @end 29 | 30 | @interface NSOrderedSet (KiwiGenericMatchingAdditions) 31 | 32 | - (BOOL)containsObjectEqualToOrMatching:(id)object DEPRECATED_ATTRIBUTE; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWHaveValueMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWHaveValueMatcher.h 3 | // Kiwi 4 | // 5 | // Created by Luke Redpath on 24/01/2011. 6 | // Copyright 2011 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KWMatcher.h" 11 | 12 | @interface KWHaveValueMatcher : KWMatcher 13 | 14 | #pragma mark - Configuring Matchers 15 | 16 | - (void)haveValue:(id)value forKey:(NSString *)key; 17 | - (void)haveValue:(id)value forKeyPath:(NSString *)keyPath; 18 | - (void)haveValueForKey:(NSString *)key; 19 | - (void)haveValueForKeyPath:(NSString *)keyPath; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWInequalityMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | 10 | @interface KWInequalityMatcher : KWMatcher 11 | 12 | #pragma mark - Configuring Matchers 13 | 14 | - (void)beLessThan:(id)aValue; 15 | - (void)beLessThanOrEqualTo:(id)aValue; 16 | - (void)beGreaterThan:(id)aValue; 17 | - (void)beGreaterThanOrEqualTo:(id)aValue; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWNilMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWBeNilMatcher.h 3 | // iOSFalconCore 4 | // 5 | // Created by Luke Redpath on 14/01/2011. 6 | // Copyright 2011 LJR Software Limited. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KWMatcher.h" 11 | 12 | @interface KWNilMatcher : KWMatcher 13 | 14 | - (void)beNil; 15 | - (void)beNonNil; 16 | 17 | - (void)beNil:(BOOL)workaroundArgument; 18 | - (void)beNonNil:(BOOL)workaroundArgument; 19 | 20 | + (BOOL)verifyNilSubject; 21 | + (BOOL)verifyNonNilSubject; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWNotificationMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWNotificationMatcher.h 3 | // 4 | // Created by Paul Zabelin on 7/12/12. 5 | // Copyright (c) 2012 Blazing Cloud, Inc. All rights reserved. 6 | // 7 | 8 | #import "KWMatcher.h" 9 | 10 | typedef void (^PostedNotificationBlock)(NSNotification* note); 11 | 12 | @interface KWNotificationMatcher : KWMatcher 13 | 14 | - (void)bePosted; 15 | - (void)bePostedWithObject:(id)object; 16 | - (void)bePostedWithUserInfo:(NSDictionary *)userInfo; 17 | - (void)bePostedWithObject:(id)object andUserInfo:(NSDictionary *)userInfo; 18 | - (void)bePostedEvaluatingBlock:(PostedNotificationBlock)block; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWRegularExpressionPatternMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWRegularExpressionPatternMatcher.h 3 | // Kiwi 4 | // 5 | // Created by Kristopher Johnson on 4/11/13. 6 | // Copyright (c) 2013 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import "KiwiConfiguration.h" 10 | #import "KWMatcher.h" 11 | 12 | @interface KWRegularExpressionPatternMatcher : KWMatcher 13 | 14 | - (void)matchPattern:(NSString *)pattern; 15 | 16 | - (void)matchPattern:(NSString *)pattern options:(NSRegularExpressionOptions)options; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWRespondToSelectorMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWMatcher.h" 9 | 10 | @interface KWRespondToSelectorMatcher : KWMatcher 11 | 12 | #pragma mark - Configuring Matchers 13 | 14 | - (void)respondToSelector:(SEL)aSelector; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWRespondToSelectorMatcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWRespondToSelectorMatcher.h" 8 | #import "KWFormatter.h" 9 | 10 | @interface KWRespondToSelectorMatcher() 11 | 12 | #pragma mark - Properties 13 | 14 | @property (nonatomic, assign) SEL selector; 15 | 16 | @end 17 | 18 | @implementation KWRespondToSelectorMatcher 19 | 20 | #pragma mark - Getting Matcher Strings 21 | 22 | + (NSArray *)matcherStrings { 23 | return @[@"respondToSelector:"]; 24 | } 25 | 26 | #pragma mark - Matching 27 | 28 | - (BOOL)evaluate { 29 | return [self.subject respondsToSelector:self.selector]; 30 | } 31 | 32 | #pragma mark - Getting Failure Messages 33 | 34 | - (NSString *)failureMessageForShould { 35 | return [NSString stringWithFormat:@"expected subject to respond to -%@", 36 | NSStringFromSelector(self.selector)]; 37 | } 38 | 39 | - (NSString *)description { 40 | return [NSString stringWithFormat:@"respond to -%@", NSStringFromSelector(self.selector)]; 41 | } 42 | 43 | #pragma mark - Configuring Matchers 44 | 45 | - (void)respondToSelector:(SEL)aSelector { 46 | self.selector = aSelector; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWStringContainsMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWStringContainsMatcher.h 3 | // Kiwi 4 | // 5 | // Created by Stewart Gleadow on 7/06/12. 6 | // Copyright (c) 2012 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KWGenericMatcher.h" 11 | 12 | @interface KWStringContainsMatcher : NSObject 13 | 14 | + (id)matcherWithSubstring:(NSString *)aSubstring DEPRECATED_ATTRIBUTE; 15 | - (id)initWithSubstring:(NSString *)aSubstring DEPRECATED_ATTRIBUTE; 16 | 17 | @end 18 | 19 | #define hasSubstring(substring) [KWStringContainsMatcher matcherWithSubstring:substring] 20 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWStringContainsMatcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // StringContainsMatcher.m 3 | // Kiwi 4 | // 5 | // Created by Stewart Gleadow on 7/06/12. 6 | // Copyright (c) 2012 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import "KWStringContainsMatcher.h" 10 | 11 | @interface KWStringContainsMatcher(){} 12 | @property (nonatomic, copy) NSString *substring; 13 | @end 14 | 15 | @implementation KWStringContainsMatcher 16 | 17 | + (id)matcherWithSubstring:(NSString *)aSubstring { 18 | return [[self alloc] initWithSubstring:aSubstring]; 19 | } 20 | 21 | - (id)initWithSubstring:(NSString *)aSubstring { 22 | self = [super init]; 23 | if (self) { 24 | _substring = [aSubstring copy]; 25 | } 26 | return self; 27 | } 28 | 29 | 30 | - (BOOL)matches:(id)item { 31 | if (![item respondsToSelector:@selector(rangeOfString:)]) { 32 | return NO; 33 | } 34 | 35 | return [item rangeOfString:self.substring].location != NSNotFound; 36 | } 37 | 38 | - (NSString *)description { 39 | return [NSString stringWithFormat:@"a string with substring '%@'", self.substring]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWStringPrefixMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // StringPrefixMatcher.h 3 | // Kiwi 4 | // 5 | // Created by Luke Redpath on 17/01/2011. 6 | // Copyright 2011 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface KWStringPrefixMatcher : NSObject 12 | 13 | + (id)matcherWithPrefix:(NSString *)aPrefix; 14 | - (id)initWithPrefix:(NSString *)aPrefix; 15 | 16 | @end 17 | 18 | #define hasPrefix(prefix) [KWStringPrefixMatcher matcherWithPrefix:prefix] 19 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Matchers/KWStringPrefixMatcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // StringPrefixMatcher.m 3 | // Kiwi 4 | // 5 | // Created by Luke Redpath on 17/01/2011. 6 | // Copyright 2011 Allen Ding. All rights reserved. 7 | // 8 | 9 | #import "KWStringPrefixMatcher.h" 10 | 11 | @interface KWStringPrefixMatcher(){} 12 | @property (nonatomic, copy) NSString *prefix; 13 | @end 14 | 15 | @implementation KWStringPrefixMatcher 16 | 17 | + (id)matcherWithPrefix:(NSString *)aPrefix { 18 | return [[self alloc] initWithPrefix:aPrefix]; 19 | } 20 | 21 | - (id)initWithPrefix:(NSString *)aPrefix { 22 | self = [super init]; 23 | if (self) { 24 | _prefix = [aPrefix copy]; 25 | } 26 | return self; 27 | } 28 | 29 | 30 | - (BOOL)matches:(id)item { 31 | if (![item respondsToSelector:@selector(hasPrefix:)]) 32 | return NO; 33 | 34 | return [item hasPrefix:self.prefix]; 35 | } 36 | 37 | - (NSString *)description { 38 | return [NSString stringWithFormat:@"a string with prefix '%@'", self.prefix]; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Mocking/NSObject+KiwiMockAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @protocol KiwiMockAdditions 10 | 11 | #pragma mark - Creating Mocks 12 | 13 | + (id)mock; 14 | + (id)mockWithName:(NSString *)aName; 15 | 16 | + (id)nullMock; 17 | + (id)nullMockWithName:(NSString *)aName; 18 | 19 | @end 20 | 21 | @interface NSObject(KiwiMockAdditions) 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Mocking/NSObject+KiwiMockAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "NSObject+KiwiMockAdditions.h" 8 | #import "KWMock.h" 9 | 10 | @implementation NSObject(KiwiMockAdditions) 11 | 12 | #pragma mark - Creating Mocks 13 | 14 | + (id)mock { 15 | return [KWMock mockForClass:[self class]]; 16 | } 17 | 18 | + (id)mockWithName:(NSString *)aName { 19 | return [KWMock mockWithName:aName forClass:[self class]]; 20 | } 21 | 22 | + (id)nullMock { 23 | return [KWMock nullMockForClass:[self class]]; 24 | } 25 | 26 | + (id)nullMockWithName:(NSString *)aName { 27 | return [KWMock nullMockWithName:aName forClass:[self class]]; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWAfterAllNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWBlockNode.h" 9 | #import "KWExampleNode.h" 10 | 11 | @interface KWAfterAllNode : KWBlockNode 12 | 13 | #pragma mark - Initializing 14 | 15 | + (id)afterAllNodeWithCallSite:(KWCallSite *)aCallSite block:(void (^)(void))block; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWAfterAllNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWAfterAllNode.h" 8 | #import "KWExampleNodeVisitor.h" 9 | 10 | @implementation KWAfterAllNode 11 | 12 | #pragma mark - Initializing 13 | 14 | + (id)afterAllNodeWithCallSite:(KWCallSite *)aCallSite block:(void (^)(void))block { 15 | return [[self alloc] initWithCallSite:aCallSite description:nil block:block]; 16 | } 17 | 18 | #pragma mark - Accepting Visitors 19 | 20 | - (void)acceptExampleNodeVisitor:(id)aVisitor { 21 | [aVisitor visitAfterAllNode:self]; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWAfterEachNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWBlockNode.h" 9 | #import "KWExampleNode.h" 10 | 11 | @interface KWAfterEachNode : KWBlockNode 12 | 13 | #pragma mark - Initializing 14 | 15 | + (id)afterEachNodeWithCallSite:(KWCallSite *)aCallSite block:(void (^)(void))block; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWAfterEachNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWAfterEachNode.h" 8 | #import "KWExampleNodeVisitor.h" 9 | 10 | @implementation KWAfterEachNode 11 | 12 | #pragma mark - Initializing 13 | 14 | + (id)afterEachNodeWithCallSite:(KWCallSite *)aCallSite block:(void (^)(void))block { 15 | return [[self alloc] initWithCallSite:aCallSite description:nil block:block]; 16 | } 17 | 18 | #pragma mark - Accepting Visitors 19 | 20 | - (void)acceptExampleNodeVisitor:(id)aVisitor { 21 | [aVisitor visitAfterEachNode:self]; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWBeforeAllNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWBlockNode.h" 9 | #import "KWExampleNode.h" 10 | 11 | @interface KWBeforeAllNode : KWBlockNode 12 | 13 | #pragma mark - Initializing 14 | 15 | + (id)beforeAllNodeWithCallSite:(KWCallSite *)aCallSite block:(void (^)(void))block; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWBeforeAllNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWBeforeAllNode.h" 8 | #import "KWExampleNodeVisitor.h" 9 | 10 | @implementation KWBeforeAllNode 11 | 12 | #pragma mark - Initializing 13 | 14 | + (id)beforeAllNodeWithCallSite:(KWCallSite *)aCallSite block:(void (^)(void))block { 15 | return [[self alloc] initWithCallSite:aCallSite description:nil block:block]; 16 | } 17 | 18 | #pragma mark - Accepting Visitors 19 | 20 | - (void)acceptExampleNodeVisitor:(id)aVisitor { 21 | [aVisitor visitBeforeAllNode:self]; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWBeforeEachNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWBlockNode.h" 9 | #import "KWExampleNode.h" 10 | 11 | @interface KWBeforeEachNode : KWBlockNode 12 | 13 | #pragma mark - Initializing 14 | 15 | + (id)beforeEachNodeWithCallSite:(KWCallSite *)aCallSite block:(void (^)(void))block; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWBeforeEachNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWBeforeEachNode.h" 8 | #import "KWExampleNodeVisitor.h" 9 | 10 | @implementation KWBeforeEachNode 11 | 12 | #pragma mark - Initializing 13 | 14 | + (id)beforeEachNodeWithCallSite:(KWCallSite *)aCallSite block:(void (^)(void))block { 15 | return [[self alloc] initWithCallSite:aCallSite description:nil block:block]; 16 | } 17 | 18 | #pragma mark - Accepting Visitors 19 | 20 | - (void)acceptExampleNodeVisitor:(id)aVisitor { 21 | [aVisitor visitBeforeEachNode:self]; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWBlockNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWBlock.h" 9 | 10 | @class KWCallSite; 11 | 12 | @interface KWBlockNode : NSObject 13 | 14 | #pragma mark - Initializing 15 | 16 | - (id)initWithCallSite:(KWCallSite *)aCallSite description:(NSString *)aDescription block:(void (^)(void))block; 17 | 18 | #pragma mark - Getting Call Sites 19 | 20 | @property (nonatomic, strong, readonly) KWCallSite *callSite; 21 | 22 | #pragma mark - Getting Descriptions 23 | 24 | @property (nonatomic, copy) NSString *description; 25 | 26 | #pragma mark - Getting Blocks 27 | 28 | @property (nonatomic, copy, readonly) void (^block)(void); 29 | 30 | #pragma mark - Performing blocks 31 | 32 | - (void)performBlock; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWBlockNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWBlockNode.h" 8 | 9 | @implementation KWBlockNode 10 | 11 | @synthesize description = _description; 12 | 13 | #pragma mark - Initializing 14 | 15 | - (id)initWithCallSite:(KWCallSite *)aCallSite description:(NSString *)aDescription block:(void (^)(void))block { 16 | self = [super init]; 17 | if (self) { 18 | _callSite = aCallSite; 19 | _description = [aDescription copy]; 20 | _block = [block copy]; 21 | } 22 | 23 | return self; 24 | } 25 | 26 | - (void)performBlock { 27 | if (self.block != nil) { self.block(); } 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWExampleNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @class KWContextNode; 10 | @protocol KWExampleNodeVisitor; 11 | 12 | @protocol KWExampleNode 13 | 14 | #pragma mark - Accepting Visitors 15 | 16 | - (void)acceptExampleNodeVisitor:(id)aVisitor; 17 | 18 | @optional 19 | 20 | - (NSArray *)contextStack; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWItNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWBlockNode.h" 9 | #import "KWExampleNode.h" 10 | 11 | @class KWPendingNode; 12 | @class KWExample; 13 | @class KWContextNode; 14 | 15 | @interface KWItNode : KWBlockNode 16 | 17 | @property (nonatomic, strong) KWExample *example; 18 | @property (nonatomic, weak, readonly) KWContextNode *context; 19 | 20 | #pragma mark - Initializing 21 | 22 | + (id)itNodeWithCallSite:(KWCallSite *)aCallSite 23 | description:(NSString *)aDescription 24 | context:(KWContextNode *)context 25 | block:(void (^)(void))block; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWLetNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWExampleNode.h" 9 | 10 | @interface KWLetNode : NSObject 11 | 12 | - (instancetype)initWithSymbolName:(NSString *)aSymbolName objectRef:(id *)anObjectRef block:(id (^)(void))block; 13 | + (instancetype)letNodeWithSymbolName:(NSString *)aSymbolName objectRef:(id *)anObjectRef block:(id (^)(void))block; 14 | 15 | @property (nonatomic, copy) NSString *symbolName; 16 | @property (nonatomic, copy) id (^block)(void); 17 | @property (nonatomic, readonly) __autoreleasing id *objectRef; 18 | 19 | - (id)evaluate; 20 | - (void)evaluateTree; 21 | 22 | - (void)addLetNode:(KWLetNode *)aNode; 23 | - (void)unlink; 24 | 25 | // The parent/child relationship describes let nodes declared in nested 26 | // contexts -- evaluating a node returns the value of the deepest 27 | // evaluated child. 28 | @property (nonatomic, readonly, weak) KWLetNode *parent; 29 | @property (nonatomic, readonly, strong) KWLetNode *child; 30 | 31 | // The next/previous relationship describes the order in which nodes 32 | // of different symbols were declared. 33 | @property (nonatomic, readonly, strong) KWLetNode *next; 34 | @property (nonatomic, readonly, weak) KWLetNode *previous; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWPendingNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWExampleNode.h" 9 | 10 | @class KWContextNode; 11 | @class KWCallSite; 12 | 13 | @interface KWPendingNode : NSObject 14 | 15 | @property (nonatomic, readonly, strong) KWContextNode *context; 16 | 17 | #pragma mark - Initializing 18 | 19 | - (id)initWithCallSite:(KWCallSite *)aCallSite context:(KWContextNode *)context description:(NSString *)aDescription; 20 | 21 | + (id)pendingNodeWithCallSite:(KWCallSite *)aCallSite context:(KWContextNode *)context description:(NSString *)aDescription; 22 | 23 | #pragma mark - Getting Call Sites 24 | 25 | @property (nonatomic, readonly) KWCallSite *callSite; 26 | 27 | #pragma mark - Getting Descriptions 28 | 29 | @property (readonly, copy) NSString *description; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWRegisterMatchersNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWExampleNode.h" 9 | 10 | @class KWCallSite; 11 | 12 | @interface KWRegisterMatchersNode : NSObject 13 | 14 | #pragma mark - Initializing 15 | 16 | - (id)initWithCallSite:(KWCallSite *)aCallSite namespacePrefix:(NSString *)aNamespacePrefix; 17 | 18 | + (id)registerMatchersNodeWithCallSite:(KWCallSite *)aCallSite namespacePrefix:(NSString *)aNamespacePrefix; 19 | 20 | #pragma mark - Getting Call Sites 21 | 22 | @property (nonatomic, readonly) KWCallSite *callSite; 23 | 24 | #pragma mark - Getting Namespace Prefixes 25 | 26 | @property (nonatomic, readonly) NSString *namespacePrefix; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Nodes/KWRegisterMatchersNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KWRegisterMatchersNode.h" 8 | 9 | #import "KWCallSite.h" 10 | #import "KWExampleNodeVisitor.h" 11 | 12 | @implementation KWRegisterMatchersNode 13 | 14 | #pragma mark - Initializing 15 | 16 | - (id)initWithCallSite:(KWCallSite *)aCallSite namespacePrefix:(NSString *)aNamespacePrefix { 17 | self = [super init]; 18 | if (self) { 19 | _callSite = aCallSite; 20 | _namespacePrefix = [aNamespacePrefix copy]; 21 | } 22 | 23 | return self; 24 | } 25 | 26 | + (id)registerMatchersNodeWithCallSite:(KWCallSite *)aCallSite namespacePrefix:(NSString *)aNamespacePrefix { 27 | return [[self alloc] initWithCallSite:aCallSite namespacePrefix:aNamespacePrefix]; 28 | } 29 | 30 | #pragma mark - Accepting Visitors 31 | 32 | - (void)acceptExampleNodeVisitor:(id)aVisitor { 33 | [aVisitor visitRegisterMatchersNode:self]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Verifiers/KWAsyncVerifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // KWAsyncVerifier.h 3 | // iOSFalconCore 4 | // 5 | // Created by Luke Redpath on 13/01/2011. 6 | // Copyright 2011 LJR Software Limited. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KWMatchVerifier.h" 11 | #import "KWProbe.h" 12 | 13 | #define kKW_DEFAULT_PROBE_TIMEOUT 1.0 14 | 15 | @class KWAsyncMatcherProbe; 16 | 17 | 18 | @interface KWAsyncVerifier : KWMatchVerifier 19 | 20 | @property (nonatomic, assign) NSTimeInterval timeout; 21 | @property (nonatomic, assign) BOOL shouldWait; 22 | 23 | + (id)asyncVerifierWithExpectationType:(KWExpectationType)anExpectationType callSite:(KWCallSite *)aCallSite matcherFactory:(KWMatcherFactory *)aMatcherFactory reporter:(id)aReporter probeTimeout:(NSTimeInterval)probeTimeout shouldWait:(BOOL)shouldWait; 24 | - (void)verifyWithProbe:(KWAsyncMatcherProbe *)aProbe; 25 | 26 | @end 27 | 28 | 29 | @interface KWAsyncMatcherProbe : NSObject 30 | 31 | @property (nonatomic, assign) BOOL matchResult; 32 | @property (nonatomic, readonly) id matcher; 33 | 34 | - (id)initWithMatcher:(id)aMatcher; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Verifiers/KWExistVerifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | #import "KWExpectationType.h" 9 | #import "KWVerifying.h" 10 | 11 | @class KWCallSite; 12 | 13 | @protocol KWReporting; 14 | 15 | @interface KWExistVerifier : NSObject 16 | 17 | #pragma mark - Initializing 18 | 19 | - (id)initWithExpectationType:(KWExpectationType)anExpectationType callSite:(KWCallSite *)aCallSite reporter:(id)aReporter; 20 | 21 | + (id)existVerifierWithExpectationType:(KWExpectationType)anExpectationType callSite:(KWCallSite *)aCallSite reporter:(id)aReporter; 22 | 23 | #pragma mark - Properties 24 | 25 | @property (nonatomic, strong) id subject; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Pods/Kiwi/Classes/Verifiers/KWVerifying.h: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the terms in License.txt 3 | // 4 | // Copyright 2010 Allen Ding. All rights reserved. 5 | // 6 | 7 | #import "KiwiConfiguration.h" 8 | 9 | @class KWCallSite; 10 | 11 | @protocol KWVerifying 12 | 13 | @property (nonatomic, readonly) KWCallSite *callSite; 14 | 15 | - (NSString *)descriptionForAnonymousItNode; 16 | 17 | #pragma mark - Subjects 18 | 19 | @property (nonatomic, strong) id subject; 20 | 21 | #pragma mark - Ending Examples 22 | 23 | - (void)exampleWillEnd; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Kiwi (2.3.0) 3 | 4 | DEPENDENCIES: 5 | - Kiwi 6 | 7 | SPEC CHECKSUMS: 8 | Kiwi: 54bece5b35564d9b8e03c608d926f1a22fcfc589 9 | 10 | COCOAPODS: 0.35.0 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-UnitTests-Kiwi/Pods-UnitTests-Kiwi-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-UnitTests-Kiwi.xcconfig" 2 | FRAMEWORK_SEARCH_PATHS = ${PODS_UNITTESTS_KIWI_FRAMEWORK_SEARCH_PATHS} 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/Kiwi" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Kiwi" 5 | OTHER_LDFLAGS = ${PODS_UNITTESTS_KIWI_OTHER_LDFLAGS} -ObjC 6 | PODS_ROOT = ${SRCROOT} -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-UnitTests-Kiwi/Pods-UnitTests-Kiwi-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_UnitTests_Kiwi : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_UnitTests_Kiwi 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-UnitTests-Kiwi/Pods-UnitTests-Kiwi-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-UnitTests-environment.h" 6 | #import 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-UnitTests-Kiwi/Pods-UnitTests-Kiwi.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_UNITTESTS_KIWI_FRAMEWORK_SEARCH_PATHS = "$(SDKROOT)/Developer/Library/Frameworks" $(inherited) "$(DEVELOPER_FRAMEWORKS_DIR)" "$(DEVELOPER_DIR)/Platforms/MacOSX.platform/Developer/Library/Frameworks" "$(DEVELOPER_LIBRARY_DIR)/Frameworks" "$(PLATFORM_DIR)/Developer/Library/Frameworks" 2 | PODS_UNITTESTS_KIWI_OTHER_LDFLAGS = -framework "XCTest" -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-UnitTests/Pods-UnitTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_UnitTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_UnitTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-UnitTests/Pods-UnitTests-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // Kiwi 10 | #define COCOAPODS_POD_AVAILABLE_Kiwi 11 | #define COCOAPODS_VERSION_MAJOR_Kiwi 2 12 | #define COCOAPODS_VERSION_MINOR_Kiwi 3 13 | #define COCOAPODS_VERSION_PATCH_Kiwi 0 14 | 15 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-UnitTests/Pods-UnitTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = "$(SDKROOT)/Developer/Library/Frameworks" $(inherited) "$(DEVELOPER_FRAMEWORKS_DIR)" "$(DEVELOPER_DIR)/Platforms/MacOSX.platform/Developer/Library/Frameworks" "$(DEVELOPER_LIBRARY_DIR)/Frameworks" "$(PLATFORM_DIR)/Developer/Library/Frameworks" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Kiwi" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Kiwi" 5 | OTHER_LDFLAGS = -ObjC -l"Pods-UnitTests-Kiwi" -framework "XCTest" 6 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 7 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-UnitTests/Pods-UnitTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = "$(SDKROOT)/Developer/Library/Frameworks" $(inherited) "$(DEVELOPER_FRAMEWORKS_DIR)" "$(DEVELOPER_DIR)/Platforms/MacOSX.platform/Developer/Library/Frameworks" "$(DEVELOPER_LIBRARY_DIR)/Frameworks" "$(PLATFORM_DIR)/Developer/Library/Frameworks" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Kiwi" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Kiwi" 5 | OTHER_LDFLAGS = -ObjC -l"Pods-UnitTests-Kiwi" -framework "XCTest" 6 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 7 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Source/CDBalanceFormatter.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @interface CDBalanceFormatter : NSObject 7 | 8 | - (id)initWithString:(NSString *)str; 9 | 10 | - (void)parse:(NSString *)open index:(NSUInteger)openIndex level:(NSUInteger)level; 11 | 12 | - (NSString *)format; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/CDClassDumpVisitor.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDTextClassDumpVisitor.h" 7 | 8 | @interface CDClassDumpVisitor : CDTextClassDumpVisitor 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Source/CDClassFrameworkVisitor.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDVisitor.h" 7 | 8 | // This builds up a dictionary mapping class names to a framework names. 9 | // It is only used by CDMultiFileVisitor to generate individual imports when creating separate header files. 10 | 11 | // Some protocols appear in multiple frameworks. This just records the last framework that contained a reference, which 12 | // produces incorrect results. For example, -r AppKit.framework, and Foundation.framework is processed before several 13 | // others, including Symbolication. 14 | 15 | // If we follow framework dependancies, the earliest reference to NSCopying is CoreFoundation, but NSCopying is really 16 | // defined in Foundation. 17 | 18 | // But it turns out that we can just use forward references for protocols. 19 | 20 | @interface CDClassFrameworkVisitor : CDVisitor 21 | 22 | // NSString (class name) -> NSString (framework name) 23 | @property (nonatomic, readonly) NSDictionary *frameworkNamesByClassName; 24 | 25 | // NSString (protocol name) -> NSString (framework name) 26 | @property (nonatomic, readonly) NSDictionary *frameworkNamesByProtocolName; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Source/CDDataCursor.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @interface CDDataCursor : NSObject 7 | 8 | - (id)initWithData:(NSData *)data; 9 | 10 | @property (readonly) NSData *data; 11 | - (const void *)bytes; 12 | 13 | @property (nonatomic, assign) NSUInteger offset; 14 | 15 | - (void)advanceByLength:(NSUInteger)length; 16 | - (NSUInteger)remaining; 17 | 18 | - (uint8_t)readByte; 19 | 20 | - (uint16_t)readLittleInt16; 21 | - (uint32_t)readLittleInt32; 22 | - (uint64_t)readLittleInt64; 23 | 24 | - (uint16_t)readBigInt16; 25 | - (uint32_t)readBigInt32; 26 | - (uint64_t)readBigInt64; 27 | 28 | - (float)readLittleFloat32; 29 | - (float)readBigFloat32; 30 | 31 | - (double)readLittleFloat64; 32 | //- (double)readBigFloat64; 33 | 34 | - (void)appendBytesOfLength:(NSUInteger)length intoData:(NSMutableData *)data; 35 | - (void)readBytesOfLength:(NSUInteger)length intoBuffer:(void *)buf; 36 | - (BOOL)isAtEnd; 37 | 38 | - (NSString *)readCString; 39 | - (NSString *)readStringOfLength:(NSUInteger)length encoding:(NSStringEncoding)encoding; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Source/CDExtensions.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDTopoSortNode.h" 7 | #import "NSArray-CDExtensions.h" 8 | #import "NSData-CDExtensions.h" 9 | #import "NSData-CDExtensions.h" 10 | #import "NSError-CDExtensions.h" 11 | #import "NSScanner-CDExtensions.h" 12 | #import "NSString-CDExtensions.h" 13 | -------------------------------------------------------------------------------- /Source/CDFatArch.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDFile.h" // For CDArch 7 | 8 | @class CDDataCursor; 9 | @class CDFatFile, CDMachOFile; 10 | 11 | @interface CDFatArch : NSObject 12 | 13 | - (id)initWithMachOFile:(CDMachOFile *)machOFile; 14 | - (id)initWithDataCursor:(CDDataCursor *)cursor; 15 | 16 | @property (assign) cpu_type_t cputype; 17 | @property (assign) cpu_subtype_t cpusubtype; 18 | @property (assign) uint32_t offset; 19 | @property (assign) uint32_t size; 20 | @property (assign) uint32_t align; 21 | 22 | @property (nonatomic, readonly) cpu_type_t maskedCPUType; 23 | @property (nonatomic, readonly) cpu_subtype_t maskedCPUSubtype; 24 | @property (nonatomic, readonly) BOOL uses64BitABI; 25 | @property (nonatomic, readonly) BOOL uses64BitLibraries; 26 | 27 | @property (weak) CDFatFile *fatFile; 28 | 29 | @property (nonatomic, readonly) CDArch arch; 30 | @property (nonatomic, readonly) NSString *archName; 31 | 32 | @property (nonatomic, readonly) CDMachOFile *machOFile; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Source/CDFatFile.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDFile.h" 7 | 8 | @class CDFatArch; 9 | 10 | @interface CDFatFile : CDFile 11 | 12 | @property (readonly) NSMutableArray *arches; 13 | @property (nonatomic, readonly) NSArray *archNames; 14 | 15 | - (void)addArchitecture:(CDFatArch *)fatArch; 16 | - (BOOL)containsArchitecture:(CDArch)arch; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Source/CDFindMethodVisitor.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDVisitor.h" 7 | 8 | // This limits the output to methods matching the search string. Some context is included, so that you can see which class, category, or protocol 9 | // contains the method. 10 | 11 | @interface CDFindMethodVisitor : CDVisitor 12 | 13 | @property (strong) NSString *searchString; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/CDLCDataInCode.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCLinkeditData.h" 7 | 8 | @interface CDLCDataInCode : CDLCLinkeditData 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Source/CDLCDataInCode.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCDataInCode.h" 7 | 8 | #import "CDMachOFile.h" 9 | 10 | @implementation CDLCDataInCode 11 | { 12 | } 13 | 14 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor; 15 | { 16 | if ((self = [super initWithDataCursor:cursor])) { 17 | } 18 | 19 | return self; 20 | } 21 | 22 | #pragma mark - 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Source/CDLCDyldInfo.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCDyldInfo : CDLoadCommand 9 | 10 | - (NSString *)symbolNameForAddress:(NSUInteger)address; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/CDLCDylib.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCDylib : CDLoadCommand 9 | 10 | @property (readonly) NSString *path; 11 | @property (nonatomic, readonly) uint32_t timestamp; 12 | @property (nonatomic, readonly) uint32_t currentVersion; 13 | @property (nonatomic, readonly) uint32_t compatibilityVersion; 14 | 15 | @property (nonatomic, readonly) NSString *formattedCurrentVersion; 16 | @property (nonatomic, readonly) NSString *formattedCompatibilityVersion; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Source/CDLCDylinker.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCDylinker : CDLoadCommand 9 | 10 | @property (readonly) NSString *name; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/CDLCDylinker.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCDylinker.h" 7 | 8 | @implementation CDLCDylinker 9 | { 10 | struct dylinker_command _dylinkerCommand; 11 | NSString *_name; 12 | } 13 | 14 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor; 15 | { 16 | if ((self = [super initWithDataCursor:cursor])) { 17 | _dylinkerCommand.cmd = [cursor readInt32]; 18 | _dylinkerCommand.cmdsize = [cursor readInt32]; 19 | 20 | _dylinkerCommand.name.offset = [cursor readInt32]; 21 | 22 | NSUInteger length = _dylinkerCommand.cmdsize - sizeof(_dylinkerCommand); 23 | //NSLog(@"expected length: %u", length); 24 | 25 | _name = [cursor readStringOfLength:length encoding:NSASCIIStringEncoding]; 26 | //NSLog(@"name: %@", name); 27 | } 28 | 29 | return self; 30 | } 31 | 32 | #pragma mark - 33 | 34 | - (uint32_t)cmd; 35 | { 36 | return _dylinkerCommand.cmd; 37 | } 38 | 39 | - (uint32_t)cmdsize; 40 | { 41 | return _dylinkerCommand.cmdsize; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Source/CDLCDynamicSymbolTable.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @class CDRelocationInfo; 9 | 10 | @interface CDLCDynamicSymbolTable : CDLoadCommand 11 | 12 | - (void)loadSymbols; 13 | 14 | - (CDRelocationInfo *)relocationEntryWithOffset:(NSUInteger)offset; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/CDLCEncryptionInfo.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCEncryptionInfo : CDLoadCommand 9 | 10 | @property (nonatomic, readonly) uint32_t cryptoff; 11 | @property (nonatomic, readonly) uint32_t cryptsize; 12 | @property (nonatomic, readonly) uint32_t cryptid; 13 | 14 | @property (nonatomic, readonly) BOOL isEncrypted; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/CDLCFunctionStarts.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCLinkeditData.h" 7 | 8 | @interface CDLCFunctionStarts : CDLCLinkeditData 9 | 10 | @property (nonatomic, readonly) NSArray *functionStarts; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/CDLCFunctionStarts.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCFunctionStarts.h" 7 | 8 | #import "ULEB128.h" 9 | 10 | @implementation CDLCFunctionStarts 11 | { 12 | NSArray *_functionStarts; 13 | } 14 | 15 | #pragma mark - 16 | 17 | - (NSArray *)functionStarts; 18 | { 19 | if (_functionStarts == nil) { 20 | NSData *functionStartsData = [self linkeditData]; 21 | const uint8_t *start = (uint8_t *)[functionStartsData bytes]; 22 | const uint8_t *end = start + [functionStartsData length]; 23 | uint64_t startAddress; 24 | uint64_t previousAddress = 0; 25 | NSMutableArray *functionStarts = [[NSMutableArray alloc] init]; 26 | while ((startAddress = read_uleb128(&start, end))) { 27 | [functionStarts addObject:@(startAddress + previousAddress)]; 28 | previousAddress += startAddress; 29 | } 30 | _functionStarts = [functionStarts copy]; 31 | } 32 | return _functionStarts; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Source/CDLCLinkeditData.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCLinkeditData : CDLoadCommand 9 | 10 | @property (nonatomic, readonly) NSData *linkeditData; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/CDLCMain.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCMain : CDLoadCommand 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Source/CDLCMain.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCMain.h" 7 | 8 | @implementation CDLCMain 9 | { 10 | struct entry_point_command _entryPointCommand; 11 | } 12 | 13 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor; 14 | { 15 | if ((self = [super initWithDataCursor:cursor])) { 16 | _entryPointCommand.cmd = [cursor readInt32]; 17 | _entryPointCommand.cmdsize = [cursor readInt32]; 18 | _entryPointCommand.entryoff = [cursor readInt64]; 19 | _entryPointCommand.stacksize = [cursor readInt64]; 20 | } 21 | 22 | return self; 23 | } 24 | 25 | #pragma mark - 26 | 27 | - (uint32_t)cmd; 28 | { 29 | return _entryPointCommand.cmd; 30 | } 31 | 32 | - (uint32_t)cmdsize; 33 | { 34 | return _entryPointCommand.cmdsize; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Source/CDLCPrebindChecksum.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCPrebindChecksum : CDLoadCommand 9 | 10 | @property (nonatomic, readonly) uint32_t cksum; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/CDLCPrebindChecksum.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCPrebindChecksum.h" 7 | 8 | @implementation CDLCPrebindChecksum 9 | { 10 | struct prebind_cksum_command _prebindChecksumCommand; 11 | } 12 | 13 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor; 14 | { 15 | if ((self = [super initWithDataCursor:cursor])) { 16 | _prebindChecksumCommand.cmd = [cursor readInt32]; 17 | _prebindChecksumCommand.cmdsize = [cursor readInt32]; 18 | _prebindChecksumCommand.cksum = [cursor readInt32]; 19 | } 20 | 21 | return self; 22 | } 23 | 24 | #pragma mark - 25 | 26 | - (uint32_t)cmd; 27 | { 28 | return _prebindChecksumCommand.cmd; 29 | } 30 | 31 | - (uint32_t)cmdsize; 32 | { 33 | return _prebindChecksumCommand.cmdsize; 34 | } 35 | 36 | - (uint32_t)cksum; 37 | { 38 | return _prebindChecksumCommand.cksum; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Source/CDLCPreboundDylib.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCPreboundDylib : CDLoadCommand 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Source/CDLCRoutines32.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCRoutines32 : CDLoadCommand 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Source/CDLCRoutines32.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCRoutines32.h" 7 | 8 | @implementation CDLCRoutines32 9 | { 10 | struct routines_command _routinesCommand; 11 | } 12 | 13 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor; 14 | { 15 | if ((self = [super initWithDataCursor:cursor])) { 16 | _routinesCommand.cmd = [cursor readInt32]; 17 | _routinesCommand.cmdsize = [cursor readInt32]; 18 | 19 | _routinesCommand.init_address = [cursor readInt32]; 20 | _routinesCommand.init_module = [cursor readInt32]; 21 | _routinesCommand.reserved1 = [cursor readInt32]; 22 | _routinesCommand.reserved2 = [cursor readInt32]; 23 | _routinesCommand.reserved3 = [cursor readInt32]; 24 | _routinesCommand.reserved4 = [cursor readInt32]; 25 | _routinesCommand.reserved5 = [cursor readInt32]; 26 | _routinesCommand.reserved6 = [cursor readInt32]; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | #pragma mark - 33 | 34 | - (uint32_t)cmd; 35 | { 36 | return _routinesCommand.cmd; 37 | } 38 | 39 | - (uint32_t)cmdsize; 40 | { 41 | return _routinesCommand.cmdsize; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Source/CDLCRoutines64.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCRoutines64 : CDLoadCommand 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Source/CDLCRoutines64.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCRoutines64.h" 7 | 8 | @implementation CDLCRoutines64 9 | { 10 | struct routines_command_64 _routinesCommand; 11 | } 12 | 13 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor; 14 | { 15 | if ((self = [super initWithDataCursor:cursor])) { 16 | _routinesCommand.cmd = [cursor readInt32]; 17 | _routinesCommand.cmdsize = [cursor readInt32]; 18 | 19 | _routinesCommand.init_address = [cursor readInt64]; 20 | _routinesCommand.init_module = [cursor readInt64]; 21 | _routinesCommand.reserved1 = [cursor readInt64]; 22 | _routinesCommand.reserved2 = [cursor readInt64]; 23 | _routinesCommand.reserved3 = [cursor readInt64]; 24 | _routinesCommand.reserved4 = [cursor readInt64]; 25 | _routinesCommand.reserved5 = [cursor readInt64]; 26 | _routinesCommand.reserved6 = [cursor readInt64]; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | #pragma mark - 33 | 34 | - (uint32_t)cmd; 35 | { 36 | return _routinesCommand.cmd; 37 | } 38 | 39 | - (uint32_t)cmdsize; 40 | { 41 | return _routinesCommand.cmdsize; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Source/CDLCRunPath.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCRunPath : CDLoadCommand 9 | 10 | @property (readonly) NSString *path; 11 | @property (nonatomic, readonly) NSString *resolvedRunPath; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/CDLCSourceVersion.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCSourceVersion : CDLoadCommand 9 | 10 | @property (nonatomic, readonly) NSString *sourceVersionString; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/CDLCSubClient.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCSubClient : CDLoadCommand 9 | 10 | @property (readonly) NSString *name; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/CDLCSubClient.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCSubClient.h" 7 | 8 | @implementation CDLCSubClient 9 | { 10 | struct sub_client_command _command; 11 | NSString *_name; 12 | } 13 | 14 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor; 15 | { 16 | if ((self = [super initWithDataCursor:cursor])) { 17 | _command.cmd = [cursor readInt32]; 18 | _command.cmdsize = [cursor readInt32]; 19 | 20 | uint32_t strOffset = [cursor readInt32]; 21 | NSParameterAssert(strOffset == 12); 22 | 23 | NSUInteger length = _command.cmdsize - sizeof(_command); 24 | //NSLog(@"expected length: %u", length); 25 | 26 | _name = [cursor readStringOfLength:length encoding:NSASCIIStringEncoding]; 27 | //NSLog(@"name: %@", _name); 28 | } 29 | 30 | return self; 31 | } 32 | 33 | #pragma mark - 34 | 35 | - (uint32_t)cmd; 36 | { 37 | return _command.cmd; 38 | } 39 | 40 | - (uint32_t)cmdsize; 41 | { 42 | return _command.cmdsize; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Source/CDLCSubFramework.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCSubFramework : CDLoadCommand 9 | 10 | @property (readonly) NSString *name; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/CDLCSubFramework.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCSubFramework.h" 7 | 8 | @implementation CDLCSubFramework 9 | { 10 | struct sub_framework_command _command; 11 | NSString *_name; 12 | } 13 | 14 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor; 15 | { 16 | if ((self = [super initWithDataCursor:cursor])) { 17 | _command.cmd = [cursor readInt32]; 18 | _command.cmdsize = [cursor readInt32]; 19 | 20 | uint32_t strOffset = [cursor readInt32]; 21 | NSParameterAssert(strOffset == 12); 22 | 23 | NSUInteger length = _command.cmdsize - sizeof(_command); 24 | //NSLog(@"expected length: %u", length); 25 | 26 | _name = [cursor readStringOfLength:length encoding:NSASCIIStringEncoding]; 27 | //NSLog(@"name: %@", _name); 28 | } 29 | 30 | return self; 31 | } 32 | 33 | #pragma mark - 34 | 35 | - (uint32_t)cmd; 36 | { 37 | return _command.cmd; 38 | } 39 | 40 | - (uint32_t)cmdsize; 41 | { 42 | return _command.cmdsize; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Source/CDLCSubLibrary.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCSubLibrary : CDLoadCommand 9 | 10 | @property (readonly) NSString *name; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/CDLCSubLibrary.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCSubLibrary.h" 7 | 8 | @implementation CDLCSubLibrary 9 | { 10 | struct sub_library_command _command; 11 | NSString *_name; 12 | } 13 | 14 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor; 15 | { 16 | if ((self = [super initWithDataCursor:cursor])) { 17 | _command.cmd = [cursor readInt32]; 18 | _command.cmdsize = [cursor readInt32]; 19 | 20 | NSUInteger length = _command.cmdsize - sizeof(_command); 21 | //NSLog(@"expected length: %u", length); 22 | 23 | _name = [cursor readStringOfLength:length encoding:NSASCIIStringEncoding]; 24 | //NSLog(@"name: %@", _name); 25 | } 26 | 27 | return self; 28 | } 29 | 30 | #pragma mark - 31 | 32 | - (uint32_t)cmd; 33 | { 34 | return _command.cmd; 35 | } 36 | 37 | - (uint32_t)cmdsize; 38 | { 39 | return _command.cmdsize; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Source/CDLCSubUmbrella.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCSubUmbrella : CDLoadCommand 9 | 10 | @property (readonly) NSString *name; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/CDLCSubUmbrella.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCSubUmbrella.h" 7 | 8 | @implementation CDLCSubUmbrella 9 | { 10 | struct sub_umbrella_command _command; 11 | NSString *_name; 12 | } 13 | 14 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor; 15 | { 16 | if ((self = [super initWithDataCursor:cursor])) { 17 | _command.cmd = [cursor readInt32]; 18 | _command.cmdsize = [cursor readInt32]; 19 | 20 | NSUInteger length = _command.cmdsize - sizeof(_command); 21 | //NSLog(@"expected length: %u", length); 22 | 23 | _name = [cursor readStringOfLength:length encoding:NSASCIIStringEncoding]; 24 | //NSLog(@"name: %@", _name); 25 | } 26 | 27 | return self; 28 | } 29 | 30 | #pragma mark - 31 | 32 | - (uint32_t)cmd; 33 | { 34 | return _command.cmd; 35 | } 36 | 37 | - (uint32_t)cmdsize; 38 | { 39 | return _command.cmdsize; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Source/CDLCSymbolTable.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @class CDSymbol; 9 | 10 | @interface CDLCSymbolTable : CDLoadCommand 11 | 12 | - (void)loadSymbols; 13 | 14 | @property (nonatomic, readonly) uint32_t symoff; 15 | @property (nonatomic, readonly) uint32_t nsyms; 16 | @property (nonatomic, readonly) uint32_t stroff; 17 | @property (nonatomic, readonly) uint32_t strsize; 18 | 19 | @property (nonatomic, readonly) NSUInteger baseAddress; 20 | @property (nonatomic, readonly) NSArray *symbols; 21 | 22 | - (CDSymbol *)symbolForClassName:(NSString *)className; 23 | - (CDSymbol *)symbolForExternalClassName:(NSString *)className; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Source/CDLCTwoLevelHints.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCTwoLevelHints : CDLoadCommand 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Source/CDLCTwoLevelHints.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCTwoLevelHints.h" 7 | 8 | #import "CDMachOFile.h" 9 | 10 | @implementation CDLCTwoLevelHints 11 | { 12 | struct twolevel_hints_command _hintsCommand; 13 | } 14 | 15 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor; 16 | { 17 | if ((self = [super initWithDataCursor:cursor])) { 18 | _hintsCommand.cmd = [cursor readInt32]; 19 | _hintsCommand.cmdsize = [cursor readInt32]; 20 | _hintsCommand.offset = [cursor readInt32]; 21 | _hintsCommand.nhints = [cursor readInt32]; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | #pragma mark - 28 | 29 | - (uint32_t)cmd; 30 | { 31 | return _hintsCommand.cmd; 32 | } 33 | 34 | - (uint32_t)cmdsize; 35 | { 36 | return _hintsCommand.cmdsize; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Source/CDLCUUID.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCUUID : CDLoadCommand 9 | 10 | @property (nonatomic, readonly) NSUUID *UUID; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/CDLCUnixThread.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCUnixThread : CDLoadCommand 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Source/CDLCUnixThread.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCUnixThread.h" 7 | 8 | // For now, this is all I need. There is no data in here sensitive to its position in the file. 9 | 10 | @implementation CDLCUnixThread 11 | { 12 | struct load_command _loadCommand; 13 | 14 | NSData *_commandData; 15 | } 16 | 17 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor; 18 | { 19 | if ((self = [super initWithDataCursor:cursor])) { 20 | _loadCommand.cmd = [cursor readInt32]; 21 | _loadCommand.cmdsize = [cursor readInt32]; 22 | 23 | if (_loadCommand.cmdsize > 8) { 24 | NSMutableData *commandData = [[NSMutableData alloc] init]; 25 | [cursor appendBytesOfLength:_loadCommand.cmdsize - 8 intoData:commandData]; 26 | _commandData = [commandData copy]; 27 | } else { 28 | _commandData = nil; 29 | } 30 | } 31 | 32 | return self; 33 | } 34 | 35 | #pragma mark - 36 | 37 | - (uint32_t)cmd; 38 | { 39 | return _loadCommand.cmd; 40 | } 41 | 42 | - (uint32_t)cmdsize; 43 | { 44 | return _loadCommand.cmdsize; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Source/CDLCUnknown.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCUnknown : CDLoadCommand 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Source/CDLCUnknown.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLCUnknown.h" 7 | 8 | static BOOL debug = NO; 9 | 10 | @implementation CDLCUnknown 11 | { 12 | struct load_command _loadCommand; 13 | 14 | NSData *_commandData; 15 | } 16 | 17 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor; 18 | { 19 | if ((self = [super initWithDataCursor:cursor])) { 20 | if (debug) NSLog(@"offset: %lu", [cursor offset]); 21 | _loadCommand.cmd = [cursor readInt32]; 22 | _loadCommand.cmdsize = [cursor readInt32]; 23 | if (debug) NSLog(@"cmdsize: %u", _loadCommand.cmdsize); 24 | 25 | if (_loadCommand.cmdsize > 8) { 26 | NSMutableData *commandData = [[NSMutableData alloc] init]; 27 | [cursor appendBytesOfLength:_loadCommand.cmdsize - 8 intoData:commandData]; 28 | _commandData = [commandData copy]; 29 | } else { 30 | _commandData = nil; 31 | } 32 | } 33 | 34 | return self; 35 | } 36 | 37 | #pragma mark - 38 | 39 | - (uint32_t)cmd; 40 | { 41 | return _loadCommand.cmd; 42 | } 43 | 44 | - (uint32_t)cmdsize; 45 | { 46 | return _loadCommand.cmdsize; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Source/CDLCVersionMinimum.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDLoadCommand.h" 7 | 8 | @interface CDLCVersionMinimum : CDLoadCommand 9 | 10 | @property (nonatomic, readonly) NSString *minimumVersionString; 11 | @property (nonatomic, readonly) NSString *SDKVersionString; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/CDLoadCommand.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | // Importing these here saves us from importing them in the implementation of every load command. 7 | #include 8 | #import "CDMachOFileDataCursor.h" 9 | 10 | @class CDMachOFile; 11 | 12 | @interface CDLoadCommand : NSObject 13 | 14 | + (id)loadCommandWithDataCursor:(CDMachOFileDataCursor *)cursor; 15 | 16 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor; 17 | 18 | - (NSString *)extraDescription; 19 | 20 | @property (weak, readonly) CDMachOFile *machOFile; 21 | @property (readonly) NSUInteger commandOffset; 22 | 23 | @property (nonatomic, readonly) uint32_t cmd; 24 | @property (nonatomic, readonly) uint32_t cmdsize; 25 | @property (nonatomic, readonly) BOOL mustUnderstandToExecute; 26 | 27 | @property (nonatomic, readonly) NSString *commandName; 28 | 29 | - (void)appendToString:(NSMutableString *)resultString verbose:(BOOL)isVerbose; 30 | 31 | - (void)machOFileDidReadLoadCommands:(CDMachOFile *)machOFile; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Source/CDMachOFileDataCursor.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDDataCursor.h" 7 | 8 | @class CDMachOFile, CDSection; 9 | 10 | @interface CDMachOFileDataCursor : CDDataCursor 11 | 12 | - (id)initWithFile:(CDMachOFile *)machOFile; 13 | - (id)initWithFile:(CDMachOFile *)machOFile offset:(NSUInteger)offset; 14 | - (id)initWithFile:(CDMachOFile *)machOFile address:(NSUInteger)address; 15 | 16 | - (id)initWithSection:(CDSection *)section; 17 | 18 | @property (nonatomic, weak, readonly) CDMachOFile *machOFile; 19 | 20 | - (void)setAddress:(NSUInteger)address; 21 | 22 | // Read using the current byteOrder 23 | - (uint16_t)readInt16; 24 | - (uint32_t)readInt32; 25 | - (uint64_t)readInt64; 26 | 27 | - (uint32_t)peekInt32; 28 | 29 | // Read using the current byteOrder and ptrSize (from the machOFile) 30 | - (uint64_t)readPtr; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Source/CDMethodType.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @class CDType; 7 | 8 | @interface CDMethodType : NSObject 9 | 10 | - (id)initWithType:(CDType *)type offset:(NSString *)offset; 11 | 12 | @property (readonly) CDType *type; 13 | @property (readonly) NSString *offset; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/CDMethodType.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDMethodType.h" 7 | 8 | #import "CDType.h" 9 | 10 | @implementation CDMethodType 11 | { 12 | CDType *_type; 13 | NSString *_offset; 14 | } 15 | 16 | - (id)initWithType:(CDType *)type offset:(NSString *)offset; 17 | { 18 | if ((self = [super init])) { 19 | _type = type; 20 | _offset = offset; 21 | } 22 | 23 | return self; 24 | } 25 | 26 | #pragma mark - Debugging 27 | 28 | - (NSString *)description; 29 | { 30 | return [NSString stringWithFormat:@"[%@] type: %@, offset: %@", NSStringFromClass([self class]), self.type, self.offset]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Source/CDMultiFileVisitor.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDTextClassDumpVisitor.h" 7 | 8 | #import "CDTypeController.h" // For CDTypeControllerDelegate protocol 9 | 10 | // This generates separate files for each class. Files are created in the 'outputPath' directory. 11 | 12 | @interface CDMultiFileVisitor : CDTextClassDumpVisitor 13 | 14 | @property (strong) NSString *outputPath; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/CDOCCategory.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDOCProtocol.h" 7 | 8 | @class CDOCClassReference; 9 | 10 | @interface CDOCCategory : CDOCProtocol 11 | 12 | @property (strong) CDOCClassReference *classRef; 13 | @property (strong, readonly) NSString *className; 14 | 15 | - (NSString *)methodSearchContext; 16 | - (void)recursivelyVisit:(CDVisitor *)visitor; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Source/CDOCClass.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDOCProtocol.h" 7 | 8 | #import "CDTopologicalSortProtocol.h" 9 | 10 | @class CDOCClassReference; 11 | 12 | @interface CDOCClass : CDOCProtocol 13 | 14 | @property (strong) CDOCClassReference *superClassRef; 15 | @property (copy, readonly) NSString *superClassName; 16 | @property (strong) NSArray *instanceVariables; 17 | @property (assign) BOOL isExported; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Source/CDOCClassReference.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import 7 | 8 | @class CDOCClass, CDSymbol; 9 | 10 | /*! 11 | * CDOCClassReference acts as a proxy object to a class that may be external. It can thus be repesented 12 | * as one of: a \c CDOCClass object (for internal classes), a \c CDSymbol object (for external classes), 13 | * or an \c NSString of the class name (for ObjC1 compatibility). The class name can then be inferred from 14 | * any of these representations. 15 | */ 16 | @interface CDOCClassReference : NSObject 17 | 18 | @property (strong) CDOCClass *classObject; 19 | @property (strong) CDSymbol *classSymbol; 20 | @property (nonatomic, copy) NSString *className; // inferred from classObject / classSymbol if not set directly 21 | @property (nonatomic, readonly, getter = isExternalClass) BOOL externalClass; 22 | 23 | - (instancetype)initWithClassObject:(CDOCClass *)classObject; 24 | - (instancetype)initWithClassSymbol:(CDSymbol *)symbol; 25 | - (instancetype)initWithClassName:(NSString *)className; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Source/CDOCInstanceVariable.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @class CDType, CDTypeController; 7 | 8 | @interface CDOCInstanceVariable : NSObject 9 | 10 | - (id)initWithName:(NSString *)name typeString:(NSString *)typeString offset:(NSUInteger)offset; 11 | 12 | @property (readonly) NSString *name; 13 | @property (readonly) NSString *typeString; 14 | @property (readonly) NSUInteger offset; 15 | 16 | // Lazily parses the typeString. Returns nil and sets the parseError if parsing failed. Does not try to parse again in the event of an error. 17 | @property (nonatomic, readonly) CDType *type; 18 | 19 | // This is set after the typeString has been parsed if there was an error. Doesn't trigger parsing. 20 | @property (readonly) NSError *parseError; 21 | 22 | - (void)appendToString:(NSMutableString *)resultString typeController:(CDTypeController *)typeController; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Source/CDOCMethod.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @class CDTypeController; 7 | 8 | @interface CDOCMethod : NSObject 9 | 10 | - (id)initWithName:(NSString *)name typeString:(NSString *)typeString; 11 | - (id)initWithName:(NSString *)name typeString:(NSString *)typeString address:(NSUInteger)address; 12 | 13 | @property (readonly) NSString *name; 14 | @property (readonly) NSString *typeString; 15 | @property (assign) NSUInteger address; 16 | 17 | - (NSArray *)parsedMethodTypes; 18 | 19 | - (void)appendToString:(NSMutableString *)resultString typeController:(CDTypeController *)typeController; 20 | 21 | - (NSComparisonResult)ascendingCompareByName:(CDOCMethod *)other; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/CDOCModule.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @class CDOCSymtab; 7 | 8 | @interface CDOCModule : NSObject 9 | 10 | @property (assign) uint32_t version; 11 | @property (strong) NSString *name; 12 | @property (strong) CDOCSymtab *symtab; 13 | 14 | - (NSString *)formattedString; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/CDOCModule.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDOCModule.h" 7 | 8 | #import "CDObjectiveC1Processor.h" 9 | #import "CDOCSymtab.h" 10 | 11 | @implementation CDOCModule 12 | { 13 | uint32_t _version; 14 | NSString *_name; 15 | CDOCSymtab *_symtab; 16 | } 17 | 18 | - (id)init; 19 | { 20 | if ((self = [super init])) { 21 | _version = 0; 22 | _name = nil; 23 | _symtab = nil; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | #pragma mark - Debugging 30 | 31 | - (NSString *)description; 32 | { 33 | return [NSString stringWithFormat:@"[%@] name: %@, version: %u, symtab: %@", NSStringFromClass([self class]), self.name, self.version, self.symtab]; 34 | } 35 | 36 | #pragma mark - 37 | 38 | - (NSString *)formattedString; 39 | { 40 | return [NSString stringWithFormat:@"//\n// %@\n//\n", self.name]; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Source/CDOCProperty.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @class CDType; 7 | 8 | @interface CDOCProperty : NSObject 9 | 10 | - (id)initWithName:(NSString *)name attributes:(NSString *)attributes; 11 | 12 | @property (readonly) NSString *name; 13 | @property (readonly) NSString *attributeString; 14 | @property (readonly) CDType *type; 15 | @property (readonly) NSArray *attributes; 16 | 17 | @property (strong) NSString *attributeStringAfterType; 18 | 19 | @property (nonatomic, readonly) NSString *defaultGetter; 20 | @property (nonatomic, readonly) NSString *defaultSetter; 21 | 22 | @property (strong) NSString *customGetter; 23 | @property (strong) NSString *customSetter; 24 | 25 | @property (nonatomic, readonly) NSString *getter; 26 | @property (nonatomic, readonly) NSString *setter; 27 | 28 | @property (readonly) BOOL isReadOnly; 29 | @property (readonly) BOOL isDynamic; 30 | 31 | - (NSComparisonResult)ascendingCompareByName:(CDOCProperty *)other; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Source/CDOCSymtab.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @class CDOCCategory, CDOCClass; 7 | 8 | @interface CDOCSymtab : NSObject 9 | 10 | @property (readonly) NSMutableArray *classes; 11 | - (void)addClass:(CDOCClass *)aClass; 12 | 13 | @property (readonly) NSMutableArray *categories; 14 | - (void)addCategory:(CDOCCategory *)category; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/CDOCSymtab.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDOCSymtab.h" 7 | 8 | #import "CDOCCategory.h" 9 | #import "CDOCClass.h" 10 | 11 | @implementation CDOCSymtab 12 | { 13 | NSMutableArray *_classes; 14 | NSMutableArray *_categories; 15 | } 16 | 17 | - (id)init; 18 | { 19 | if ((self = [super init])) { 20 | _classes = [[NSMutableArray alloc] init]; 21 | _categories = [[NSMutableArray alloc] init]; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | #pragma mark - Debugging 28 | 29 | - (NSString *)description; 30 | { 31 | return [NSString stringWithFormat:@"[%@] classes: %@, categories: %@", NSStringFromClass([self class]), self.classes, self.categories]; 32 | } 33 | 34 | #pragma mark - 35 | 36 | - (void)addClass:(CDOCClass *)aClass; 37 | { 38 | [self.classes addObject:aClass]; 39 | } 40 | 41 | - (void)addCategory:(CDOCCategory *)category; 42 | { 43 | [self.categories addObject:category]; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Source/CDObjectiveC1Processor.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDObjectiveCProcessor.h" 7 | 8 | @interface CDObjectiveC1Processor : CDObjectiveCProcessor 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Source/CDObjectiveC2Processor.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDObjectiveCProcessor.h" 7 | 8 | @interface CDObjectiveC2Processor : CDObjectiveCProcessor 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Source/CDProtocolUniquer.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @class CDOCProtocol; 7 | 8 | @interface CDProtocolUniquer : NSObject 9 | 10 | // Gather 11 | - (CDOCProtocol *)protocolWithAddress:(uint64_t)address; 12 | - (void)setProtocol:(CDOCProtocol *)protocol withAddress:(uint64_t)address; 13 | 14 | // Process 15 | - (void)createUniquedProtocols; 16 | 17 | // Results 18 | - (NSArray *)uniqueProtocolsAtAddresses:(NSArray *)addresses; 19 | - (NSArray *)uniqueProtocolsSortedByName; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Source/CDRelocationInfo.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #include 7 | 8 | typedef enum : NSUInteger { 9 | CDRelocationInfoSize_8Bit = 0, 10 | CDRelocationInfoSize_16Bit = 1, 11 | CDRelocationInfoSize_32Bit = 2, 12 | CDRelocationInfoSize_64Bit = 3, 13 | } CDRelocationSize; 14 | 15 | @interface CDRelocationInfo : NSObject 16 | 17 | - (id)initWithInfo:(struct relocation_info)info; 18 | 19 | @property (nonatomic, readonly) NSUInteger offset; 20 | @property (nonatomic, readonly) CDRelocationSize size; 21 | @property (nonatomic, readonly) uint32_t symbolnum; 22 | @property (nonatomic, readonly) BOOL isExtern; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Source/CDRelocationInfo.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDRelocationInfo.h" 7 | 8 | @implementation CDRelocationInfo 9 | { 10 | struct relocation_info _rinfo; 11 | } 12 | 13 | - (id)initWithInfo:(struct relocation_info)info; 14 | { 15 | if ((self = [super init])) { 16 | _rinfo = info; 17 | } 18 | 19 | return self; 20 | } 21 | 22 | #pragma mark - Debugging 23 | 24 | - (NSString *)description; 25 | { 26 | return [NSString stringWithFormat:@"<%@:%p> addr/off: %08x, sym #: %5u, pcrel? %u, len: %u, extern? %u, type: %x", 27 | NSStringFromClass([self class]), self, 28 | _rinfo.r_address, _rinfo.r_symbolnum, _rinfo.r_pcrel, _rinfo.r_length, _rinfo.r_extern, _rinfo.r_type]; 29 | } 30 | 31 | #pragma mark - 32 | 33 | - (NSUInteger)offset; 34 | { 35 | return _rinfo.r_address; 36 | } 37 | 38 | - (CDRelocationSize)size; 39 | { 40 | return _rinfo.r_length; 41 | } 42 | 43 | - (uint32_t)symbolnum; 44 | { 45 | return _rinfo.r_symbolnum; 46 | } 47 | 48 | - (BOOL)isExtern; 49 | { 50 | return _rinfo.r_extern == 1; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Source/CDSearchPathState.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @interface CDSearchPathState : NSObject 7 | 8 | @property (nonatomic, strong) NSString *executablePath; 9 | 10 | - (void)pushSearchPaths:(NSArray *)searchPaths; 11 | - (void)popSearchPaths; 12 | 13 | - (NSArray *)searchPaths; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/CDSection.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @class CDMachOFileDataCursor; 7 | @class CDLCSegment; 8 | 9 | @interface CDSection : NSObject 10 | 11 | - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor segment:(CDLCSegment *)segment; 12 | 13 | @property (weak, readonly) CDLCSegment *segment; 14 | 15 | @property (nonatomic, readonly) NSData *data; 16 | 17 | @property (nonatomic, readonly) NSString *segmentName; 18 | @property (nonatomic, readonly) NSString *sectionName; 19 | 20 | @property (nonatomic, readonly) NSUInteger addr; 21 | @property (nonatomic, readonly) NSUInteger size; 22 | 23 | - (BOOL)containsAddress:(NSUInteger)address; 24 | - (NSUInteger)fileOffsetForAddress:(NSUInteger)address; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Source/CDStructureInfo.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @class CDType; 7 | 8 | @interface CDStructureInfo : NSObject 9 | 10 | - (id)initWithType:(CDType *)type; 11 | 12 | - (NSString *)shortDescription; 13 | 14 | @property (readonly) CDType *type; 15 | 16 | @property (assign) NSUInteger referenceCount; 17 | - (void)addReferenceCount:(NSUInteger)count; 18 | 19 | @property (assign) BOOL isUsedInMethod; 20 | @property (strong) NSString *typedefName; 21 | 22 | - (void)generateTypedefName:(NSString *)baseName; 23 | 24 | @property (nonatomic, readonly) NSString *name; 25 | 26 | - (NSComparisonResult)ascendingCompareByStructureDepth:(CDStructureInfo *)other; 27 | - (NSComparisonResult)descendingCompareByStructureDepth:(CDStructureInfo *)other; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Source/CDSymbolsGeneratorVisitor.h: -------------------------------------------------------------------------------- 1 | #import "CDVisitor.h" 2 | 3 | 4 | @interface CDSymbolsGeneratorVisitor : CDVisitor 5 | @property (nonatomic, copy) NSArray *classFilter; 6 | @property (nonatomic, copy) NSArray *ignoreSymbols; 7 | @property (nonatomic, readonly) NSString *resultString; 8 | @property (nonatomic, readonly) NSDictionary *symbols; 9 | @property(nonatomic, copy) NSString *symbolsFilePath; 10 | - (void)addSymbolsPadding; 11 | @end 12 | -------------------------------------------------------------------------------- /Source/CDTextClassDumpVisitor.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDVisitor.h" 7 | 8 | // Has a mutable string for storing output, and method to write it to standard out. 9 | // symbol references are for... ? 10 | 11 | @interface CDTextClassDumpVisitor : CDVisitor 12 | 13 | @property (readonly) NSMutableString *resultString; 14 | 15 | - (void)writeResultToStandardOutput; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Source/CDTopoSortNode.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "CDTopologicalSortProtocol.h" 7 | 8 | typedef enum : NSUInteger { 9 | CDNodeColor_White = 0, 10 | CDNodeColor_Gray = 1, 11 | CDNodeColor_Black = 2, 12 | } CDNodeColor; 13 | 14 | @interface CDTopoSortNode : NSObject 15 | 16 | - (id)initWithObject:(id )object; 17 | 18 | @property (nonatomic, readonly) NSString *identifier; 19 | @property (readonly) id sortableObject; 20 | 21 | - (NSArray *)dependancies; 22 | - (void)addDependancy:(NSString *)identifier; 23 | - (void)removeDependancy:(NSString *)identifier; 24 | - (void)addDependanciesFromArray:(NSArray *)identifiers; 25 | @property (nonatomic, readonly) NSString *dependancyDescription; 26 | 27 | @property (assign) CDNodeColor color; 28 | 29 | - (NSComparisonResult)ascendingCompareByIdentifier:(CDTopoSortNode *)other; 30 | - (void)topologicallySortNodes:(NSDictionary *)nodesByIdentifier intoArray:(NSMutableArray *)sortedArray; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Source/CDTopologicalSortProtocol.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | // A rather clunky way to avoid warnings in CDTopoSortNode.m regarding -retain not implemented by protocols 7 | @protocol CDTopologicalSort 8 | @property (nonatomic, readonly) NSString *identifier; 9 | @property (nonatomic, readonly) NSArray *dependancies; 10 | @end 11 | -------------------------------------------------------------------------------- /Source/CDTypeFormatter.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @class CDType, CDTypeController; 7 | 8 | @interface CDTypeFormatter : NSObject 9 | 10 | @property (weak) CDTypeController *typeController; 11 | 12 | @property (assign) NSUInteger baseLevel; 13 | @property (assign) BOOL shouldExpand; 14 | @property (assign) BOOL shouldAutoExpand; 15 | @property (assign) BOOL shouldShowLexing; 16 | 17 | - (NSString *)formatVariable:(NSString *)name type:(CDType *)type; 18 | - (NSString *)formatMethodName:(NSString *)name typeString:(NSString *)typeString; 19 | 20 | - (NSString *)typedefNameForStructure:(CDType *)structureType level:(NSUInteger)level; 21 | 22 | - (void)formattingDidReferenceClassName:(NSString *)name; 23 | - (void)formattingDidReferenceProtocolNames:(NSArray *)names; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Source/CDTypeLexer.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #define TK_EOS 0 7 | #define TK_NUMBER 257 8 | #define TK_IDENTIFIER 258 9 | #define T_NAMED_OBJECT 259 10 | #define TK_QUOTED_STRING 260 11 | #define TK_TEMPLATE_TYPE TK_IDENTIFIER 12 | #define T_FUNCTION_POINTER_TYPE 1001 13 | #define T_BLOCK_TYPE 1002 14 | 15 | typedef enum : NSUInteger { 16 | CDTypeLexerState_Normal = 0, 17 | CDTypeLexerState_Identifier = 1, 18 | CDTypeLexerState_TemplateTypes = 2, 19 | } CDTypeLexerState; 20 | 21 | @interface CDTypeLexer : NSObject 22 | 23 | - (id)initWithString:(NSString *)string; 24 | 25 | @property (readonly) NSScanner *scanner; 26 | @property (nonatomic, assign) CDTypeLexerState state; 27 | @property (assign) BOOL shouldShowLexing; 28 | 29 | @property (nonatomic, readonly) NSString *string; 30 | - (int)scanNextToken; 31 | 32 | @property (strong) NSString *lexText; 33 | 34 | @property (nonatomic, readonly) unichar peekChar; 35 | @property (nonatomic, readonly) NSString *remainingString; 36 | @property (nonatomic, readonly) NSString *peekIdentifier; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Source/CDTypeName.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @interface CDTypeName : NSObject 7 | 8 | @property (strong) NSString *name; 9 | @property (readonly) NSMutableArray *templateTypes; 10 | @property (strong) NSString *suffix; 11 | @property (nonatomic, readonly) BOOL isTemplateType; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/CDTypeParser.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @class CDType, CDTypeLexer; 7 | 8 | extern NSString *CDExceptionName_SyntaxError; 9 | extern NSString *CDErrorDomain_TypeParser; 10 | 11 | extern NSString *CDErrorKey_Type; 12 | extern NSString *CDErrorKey_RemainingString; 13 | extern NSString *CDErrorKey_MethodOrVariable; 14 | extern NSString *CDErrorKey_LocalizedLongDescription; 15 | 16 | #define CDTypeParserCode_Default 0 17 | #define CDTypeParserCode_SyntaxError 1 18 | 19 | @interface CDTypeParser : NSObject 20 | 21 | - (id)initWithString:(NSString *)string; 22 | 23 | @property (readonly) CDTypeLexer *lexer; 24 | 25 | - (NSArray *)parseMethodType:(NSError **)error; 26 | - (CDType *)parseType:(NSError **)error; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Source/CDVisitorPropertyState.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @class CDOCProperty; 7 | 8 | @interface CDVisitorPropertyState : NSObject 9 | 10 | - (id)initWithProperties:(NSArray *)properties; 11 | 12 | - (CDOCProperty *)propertyForAccessor:(NSString *)str; 13 | 14 | - (BOOL)hasUsedProperty:(CDOCProperty *)property; 15 | - (void)useProperty:(CDOCProperty *)property; 16 | 17 | @property (nonatomic, readonly) NSArray *remainingProperties; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Source/CDXibStoryboardParser.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CDXMLParserSharedBase.h" 3 | 4 | 5 | @interface CDXibStoryboardParser : CDXMLParserSharedBase 6 | @end 7 | -------------------------------------------------------------------------------- /Source/NSArray-CDExtensions.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @interface NSArray (CDExtensions) 7 | 8 | - (NSArray *)reversedArray; 9 | 10 | @end 11 | 12 | @interface NSArray (CDTopoSort) 13 | 14 | - (NSArray *)topologicallySortedArray; 15 | 16 | @end 17 | 18 | @interface NSMutableArray (CDTopoSort) 19 | 20 | - (void)sortTopologically; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Source/NSData-CDExtensions.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @interface NSData (CDExtensions) 7 | 8 | - (NSString *)hexString; 9 | - (NSData *)SHA1Digest; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /Source/NSData-CDExtensions.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "NSData-CDExtensions.h" 7 | 8 | #import 9 | 10 | @implementation NSData (CDExtensions) 11 | 12 | - (NSString *)hexString; 13 | { 14 | NSMutableString *str = [NSMutableString string]; 15 | const uint8_t *ptr = [self bytes]; 16 | for (NSUInteger index = 0; index < [self length]; index++) { 17 | [str appendFormat:@"%02x", *ptr++]; 18 | } 19 | 20 | return str; 21 | } 22 | 23 | - (NSData *)SHA1Digest; 24 | { 25 | NSParameterAssert([self length] <= UINT32_MAX); 26 | 27 | unsigned char digest[CC_SHA1_DIGEST_LENGTH]; 28 | CC_SHA1([self bytes], (CC_LONG)[self length], digest); 29 | 30 | return [NSData dataWithBytes:digest length:CC_SHA1_DIGEST_LENGTH]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Source/NSError-CDExtensions.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @interface NSError (CDExtensions) 7 | 8 | @end 9 | 10 | extern NSString *NSErrorDomain_ClassDump; 11 | -------------------------------------------------------------------------------- /Source/NSError-CDExtensions.m: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import "NSError-CDExtensions.h" 7 | 8 | NSString *NSErrorDomain_ClassDump = @"com.stevenygard.MachObjC.ErrorDomain"; 9 | 10 | @implementation NSError (CDExtensions) 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/NSScanner-CDExtensions.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @interface NSScanner (CDExtensions) 7 | 8 | + (NSCharacterSet *)cdOtherCharacterSet; 9 | + (NSCharacterSet *)cdIdentifierStartCharacterSet; 10 | + (NSCharacterSet *)cdIdentifierCharacterSet; 11 | + (NSCharacterSet *)cdTemplateTypeCharacterSet; 12 | 13 | - (NSString *)peekCharacter; 14 | - (unichar)peekChar; 15 | - (BOOL)scanCharacter:(unichar *)value; 16 | - (BOOL)scanCharacterFromSet:(NSCharacterSet *)set intoString:(NSString **)value; 17 | - (BOOL)my_scanCharactersFromSet:(NSCharacterSet *)set intoString:(NSString **)value; 18 | 19 | - (BOOL)scanIdentifierIntoString:(NSString **)stringPointer; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Source/NSString-CDExtensions.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | @interface NSString (CDExtensions) 7 | 8 | + (NSString *)stringWithFileSystemRepresentation:(const char *)str; 9 | + (NSString *)spacesIndentedToLevel:(NSUInteger)level; 10 | + (NSString *)spacesIndentedToLevel:(NSUInteger)level spacesPerLevel:(NSUInteger)spacesPerLevel; 11 | + (NSString *)stringWithUnichar:(unichar)character; 12 | 13 | - (BOOL)isFirstLetterUppercase; 14 | 15 | - (void)print; 16 | 17 | - (NSString *)executablePathForFilename; 18 | 19 | - (NSString *)SHA1DigestString; 20 | 21 | - (BOOL)hasUnderscoreCapitalPrefix; 22 | - (NSString *)capitalizeFirstCharacter; 23 | - (NSString *)lowercaseFirstCharacter; 24 | 25 | @end 26 | 27 | @interface NSMutableString (CDExtensions) 28 | 29 | - (void)appendSpacesIndentedToLevel:(NSUInteger)level; 30 | - (void)appendSpacesIndentedToLevel:(NSUInteger)level spacesPerLevel:(NSUInteger)spacesPerLevel; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Symbol mapping/CDSymbolMapper.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class CDSymbolsGeneratorVisitor; 4 | 5 | 6 | @interface CDSymbolMapper : NSObject 7 | 8 | - (void)writeSymbolsFromSymbolsVisitor:(CDSymbolsGeneratorVisitor *)visitor toFile:(NSString *)file; 9 | 10 | - (NSString *)processCrashDump:(NSString *)crashDump withSymbols:(NSDictionary *)symbols; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /System Protocols Dumping/CDSystemProtocolsProcessor.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface CDSystemProtocolsProcessor : NSObject 5 | - (id)initWithSdkPath:(NSString *)sdkPath; 6 | - (NSArray *)systemProtocolsSymbolsToExclude; 7 | @end 8 | -------------------------------------------------------------------------------- /Tests/showdiff: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | pushd /tmp/cdt/new 4 | foreach i (*.txt) 5 | echo -e "\\033[32m" 6 | echo $i 7 | echo -e "\\033[0m" 8 | diff ../old/$i $i | colordiff.pl 9 | echo 10 | echo 11 | echo 12 | 13 | end 14 | -------------------------------------------------------------------------------- /UnitTests.old/AllTests.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | #import 4 | 5 | @interface AllTests : SenTestCase 6 | { 7 | } 8 | 9 | + (id)defaultTestSuite; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /UnitTests.old/CDPathUnitTest.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import 7 | 8 | @class CDClassDump; 9 | 10 | @interface CDPathUnitTest : SenTestCase 11 | { 12 | CDClassDump *classDump; 13 | } 14 | 15 | - (void)setUp; 16 | - (void)tearDown; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /UnitTests.old/CDStructHandlingUnitTest.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import 7 | 8 | @class CDClassDump; 9 | 10 | @interface CDStructHandlingUnitTest : SenTestCase 11 | { 12 | CDClassDump *classDump; 13 | } 14 | 15 | - (void)dealloc; 16 | 17 | - (void)setUp; 18 | - (void)tearDown; 19 | 20 | - (void)testVariableName:(NSString *)aVariableName type:(NSString *)aType expectedResult:(NSString *)expectedResult; 21 | - (void)registerStructsFromType:(NSString *)aTypeString phase:(int)phase; 22 | 23 | - (void)testFilename:(NSString *)testFilename; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /UnitTests.old/CDTypeFormatterUnitTest.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import 7 | 8 | @class CDTypeFormatter; 9 | 10 | @interface CDTypeFormatterUnitTest : SenTestCase 11 | { 12 | CDTypeFormatter *typeFormatter; 13 | } 14 | 15 | - (void)dealloc; 16 | 17 | - (void)setUp; 18 | - (void)tearDown; 19 | 20 | - (void)testVariableName:(NSString *)aVariableName type:(NSString *)aType expectedResult:(NSString *)expectedResult; 21 | - (void)parseAndEncodeType:(NSString *)originalType; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /UnitTests.old/CDTypeLexerUnitTest.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import 7 | 8 | @class CDTypeLexer; 9 | 10 | @interface CDTypeLexerUnitTest : SenTestCase 11 | { 12 | CDTypeLexer *lexer; 13 | } 14 | 15 | - (void)setUp; 16 | - (void)tearDown; 17 | 18 | - (void)_setupLexerForString:(NSString *)str; 19 | - (void)_cleanupLexer; 20 | - (void)_showScannedTokens; 21 | - (void)showScannedTokensForString:(NSString *)str; 22 | 23 | - (void)testLexingString:(NSString *)str expectedResults:(struct tokenValuePair *)expectedResults; 24 | 25 | - (void)testSimpleTokens; 26 | - (void)testQuotedStringToken; 27 | - (void)testEmptyQuotedStringToken; 28 | - (void)testUnterminatedQuotedString; 29 | - (void)testIdentifierToken; 30 | - (void)testTemplateTokens; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /UnitTests.old/CDTypeParserUnitTest.h: -------------------------------------------------------------------------------- 1 | // -*- mode: ObjC -*- 2 | 3 | // This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files. 4 | // Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | 6 | #import 7 | 8 | @interface CDTypeParserUnitTest : SenTestCase 9 | { 10 | } 11 | 12 | - (void)setUp; 13 | - (void)tearDown; 14 | 15 | - (void)testType:(NSString *)aType showLexing:(BOOL)shouldShowLexing; 16 | - (void)testMethodType:(NSString *)aMethodType showLexing:(BOOL)shouldShowLexing; 17 | 18 | - (void)testLoneConstType; 19 | - (void)testObjectQuotedStringTypes; 20 | 21 | - (void)testMissingFieldNames; 22 | - (void)testLowercaseClassName; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /UnitTests.old/otest-all: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "${OTEST_TEST_CLASS}" = "" ]; then 4 | OTEST_TEST_CLASS="AllTests" 5 | fi 6 | 7 | ${DEVELOPER_DIR}/Tools/otest -SenTest ${OTEST_TEST_CLASS} $* 8 | -------------------------------------------------------------------------------- /UnitTests.old/shud01-in.txt: -------------------------------------------------------------------------------- 1 | // This tests a simple structure without field names. 2 | {_NSRange=II} foo 3 | -------------------------------------------------------------------------------- /UnitTests.old/shud01-out.txt: -------------------------------------------------------------------------------- 1 | struct _NSRange { 2 | unsigned int; 3 | unsigned int; 4 | }; 5 | 6 | struct _NSRange foo; 7 | -------------------------------------------------------------------------------- /UnitTests.old/shud02-in.txt: -------------------------------------------------------------------------------- 1 | // This tests recognizing that two structures, one with field names and the other without, are really the same. 2 | {_NSRange=II} foo 3 | {_NSRange="location"I"length"I} bar 4 | -------------------------------------------------------------------------------- /UnitTests.old/shud02-out.txt: -------------------------------------------------------------------------------- 1 | struct _NSRange { 2 | unsigned int location; 3 | unsigned int length; 4 | }; 5 | 6 | struct _NSRange foo; 7 | struct _NSRange bar; 8 | -------------------------------------------------------------------------------- /UnitTests.old/shud04-in.txt: -------------------------------------------------------------------------------- 1 | // This tests a common structure that contains two other structures. 2 | // Note: It looks like struct _NSSize is shown after _NSRect, but it should really be before it. 3 | {_NSRect={_NSPoint=ff}{_NSSize=ff}} 4 | -------------------------------------------------------------------------------- /UnitTests.old/shud04-out.txt: -------------------------------------------------------------------------------- 1 | struct _NSPoint { 2 | float; 3 | float; 4 | }; 5 | 6 | struct _NSRect { 7 | struct _NSPoint; 8 | struct _NSSize; 9 | }; 10 | 11 | struct _NSSize { 12 | float; 13 | float; 14 | }; 15 | 16 | struct _NSRect var; 17 | -------------------------------------------------------------------------------- /UnitTests.old/shud05-in.txt: -------------------------------------------------------------------------------- 1 | {one="field1"i"field2"c"field3"{?=ff}} 2 | -------------------------------------------------------------------------------- /UnitTests.old/shud05-out.txt: -------------------------------------------------------------------------------- 1 | struct one { 2 | int field1; 3 | char field2; 4 | struct { 5 | float; 6 | float; 7 | } field3; 8 | }; 9 | 10 | struct one var; 11 | -------------------------------------------------------------------------------- /UnitTests.old/shud06-in.txt: -------------------------------------------------------------------------------- 1 | {one="field1"i"field2"c"field3"{?=ff}} 2 | {one="field1"i"field2"c"field3"{?="x"f"y"f}} 3 | -------------------------------------------------------------------------------- /UnitTests.old/shud06-out.txt: -------------------------------------------------------------------------------- 1 | struct one { 2 | int field1; 3 | char field2; 4 | struct { 5 | float x; 6 | float y; 7 | } field3; 8 | }; 9 | 10 | struct one var; 11 | struct one var; 12 | -------------------------------------------------------------------------------- /UnitTests.old/shud07-in.txt: -------------------------------------------------------------------------------- 1 | {one="field1"i"field2"c"field3"{?="x"f"y"f}} 2 | {one="field1"i"field2"c"field3"{?="x"f"y"f}} 3 | -------------------------------------------------------------------------------- /UnitTests.old/shud07-out.txt: -------------------------------------------------------------------------------- 1 | struct one { 2 | int field1; 3 | char field2; 4 | struct { 5 | float x; 6 | float y; 7 | } field3; 8 | }; 9 | 10 | struct one var; 11 | struct one var; 12 | -------------------------------------------------------------------------------- /UnitTests.old/shud08-in.txt: -------------------------------------------------------------------------------- 1 | {one="field1"i"field2"c"field3"{?="x"f"y"f}} 2 | {one="field1"i"field2"c"field3"{?="x"f"y"f}} 3 | {?="x"f"y"f} 4 | -------------------------------------------------------------------------------- /UnitTests.old/shud08-out.txt: -------------------------------------------------------------------------------- 1 | struct one { 2 | int field1; 3 | char field2; 4 | CDAnonymousStruct1 field3; 5 | }; 6 | 7 | typedef struct { 8 | float x; 9 | float y; 10 | } CDAnonymousStruct1; 11 | 12 | struct one var; 13 | struct one var; 14 | CDAnonymousStruct1 var; 15 | -------------------------------------------------------------------------------- /UnitTests.old/shud09-in.txt: -------------------------------------------------------------------------------- 1 | // Test a structure that contains one of many common types. The first type has member names, the second doesn't, but they're the same. 2 | {?="type"i"value"(?="charValue"c"shortValue"s"longValue"l"longlongValue"q"floatValue"f"doubleValue"d"boolValue"B"selectorValue":"objectValue"@"pointerValue"^v"structLocation"^v"cStringLocation"*)} 3 | {?=i(?=cslqfdB:@^v^v*)} 4 | -------------------------------------------------------------------------------- /UnitTests.old/shud09-out.txt: -------------------------------------------------------------------------------- 1 | typedef struct { 2 | int type; 3 | union { 4 | char charValue; 5 | short shortValue; 6 | long longValue; 7 | long long longlongValue; 8 | float floatValue; 9 | double doubleValue; 10 | _Bool boolValue; 11 | SEL selectorValue; 12 | id objectValue; 13 | void *pointerValue; 14 | void *structLocation; 15 | char *cStringLocation; 16 | } value; 17 | } CDAnonymousStruct1; 18 | 19 | CDAnonymousStruct1 var; 20 | CDAnonymousStruct1 var; 21 | -------------------------------------------------------------------------------- /UnitTests.old/shud10-in.txt: -------------------------------------------------------------------------------- 1 | {?="field1"i"field2"i} 2 | {?=ii} 3 | -------------------------------------------------------------------------------- /UnitTests.old/shud10-out.txt: -------------------------------------------------------------------------------- 1 | typedef struct { 2 | int field1; 3 | int field2; 4 | } CDAnonymousStruct1; 5 | 6 | CDAnonymousStruct1 var; 7 | CDAnonymousStruct1 var; 8 | -------------------------------------------------------------------------------- /UnitTests.old/shud11-in.txt: -------------------------------------------------------------------------------- 1 | {?="field1"i"field2"i} 2 | {?=ii} 3 | {?="bar1"i"bar2"i} 4 | -------------------------------------------------------------------------------- /UnitTests.old/shud11-out.txt: -------------------------------------------------------------------------------- 1 | struct { 2 | int field1; 3 | int field2; 4 | } var; 5 | struct { 6 | int; 7 | int; 8 | } var; 9 | struct { 10 | int bar1; 11 | int bar2; 12 | } var; 13 | -------------------------------------------------------------------------------- /UnitTests.old/shud13-in.txt: -------------------------------------------------------------------------------- 1 | {NSBrowserAuxiliary="_field1"@"NSMutableArray""_field2"@"_NSBrowserScrollView""_field3"@"NSClipView""_field4"@"_NSBrowserColumnScrollHelper""_field5"i"_field6"i"_field7"@"NSMatrix""_field8"@"NSEvent""_field9"f"_field10"@"NSMutableArray""_field11"i"_field12"i"_field13"@"NSString""_field14"{__BrFlags2="delegateShouldSizeColumnToWidth"b1"delegateSizeToFitWidtOfColumn"b1"shouldAnimateColumnScrolling"b1"tilingDisabled"b1"setPathOptimizationOn"b1"readingSavedColumns"b1"recomputeExistingColumnPositions"b1"waitingToSendDoubleActionAtEndOfScroll"b1"waitingToSendSingleActionAtEndOfScroll"b1"waitingToSendConfigChangeNotificationAtEndOfScroll"b1"compatContinuousScrollingCapable"b1"compatContinuousScrollingCapableSet"b1"forceSynchronizedScrollingAnimation"b1"useCustomBorderType"b1"customBorderType"b3"animateColumnScrollingForAnyEvent"b1"reserved"b14}} 2 | -------------------------------------------------------------------------------- /UnitTests.old/shud14-in.txt: -------------------------------------------------------------------------------- 1 | // This is a type from iPhoto 5 that caused problems. 2 | ^{IPAlbumList=^^?{vector >={?={?=^@^@^@}}}{_opaque_pthread_mutex_t=l[40c]}} 3 | -------------------------------------------------------------------------------- /UnitTests.old/shud14-out.txt: -------------------------------------------------------------------------------- 1 | struct IPAlbumList { 2 | void **; 3 | struct vector>; 4 | struct _opaque_pthread_mutex_t; 5 | }; 6 | 7 | struct _opaque_pthread_mutex_t { 8 | long; 9 | char [40]; 10 | }; 11 | 12 | struct vector> { 13 | struct { 14 | struct { 15 | id *; 16 | id *; 17 | id *; 18 | }; 19 | }; 20 | }; 21 | 22 | struct IPAlbumList *var; 23 | -------------------------------------------------------------------------------- /UnitTests.old/shud15-in.txt: -------------------------------------------------------------------------------- 1 | {my_struct1="field1"@"NSObject"} 2 | {my_struct2="field1"@"NSObject""field2"@} 3 | {my_struct3="field1"@"field2"@} 4 | {my_struct4=@"NSObject"} 5 | {my_struct5=@"NSObject"@"NSObject"} 6 | -------------------------------------------------------------------------------- /UnitTests.old/shud15-out.txt: -------------------------------------------------------------------------------- 1 | struct my_struct1 { 2 | NSObject *field1; 3 | }; 4 | 5 | struct my_struct2 { 6 | NSObject *field1; 7 | id field2; 8 | }; 9 | 10 | struct my_struct3 { 11 | id field1; 12 | id field2; 13 | }; 14 | 15 | struct my_struct4 { 16 | NSObject *; 17 | }; 18 | 19 | struct my_struct5 { 20 | NSObject *; 21 | NSObject *; 22 | }; 23 | 24 | struct my_struct1 var; 25 | struct my_struct2 var; 26 | struct my_struct3 var; 27 | struct my_struct4 var; 28 | struct my_struct5 var; 29 | -------------------------------------------------------------------------------- /UnitTests.old/shud16-in.txt: -------------------------------------------------------------------------------- 1 | // TextMate 1.5.4 has structures like... "storage""stack"{etc} -- two quoted strings next to each other. 2 | // It looks like this is a problem with the name rather than a problem with missing types -- when I compared 3 | // it to a case that didn't have names the types matched up perfectly. 4 | {my_struct1="storage""stack"i} 5 | -------------------------------------------------------------------------------- /UnitTests.old/shud16-out.txt: -------------------------------------------------------------------------------- 1 | struct my_struct1 { 2 | int storage__stack; 3 | }; 4 | 5 | struct my_struct1 var; 6 | -------------------------------------------------------------------------------- /UnitTests.old/var-001.txt: -------------------------------------------------------------------------------- 1 | // Test a pointer to no type in a structure. 2 | // This is an excerpt from the _topSitesViewController ivar of BrowserWebView in Safari 4.0 on Mac OS X 10.5. 3 | 4 | var1 5 | {?="__pfn"^"__delta"i} 6 | 7 | // Similar to the case above, but what happens if it occurs as the last member of the structure? 8 | 9 | var2 10 | {?="__pfn"^} 11 | 12 | // Combination of the first two cases. Order reversed from first case. 13 | 14 | var3 15 | {?="__delta"i"__pfn"^} 16 | 17 | // Same as the three tests above, but for unions. 18 | 19 | var4 20 | (?="__pfn"^"__delta"i) 21 | 22 | var5 23 | (?="__pfn"^) 24 | 25 | var6 26 | (?="__delta"i"__pfn"^) 27 | 28 | -------------------------------------------------------------------------------- /UnitTests.old/var-002.txt: -------------------------------------------------------------------------------- 1 | // This is an excerpt from the _topSitesViewController ivar of BrowserWebView in Safari 4.0 on Mac OS X 10.5. 2 | 3 | var1 4 | {STimer="_vptr$STimerBase"^^?"m_ID"I"m_isRepeating"B"m_object"^{TopSitesViewController}"m_function"{?="__pfn"^"__delta"i}} 5 | -------------------------------------------------------------------------------- /UnitTests.old/var-004.txt: -------------------------------------------------------------------------------- 1 | var 1 2 | {RetainPtr=^{__CFString}} 3 | 4 | var 5 | {My::List} 6 | 7 | var 8 | {My::List} 9 | 10 | var 11 | {My::List} 12 | 13 | var 14 | {My::List*,int>} 15 | 16 | // If it's still in the template mode, it adds any identifier after the > to the suffix; 17 | 18 | var 19 | {My::List*bob,int>} 20 | 21 | // And this should fail: 22 | var 23 | {My::List*} 24 | 25 | // Should this work or not? 26 | var 27 | {^My::List} 28 | 29 | -------------------------------------------------------------------------------- /UnitTests.old/var-005.txt: -------------------------------------------------------------------------------- 1 | // From Safari 4.0.2 on Mac OS X 10.5: 2 | 3 | var 4 | {pair, 0ul>*>} 5 | -------------------------------------------------------------------------------- /UnitTests/UnitTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.stevenygard.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /UnitTests/UnitTests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /UnitTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /dSYM deobfuscating/CDdSYMProcessor.h: -------------------------------------------------------------------------------- 1 | // 2 | // CDdSYMProcessor.h 3 | // ios-class-guard 4 | // 5 | // Created by Tomasz Grynfelder on 22/01/15. 6 | // Copyright (c) 2015 Polidea Sp. z o.o. All rights reserved. 7 | // 8 | #import 9 | 10 | @interface CDdSYMProcessor : NSObject 11 | - (NSData *)processDwarfdump:(NSData *)dwarfdumpContent withSymbols:(NSDictionary *)symbols; 12 | - (void)writeDwarfdump:(NSData *)dwarfdumpContent originalDwarfPath:(NSString *)originalDwarfPath inputDSYM:(NSString *)inputDSYM outputDSYM:(NSString *)outputDSYM; 13 | - (NSArray *)extractDwarfPathsForDSYM:(NSString *)path; 14 | @end 15 | -------------------------------------------------------------------------------- /deprotect-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'deprotect' target in the 'deprotect' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import "CDExtensions.h" 8 | #endif 9 | -------------------------------------------------------------------------------- /formatType-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'formatType' target in the 'formatType' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import "CDExtensions.h" 8 | #endif 9 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | fail() { 4 | echo "ERROR: $@" 1>&2 5 | exit 1 6 | } 7 | 8 | curl --silent -o /tmp/ios-class-guard https://polidea.github.io/ios-class-guard/ios-class-guard || fail "Failed to download latest ios-class-guard" 9 | chmod +x /tmp/ios-class-guard || fail "Failed to chmod ios-class-guard" 10 | sudo mv /tmp/ios-class-guard /usr/local/bin/ios-class-guard || fail "Failed to install ios-class-guard" 11 | 12 | echo "Installed!" 13 | -------------------------------------------------------------------------------- /ios-class-guard-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'class-dump' target in the 'class-dump' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import "CDExtensions.h" 8 | #define __cmd __PRETTY_FUNCTION__ 9 | #endif 10 | -------------------------------------------------------------------------------- /ios-class-guard.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios-class-guard.xcodeproj/xcshareddata/xcschemes/MachObjC.xcscheme: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kk-vv/ios-class-guard/2e6885d3ed24b66875b3ab4aba76e1b906ee2a3b/ios-class-guard.xcodeproj/xcshareddata/xcschemes/MachObjC.xcscheme -------------------------------------------------------------------------------- /ios-class-guard.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /keys.txt: -------------------------------------------------------------------------------- 1 | APPNAME=class-dump 2 | SHORT_DESCRIPTION=a utility for examining the Objective-C segment of Mach-O files 3 | OWNER=Steve Nygard 4 | COPYRIGHT=Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard. 5 | --------------------------------------------------------------------------------