code stringlengths 3 10M | language stringclasses 31 values |
|---|---|
/Users/triggullberg/Desktop/LpRocks/Build/Intermediates/LpRocks.build/Debug-iphonesimulator/LpRocks.build/Objects-normal/x86_64/StartVC.o : /Users/triggullberg/Desktop/LpRocks/LpRocks/OnboardVC.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/MainVC.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/StartVC.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulseSync.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScalePulseOutRapid.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScale.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScale.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorViewable.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleMultiple.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleRippleMultiple.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotateMultiple.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleRipple.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorShape.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallRotateChase.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulseRise.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallGridPulse.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotatePulse.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulse.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorAnimationDelegate.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/AppDelegate.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallRotate.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotate.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallZigZag.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallTrianglePath.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBlank.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationPacman.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationSemiCircleSpin.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationSquareSpin.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationTriangleSkewSpin.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationCubeTransition.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineSpinFadeLoader.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallSpinFadeLoader.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorPresenter.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationAudioEqualizer.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallGridBeat.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallBeat.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallZigZagDeflect.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationOrbit.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScalePulseOut.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorView.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScaleParty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-SDK/Leanplum.framework/Headers/Leanplum.h /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-UIEditor/LeanplumUIEditor.framework/Headers/LeanplumUIEditor.h /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-SDK/Leanplum.framework/Headers/LPInbox.h /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-SDK/Leanplum.framework/Modules/module.modulemap /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-UIEditor/LeanplumUIEditor.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AdSupport.framework/Headers/AdSupport.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes
/Users/triggullberg/Desktop/LpRocks/Build/Intermediates/LpRocks.build/Debug-iphonesimulator/LpRocks.build/Objects-normal/x86_64/StartVC~partial.swiftmodule : /Users/triggullberg/Desktop/LpRocks/LpRocks/OnboardVC.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/MainVC.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/StartVC.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulseSync.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScalePulseOutRapid.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScale.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScale.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorViewable.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleMultiple.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleRippleMultiple.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotateMultiple.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleRipple.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorShape.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallRotateChase.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulseRise.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallGridPulse.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotatePulse.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulse.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorAnimationDelegate.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/AppDelegate.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallRotate.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotate.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallZigZag.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallTrianglePath.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBlank.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationPacman.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationSemiCircleSpin.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationSquareSpin.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationTriangleSkewSpin.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationCubeTransition.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineSpinFadeLoader.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallSpinFadeLoader.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorPresenter.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationAudioEqualizer.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallGridBeat.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallBeat.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallZigZagDeflect.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationOrbit.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScalePulseOut.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorView.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScaleParty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-SDK/Leanplum.framework/Headers/Leanplum.h /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-UIEditor/LeanplumUIEditor.framework/Headers/LeanplumUIEditor.h /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-SDK/Leanplum.framework/Headers/LPInbox.h /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-SDK/Leanplum.framework/Modules/module.modulemap /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-UIEditor/LeanplumUIEditor.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AdSupport.framework/Headers/AdSupport.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes
/Users/triggullberg/Desktop/LpRocks/Build/Intermediates/LpRocks.build/Debug-iphonesimulator/LpRocks.build/Objects-normal/x86_64/StartVC~partial.swiftdoc : /Users/triggullberg/Desktop/LpRocks/LpRocks/OnboardVC.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/MainVC.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/StartVC.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulseSync.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScalePulseOutRapid.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScale.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScale.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorViewable.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleMultiple.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleRippleMultiple.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotateMultiple.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleRipple.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorShape.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallRotateChase.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulseRise.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallGridPulse.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotatePulse.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulse.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorAnimationDelegate.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/AppDelegate.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallRotate.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotate.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallZigZag.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallTrianglePath.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBlank.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationPacman.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationSemiCircleSpin.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationSquareSpin.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationTriangleSkewSpin.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationCubeTransition.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineSpinFadeLoader.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallSpinFadeLoader.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorPresenter.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationAudioEqualizer.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallGridBeat.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallBeat.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallZigZagDeflect.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationOrbit.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScalePulseOut.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/NVActivityIndicatorView.swift /Users/triggullberg/Desktop/LpRocks/LpRocks/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScaleParty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-SDK/Leanplum.framework/Headers/Leanplum.h /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-UIEditor/LeanplumUIEditor.framework/Headers/LeanplumUIEditor.h /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-SDK/Leanplum.framework/Headers/LPInbox.h /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-SDK/Leanplum.framework/Modules/module.modulemap /Users/triggullberg/Desktop/LpRocks/Pods/Leanplum-iOS-UIEditor/LeanplumUIEditor.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AdSupport.framework/Headers/AdSupport.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes
| D |
/**
* Authors: Jon "ylixir" Allen, ylixir@gmail.com
* Copyright: Copyright (c) 2008 ylixir. All rights reserved.
* License:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/
import std.c.stdarg;
public import ncurses, eti;
extern(C):
typedef void FIELD;
typedef void FORM;
typedef void FIELDTYPE;
/**
Restores the cursor to the position required by the forms driver.
See_also: man form_cursor
*/
int pos_form_cursor(FORM* form);
/**
Check and see if there is offscreen data ahead/behind in the form.
See_also: man form_data
*/
bool data_ahead(FORM* form);
///ditto
bool data_behind(FORM* form);
/**
Routine to funnel input events for the form though.
See_also: man form_driver
*/
int form_driver(FORM* form, int c);
//driver requests
immutable enum :int
{
///move to the given page
REQ_NEXT_PAGE = 0x200,
///ditto
REQ_PREV_PAGE = 0x201,
///ditto
REQ_FIRST_PAGE = 0x202,
///ditto
REQ_LAST_PAGE = 0x203,
///move to the specified field
REQ_NEXT_FIELD = 0x204,
///ditto
REQ_PREV_FIELD = 0x205,
///ditto
REQ_FIRST_FIELD = 0x206,
///ditto
REQ_LAST_FIELD = 0x207,
///ditto
REQ_SNEXT_FIELD = 0x208,
///ditto
REQ_SPREV_FIELD = 0x209,
///ditto
REQ_SFIRST_FIELD = 0x20A,
///ditto
REQ_SLAST_FIELD = 0x20B,
///ditto
REQ_LEFT_FIELD = 0x20C,
///ditto
REQ_RIGHT_FIELD = 0x20D,
///ditto
REQ_UP_FIELD = 0x20E,
///ditto
REQ_DOWN_FIELD = 0x20F,
///move to the specified place
REQ_NEXT_CHAR = 0x210,
///ditto
REQ_PREV_CHAR = 0x211,
///ditto
REQ_NEXT_LINE = 0x212,
///ditto
REQ_PREV_LINE = 0x213,
///ditto
REQ_NEXT_WORD = 0x214,
///ditto
REQ_PREV_WORD = 0x215,
///ditto
REQ_BEG_FIELD = 0x216,
///ditto
REQ_END_FIELD = 0x217,
///ditto
REQ_BEG_LINE = 0x218,
///ditto
REQ_END_LINE = 0x219,
///ditto
REQ_LEFT_CHAR = 0x21A,
///ditto
REQ_RIGHT_CHAR = 0x21B,
///ditto
REQ_UP_CHAR = 0x21C,
///ditto
REQ_DOWN_CHAR = 0x21D,
///insert/overlay a new line
REQ_NEW_LINE = 0x21E,
///insert a blank char/line at the cursor
REQ_INS_CHAR = 0x21F,
///ditto
REQ_INS_LINE = 0x220,
///delete the specified item
REQ_DEL_CHAR = 0x221,
///ditto
REQ_DEL_PREV = 0x222,
///ditto
REQ_DEL_LINE = 0x223,
///ditto
REQ_DEL_WORD = 0x224,
///clear as specified
REQ_CLR_EOL = 0x225,
///ditto
REQ_CLR_EOF = 0x226,
///ditto
REQ_CLR_FIELD = 0x227,
///enter the specified mode
REQ_OVL_MODE = 0x228,
///ditto
REQ_INS_MODE = 0x229,
///scroll the given amount
REQ_SCR_FLINE = 0x22A,
///ditto
REQ_SCR_BLINE = 0x22B,
///ditto
REQ_SCR_FPAGE = 0x22C,
///ditto
REQ_SCR_BPAGE = 0x22D,
///ditto
REQ_SCR_FHPAGE = 0x22E,
///ditto
REQ_SCR_BHPAGE = 0x22F,
///ditto
REQ_SCR_FCHAR = 0x230,
///ditto
REQ_SCR_BCHAR = 0x231,
///ditto
REQ_SCR_HFLINE = 0x232,
///ditto
REQ_SCR_HBLINE = 0x233,
///ditto
REQ_SCR_HFHALF = 0x234,
///ditto
REQ_SCR_HBHALF = 0x235,
///validate a field
REQ_VALIDATION = 0x236,
///display next/previous choice
REQ_NEXT_CHOICE = 0x237,
///ditto
REQ_PREV_CHOICE = 0x238,
MIN_FORM_COMMAND = 0x200,
MAX_FORM_COMMAND = 0x238
}
/**
Set the fields in the form to the given null terminated array
See_also: man form_field
*/
int set_form_fields(FORM* form, FIELD** fields);
/**
Get the array of fields in the form.
See_also: man form_field
*/
FIELD** form_fields(FORM* form);
/**
Find out how many fields are in the form.
See_also: man form_field
*/
int field_count(FORM* form);
/**
Move the field to the specified place on the screen.
See_also: man form_field
*/
int move_field(FIELD* field, int frow, int fcol);
/**
Get the attributes passed to a field when it was created.
See_also: man form_field_info
*/
int field_info(FIELD* field, int* rows, int* cols,
int* frow, int* fcol, int* nrow, int* nbuf);
/**
Get the actual attributes of a field.
See_also: man form_field_info
*/
int dynamic_field_info(FIELD* field, int* rows, int* cols,
int* max);
/**
Allocate and initialize a new field.
See_also: man form_field_new
*/
FIELD* new_field(int height, int width,
int toprow, int leftcol,
int offscreen, int nbuffers);
/**
Duplicate an existing field
See_also: man form_field_new
*/
FIELD* dup_field(FIELD* field, int toprow, int leftcol);
/**
Duplicate a field, but share buffers with the original field.
See_also: man form_field_new
*/
FIELD* link_field(FIELD* field, int toprow, int leftcol);
/**
Deallocate a field.
See_also: man form_field_new
*/
int free_field(FIELD* field);
/**
Sets/gets a fields foreground attributes.
See_also: man form_field_attributes
*/
int set_field_fore(FIELD* field, chtype attr);
///ditto
chtype field_fore(FIELD* field);
/**
Sets/gets a fields background attributes.
See_also: man form_field_attributes
*/
int set_field_back(FIELD* field, chtype attr);
///ditto
chtype field_back(FIELD* field);
/**
Sets/gets a fields padding character attributes.
See_also: man form_field_attributes
*/
int set_field_pad(FIELD* field, int pad);
///ditto
int field_pad(FIELD* field);
/**
Set the buffer of a field to contain a given string
See_also: man form_field_buffer
*/
int set_field_buffer(FIELD* field, int buf, immutable char* value);
/**
Get a pointer to a fields buffer
See_also: man form_field_buffer
*/
char *field_buffer(FIELD* field, int buffer);
/**
Get/set a fields status. True if changed.
See_also: man form_field_buffer
*/
int set_field_status(FIELD* field, bool status);
///ditto
bool field_status(FIELD* field);
/**
Set the max size of a dynamic field.
See_also: man form_field_buffer
*/
int set_max_field(FIELD* field, int max);
/**
Get/set a fields justification.
See_also: man form_field_just
*/
int set_field_just(FIELD* field, int justification);
///ditto
int field_just(FIELD* field);
immutable enum :int
{
///Justification constants
NO_JUSTIFICATION = 0,
///ditto
JUSTIFY_LEFT = 1,
///ditto
JUSTIFY_CENTER = 2,
///ditto
JUSTIFY_RIGHT = 3
}
/**
Set all of a fields option bits.
See_also: man form_field_opts
*/
int set_field_opts(FIELD* field, OPTIONS opts);
/**
Turn on a fields given option bits.
See_also: man form_field_opts
*/
int field_opts_on(FIELD* field, OPTIONS opts);
/**
Turn off a fields given option bits.
See_also: man form_field_opts
*/
int field_opts_off(FIELD* field, OPTIONS opts);
/**
Get a fields option bits.
See_also: man form_field_opts
*/
OPTIONS field_opts(FIELD* field);
/**
Get/set a fields application specific data.
See_also: man form_field_userptr
*/
int set_field_userptr(FIELD* field, void* userptr);
///ditto
void* field_userptr(FIELD* field);
/**
Set/get a field type.
See_also: man form_field_validation
*/
int set_field_type(FIELD* field, FIELDTYPE* type, ...);
///ditto
FIELDTYPE* field_type(FIELD* field);
///ditto
void* field_arg(FIELD* field);
/**
Valid field types.
See_also: man form_field_validation
*/
extern FIELDTYPE* TYPE_ALNUM;
///ditto
extern FIELDTYPE* TYPE_ALPHA;
///ditto
extern FIELDTYPE* TYPE_ENUM;
///ditto
extern FIELDTYPE* TYPE_INTEGER;
///ditto
extern FIELDTYPE* TYPE_NUMERIC;
///ditto
extern FIELDTYPE* TYPE_REGEXP;
///ditto
extern FIELDTYPE* TYPE_IPV4;
/**
Create a new field type.
See_also: man form_fieldtype
*/
FIELDTYPE* new_fieldtype(
bool function(FIELD*, void*) field_check,
bool function(int, void*) char_check);
/**
Free space allocated for a field type.
See_also: man form_fieldtype
*/
int free_fieldtype(FIELDTYPE* fieldtype);
/**
Associate storage management functions with a field type.
See_also: man form_fieldtype
*/
int set_fieldtype_arg(
FIELDTYPE* fieldtype,
void* function(va_list*) make_arg,
void* function(void*) copy_arg,
void function(void*) free_arg);
/**
Define successor and predecessor functions for the field type.
See_also: man form_fieldtype
*/
int set_fieldtype_choice(
FIELDTYPE *fieldtype,
bool function(FIELD*, void*) next_choice,
bool function(FIELD*, void*) prev_choice);
/**
Create a new field type from two other types.
See_also: man form_fieldtype
*/
FIELDTYPE* link_fieldtype(FIELDTYPE* type1,
FIELDTYPE* type2);
/**
Sets/gets a hook to be called at form post time and after a field changes.
See_also: man form_hook
*/
int set_field_init(FORM* form, void function(FORM*) func);
///ditto
void function(FORM*) field_init(FORM* form);
/**
Sets/gets a hook to be called at form unpost time and before a field change.
See_also: man form_hook
*/
int set_field_term(FORM* form, void function(FORM*) func);
///ditto
void function(FORM*) field_term(FORM* form);
/**
Sets/gets a hook to be called at form post time and after a page change.
See_also: man form_hook
*/
int set_form_init(FORM *form, void function(FORM*) func);
///ditto
void function(FORM*) form_init(FORM* form);
/**
Sets/gets a hook to be called at form unpost time and before a page change.
See_also: man form_hook
*/
int set_form_term(FORM *form, void function(FORM*) func);
///ditto
void function(FORM*) form_term(FORM* form);
/**
Create/destroy a new form.
See_also: man form_new
*/
FORM* new_form(FIELD** fields);
///ditto
int free_form(FORM* form);
/**
Set a field to be the beginning of a new page.
See_also: man form_new_page
*/
int set_new_page(FIELD* field, bool new_page_flag);
/**
Check if a field is the beginning of a new page.
See_also: man form_new_page
*/
bool new_page(FIELD* field);
/**
Set all of a forms option bits.
See_also: man form_form_opts
*/
int set_form_opts(FORM* form, OPTIONS opts);
/**
Turn on a forms given option bits.
See_also: man form_form_opts
*/
int form_opts_on(FORM* form, OPTIONS opts);
/**
Turn off a forms given option bits.
See_also: man form_form_opts
*/
int form_opts_off(FORM* form, OPTIONS opts);
/**
Get a forms option bits.
See_also: man form_form_opts
*/
OPTIONS form_opts(FORM* form);
/**
Set/get the forms current field.
See_also: man form_page
*/
int set_current_field(FORM* form, FIELD* field);
///ditto
FIELD* current_field(FORM* form);
/**
Set/get the forms current page.
See_also: man form_page
*/
int set_form_page(FORM* form, int n);
///ditto
int form_page(FORM* form);
/**
Get a fields index in its form.
See_also: man form_page
*/
int field_index(FIELD* field);
/**
Display/erase a form
See_also: man form_post
*/
int post_form(FORM* form);
///ditto
int unpost_form(FORM* form);
/**
Get the printable name of a form request code
See_also: man form_requestname
*/
char* form_request_name(int request);
/**
Search for a request code by it's printable name
See_also: man form_requestname
*/
int form_request_by_name(immutable char* name);
/**
Set/remove form window associations.
See_also: man form_win
*/
int set_form_win(FORM* form, WINDOW* win);
///ditto
WINDOW* form_win(FORM* form);
///ditto
int set_form_sub(FORM* form, WINDOW* sub);
///ditto
WINDOW* form_sub(FORM* form);
/**
Get the minimum size required for a forms subwindow
See_also: man form_win
*/
int scale_form(FORM* form, int* rows, int* columns);
/**
Get/set a forms application specific data.
See_also: man form_field_userptr
*/
int set_form_userptr(FORM* form, void* userptr);
///ditto
void* form_userptr(FORM* form);
immutable enum :OPTIONS
{
/* form vals */
O_VISIBLE = 0x0001,
O_ACTIVE = 0x0002,
O_PUBLIC = 0x0004,
O_EDIT = 0x0008,
O_WRAP = 0x0010,
O_BLANK = 0x0020,
O_AUTOSKIP = 0x0040,
O_NULLOK = 0x0080,
O_PASSOK = 0x0100,
O_STATIC = 0x0200,
O_NL_OVERLOAD = 0x0001,
O_BS_OVERLOAD = 0x0002
}
| D |
/Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Console.build/Command/Group.swift.o : /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Bar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Argument.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Command+Print.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Command.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Group.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Option.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Runnable.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Value.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Ask.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Center.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Confirm.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Options.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Print.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Run.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/ConsoleError.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Stream/FileHandle+Stream.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Stream/Pipe+Stream.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Stream/Stream.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/ConsoleColor+Terminal.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/ConsoleStyle+Terminal.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/String+ANSI.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/Terminal+Command.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/Terminal.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Utilities/Bool+Polymorphic.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Utilities/String+Trim.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Loading/Console+LoadingBar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Loading/LoadingBar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Progress/Console+ProgressBar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Progress/ProgressBar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Clear/ConsoleClear.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Color/ConsoleColor.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Style/Console+ConsoleStyle.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Style/ConsoleStyle.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Polymorphic.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Core.swiftmodule
/Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Console.build/Group~partial.swiftmodule : /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Bar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Argument.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Command+Print.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Command.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Group.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Option.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Runnable.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Value.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Ask.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Center.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Confirm.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Options.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Print.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Run.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/ConsoleError.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Stream/FileHandle+Stream.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Stream/Pipe+Stream.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Stream/Stream.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/ConsoleColor+Terminal.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/ConsoleStyle+Terminal.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/String+ANSI.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/Terminal+Command.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/Terminal.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Utilities/Bool+Polymorphic.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Utilities/String+Trim.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Loading/Console+LoadingBar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Loading/LoadingBar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Progress/Console+ProgressBar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Progress/ProgressBar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Clear/ConsoleClear.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Color/ConsoleColor.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Style/Console+ConsoleStyle.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Style/ConsoleStyle.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Polymorphic.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Core.swiftmodule
/Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Console.build/Group~partial.swiftdoc : /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Bar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Argument.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Command+Print.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Command.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Group.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Option.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Runnable.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Command/Value.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Ask.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Center.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Confirm.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Options.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Print.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console+Run.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Console.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/ConsoleError.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Stream/FileHandle+Stream.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Stream/Pipe+Stream.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Stream/Stream.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/ConsoleColor+Terminal.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/ConsoleStyle+Terminal.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/String+ANSI.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/Terminal+Command.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Terminal/Terminal.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Utilities/Bool+Polymorphic.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Utilities/String+Trim.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Loading/Console+LoadingBar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Loading/LoadingBar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Progress/Console+ProgressBar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Bar/Progress/ProgressBar.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Clear/ConsoleClear.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Color/ConsoleColor.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Style/Console+ConsoleStyle.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Console-1.0.1/Sources/Console/Console/Style/ConsoleStyle.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Polymorphic.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Core.swiftmodule
| D |
// Written in the D programming language.
/**
This module defines the notion of a range. Ranges generalize the concept of
arrays, lists, or anything that involves sequential access. This abstraction
enables the same set of algorithms (see $(MREF std, algorithm)) to be used
with a vast variety of different concrete types. For example,
a linear search algorithm such as $(REF find, std, algorithm, searching)
works not just for arrays, but for linked-lists, input files,
incoming network data, etc.
Guides:
There are many articles available that can bolster understanding ranges:
$(UL
$(LI Ali Çehreli's $(HTTP ddili.org/ders/d.en/ranges.html, tutorial on ranges)
for the basics of working with and creating range-based code.)
$(LI Jonathan M. Davis $(LINK2 http://dconf.org/2015/talks/davis.html, $(I Introduction to Ranges))
talk at DConf 2015 a vivid introduction from its core constructs to practical advice.)
$(LI The DLang Tour's $(LINK2 http://tour.dlang.org/tour/en/basics/ranges, chapter on ranges)
for an interactive introduction.)
$(LI H. S. Teoh's $(LINK2 http://wiki.dlang.org/Component_programming_with_ranges, tutorial on
component programming with ranges) for a real-world showcase of the influence
of range-based programming on complex algorithms.)
$(LI Andrei Alexandrescu's article
$(LINK2 http://www.informit.com/articles/printerfriendly.aspx?p=1407357$(AMP)rll=1,
$(I On Iteration)) for conceptual aspect of ranges and the motivation
)
)
Submodules:
This module has two submodules:
The $(MREF std, range, primitives) submodule
provides basic range functionality. It defines several templates for testing
whether a given object is a range, what kind of range it is, and provides
some common range operations.
The $(MREF std, range, interfaces) submodule
provides object-based interfaces for working with ranges via runtime
polymorphism.
The remainder of this module provides a rich set of range creation and
composition templates that let you construct new ranges out of existing ranges:
$(SCRIPT inhibitQuickIndex = 1;)
$(DIVC quickindex,
$(BOOKTABLE ,
$(TR $(TD $(LREF chain))
$(TD Concatenates several ranges into a single range.
))
$(TR $(TD $(LREF choose))
$(TD Chooses one of two ranges at runtime based on a boolean condition.
))
$(TR $(TD $(LREF chooseAmong))
$(TD Chooses one of several ranges at runtime based on an index.
))
$(TR $(TD $(LREF chunks))
$(TD Creates a range that returns fixed-size chunks of the original
range.
))
$(TR $(TD $(LREF cycle))
$(TD Creates an infinite range that repeats the given forward range
indefinitely. Good for implementing circular buffers.
))
$(TR $(TD $(LREF drop))
$(TD Creates the range that results from discarding the first $(I n)
elements from the given range.
))
$(TR $(TD $(LREF dropBack))
$(TD Creates the range that results from discarding the last $(I n)
elements from the given range.
))
$(TR $(TD $(LREF dropExactly))
$(TD Creates the range that results from discarding exactly $(I n)
of the first elements from the given range.
))
$(TR $(TD $(LREF dropBackExactly))
$(TD Creates the range that results from discarding exactly $(I n)
of the last elements from the given range.
))
$(TR $(TD $(LREF dropOne))
$(TD Creates the range that results from discarding
the first element from the given range.
))
$(TR $(TD $(D $(LREF dropBackOne)))
$(TD Creates the range that results from discarding
the last element from the given range.
))
$(TR $(TD $(LREF enumerate))
$(TD Iterates a range with an attached index variable.
))
$(TR $(TD $(LREF evenChunks))
$(TD Creates a range that returns a number of chunks of
approximately equal length from the original range.
))
$(TR $(TD $(LREF frontTransversal))
$(TD Creates a range that iterates over the first elements of the
given ranges.
))
$(TR $(TD $(LREF generate))
$(TD Creates a range by successive calls to a given function. This
allows to create ranges as a single delegate.
))
$(TR $(TD $(LREF indexed))
$(TD Creates a range that offers a view of a given range as though
its elements were reordered according to a given range of indices.
))
$(TR $(TD $(LREF iota))
$(TD Creates a range consisting of numbers between a starting point
and ending point, spaced apart by a given interval.
))
$(TR $(TD $(LREF lockstep))
$(TD Iterates $(I n) ranges in lockstep, for use in a `foreach`
loop. Similar to `zip`, except that `lockstep` is designed
especially for `foreach` loops.
))
$(TR $(TD $(LREF nullSink))
$(TD An output range that discards the data it receives.
))
$(TR $(TD $(LREF only))
$(TD Creates a range that iterates over the given arguments.
))
$(TR $(TD $(LREF padLeft))
$(TD Pads a range to a specified length by adding a given element to
the front of the range. Is lazy if the range has a known length.
))
$(TR $(TD $(LREF padRight))
$(TD Lazily pads a range to a specified length by adding a given element to
the back of the range.
))
$(TR $(TD $(LREF radial))
$(TD Given a random-access range and a starting point, creates a
range that alternately returns the next left and next right element to
the starting point.
))
$(TR $(TD $(LREF recurrence))
$(TD Creates a forward range whose values are defined by a
mathematical recurrence relation.
))
$(TR $(TD $(LREF refRange))
$(TD Pass a range by reference. Both the original range and the RefRange
will always have the exact same elements.
Any operation done on one will affect the other.
))
$(TR $(TD $(LREF repeat))
$(TD Creates a range that consists of a single element repeated $(I n)
times, or an infinite range repeating that element indefinitely.
))
$(TR $(TD $(LREF retro))
$(TD Iterates a bidirectional range backwards.
))
$(TR $(TD $(LREF roundRobin))
$(TD Given $(I n) ranges, creates a new range that return the $(I n)
first elements of each range, in turn, then the second element of each
range, and so on, in a round-robin fashion.
))
$(TR $(TD $(LREF sequence))
$(TD Similar to `recurrence`, except that a random-access range is
created.
))
$(TR $(TD $(D $(LREF slide)))
$(TD Creates a range that returns a fixed-size sliding window
over the original range. Unlike chunks,
it advances a configurable number of items at a time,
not one chunk at a time.
))
$(TR $(TD $(LREF stride))
$(TD Iterates a range with stride $(I n).
))
$(TR $(TD $(LREF tail))
$(TD Return a range advanced to within `n` elements of the end of
the given range.
))
$(TR $(TD $(LREF take))
$(TD Creates a sub-range consisting of only up to the first $(I n)
elements of the given range.
))
$(TR $(TD $(LREF takeExactly))
$(TD Like `take`, but assumes the given range actually has $(I n)
elements, and therefore also defines the `length` property.
))
$(TR $(TD $(LREF takeNone))
$(TD Creates a random-access range consisting of zero elements of the
given range.
))
$(TR $(TD $(LREF takeOne))
$(TD Creates a random-access range consisting of exactly the first
element of the given range.
))
$(TR $(TD $(LREF tee))
$(TD Creates a range that wraps a given range, forwarding along
its elements while also calling a provided function with each element.
))
$(TR $(TD $(LREF transposed))
$(TD Transposes a range of ranges.
))
$(TR $(TD $(LREF transversal))
$(TD Creates a range that iterates over the $(I n)'th elements of the
given random-access ranges.
))
$(TR $(TD $(LREF zip))
$(TD Given $(I n) ranges, creates a range that successively returns a
tuple of all the first elements, a tuple of all the second elements,
etc.
))
))
Sortedness:
Ranges whose elements are sorted afford better efficiency with certain
operations. For this, the $(LREF assumeSorted) function can be used to
construct a $(LREF SortedRange) from a pre-sorted range. The $(REF
sort, std, algorithm, sorting) function also conveniently
returns a $(LREF SortedRange). $(LREF SortedRange) objects provide some additional
range operations that take advantage of the fact that the range is sorted.
Source: $(PHOBOSSRC std/range/package.d)
License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(HTTP erdani.com, Andrei Alexandrescu), David Simcha,
$(HTTP jmdavisprog.com, Jonathan M Davis), and Jack Stouffer. Credit
for some of the ideas in building this module goes to
$(HTTP fantascienza.net/leonardo/so/, Leonardo Maffi).
*/
module std.range;
public import std.array;
public import std.range.interfaces;
public import std.range.primitives;
public import std.typecons : Flag, Yes, No;
import std.internal.attributes : betterC;
import std.meta : allSatisfy, staticMap;
import std.traits : CommonType, isCallable, isFloatingPoint, isIntegral,
isPointer, isSomeFunction, isStaticArray, Unqual, isInstanceOf;
/**
Iterates a bidirectional range backwards. The original range can be
accessed by using the `source` property. Applying retro twice to
the same range yields the original range.
Params:
r = the bidirectional range to iterate backwards
Returns:
A bidirectional range with length if `r` also provides a length. Or,
if `r` is a random access range, then the return value will be random
access as well.
See_Also:
$(REF reverse, std,algorithm,mutation) for mutating the source range directly.
*/
auto retro(Range)(Range r)
if (isBidirectionalRange!(Unqual!Range))
{
// Check for retro(retro(r)) and just return r in that case
static if (is(typeof(retro(r.source)) == Range))
{
return r.source;
}
else
{
static struct Result()
{
private alias R = Unqual!Range;
// User code can get and set source, too
R source;
static if (hasLength!R)
{
size_t retroIndex(size_t n)
{
return source.length - n - 1;
}
}
public:
alias Source = R;
@property bool empty() { return source.empty; }
@property auto save()
{
return Result(source.save);
}
@property auto ref front() { return source.back; }
void popFront() { source.popBack(); }
@property auto ref back() { return source.front; }
void popBack() { source.popFront(); }
static if (is(typeof(source.moveBack())))
{
ElementType!R moveFront()
{
return source.moveBack();
}
}
static if (is(typeof(source.moveFront())))
{
ElementType!R moveBack()
{
return source.moveFront();
}
}
static if (hasAssignableElements!R)
{
@property void front(ElementType!R val)
{
source.back = val;
}
@property void back(ElementType!R val)
{
source.front = val;
}
}
static if (isRandomAccessRange!(R) && hasLength!(R))
{
auto ref opIndex(size_t n) { return source[retroIndex(n)]; }
static if (hasAssignableElements!R)
{
void opIndexAssign(ElementType!R val, size_t n)
{
source[retroIndex(n)] = val;
}
}
static if (is(typeof(source.moveAt(0))))
{
ElementType!R moveAt(size_t index)
{
return source.moveAt(retroIndex(index));
}
}
static if (hasSlicing!R)
typeof(this) opSlice(size_t a, size_t b)
{
return typeof(this)(source[source.length - b .. source.length - a]);
}
}
mixin ImplementLength!source;
}
return Result!()(r);
}
}
///
pure @safe nothrow @nogc unittest
{
import std.algorithm.comparison : equal;
int[5] a = [ 1, 2, 3, 4, 5 ];
int[5] b = [ 5, 4, 3, 2, 1 ];
assert(equal(retro(a[]), b[]));
assert(retro(a[]).source is a[]);
assert(retro(retro(a[])) is a[]);
}
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
static assert(isBidirectionalRange!(typeof(retro("hello"))));
int[] a;
static assert(is(typeof(a) == typeof(retro(retro(a)))));
assert(retro(retro(a)) is a);
static assert(isRandomAccessRange!(typeof(retro([1, 2, 3]))));
void test(int[] input, int[] witness)
{
auto r = retro(input);
assert(r.front == witness.front);
assert(r.back == witness.back);
assert(equal(r, witness));
}
test([ 1 ], [ 1 ]);
test([ 1, 2 ], [ 2, 1 ]);
test([ 1, 2, 3 ], [ 3, 2, 1 ]);
test([ 1, 2, 3, 4 ], [ 4, 3, 2, 1 ]);
test([ 1, 2, 3, 4, 5 ], [ 5, 4, 3, 2, 1 ]);
test([ 1, 2, 3, 4, 5, 6 ], [ 6, 5, 4, 3, 2, 1 ]);
immutable foo = [1,2,3].idup;
auto r = retro(foo);
assert(equal(r, [3, 2, 1]));
}
pure @safe nothrow unittest
{
import std.internal.test.dummyrange : AllDummyRanges, propagatesRangeType,
ReturnBy;
foreach (DummyType; AllDummyRanges)
{
static if (!isBidirectionalRange!DummyType)
{
static assert(!__traits(compiles, Retro!DummyType));
}
else
{
DummyType dummyRange;
dummyRange.reinit();
auto myRetro = retro(dummyRange);
static assert(propagatesRangeType!(typeof(myRetro), DummyType));
assert(myRetro.front == 10);
assert(myRetro.back == 1);
assert(myRetro.moveFront() == 10);
assert(myRetro.moveBack() == 1);
static if (isRandomAccessRange!DummyType && hasLength!DummyType)
{
assert(myRetro[0] == myRetro.front);
assert(myRetro.moveAt(2) == 8);
static if (DummyType.r == ReturnBy.Reference)
{
{
myRetro[9]++;
scope(exit) myRetro[9]--;
assert(dummyRange[0] == 2);
myRetro.front++;
scope(exit) myRetro.front--;
assert(myRetro.front == 11);
myRetro.back++;
scope(exit) myRetro.back--;
assert(myRetro.back == 3);
}
{
myRetro.front = 0xFF;
scope(exit) myRetro.front = 10;
assert(dummyRange.back == 0xFF);
myRetro.back = 0xBB;
scope(exit) myRetro.back = 1;
assert(dummyRange.front == 0xBB);
myRetro[1] = 11;
scope(exit) myRetro[1] = 8;
assert(dummyRange[8] == 11);
}
}
}
}
}
}
pure @safe nothrow @nogc unittest
{
import std.algorithm.comparison : equal;
auto LL = iota(1L, 4L);
auto r = retro(LL);
long[3] excepted = [3, 2, 1];
assert(equal(r, excepted[]));
}
// https://issues.dlang.org/show_bug.cgi?id=12662
pure @safe nothrow @nogc unittest
{
int[3] src = [1,2,3];
int[] data = src[];
foreach_reverse (x; data) {}
foreach (x; data.retro) {}
}
/**
Iterates range `r` with stride `n`. If the range is a
random-access range, moves by indexing into the range; otherwise,
moves by successive calls to `popFront`. Applying stride twice to
the same range results in a stride with a step that is the
product of the two applications. It is an error for `n` to be 0.
Params:
r = the $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to stride over
n = the number of elements to skip over
Returns:
At minimum, an input range. The resulting range will adopt the
range primitives of the underlying range as long as
$(REF hasLength, std,range,primitives) is `true`.
*/
auto stride(Range)(Range r, size_t n)
if (isInputRange!(Unqual!Range))
in
{
assert(n != 0, "stride cannot have step zero.");
}
do
{
import std.algorithm.comparison : min;
static if (is(typeof(stride(r.source, n)) == Range))
{
// stride(stride(r, n1), n2) is stride(r, n1 * n2)
return stride(r.source, r._n * n);
}
else
{
static struct Result
{
private alias R = Unqual!Range;
public R source;
private size_t _n;
// Chop off the slack elements at the end
static if (hasLength!R &&
(isRandomAccessRange!R && hasSlicing!R
|| isBidirectionalRange!R))
private void eliminateSlackElements()
{
auto slack = source.length % _n;
if (slack)
{
slack--;
}
else if (!source.empty)
{
slack = min(_n, source.length) - 1;
}
else
{
slack = 0;
}
if (!slack) return;
static if (isRandomAccessRange!R && hasLength!R && hasSlicing!R)
{
source = source[0 .. source.length - slack];
}
else static if (isBidirectionalRange!R)
{
foreach (i; 0 .. slack)
{
source.popBack();
}
}
}
static if (isForwardRange!R)
{
@property auto save()
{
return Result(source.save, _n);
}
}
static if (isInfinite!R)
{
enum bool empty = false;
}
else
{
@property bool empty()
{
return source.empty;
}
}
@property auto ref front()
{
return source.front;
}
static if (is(typeof(.moveFront(source))))
{
ElementType!R moveFront()
{
return source.moveFront();
}
}
static if (hasAssignableElements!R)
{
@property void front(ElementType!R val)
{
source.front = val;
}
}
void popFront()
{
source.popFrontN(_n);
}
static if (isBidirectionalRange!R && hasLength!R)
{
void popBack()
{
popBackN(source, _n);
}
@property auto ref back()
{
eliminateSlackElements();
return source.back;
}
static if (is(typeof(.moveBack(source))))
{
ElementType!R moveBack()
{
eliminateSlackElements();
return source.moveBack();
}
}
static if (hasAssignableElements!R)
{
@property void back(ElementType!R val)
{
eliminateSlackElements();
source.back = val;
}
}
}
static if (isRandomAccessRange!R && hasLength!R)
{
auto ref opIndex(size_t n)
{
return source[_n * n];
}
/**
Forwards to $(D moveAt(source, n)).
*/
static if (is(typeof(source.moveAt(0))))
{
ElementType!R moveAt(size_t n)
{
return source.moveAt(_n * n);
}
}
static if (hasAssignableElements!R)
{
void opIndexAssign(ElementType!R val, size_t n)
{
source[_n * n] = val;
}
}
}
static if (hasSlicing!R && hasLength!R)
typeof(this) opSlice(size_t lower, size_t upper)
{
assert(upper >= lower && upper <= length);
immutable translatedUpper = (upper == 0) ? 0 :
(upper * _n - (_n - 1));
immutable translatedLower = min(lower * _n, translatedUpper);
assert(translatedLower <= translatedUpper);
return typeof(this)(source[translatedLower .. translatedUpper], _n);
}
static if (hasLength!R)
{
@property auto length()
{
return (source.length + _n - 1) / _n;
}
alias opDollar = length;
}
}
return Result(r, n);
}
}
///
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
int[] a = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ];
assert(equal(stride(a, 3), [ 1, 4, 7, 10 ][]));
assert(stride(stride(a, 2), 3) == stride(a, 6));
}
pure @safe nothrow @nogc unittest
{
import std.algorithm.comparison : equal;
int[4] testArr = [1,2,3,4];
static immutable result = [1, 3];
assert(equal(testArr[].stride(2), result));
}
debug pure nothrow @system unittest
{//check the contract
int[4] testArr = [1,2,3,4];
bool passed = false;
scope (success) assert(passed);
import core.exception : AssertError;
//std.exception.assertThrown won't do because it can't infer nothrow
// https://issues.dlang.org/show_bug.cgi?id=12647
try
{
auto unused = testArr[].stride(0);
}
catch (AssertError unused)
{
passed = true;
}
}
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : AllDummyRanges, propagatesRangeType,
ReturnBy;
static assert(isRandomAccessRange!(typeof(stride([1, 2, 3], 2))));
void test(size_t n, int[] input, int[] witness)
{
assert(equal(stride(input, n), witness));
}
test(1, [], []);
int[] arr = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
assert(stride(stride(arr, 2), 3) is stride(arr, 6));
test(1, arr, arr);
test(2, arr, [1, 3, 5, 7, 9]);
test(3, arr, [1, 4, 7, 10]);
test(4, arr, [1, 5, 9]);
// Test slicing.
auto s1 = stride(arr, 1);
assert(equal(s1[1 .. 4], [2, 3, 4]));
assert(s1[1 .. 4].length == 3);
assert(equal(s1[1 .. 5], [2, 3, 4, 5]));
assert(s1[1 .. 5].length == 4);
assert(s1[0 .. 0].empty);
assert(s1[3 .. 3].empty);
// assert(s1[$ .. $].empty);
assert(s1[s1.opDollar .. s1.opDollar].empty);
auto s2 = stride(arr, 2);
assert(equal(s2[0 .. 2], [1,3]));
assert(s2[0 .. 2].length == 2);
assert(equal(s2[1 .. 5], [3, 5, 7, 9]));
assert(s2[1 .. 5].length == 4);
assert(s2[0 .. 0].empty);
assert(s2[3 .. 3].empty);
// assert(s2[$ .. $].empty);
assert(s2[s2.opDollar .. s2.opDollar].empty);
// Test fix for https://issues.dlang.org/show_bug.cgi?id=5035
auto m = [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]; // 3 rows, 4 columns
auto col = stride(m, 4);
assert(equal(col, [1, 1, 1]));
assert(equal(retro(col), [1, 1, 1]));
immutable int[] immi = [ 1, 2, 3 ];
static assert(isRandomAccessRange!(typeof(stride(immi, 1))));
// Check for infiniteness propagation.
static assert(isInfinite!(typeof(stride(repeat(1), 3))));
foreach (DummyType; AllDummyRanges)
{
DummyType dummyRange;
dummyRange.reinit();
auto myStride = stride(dummyRange, 4);
// Should fail if no length and bidirectional b/c there's no way
// to know how much slack we have.
static if (hasLength!DummyType || !isBidirectionalRange!DummyType)
{
static assert(propagatesRangeType!(typeof(myStride), DummyType));
}
assert(myStride.front == 1);
assert(myStride.moveFront() == 1);
assert(equal(myStride, [1, 5, 9]));
static if (hasLength!DummyType)
{
assert(myStride.length == 3);
}
static if (isBidirectionalRange!DummyType && hasLength!DummyType)
{
assert(myStride.back == 9);
assert(myStride.moveBack() == 9);
}
static if (isRandomAccessRange!DummyType && hasLength!DummyType)
{
assert(myStride[0] == 1);
assert(myStride[1] == 5);
assert(myStride.moveAt(1) == 5);
assert(myStride[2] == 9);
static assert(hasSlicing!(typeof(myStride)));
}
static if (DummyType.r == ReturnBy.Reference)
{
// Make sure reference is propagated.
{
myStride.front++;
scope(exit) myStride.front--;
assert(dummyRange.front == 2);
}
{
myStride.front = 4;
scope(exit) myStride.front = 1;
assert(dummyRange.front == 4);
}
static if (isBidirectionalRange!DummyType && hasLength!DummyType)
{
{
myStride.back++;
scope(exit) myStride.back--;
assert(myStride.back == 10);
}
{
myStride.back = 111;
scope(exit) myStride.back = 9;
assert(myStride.back == 111);
}
static if (isRandomAccessRange!DummyType)
{
{
myStride[1]++;
scope(exit) myStride[1]--;
assert(dummyRange[4] == 6);
}
{
myStride[1] = 55;
scope(exit) myStride[1] = 5;
assert(dummyRange[4] == 55);
}
}
}
}
}
}
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
auto LL = iota(1L, 10L);
auto s = stride(LL, 3);
assert(equal(s, [1L, 4L, 7L]));
}
/**
Spans multiple ranges in sequence. The function `chain` takes any
number of ranges and returns a $(D Chain!(R1, R2,...)) object. The
ranges may be different, but they must have the same element type. The
result is a range that offers the `front`, `popFront`, and $(D
empty) primitives. If all input ranges offer random access and $(D
length), `Chain` offers them as well.
If only one range is offered to `Chain` or `chain`, the $(D
Chain) type exits the picture by aliasing itself directly to that
range's type.
Params:
rs = the $(REF_ALTTEXT input ranges, isInputRange, std,range,primitives) to chain together
Returns:
An input range at minimum. If all of the ranges in `rs` provide
a range primitive, the returned range will also provide that range
primitive.
See_Also: $(LREF only) to chain values to a range
*/
auto chain(Ranges...)(Ranges rs)
if (Ranges.length > 0 &&
allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) &&
!is(CommonType!(staticMap!(ElementType, staticMap!(Unqual, Ranges))) == void))
{
static if (Ranges.length == 1)
{
return rs[0];
}
else
{
static struct Result
{
private:
alias R = staticMap!(Unqual, Ranges);
alias RvalueElementType = CommonType!(staticMap!(.ElementType, R));
private template sameET(A)
{
enum sameET = is(.ElementType!A == RvalueElementType);
}
enum bool allSameType = allSatisfy!(sameET, R);
alias ElementType = RvalueElementType;
static if (allSameType && allSatisfy!(hasLvalueElements, R))
{
static ref RvalueElementType fixRef(ref RvalueElementType val)
{
return val;
}
}
else
{
static RvalueElementType fixRef(RvalueElementType val)
{
return val;
}
}
// This is the entire state
R source;
// TODO: use a vtable (or more) instead of linear iteration
public:
this(R input)
{
foreach (i, v; input)
{
source[i] = v;
}
}
import std.meta : anySatisfy;
static if (anySatisfy!(isInfinite, R))
{
// Propagate infiniteness.
enum bool empty = false;
}
else
{
@property bool empty()
{
foreach (i, Unused; R)
{
if (!source[i].empty) return false;
}
return true;
}
}
static if (allSatisfy!(isForwardRange, R))
@property auto save()
{
auto saveSource(size_t len)()
{
import std.typecons : tuple;
static assert(len > 0);
static if (len == 1)
{
return tuple(source[0].save);
}
else
{
return saveSource!(len - 1)() ~
tuple(source[len - 1].save);
}
}
return Result(saveSource!(R.length).expand);
}
void popFront()
{
foreach (i, Unused; R)
{
if (source[i].empty) continue;
source[i].popFront();
return;
}
}
@property auto ref front()
{
foreach (i, Unused; R)
{
if (source[i].empty) continue;
return fixRef(source[i].front);
}
assert(false);
}
static if (allSameType && allSatisfy!(hasAssignableElements, R))
{
// @@@BUG@@@
//@property void front(T)(T v) if (is(T : RvalueElementType))
@property void front(RvalueElementType v)
{
foreach (i, Unused; R)
{
if (source[i].empty) continue;
source[i].front = v;
return;
}
assert(false);
}
}
static if (allSatisfy!(hasMobileElements, R))
{
RvalueElementType moveFront()
{
foreach (i, Unused; R)
{
if (source[i].empty) continue;
return source[i].moveFront();
}
assert(false);
}
}
static if (allSatisfy!(isBidirectionalRange, R))
{
@property auto ref back()
{
foreach_reverse (i, Unused; R)
{
if (source[i].empty) continue;
return fixRef(source[i].back);
}
assert(false);
}
void popBack()
{
foreach_reverse (i, Unused; R)
{
if (source[i].empty) continue;
source[i].popBack();
return;
}
}
static if (allSatisfy!(hasMobileElements, R))
{
RvalueElementType moveBack()
{
foreach_reverse (i, Unused; R)
{
if (source[i].empty) continue;
return source[i].moveBack();
}
assert(false);
}
}
static if (allSameType && allSatisfy!(hasAssignableElements, R))
{
@property void back(RvalueElementType v)
{
foreach_reverse (i, Unused; R)
{
if (source[i].empty) continue;
source[i].back = v;
return;
}
assert(false);
}
}
}
static if (allSatisfy!(hasLength, R))
{
@property size_t length()
{
size_t result;
foreach (i, Unused; R)
{
result += source[i].length;
}
return result;
}
alias opDollar = length;
}
static if (allSatisfy!(isRandomAccessRange, R))
{
auto ref opIndex(size_t index)
{
foreach (i, Range; R)
{
static if (isInfinite!(Range))
{
return source[i][index];
}
else
{
immutable length = source[i].length;
if (index < length) return fixRef(source[i][index]);
index -= length;
}
}
assert(false);
}
static if (allSatisfy!(hasMobileElements, R))
{
RvalueElementType moveAt(size_t index)
{
foreach (i, Range; R)
{
static if (isInfinite!(Range))
{
return source[i].moveAt(index);
}
else
{
immutable length = source[i].length;
if (index < length) return source[i].moveAt(index);
index -= length;
}
}
assert(false);
}
}
static if (allSameType && allSatisfy!(hasAssignableElements, R))
void opIndexAssign(ElementType v, size_t index)
{
foreach (i, Range; R)
{
static if (isInfinite!(Range))
{
source[i][index] = v;
}
else
{
immutable length = source[i].length;
if (index < length)
{
source[i][index] = v;
return;
}
index -= length;
}
}
assert(false);
}
}
static if (allSatisfy!(hasLength, R) && allSatisfy!(hasSlicing, R))
auto opSlice(size_t begin, size_t end) return scope
{
auto result = this;
foreach (i, Unused; R)
{
immutable len = result.source[i].length;
if (len < begin)
{
result.source[i] = result.source[i]
[len .. len];
begin -= len;
}
else
{
result.source[i] = result.source[i]
[begin .. len];
break;
}
}
auto cut = length;
cut = cut <= end ? 0 : cut - end;
foreach_reverse (i, Unused; R)
{
immutable len = result.source[i].length;
if (cut > len)
{
result.source[i] = result.source[i]
[0 .. 0];
cut -= len;
}
else
{
result.source[i] = result.source[i]
[0 .. len - cut];
break;
}
}
return result;
}
}
return Result(rs);
}
}
///
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
int[] arr1 = [ 1, 2, 3, 4 ];
int[] arr2 = [ 5, 6 ];
int[] arr3 = [ 7 ];
auto s = chain(arr1, arr2, arr3);
assert(s.length == 7);
assert(s[5] == 6);
assert(equal(s, [1, 2, 3, 4, 5, 6, 7][]));
}
/**
* Range primitives are carried over to the returned range if
* all of the ranges provide them
*/
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.sorting : sort;
int[] arr1 = [5, 2, 8];
int[] arr2 = [3, 7, 9];
int[] arr3 = [1, 4, 6];
// in-place sorting across all of the arrays
auto s = arr1.chain(arr2, arr3).sort;
assert(s.equal([1, 2, 3, 4, 5, 6, 7, 8, 9]));
assert(arr1.equal([1, 2, 3]));
assert(arr2.equal([4, 5, 6]));
assert(arr3.equal([7, 8, 9]));
}
/**
Due to safe type promotion in D, chaining together different
character ranges results in a `uint` range.
Use $(REF_ALTTEXT byChar, byChar,std,utf), $(REF_ALTTEXT byWchar, byWchar,std,utf),
and $(REF_ALTTEXT byDchar, byDchar,std,utf) on the ranges
to get the type you need.
*/
pure @safe nothrow unittest
{
import std.utf : byChar, byCodeUnit;
auto s1 = "string one";
auto s2 = "string two";
// s1 and s2 front is dchar because of auto-decoding
static assert(is(typeof(s1.front) == dchar) && is(typeof(s2.front) == dchar));
auto r1 = s1.chain(s2);
// chains of ranges of the same character type give that same type
static assert(is(typeof(r1.front) == dchar));
auto s3 = "string three".byCodeUnit;
static assert(is(typeof(s3.front) == immutable char));
auto r2 = s1.chain(s3);
// chaining ranges of mixed character types gives `dchar`
static assert(is(typeof(r2.front) == dchar));
// use byChar on character ranges to correctly convert them to UTF-8
auto r3 = s1.byChar.chain(s3);
static assert(is(typeof(r3.front) == immutable char));
}
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : AllDummyRanges, dummyLength,
propagatesRangeType;
{
int[] arr1 = [ 1, 2, 3, 4 ];
int[] arr2 = [ 5, 6 ];
int[] arr3 = [ 7 ];
int[] witness = [ 1, 2, 3, 4, 5, 6, 7 ];
auto s1 = chain(arr1);
static assert(isRandomAccessRange!(typeof(s1)));
auto s2 = chain(arr1, arr2);
static assert(isBidirectionalRange!(typeof(s2)));
static assert(isRandomAccessRange!(typeof(s2)));
s2.front = 1;
auto s = chain(arr1, arr2, arr3);
assert(s[5] == 6);
assert(equal(s, witness));
assert(s[5] == 6);
}
{
int[] arr1 = [ 1, 2, 3, 4 ];
int[] witness = [ 1, 2, 3, 4 ];
assert(equal(chain(arr1), witness));
}
{
uint[] foo = [1,2,3,4,5];
uint[] bar = [1,2,3,4,5];
auto c = chain(foo, bar);
c[3] = 42;
assert(c[3] == 42);
assert(c.moveFront() == 1);
assert(c.moveBack() == 5);
assert(c.moveAt(4) == 5);
assert(c.moveAt(5) == 1);
}
// Make sure https://issues.dlang.org/show_bug.cgi?id=3311 is fixed.
// elements are mutable.
assert(equal(chain(iota(0, 3), iota(0, 3)), [0, 1, 2, 0, 1, 2]));
// Test the case where infinite ranges are present.
auto inf = chain([0,1,2][], cycle([4,5,6][]), [7,8,9][]); // infinite range
assert(inf[0] == 0);
assert(inf[3] == 4);
assert(inf[6] == 4);
assert(inf[7] == 5);
static assert(isInfinite!(typeof(inf)));
immutable int[] immi = [ 1, 2, 3 ];
immutable float[] immf = [ 1, 2, 3 ];
static assert(is(typeof(chain(immi, immf))));
// Check that chain at least instantiates and compiles with every possible
// pair of DummyRange types, in either order.
foreach (DummyType1; AllDummyRanges)
(){ // workaround slow optimizations for large functions
// https://issues.dlang.org/show_bug.cgi?id=2396
DummyType1 dummy1;
foreach (DummyType2; AllDummyRanges)
{
DummyType2 dummy2;
auto myChain = chain(dummy1, dummy2);
static assert(
propagatesRangeType!(typeof(myChain), DummyType1, DummyType2)
);
assert(myChain.front == 1);
foreach (i; 0 .. dummyLength)
{
myChain.popFront();
}
assert(myChain.front == 1);
static if (isBidirectionalRange!DummyType1 &&
isBidirectionalRange!DummyType2) {
assert(myChain.back == 10);
}
static if (isRandomAccessRange!DummyType1 &&
isRandomAccessRange!DummyType2) {
assert(myChain[0] == 1);
}
static if (hasLvalueElements!DummyType1 && hasLvalueElements!DummyType2)
{
static assert(hasLvalueElements!(typeof(myChain)));
}
else
{
static assert(!hasLvalueElements!(typeof(myChain)));
}
}
}();
}
pure @safe nothrow @nogc unittest
{
class Foo{}
immutable(Foo)[] a;
immutable(Foo)[] b;
assert(chain(a, b).empty);
}
// https://issues.dlang.org/show_bug.cgi?id=18657
pure @safe unittest
{
import std.algorithm.comparison : equal;
string s = "foo";
auto r = refRange(&s).chain("bar");
assert(equal(r.save, "foobar"));
assert(equal(r, "foobar"));
}
/**
Choose one of two ranges at runtime depending on a Boolean condition.
The ranges may be different, but they must have compatible element types (i.e.
`CommonType` must exist for the two element types). The result is a range
that offers the weakest capabilities of the two (e.g. `ForwardRange` if $(D
R1) is a random-access range and `R2` is a forward range).
Params:
condition = which range to choose: `r1` if `true`, `r2` otherwise
r1 = the "true" range
r2 = the "false" range
Returns:
A range type dependent on `R1` and `R2`.
*/
auto choose(R1, R2)(bool condition, return scope R1 r1, return scope R2 r2)
if (isInputRange!(Unqual!R1) && isInputRange!(Unqual!R2) &&
!is(CommonType!(ElementType!(Unqual!R1), ElementType!(Unqual!R2)) == void))
{
return ChooseResult!(R1, R2)(condition, r1, r2);
}
///
@safe nothrow pure @nogc unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filter, map;
auto data1 = only(1, 2, 3, 4).filter!(a => a != 3);
auto data2 = only(5, 6, 7, 8).map!(a => a + 1);
// choose() is primarily useful when you need to select one of two ranges
// with different types at runtime.
static assert(!is(typeof(data1) == typeof(data2)));
auto chooseRange(bool pickFirst)
{
// The returned range is a common wrapper type that can be used for
// returning or storing either range without running into a type error.
return choose(pickFirst, data1, data2);
// Simply returning the chosen range without using choose() does not
// work, because map() and filter() return different types.
//return pickFirst ? data1 : data2; // does not compile
}
auto result = chooseRange(true);
assert(result.equal(only(1, 2, 4)));
result = chooseRange(false);
assert(result.equal(only(6, 7, 8, 9)));
}
private struct ChooseResult(R1, R2)
{
import std.traits : hasElaborateCopyConstructor, hasElaborateDestructor;
private union
{
R1 r1;
R2 r2;
}
private bool r1Chosen;
private static auto ref actOnChosen(alias foo, ExtraArgs ...)(ref ChooseResult r,
auto ref ExtraArgs extraArgs)
{
if (r.r1Chosen)
{
ref get1(return ref ChooseResult r) @trusted { return r.r1; }
return foo(get1(r), extraArgs);
}
else
{
ref get2(return ref ChooseResult r) @trusted { return r.r2; }
return foo(get2(r), extraArgs);
}
}
this(bool r1Chosen, return scope R1 r1, return scope R2 r2) @trusted
{
// @trusted because of assignment of r1 and r2 which overlap each other
import core.lifetime : emplace;
// This should be the only place r1Chosen is ever assigned
// independently
this.r1Chosen = r1Chosen;
if (r1Chosen)
{
this.r2 = R2.init;
emplace(&this.r1, r1);
}
else
{
this.r1 = R1.init;
emplace(&this.r2, r2);
}
}
void opAssign(ChooseResult r)
{
static if (hasElaborateDestructor!R1 || hasElaborateDestructor!R2)
if (r1Chosen != r.r1Chosen)
{
// destroy the current item
actOnChosen!((ref r) => destroy(r))(this);
}
r1Chosen = r.r1Chosen;
if (r1Chosen)
{
ref get1(return ref ChooseResult r) @trusted { return r.r1; }
get1(this) = get1(r);
}
else
{
ref get2(return ref ChooseResult r) @trusted { return r.r2; }
get2(this) = get2(r);
}
}
// Carefully defined postblit to postblit the appropriate range
static if (hasElaborateCopyConstructor!R1
|| hasElaborateCopyConstructor!R2)
this(this)
{
actOnChosen!((ref r) {
static if (hasElaborateCopyConstructor!(typeof(r))) r.__postblit();
})(this);
}
static if (hasElaborateDestructor!R1 || hasElaborateDestructor!R2)
~this()
{
actOnChosen!((ref r) => destroy(r))(this);
}
static if (isInfinite!R1 && isInfinite!R2)
// Propagate infiniteness.
enum bool empty = false;
else
@property bool empty()
{
return actOnChosen!(r => r.empty)(this);
}
@property auto ref front()
{
static auto ref getFront(R)(ref R r) { return r.front; }
return actOnChosen!getFront(this);
}
void popFront()
{
return actOnChosen!((ref r) { r.popFront; })(this);
}
static if (isForwardRange!R1 && isForwardRange!R2)
@property auto save() return scope
{
if (r1Chosen)
{
ref R1 getR1() @trusted { return r1; }
return ChooseResult(r1Chosen, getR1.save, R2.init);
}
else
{
ref R2 getR2() @trusted { return r2; }
return ChooseResult(r1Chosen, R1.init, getR2.save);
}
}
@property void front(T)(T v)
if (is(typeof({ r1.front = v; r2.front = v; })))
{
actOnChosen!((ref r, T v) { r.front = v; })(this, v);
}
static if (hasMobileElements!R1 && hasMobileElements!R2)
auto moveFront()
{
return actOnChosen!((ref r) => r.moveFront)(this);
}
static if (isBidirectionalRange!R1 && isBidirectionalRange!R2)
{
@property auto ref back()
{
static auto ref getBack(R)(ref R r) { return r.back; }
return actOnChosen!getBack(this);
}
void popBack()
{
actOnChosen!((ref r) { r.popBack; })(this);
}
static if (hasMobileElements!R1 && hasMobileElements!R2)
auto moveBack()
{
return actOnChosen!((ref r) => r.moveBack)(this);
}
@property void back(T)(T v)
if (is(typeof({ r1.back = v; r2.back = v; })))
{
actOnChosen!((ref r, T v) { r.back = v; })(this, v);
}
}
static if (hasLength!R1 && hasLength!R2)
{
@property size_t length()
{
return actOnChosen!(r => r.length)(this);
}
alias opDollar = length;
}
static if (isRandomAccessRange!R1 && isRandomAccessRange!R2)
{
auto ref opIndex(size_t index)
{
static auto ref get(R)(ref R r, size_t index) { return r[index]; }
return actOnChosen!get(this, index);
}
static if (hasMobileElements!R1 && hasMobileElements!R2)
auto moveAt(size_t index)
{
return actOnChosen!((ref r, size_t index) => r.moveAt(index))
(this, index);
}
void opIndexAssign(T)(T v, size_t index)
if (is(typeof({ r1[1] = v; r2[1] = v; })))
{
return actOnChosen!((ref r, size_t index, T v) { r[index] = v; })
(this, index, v);
}
}
static if (hasSlicing!R1 && hasSlicing!R2)
auto opSlice(size_t begin, size_t end)
{
alias Slice1 = typeof(R1.init[0 .. 1]);
alias Slice2 = typeof(R2.init[0 .. 1]);
return actOnChosen!((r, size_t begin, size_t end) {
static if (is(typeof(r) == Slice1))
return choose(true, r[begin .. end], Slice2.init);
else
return choose(false, Slice1.init, r[begin .. end]);
})(this, begin, end);
}
}
// https://issues.dlang.org/show_bug.cgi?id=18657
pure @safe unittest
{
import std.algorithm.comparison : equal;
string s = "foo";
auto r = choose(true, refRange(&s), "bar");
assert(equal(r.save, "foo"));
assert(equal(r, "foo"));
}
@safe unittest
{
static void* p;
static struct R
{
void* q;
int front;
bool empty;
void popFront() {}
@property R save() { p = q; return this; }
// `p = q;` is only there to prevent inference of `scope return`.
}
R r;
choose(true, r, r).save;
}
// Make sure ChooseResult.save doesn't trust @system user code.
@system unittest // copy is @system
{
static struct R
{
int front;
bool empty;
void popFront() {}
this(this) @system {}
@property R save() { return R(front, empty); }
}
choose(true, R(), R()).save;
choose(true, [0], R()).save;
choose(true, R(), [0]).save;
}
@safe unittest // copy is @system
{
static struct R
{
int front;
bool empty;
void popFront() {}
this(this) @system {}
@property R save() { return R(front, empty); }
}
static assert(!__traits(compiles, choose(true, R(), R()).save));
static assert(!__traits(compiles, choose(true, [0], R()).save));
static assert(!__traits(compiles, choose(true, R(), [0]).save));
}
@system unittest // .save is @system
{
static struct R
{
int front;
bool empty;
void popFront() {}
@property R save() @system { return this; }
}
choose(true, R(), R()).save;
choose(true, [0], R()).save;
choose(true, R(), [0]).save;
}
@safe unittest // .save is @system
{
static struct R
{
int front;
bool empty;
void popFront() {}
@property R save() @system { return this; }
}
static assert(!__traits(compiles, choose(true, R(), R()).save));
static assert(!__traits(compiles, choose(true, [0], R()).save));
static assert(!__traits(compiles, choose(true, R(), [0]).save));
}
//https://issues.dlang.org/show_bug.cgi?id=19738
@safe nothrow pure @nogc unittest
{
static struct EvilRange
{
enum empty = true;
int front;
void popFront() @safe {}
auto opAssign(const ref EvilRange other)
{
*(cast(uint*) 0xcafebabe) = 0xdeadbeef;
return this;
}
}
static assert(!__traits(compiles, () @safe
{
auto c1 = choose(true, EvilRange(), EvilRange());
auto c2 = c1;
c1 = c2;
}));
}
// https://issues.dlang.org/show_bug.cgi?id=20495
@safe unittest
{
static struct KillableRange
{
int *item;
ref int front() { return *item; }
bool empty() { return *item > 10; }
void popFront() { ++(*item); }
this(this)
{
assert(item is null || cast(size_t) item > 1000);
item = new int(*item);
}
KillableRange save() { return this; }
}
auto kr = KillableRange(new int(1));
int[] x = [1,2,3,4,5]; // length is first
auto chosen = choose(true, x, kr);
auto chosen2 = chosen.save;
}
/**
Choose one of multiple ranges at runtime.
The ranges may be different, but they must have compatible element types. The
result is a range that offers the weakest capabilities of all `Ranges`.
Params:
index = which range to choose, must be less than the number of ranges
rs = two or more ranges
Returns:
The indexed range. If rs consists of only one range, the return type is an
alias of that range's type.
*/
auto chooseAmong(Ranges...)(size_t index, return scope Ranges rs)
if (Ranges.length >= 2
&& allSatisfy!(isInputRange, staticMap!(Unqual, Ranges))
&& !is(CommonType!(staticMap!(ElementType, Ranges)) == void))
{
static if (Ranges.length == 2)
return choose(index == 0, rs[0], rs[1]);
else
return choose(index == 0, rs[0], chooseAmong(index - 1, rs[1 .. $]));
}
///
@safe nothrow pure @nogc unittest
{
auto test()
{
import std.algorithm.comparison : equal;
int[4] sarr1 = [1, 2, 3, 4];
int[2] sarr2 = [5, 6];
int[1] sarr3 = [7];
auto arr1 = sarr1[];
auto arr2 = sarr2[];
auto arr3 = sarr3[];
{
auto s = chooseAmong(0, arr1, arr2, arr3);
auto t = s.save;
assert(s.length == 4);
assert(s[2] == 3);
s.popFront();
assert(equal(t, only(1, 2, 3, 4)));
}
{
auto s = chooseAmong(1, arr1, arr2, arr3);
assert(s.length == 2);
s.front = 8;
assert(equal(s, only(8, 6)));
}
{
auto s = chooseAmong(1, arr1, arr2, arr3);
assert(s.length == 2);
s[1] = 9;
assert(equal(s, only(8, 9)));
}
{
auto s = chooseAmong(1, arr2, arr1, arr3)[1 .. 3];
assert(s.length == 2);
assert(equal(s, only(2, 3)));
}
{
auto s = chooseAmong(0, arr1, arr2, arr3);
assert(s.length == 4);
assert(s.back == 4);
s.popBack();
s.back = 5;
assert(equal(s, only(1, 2, 5)));
s.back = 3;
assert(equal(s, only(1, 2, 3)));
}
{
uint[5] foo = [1, 2, 3, 4, 5];
uint[5] bar = [6, 7, 8, 9, 10];
auto c = chooseAmong(1, foo[], bar[]);
assert(c[3] == 9);
c[3] = 42;
assert(c[3] == 42);
assert(c.moveFront() == 6);
assert(c.moveBack() == 10);
assert(c.moveAt(4) == 10);
}
{
import std.range : cycle;
auto s = chooseAmong(0, cycle(arr2), cycle(arr3));
assert(isInfinite!(typeof(s)));
assert(!s.empty);
assert(s[100] == 8);
assert(s[101] == 9);
assert(s[0 .. 3].equal(only(8, 9, 8)));
}
return 0;
}
// works at runtime
auto a = test();
// and at compile time
static b = test();
}
@safe nothrow pure @nogc unittest
{
int[3] a = [1, 2, 3];
long[3] b = [4, 5, 6];
auto c = chooseAmong(0, a[], b[]);
c[0] = 42;
assert(c[0] == 42);
}
@safe nothrow pure @nogc unittest
{
static struct RefAccessRange
{
int[] r;
ref front() @property { return r[0]; }
ref back() @property { return r[$ - 1]; }
void popFront() { r = r[1 .. $]; }
void popBack() { r = r[0 .. $ - 1]; }
auto empty() @property { return r.empty; }
ref opIndex(size_t i) { return r[i]; }
auto length() @property { return r.length; }
alias opDollar = length;
auto save() { return this; }
}
static assert(isRandomAccessRange!RefAccessRange);
static assert(isRandomAccessRange!RefAccessRange);
int[4] a = [4, 3, 2, 1];
int[2] b = [6, 5];
auto c = chooseAmong(0, RefAccessRange(a[]), RefAccessRange(b[]));
void refFunc(ref int a, int target) { assert(a == target); }
refFunc(c[2], 2);
refFunc(c.front, 4);
refFunc(c.back, 1);
}
/**
$(D roundRobin(r1, r2, r3)) yields `r1.front`, then `r2.front`,
then `r3.front`, after which it pops off one element from each and
continues again from `r1`. For example, if two ranges are involved,
it alternately yields elements off the two ranges. `roundRobin`
stops after it has consumed all ranges (skipping over the ones that
finish early).
*/
auto roundRobin(Rs...)(Rs rs)
if (Rs.length > 1 && allSatisfy!(isInputRange, staticMap!(Unqual, Rs)))
{
struct Result
{
import std.conv : to;
public Rs source;
private size_t _current = size_t.max;
@property bool empty()
{
foreach (i, Unused; Rs)
{
if (!source[i].empty) return false;
}
return true;
}
@property auto ref front()
{
final switch (_current)
{
foreach (i, R; Rs)
{
case i:
assert(
!source[i].empty,
"Attempting to fetch the front of an empty roundRobin"
);
return source[i].front;
}
}
assert(0);
}
void popFront()
{
final switch (_current)
{
foreach (i, R; Rs)
{
case i:
source[i].popFront();
break;
}
}
auto next = _current == (Rs.length - 1) ? 0 : (_current + 1);
final switch (next)
{
foreach (i, R; Rs)
{
case i:
if (!source[i].empty)
{
_current = i;
return;
}
if (i == _current)
{
_current = _current.max;
return;
}
goto case (i + 1) % Rs.length;
}
}
}
static if (allSatisfy!(isForwardRange, staticMap!(Unqual, Rs)))
@property auto save()
{
auto saveSource(size_t len)()
{
import std.typecons : tuple;
static assert(len > 0);
static if (len == 1)
{
return tuple(source[0].save);
}
else
{
return saveSource!(len - 1)() ~
tuple(source[len - 1].save);
}
}
return Result(saveSource!(Rs.length).expand, _current);
}
static if (allSatisfy!(hasLength, Rs))
{
@property size_t length()
{
size_t result;
foreach (i, R; Rs)
{
result += source[i].length;
}
return result;
}
alias opDollar = length;
}
}
return Result(rs, 0);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
int[] a = [ 1, 2, 3 ];
int[] b = [ 10, 20, 30, 40 ];
auto r = roundRobin(a, b);
assert(equal(r, [ 1, 10, 2, 20, 3, 30, 40 ]));
}
/**
* roundRobin can be used to create "interleave" functionality which inserts
* an element between each element in a range.
*/
@safe unittest
{
import std.algorithm.comparison : equal;
auto interleave(R, E)(R range, E element)
if ((isInputRange!R && hasLength!R) || isForwardRange!R)
{
static if (hasLength!R)
immutable len = range.length;
else
immutable len = range.save.walkLength;
return roundRobin(
range,
element.repeat(len - 1)
);
}
assert(interleave([1, 2, 3], 0).equal([1, 0, 2, 0, 3]));
}
pure @safe unittest
{
import std.algorithm.comparison : equal;
string f = "foo", b = "bar";
auto r = roundRobin(refRange(&f), refRange(&b));
assert(equal(r.save, "fboaor"));
assert(equal(r.save, "fboaor"));
}
/**
Iterates a random-access range starting from a given point and
progressively extending left and right from that point. If no initial
point is given, iteration starts from the middle of the
range. Iteration spans the entire range.
When `startingIndex` is 0 the range will be fully iterated in order
and in reverse order when `r.length` is given.
Params:
r = a random access range with length and slicing
startingIndex = the index to begin iteration from
Returns:
A forward range with length
*/
auto radial(Range, I)(Range r, I startingIndex)
if (isRandomAccessRange!(Unqual!Range) && hasLength!(Unqual!Range) && hasSlicing!(Unqual!Range) && isIntegral!I)
{
if (startingIndex != r.length) ++startingIndex;
return roundRobin(retro(r[0 .. startingIndex]), r[startingIndex .. r.length]);
}
/// Ditto
auto radial(R)(R r)
if (isRandomAccessRange!(Unqual!R) && hasLength!(Unqual!R) && hasSlicing!(Unqual!R))
{
return .radial(r, (r.length - !r.empty) / 2);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
int[] a = [ 1, 2, 3, 4, 5 ];
assert(equal(radial(a), [ 3, 4, 2, 5, 1 ]));
a = [ 1, 2, 3, 4 ];
assert(equal(radial(a), [ 2, 3, 1, 4 ]));
// If the left end is reached first, the remaining elements on the right
// are concatenated in order:
a = [ 0, 1, 2, 3, 4, 5 ];
assert(equal(radial(a, 1), [ 1, 2, 0, 3, 4, 5 ]));
// If the right end is reached first, the remaining elements on the left
// are concatenated in reverse order:
assert(equal(radial(a, 4), [ 4, 5, 3, 2, 1, 0 ]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.conv : text;
import std.exception : enforce;
import std.internal.test.dummyrange : DummyRange, Length, RangeType, ReturnBy;
void test(int[] input, int[] witness)
{
enforce(equal(radial(input), witness),
text(radial(input), " vs. ", witness));
}
test([], []);
test([ 1 ], [ 1 ]);
test([ 1, 2 ], [ 1, 2 ]);
test([ 1, 2, 3 ], [ 2, 3, 1 ]);
test([ 1, 2, 3, 4 ], [ 2, 3, 1, 4 ]);
test([ 1, 2, 3, 4, 5 ], [ 3, 4, 2, 5, 1 ]);
test([ 1, 2, 3, 4, 5, 6 ], [ 3, 4, 2, 5, 1, 6 ]);
int[] a = [ 1, 2, 3, 4, 5 ];
assert(equal(radial(a, 1), [ 2, 3, 1, 4, 5 ]));
assert(equal(radial(a, 0), [ 1, 2, 3, 4, 5 ])); // only right subrange
assert(equal(radial(a, a.length), [ 5, 4, 3, 2, 1 ])); // only left subrange
static assert(isForwardRange!(typeof(radial(a, 1))));
auto r = radial([1,2,3,4,5]);
for (auto rr = r.save; !rr.empty; rr.popFront())
{
assert(rr.front == moveFront(rr));
}
r.front = 5;
assert(r.front == 5);
// Test instantiation without lvalue elements.
DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Random) dummy;
assert(equal(radial(dummy, 4), [5, 6, 4, 7, 3, 8, 2, 9, 1, 10]));
// immutable int[] immi = [ 1, 2 ];
// static assert(is(typeof(radial(immi))));
}
@safe unittest
{
import std.algorithm.comparison : equal;
auto LL = iota(1L, 6L);
auto r = radial(LL);
assert(equal(r, [3L, 4L, 2L, 5L, 1L]));
}
/**
Lazily takes only up to `n` elements of a range. This is
particularly useful when using with infinite ranges.
Unlike $(LREF takeExactly), `take` does not require that there
are `n` or more elements in `input`. As a consequence, length
information is not applied to the result unless `input` also has
length information.
Params:
input = an $(REF_ALTTEXT input range, isInputRange, std,range,primitives)
to iterate over up to `n` times
n = the number of elements to take
Returns:
At minimum, an input range. If the range offers random access
and `length`, `take` offers them as well.
*/
Take!R take(R)(R input, size_t n)
if (isInputRange!(Unqual!R))
{
alias U = Unqual!R;
static if (is(R T == Take!T))
{
import std.algorithm.comparison : min;
return R(input.source, min(n, input._maxAvailable));
}
else static if (!isInfinite!U && hasSlicing!U)
{
import std.algorithm.comparison : min;
return input[0 .. min(n, input.length)];
}
else
{
return Take!R(input, n);
}
}
/// ditto
struct Take(Range)
if (isInputRange!(Unqual!Range) &&
//take _cannot_ test hasSlicing on infinite ranges, because hasSlicing uses
//take for slicing infinite ranges.
!((!isInfinite!(Unqual!Range) && hasSlicing!(Unqual!Range)) || is(Range T == Take!T)))
{
private alias R = Unqual!Range;
/// User accessible in read and write
public R source;
private size_t _maxAvailable;
alias Source = R;
/// Range primitives
@property bool empty()
{
return _maxAvailable == 0 || source.empty;
}
/// ditto
@property auto ref front()
{
assert(!empty,
"Attempting to fetch the front of an empty "
~ Take.stringof);
return source.front;
}
/// ditto
void popFront()
{
assert(!empty,
"Attempting to popFront() past the end of a "
~ Take.stringof);
source.popFront();
--_maxAvailable;
}
static if (isForwardRange!R)
/// ditto
@property Take save()
{
return Take(source.save, _maxAvailable);
}
static if (hasAssignableElements!R)
/// ditto
@property void front(ElementType!R v)
{
assert(!empty,
"Attempting to assign to the front of an empty "
~ Take.stringof);
// This has to return auto instead of void because of
// https://issues.dlang.org/show_bug.cgi?id=4706
source.front = v;
}
static if (hasMobileElements!R)
{
/// ditto
auto moveFront()
{
assert(!empty,
"Attempting to move the front of an empty "
~ Take.stringof);
return source.moveFront();
}
}
static if (isInfinite!R)
{
/// ditto
@property size_t length() const
{
return _maxAvailable;
}
/// ditto
alias opDollar = length;
//Note: Due to Take/hasSlicing circular dependency,
//This needs to be a restrained template.
/// ditto
auto opSlice()(size_t i, size_t j)
if (hasSlicing!R)
{
assert(i <= j, "Invalid slice bounds");
assert(j <= length, "Attempting to slice past the end of a "
~ Take.stringof);
return source[i .. j];
}
}
else static if (hasLength!R)
{
/// ditto
@property size_t length()
{
import std.algorithm.comparison : min;
return min(_maxAvailable, source.length);
}
alias opDollar = length;
}
static if (isRandomAccessRange!R)
{
/// ditto
void popBack()
{
assert(!empty,
"Attempting to popBack() past the beginning of a "
~ Take.stringof);
--_maxAvailable;
}
/// ditto
@property auto ref back()
{
assert(!empty,
"Attempting to fetch the back of an empty "
~ Take.stringof);
return source[this.length - 1];
}
/// ditto
auto ref opIndex(size_t index)
{
assert(index < length,
"Attempting to index out of the bounds of a "
~ Take.stringof);
return source[index];
}
static if (hasAssignableElements!R)
{
/// ditto
@property void back(ElementType!R v)
{
// This has to return auto instead of void because of
// https://issues.dlang.org/show_bug.cgi?id=4706
assert(!empty,
"Attempting to assign to the back of an empty "
~ Take.stringof);
source[this.length - 1] = v;
}
/// ditto
void opIndexAssign(ElementType!R v, size_t index)
{
assert(index < length,
"Attempting to index out of the bounds of a "
~ Take.stringof);
source[index] = v;
}
}
static if (hasMobileElements!R)
{
/// ditto
auto moveBack()
{
assert(!empty,
"Attempting to move the back of an empty "
~ Take.stringof);
return source.moveAt(this.length - 1);
}
/// ditto
auto moveAt(size_t index)
{
assert(index < length,
"Attempting to index out of the bounds of a "
~ Take.stringof);
return source.moveAt(index);
}
}
}
/**
Access to maximal length of the range.
Note: the actual length of the range depends on the underlying range.
If it has fewer elements, it will stop before maxLength is reached.
*/
@property size_t maxLength() const
{
return _maxAvailable;
}
}
/// ditto
template Take(R)
if (isInputRange!(Unqual!R) &&
((!isInfinite!(Unqual!R) && hasSlicing!(Unqual!R)) || is(R T == Take!T)))
{
alias Take = R;
}
///
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
int[] arr1 = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
auto s = take(arr1, 5);
assert(s.length == 5);
assert(s[4] == 5);
assert(equal(s, [ 1, 2, 3, 4, 5 ][]));
}
/**
* If the range runs out before `n` elements, `take` simply returns the entire
* range (unlike $(LREF takeExactly), which will cause an assertion failure if
* the range ends prematurely):
*/
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
int[] arr2 = [ 1, 2, 3 ];
auto t = take(arr2, 5);
assert(t.length == 3);
assert(equal(t, [ 1, 2, 3 ]));
}
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : AllDummyRanges;
int[] arr1 = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
auto s = take(arr1, 5);
assert(s.length == 5);
assert(s[4] == 5);
assert(equal(s, [ 1, 2, 3, 4, 5 ][]));
assert(equal(retro(s), [ 5, 4, 3, 2, 1 ][]));
// Test fix for bug 4464.
static assert(is(typeof(s) == Take!(int[])));
static assert(is(typeof(s) == int[]));
// Test using narrow strings.
import std.exception : assumeWontThrow;
auto myStr = "This is a string.";
auto takeMyStr = take(myStr, 7);
assert(assumeWontThrow(equal(takeMyStr, "This is")));
// Test fix for bug 5052.
auto takeMyStrAgain = take(takeMyStr, 4);
assert(assumeWontThrow(equal(takeMyStrAgain, "This")));
static assert(is (typeof(takeMyStrAgain) == typeof(takeMyStr)));
takeMyStrAgain = take(takeMyStr, 10);
assert(assumeWontThrow(equal(takeMyStrAgain, "This is")));
foreach (DummyType; AllDummyRanges)
{
DummyType dummy;
auto t = take(dummy, 5);
alias T = typeof(t);
static if (isRandomAccessRange!DummyType)
{
static assert(isRandomAccessRange!T);
assert(t[4] == 5);
assert(moveAt(t, 1) == t[1]);
assert(t.back == moveBack(t));
}
else static if (isForwardRange!DummyType)
{
static assert(isForwardRange!T);
}
for (auto tt = t; !tt.empty; tt.popFront())
{
assert(tt.front == moveFront(tt));
}
// Bidirectional ranges can't be propagated properly if they don't
// also have random access.
assert(equal(t, [1,2,3,4,5]));
//Test that take doesn't wrap the result of take.
assert(take(t, 4) == take(dummy, 4));
}
immutable myRepeat = repeat(1);
static assert(is(Take!(typeof(myRepeat))));
}
pure @safe nothrow @nogc unittest
{
//check for correct slicing of Take on an infinite range
import std.algorithm.comparison : equal;
foreach (start; 0 .. 4)
foreach (stop; start .. 4)
assert(iota(4).cycle.take(4)[start .. stop]
.equal(iota(start, stop)));
}
pure @safe nothrow @nogc unittest
{
// Check that one can declare variables of all Take types,
// and that they match the return type of the corresponding
// take().
// See https://issues.dlang.org/show_bug.cgi?id=4464
int[] r1;
Take!(int[]) t1;
t1 = take(r1, 1);
assert(t1.empty);
string r2;
Take!string t2;
t2 = take(r2, 1);
assert(t2.empty);
Take!(Take!string) t3;
t3 = take(t2, 1);
assert(t3.empty);
}
pure @safe nothrow @nogc unittest
{
alias R1 = typeof(repeat(1));
alias R2 = typeof(cycle([1]));
alias TR1 = Take!R1;
alias TR2 = Take!R2;
static assert(isBidirectionalRange!TR1);
static assert(isBidirectionalRange!TR2);
}
// https://issues.dlang.org/show_bug.cgi?id=12731
pure @safe nothrow @nogc unittest
{
auto a = repeat(1);
auto s = a[1 .. 5];
s = s[1 .. 3];
assert(s.length == 2);
assert(s[0] == 1);
assert(s[1] == 1);
}
// https://issues.dlang.org/show_bug.cgi?id=13151
pure @safe nothrow @nogc unittest
{
import std.algorithm.comparison : equal;
auto r = take(repeat(1, 4), 3);
assert(r.take(2).equal(repeat(1, 2)));
}
/**
Similar to $(LREF take), but assumes that `range` has at least $(D
n) elements. Consequently, the result of $(D takeExactly(range, n))
always defines the `length` property (and initializes it to `n`)
even when `range` itself does not define `length`.
The result of `takeExactly` is identical to that of $(LREF take) in
cases where the original range defines `length` or is infinite.
Unlike $(LREF take), however, it is illegal to pass a range with less than
`n` elements to `takeExactly`; this will cause an assertion failure.
*/
auto takeExactly(R)(R range, size_t n)
if (isInputRange!R)
{
static if (is(typeof(takeExactly(range._input, n)) == R))
{
assert(n <= range._n,
"Attempted to take more than the length of the range with takeExactly.");
// takeExactly(takeExactly(r, n1), n2) has the same type as
// takeExactly(r, n1) and simply returns takeExactly(r, n2)
range._n = n;
return range;
}
//Also covers hasSlicing!R for finite ranges.
else static if (hasLength!R)
{
assert(n <= range.length,
"Attempted to take more than the length of the range with takeExactly.");
return take(range, n);
}
else static if (isInfinite!R)
return Take!R(range, n);
else
{
static struct Result
{
R _input;
private size_t _n;
@property bool empty() const { return !_n; }
@property auto ref front()
{
assert(_n > 0, "front() on an empty " ~ Result.stringof);
return _input.front;
}
void popFront() { _input.popFront(); --_n; }
@property size_t length() const { return _n; }
alias opDollar = length;
@property auto _takeExactly_Result_asTake()
{
return take(_input, _n);
}
alias _takeExactly_Result_asTake this;
static if (isForwardRange!R)
@property auto save()
{
return Result(_input.save, _n);
}
static if (hasMobileElements!R)
{
auto moveFront()
{
assert(!empty,
"Attempting to move the front of an empty "
~ typeof(this).stringof);
return _input.moveFront();
}
}
static if (hasAssignableElements!R)
{
@property auto ref front(ElementType!R v)
{
assert(!empty,
"Attempting to assign to the front of an empty "
~ typeof(this).stringof);
return _input.front = v;
}
}
}
return Result(range, n);
}
}
///
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
auto a = [ 1, 2, 3, 4, 5 ];
auto b = takeExactly(a, 3);
assert(equal(b, [1, 2, 3]));
static assert(is(typeof(b.length) == size_t));
assert(b.length == 3);
assert(b.front == 1);
assert(b.back == 3);
}
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filter;
auto a = [ 1, 2, 3, 4, 5 ];
auto b = takeExactly(a, 3);
assert(equal(b, [1, 2, 3]));
auto c = takeExactly(b, 2);
assert(equal(c, [1, 2]));
auto d = filter!"a > 2"(a);
auto e = takeExactly(d, 3);
assert(equal(e, [3, 4, 5]));
static assert(is(typeof(e.length) == size_t));
assert(e.length == 3);
assert(e.front == 3);
assert(equal(takeExactly(e, 3), [3, 4, 5]));
}
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : AllDummyRanges;
auto a = [ 1, 2, 3, 4, 5 ];
//Test that take and takeExactly are the same for ranges which define length
//but aren't sliceable.
struct L
{
@property auto front() { return _arr[0]; }
@property bool empty() { return _arr.empty; }
void popFront() { _arr.popFront(); }
@property size_t length() { return _arr.length; }
int[] _arr;
}
static assert(is(typeof(take(L(a), 3)) == typeof(takeExactly(L(a), 3))));
assert(take(L(a), 3) == takeExactly(L(a), 3));
//Test that take and takeExactly are the same for ranges which are sliceable.
static assert(is(typeof(take(a, 3)) == typeof(takeExactly(a, 3))));
assert(take(a, 3) == takeExactly(a, 3));
//Test that take and takeExactly are the same for infinite ranges.
auto inf = repeat(1);
static assert(is(typeof(take(inf, 5)) == Take!(typeof(inf))));
assert(take(inf, 5) == takeExactly(inf, 5));
//Test that take and takeExactly are _not_ the same for ranges which don't
//define length.
static assert(!is(typeof(take(filter!"true"(a), 3)) == typeof(takeExactly(filter!"true"(a), 3))));
foreach (DummyType; AllDummyRanges)
{
{
DummyType dummy;
auto t = takeExactly(dummy, 5);
//Test that takeExactly doesn't wrap the result of takeExactly.
assert(takeExactly(t, 4) == takeExactly(dummy, 4));
}
static if (hasMobileElements!DummyType)
{
{
auto t = takeExactly(DummyType.init, 4);
assert(t.moveFront() == 1);
assert(equal(t, [1, 2, 3, 4]));
}
}
static if (hasAssignableElements!DummyType)
{
{
auto t = takeExactly(DummyType.init, 4);
t.front = 9;
assert(equal(t, [9, 2, 3, 4]));
}
}
}
}
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : DummyRange, Length, RangeType, ReturnBy;
alias DummyType = DummyRange!(ReturnBy.Value, Length.No, RangeType.Forward);
auto te = takeExactly(DummyType(), 5);
Take!DummyType t = te;
assert(equal(t, [1, 2, 3, 4, 5]));
assert(equal(t, te));
}
// https://issues.dlang.org/show_bug.cgi?id=18092
// can't combine take and takeExactly
@safe unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : AllDummyRanges;
static foreach (Range; AllDummyRanges)
{{
Range r;
assert(r.take(6).takeExactly(2).equal([1, 2]));
assert(r.takeExactly(6).takeExactly(2).equal([1, 2]));
assert(r.takeExactly(6).take(2).equal([1, 2]));
}}
}
/**
Returns a range with at most one element; for example, $(D
takeOne([42, 43, 44])) returns a range consisting of the integer $(D
42). Calling `popFront()` off that range renders it empty.
In effect `takeOne(r)` is somewhat equivalent to $(D take(r, 1)) but in
certain interfaces it is important to know statically that the range may only
have at most one element.
The type returned by `takeOne` is a random-access range with length
regardless of `R`'s capabilities, as long as it is a forward range.
(another feature that distinguishes `takeOne` from `take`). If
(D R) is an input range but not a forward range, return type is an input
range with all random-access capabilities except save.
*/
auto takeOne(R)(R source)
if (isInputRange!R)
{
static if (hasSlicing!R)
{
return source[0 .. !source.empty];
}
else
{
static struct Result
{
private R _source;
private bool _empty = true;
@property bool empty() const { return _empty; }
@property auto ref front()
{
assert(!empty, "Attempting to fetch the front of an empty takeOne");
return _source.front;
}
void popFront()
{
assert(!empty, "Attempting to popFront an empty takeOne");
_source.popFront();
_empty = true;
}
void popBack()
{
assert(!empty, "Attempting to popBack an empty takeOne");
_source.popFront();
_empty = true;
}
static if (isForwardRange!(Unqual!R))
{
@property auto save() { return Result(_source.save, empty); }
}
@property auto ref back()
{
assert(!empty, "Attempting to fetch the back of an empty takeOne");
return _source.front;
}
@property size_t length() const { return !empty; }
alias opDollar = length;
auto ref opIndex(size_t n)
{
assert(n < length, "Attempting to index a takeOne out of bounds");
return _source.front;
}
auto opSlice(size_t m, size_t n)
{
assert(
m <= n,
"Attempting to slice a takeOne range with a larger first argument than the second."
);
assert(
n <= length,
"Attempting to slice using an out of bounds index on a takeOne range."
);
return n > m ? this : Result(_source, true);
}
// Non-standard property
@property R source() { return _source; }
}
return Result(source, source.empty);
}
}
///
pure @safe nothrow unittest
{
auto s = takeOne([42, 43, 44]);
static assert(isRandomAccessRange!(typeof(s)));
assert(s.length == 1);
assert(!s.empty);
assert(s.front == 42);
s.front = 43;
assert(s.front == 43);
assert(s.back == 43);
assert(s[0] == 43);
s.popFront();
assert(s.length == 0);
assert(s.empty);
}
pure @safe nothrow @nogc unittest
{
struct NonForwardRange
{
enum empty = false;
int front() { return 42; }
void popFront() {}
}
static assert(!isForwardRange!NonForwardRange);
auto s = takeOne(NonForwardRange());
assert(s.length == 1);
assert(!s.empty);
assert(s.front == 42);
assert(s.back == 42);
assert(s[0] == 42);
auto t = s[0 .. 0];
assert(t.empty);
assert(t.length == 0);
auto u = s[1 .. 1];
assert(u.empty);
assert(u.length == 0);
auto v = s[0 .. 1];
s.popFront();
assert(s.length == 0);
assert(s.empty);
assert(!v.empty);
assert(v.front == 42);
v.popBack();
assert(v.empty);
assert(v.length == 0);
}
pure @safe nothrow @nogc unittest
{
struct NonSlicingForwardRange
{
enum empty = false;
int front() { return 42; }
void popFront() {}
@property auto save() { return this; }
}
static assert(isForwardRange!NonSlicingForwardRange);
static assert(!hasSlicing!NonSlicingForwardRange);
auto s = takeOne(NonSlicingForwardRange());
assert(s.length == 1);
assert(!s.empty);
assert(s.front == 42);
assert(s.back == 42);
assert(s[0] == 42);
auto t = s.save;
s.popFront();
assert(s.length == 0);
assert(s.empty);
assert(!t.empty);
assert(t.front == 42);
t.popBack();
assert(t.empty);
assert(t.length == 0);
}
// Test that asserts trigger correctly
@system unittest
{
import std.exception : assertThrown;
import core.exception : AssertError;
struct NonForwardRange
{
enum empty = false;
int front() { return 42; }
void popFront() {}
}
auto s = takeOne(NonForwardRange());
assertThrown!AssertError(s[1]);
assertThrown!AssertError(s[0 .. 2]);
size_t one = 1; // Avoid style warnings triggered by literals
size_t zero = 0;
assertThrown!AssertError(s[one .. zero]);
s.popFront;
assert(s.empty);
assertThrown!AssertError(s.front);
assertThrown!AssertError(s.back);
assertThrown!AssertError(s.popFront);
assertThrown!AssertError(s.popBack);
}
// https://issues.dlang.org/show_bug.cgi?id=16999
pure @safe unittest
{
auto myIota = new class
{
int front = 0;
@safe void popFront(){front++;}
enum empty = false;
};
auto iotaPart = myIota.takeOne;
int sum;
foreach (var; chain(iotaPart, iotaPart, iotaPart))
{
sum += var;
}
assert(sum == 3);
assert(iotaPart.front == 3);
}
/++
Returns an empty range which is statically known to be empty and is
guaranteed to have `length` and be random access regardless of `R`'s
capabilities.
+/
auto takeNone(R)()
if (isInputRange!R)
{
return typeof(takeOne(R.init)).init;
}
///
pure @safe nothrow @nogc unittest
{
auto range = takeNone!(int[])();
assert(range.length == 0);
assert(range.empty);
}
pure @safe nothrow @nogc unittest
{
enum ctfe = takeNone!(int[])();
static assert(ctfe.length == 0);
static assert(ctfe.empty);
}
/++
Creates an empty range from the given range in $(BIGOH 1). If it can, it
will return the same range type. If not, it will return
$(D takeExactly(range, 0)).
+/
auto takeNone(R)(R range)
if (isInputRange!R)
{
import std.traits : isDynamicArray;
//Makes it so that calls to takeNone which don't use UFCS still work with a
//member version if it's defined.
static if (is(typeof(R.takeNone)))
auto retval = range.takeNone();
// https://issues.dlang.org/show_bug.cgi?id=8339
else static if (isDynamicArray!R)/+ ||
(is(R == struct) && __traits(compiles, {auto r = R.init;}) && R.init.empty))+/
{
auto retval = R.init;
}
//An infinite range sliced at [0 .. 0] would likely still not be empty...
else static if (hasSlicing!R && !isInfinite!R)
auto retval = range[0 .. 0];
else
auto retval = takeExactly(range, 0);
// https://issues.dlang.org/show_bug.cgi?id=7892 prevents this from being
// done in an out block.
assert(retval.empty);
return retval;
}
///
pure @safe nothrow unittest
{
import std.algorithm.iteration : filter;
assert(takeNone([42, 27, 19]).empty);
assert(takeNone("dlang.org").empty);
assert(takeNone(filter!"true"([42, 27, 19])).empty);
}
@safe unittest
{
import std.algorithm.iteration : filter;
import std.meta : AliasSeq;
struct Dummy
{
mixin template genInput()
{
@safe:
@property bool empty() { return _arr.empty; }
@property auto front() { return _arr.front; }
void popFront() { _arr.popFront(); }
static assert(isInputRange!(typeof(this)));
}
}
alias genInput = Dummy.genInput;
static struct NormalStruct
{
//Disabled to make sure that the takeExactly version is used.
@disable this();
this(int[] arr) { _arr = arr; }
mixin genInput;
int[] _arr;
}
static struct SliceStruct
{
@disable this();
this(int[] arr) { _arr = arr; }
mixin genInput;
@property auto save() { return this; }
auto opSlice(size_t i, size_t j) { return typeof(this)(_arr[i .. j]); }
@property size_t length() { return _arr.length; }
int[] _arr;
}
static struct InitStruct
{
mixin genInput;
int[] _arr;
}
static struct TakeNoneStruct
{
this(int[] arr) { _arr = arr; }
@disable this();
mixin genInput;
auto takeNone() { return typeof(this)(null); }
int[] _arr;
}
static class NormalClass
{
this(int[] arr) {_arr = arr;}
mixin genInput;
int[] _arr;
}
static class SliceClass
{
@safe:
this(int[] arr) { _arr = arr; }
mixin genInput;
@property auto save() { return new typeof(this)(_arr); }
auto opSlice(size_t i, size_t j) { return new typeof(this)(_arr[i .. j]); }
@property size_t length() { return _arr.length; }
int[] _arr;
}
static class TakeNoneClass
{
@safe:
this(int[] arr) { _arr = arr; }
mixin genInput;
auto takeNone() { return new typeof(this)(null); }
int[] _arr;
}
import std.format : format;
static foreach (range; AliasSeq!([1, 2, 3, 4, 5],
"hello world",
"hello world"w,
"hello world"d,
SliceStruct([1, 2, 3]),
// https://issues.dlang.org/show_bug.cgi?id=8339
// forces this to be takeExactly `InitStruct([1, 2, 3]),
TakeNoneStruct([1, 2, 3])))
{
static assert(takeNone(range).empty, typeof(range).stringof);
assert(takeNone(range).empty);
static assert(is(typeof(range) == typeof(takeNone(range))), typeof(range).stringof);
}
static foreach (range; AliasSeq!(NormalStruct([1, 2, 3]),
InitStruct([1, 2, 3])))
{
static assert(takeNone(range).empty, typeof(range).stringof);
assert(takeNone(range).empty);
static assert(is(typeof(takeExactly(range, 0)) == typeof(takeNone(range))), typeof(range).stringof);
}
//Don't work in CTFE.
auto normal = new NormalClass([1, 2, 3]);
assert(takeNone(normal).empty);
static assert(is(typeof(takeExactly(normal, 0)) == typeof(takeNone(normal))), typeof(normal).stringof);
auto slice = new SliceClass([1, 2, 3]);
assert(takeNone(slice).empty);
static assert(is(SliceClass == typeof(takeNone(slice))), typeof(slice).stringof);
auto taken = new TakeNoneClass([1, 2, 3]);
assert(takeNone(taken).empty);
static assert(is(TakeNoneClass == typeof(takeNone(taken))), typeof(taken).stringof);
auto filtered = filter!"true"([1, 2, 3, 4, 5]);
assert(takeNone(filtered).empty);
// https://issues.dlang.org/show_bug.cgi?id=8339 and
// https://issues.dlang.org/show_bug.cgi?id=5941 force this to be takeExactly
//static assert(is(typeof(filtered) == typeof(takeNone(filtered))), typeof(filtered).stringof);
}
/++
+ Return a range advanced to within `_n` elements of the end of
+ `range`.
+
+ Intended as the range equivalent of the Unix
+ $(HTTP en.wikipedia.org/wiki/Tail_%28Unix%29, _tail) utility. When the length
+ of `range` is less than or equal to `_n`, `range` is returned
+ as-is.
+
+ Completes in $(BIGOH 1) steps for ranges that support slicing and have
+ length. Completes in $(BIGOH range.length) time for all other ranges.
+
+ Params:
+ range = range to get _tail of
+ n = maximum number of elements to include in _tail
+
+ Returns:
+ Returns the _tail of `range` augmented with length information
+/
auto tail(Range)(Range range, size_t n)
if (isInputRange!Range && !isInfinite!Range &&
(hasLength!Range || isForwardRange!Range))
{
static if (hasLength!Range)
{
immutable length = range.length;
if (n >= length)
return range.takeExactly(length);
else
return range.drop(length - n).takeExactly(n);
}
else
{
Range scout = range.save;
foreach (immutable i; 0 .. n)
{
if (scout.empty)
return range.takeExactly(i);
scout.popFront();
}
auto tail = range.save;
while (!scout.empty)
{
assert(!tail.empty);
scout.popFront();
tail.popFront();
}
return tail.takeExactly(n);
}
}
///
pure @safe nothrow unittest
{
// tail -c n
assert([1, 2, 3].tail(1) == [3]);
assert([1, 2, 3].tail(2) == [2, 3]);
assert([1, 2, 3].tail(3) == [1, 2, 3]);
assert([1, 2, 3].tail(4) == [1, 2, 3]);
assert([1, 2, 3].tail(0).length == 0);
// tail --lines=n
import std.algorithm.comparison : equal;
import std.algorithm.iteration : joiner;
import std.exception : assumeWontThrow;
import std.string : lineSplitter;
assert("one\ntwo\nthree"
.lineSplitter
.tail(2)
.joiner("\n")
.equal("two\nthree")
.assumeWontThrow);
}
// @nogc prevented by https://issues.dlang.org/show_bug.cgi?id=15408
pure nothrow @safe /+@nogc+/ unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : AllDummyRanges, DummyRange, Length,
RangeType, ReturnBy;
static immutable cheatsheet = [6, 7, 8, 9, 10];
foreach (R; AllDummyRanges)
{
static if (isInputRange!R && !isInfinite!R &&
(hasLength!R || isForwardRange!R))
{
assert(R.init.tail(5).equal(cheatsheet));
static assert(R.init.tail(5).equal(cheatsheet));
assert(R.init.tail(0).length == 0);
assert(R.init.tail(10).equal(R.init));
assert(R.init.tail(11).equal(R.init));
}
}
// Infinite ranges are not supported
static assert(!__traits(compiles, repeat(0).tail(0)));
// Neither are non-forward ranges without length
static assert(!__traits(compiles, DummyRange!(ReturnBy.Value, Length.No,
RangeType.Input).init.tail(5)));
}
pure @safe nothrow @nogc unittest
{
static immutable input = [1, 2, 3];
static immutable expectedOutput = [2, 3];
assert(input.tail(2) == expectedOutput);
}
/++
Convenience function which calls
$(REF popFrontN, std, range, primitives)`(range, n)` and returns `range`.
`drop` makes it easier to pop elements from a range
and then pass it to another function within a single expression,
whereas `popFrontN` would require multiple statements.
`dropBack` provides the same functionality but instead calls
$(REF popBackN, std, range, primitives)`(range, n)`
Note: `drop` and `dropBack` will only pop $(I up to)
`n` elements but will stop if the range is empty first.
In other languages this is sometimes called `skip`.
Params:
range = the $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to drop from
n = the number of elements to drop
Returns:
`range` with up to `n` elements dropped
See_Also:
$(REF popFront, std, range, primitives), $(REF popBackN, std, range, primitives)
+/
R drop(R)(R range, size_t n)
if (isInputRange!R)
{
range.popFrontN(n);
return range;
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
assert([0, 2, 1, 5, 0, 3].drop(3) == [5, 0, 3]);
assert("hello world".drop(6) == "world");
assert("hello world".drop(50).empty);
assert("hello world".take(6).drop(3).equal("lo "));
}
/// ditto
R dropBack(R)(R range, size_t n)
if (isBidirectionalRange!R)
{
range.popBackN(n);
return range;
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
assert([0, 2, 1, 5, 0, 3].dropBack(3) == [0, 2, 1]);
assert("hello world".dropBack(6) == "hello");
assert("hello world".dropBack(50).empty);
assert("hello world".drop(4).dropBack(4).equal("o w"));
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.container.dlist : DList;
//Remove all but the first two elements
auto a = DList!int(0, 1, 9, 9, 9, 9);
a.remove(a[].drop(2));
assert(a[].equal(a[].take(2)));
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filter;
assert(drop("", 5).empty);
assert(equal(drop(filter!"true"([0, 2, 1, 5, 0, 3]), 3), [5, 0, 3]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.container.dlist : DList;
//insert before the last two elements
auto a = DList!int(0, 1, 2, 5, 6);
a.insertAfter(a[].dropBack(2), [3, 4]);
assert(a[].equal(iota(0, 7)));
}
/++
Similar to $(LREF drop) and `dropBack` but they call
$(D range.$(LREF popFrontExactly)(n)) and `range.popBackExactly(n)`
instead.
Note: Unlike `drop`, `dropExactly` will assume that the
range holds at least `n` elements. This makes `dropExactly`
faster than `drop`, but it also means that if `range` does
not contain at least `n` elements, it will attempt to call `popFront`
on an empty range, which is undefined behavior. So, only use
`popFrontExactly` when it is guaranteed that `range` holds at least
`n` elements.
Params:
range = the $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to drop from
n = the number of elements to drop
Returns:
`range` with `n` elements dropped
See_Also:
$(REF popFrontExcatly, std, range, primitives),
$(REF popBackExcatly, std, range, primitives)
+/
R dropExactly(R)(R range, size_t n)
if (isInputRange!R)
{
popFrontExactly(range, n);
return range;
}
/// ditto
R dropBackExactly(R)(R range, size_t n)
if (isBidirectionalRange!R)
{
popBackExactly(range, n);
return range;
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filterBidirectional;
auto a = [1, 2, 3];
assert(a.dropExactly(2) == [3]);
assert(a.dropBackExactly(2) == [1]);
string s = "日本語";
assert(s.dropExactly(2) == "語");
assert(s.dropBackExactly(2) == "日");
auto bd = filterBidirectional!"true"([1, 2, 3]);
assert(bd.dropExactly(2).equal([3]));
assert(bd.dropBackExactly(2).equal([1]));
}
/++
Convenience function which calls
`range.popFront()` and returns `range`. `dropOne`
makes it easier to pop an element from a range
and then pass it to another function within a single expression,
whereas `popFront` would require multiple statements.
`dropBackOne` provides the same functionality but instead calls
`range.popBack()`.
+/
R dropOne(R)(R range)
if (isInputRange!R)
{
range.popFront();
return range;
}
/// ditto
R dropBackOne(R)(R range)
if (isBidirectionalRange!R)
{
range.popBack();
return range;
}
///
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filterBidirectional;
import std.container.dlist : DList;
auto dl = DList!int(9, 1, 2, 3, 9);
assert(dl[].dropOne().dropBackOne().equal([1, 2, 3]));
auto a = [1, 2, 3];
assert(a.dropOne() == [2, 3]);
assert(a.dropBackOne() == [1, 2]);
string s = "日本語";
import std.exception : assumeWontThrow;
assert(assumeWontThrow(s.dropOne() == "本語"));
assert(assumeWontThrow(s.dropBackOne() == "日本"));
auto bd = filterBidirectional!"true"([1, 2, 3]);
assert(bd.dropOne().equal([2, 3]));
assert(bd.dropBackOne().equal([1, 2]));
}
/**
Create a range which repeats one value.
Params:
value = the _value to repeat
n = the number of times to repeat `value`
Returns:
If `n` is not defined, an infinite random access range
with slicing.
If `n` is defined, a random access range with slicing.
*/
struct Repeat(T)
{
private:
//Store a non-qualified T when possible: This is to make Repeat assignable
static if ((is(T == class) || is(T == interface)) && (is(T == const) || is(T == immutable)))
{
import std.typecons : Rebindable;
alias UT = Rebindable!T;
}
else static if (is(T : Unqual!T) && is(Unqual!T : T))
alias UT = Unqual!T;
else
alias UT = T;
UT _value;
public:
/// Range primitives
@property inout(T) front() inout { return _value; }
/// ditto
@property inout(T) back() inout { return _value; }
/// ditto
enum bool empty = false;
/// ditto
void popFront() {}
/// ditto
void popBack() {}
/// ditto
@property auto save() inout { return this; }
/// ditto
inout(T) opIndex(size_t) inout { return _value; }
/// ditto
auto opSlice(size_t i, size_t j)
in
{
assert(
i <= j,
"Attempting to slice a Repeat with a larger first argument than the second."
);
}
do
{
return this.takeExactly(j - i);
}
private static struct DollarToken {}
/// ditto
enum opDollar = DollarToken.init;
/// ditto
auto opSlice(size_t, DollarToken) inout { return this; }
}
/// Ditto
Repeat!T repeat(T)(T value) { return Repeat!T(value); }
///
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
assert(5.repeat().take(4).equal([5, 5, 5, 5]));
}
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
auto r = repeat(5);
alias R = typeof(r);
static assert(isBidirectionalRange!R);
static assert(isForwardRange!R);
static assert(isInfinite!R);
static assert(hasSlicing!R);
assert(r.back == 5);
assert(r.front == 5);
assert(r.take(4).equal([ 5, 5, 5, 5 ]));
assert(r[0 .. 4].equal([ 5, 5, 5, 5 ]));
R r2 = r[5 .. $];
assert(r2.back == 5);
assert(r2.front == 5);
}
/// ditto
Take!(Repeat!T) repeat(T)(T value, size_t n)
{
return take(repeat(value), n);
}
///
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
assert(5.repeat(4).equal([5, 5, 5, 5]));
}
// https://issues.dlang.org/show_bug.cgi?id=12007
pure @safe nothrow unittest
{
static class C{}
Repeat!(immutable int) ri;
ri = ri.save;
Repeat!(immutable C) rc;
rc = rc.save;
import std.algorithm.setops : cartesianProduct;
import std.algorithm.comparison : equal;
import std.typecons : tuple;
immutable int[] A = [1,2,3];
immutable int[] B = [4,5,6];
assert(equal(cartesianProduct(A,B),
[
tuple(1, 4), tuple(1, 5), tuple(1, 6),
tuple(2, 4), tuple(2, 5), tuple(2, 6),
tuple(3, 4), tuple(3, 5), tuple(3, 6),
]));
}
/**
Given callable ($(REF isCallable, std,traits)) `fun`, create as a range
whose front is defined by successive calls to `fun()`.
This is especially useful to call function with global side effects (random
functions), or to create ranges expressed as a single delegate, rather than
an entire `front`/`popFront`/`empty` structure.
`fun` maybe be passed either a template alias parameter (existing
function, delegate, struct type defining `static opCall`) or
a run-time value argument (delegate, function object).
The result range models an InputRange
($(REF isInputRange, std,range,primitives)).
The resulting range will call `fun()` on construction, and every call to
`popFront`, and the cached value will be returned when `front` is called.
Returns: an `inputRange` where each element represents another call to fun.
*/
auto generate(Fun)(Fun fun)
if (isCallable!fun)
{
auto gen = Generator!(Fun)(fun);
gen.popFront(); // prime the first element
return gen;
}
/// ditto
auto generate(alias fun)()
if (isCallable!fun)
{
auto gen = Generator!(fun)();
gen.popFront(); // prime the first element
return gen;
}
///
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : map;
int i = 1;
auto powersOfTwo = generate!(() => i *= 2)().take(10);
assert(equal(powersOfTwo, iota(1, 11).map!"2^^a"()));
}
///
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
//Returns a run-time delegate
auto infiniteIota(T)(T low, T high)
{
T i = high;
return (){if (i == high) i = low; return i++;};
}
//adapted as a range.
assert(equal(generate(infiniteIota(1, 4)).take(10), [1, 2, 3, 1, 2, 3, 1, 2, 3, 1]));
}
///
@safe unittest
{
import std.format : format;
import std.random : uniform;
auto r = generate!(() => uniform(0, 6)).take(10);
format("%(%s %)", r);
}
private struct Generator(Fun...)
{
static assert(Fun.length == 1);
static assert(isInputRange!Generator);
import std.traits : FunctionAttribute, functionAttributes, ReturnType;
private:
static if (is(Fun[0]))
Fun[0] fun;
else
alias fun = Fun[0];
enum returnByRef_ = (functionAttributes!fun & FunctionAttribute.ref_) ? true : false;
static if (returnByRef_)
ReturnType!fun *elem_;
else
ReturnType!fun elem_;
public:
/// Range primitives
enum empty = false;
static if (returnByRef_)
{
/// ditto
ref front() @property
{
return *elem_;
}
/// ditto
void popFront()
{
elem_ = &fun();
}
}
else
{
/// ditto
auto front() @property
{
return elem_;
}
/// ditto
void popFront()
{
elem_ = fun();
}
}
}
@safe nothrow unittest
{
import std.algorithm.comparison : equal;
struct StaticOpCall
{
static ubyte opCall() { return 5 ; }
}
assert(equal(generate!StaticOpCall().take(10), repeat(5).take(10)));
}
@safe pure unittest
{
import std.algorithm.comparison : equal;
struct OpCall
{
ubyte opCall() @safe pure { return 5 ; }
}
OpCall op;
assert(equal(generate(op).take(10), repeat(5).take(10)));
}
// verify ref mechanism works
@system nothrow unittest
{
int[10] arr;
int idx;
ref int fun() {
auto x = idx++;
idx %= arr.length;
return arr[x];
}
int y = 1;
foreach (ref x; generate!(fun).take(20))
{
x += y++;
}
import std.algorithm.comparison : equal;
assert(equal(arr[], iota(12, 32, 2)));
}
// assure front isn't the mechanism to make generate go to the next element.
@safe unittest
{
int i;
auto g = generate!(() => ++i);
auto f = g.front;
assert(f == g.front);
g = g.drop(5); // reassign because generate caches
assert(g.front == f + 5);
}
/**
Repeats the given forward range ad infinitum. If the original range is
infinite (fact that would make `Cycle` the identity application),
`Cycle` detects that and aliases itself to the range type
itself. That works for non-forward ranges too.
If the original range has random access, `Cycle` offers
random access and also offers a constructor taking an initial position
`index`. `Cycle` works with static arrays in addition to ranges,
mostly for performance reasons.
Note: The input range must not be empty.
Tip: This is a great way to implement simple circular buffers.
*/
struct Cycle(R)
if (isForwardRange!R && !isInfinite!R)
{
static if (isRandomAccessRange!R && hasLength!R)
{
private R _original;
private size_t _index;
/// Range primitives
this(R input, size_t index = 0)
{
_original = input;
_index = index % _original.length;
}
/// ditto
@property auto ref front()
{
return _original[_index];
}
static if (is(typeof((cast(const R)_original)[_index])))
{
/// ditto
@property auto ref front() const
{
return _original[_index];
}
}
static if (hasAssignableElements!R)
{
/// ditto
@property void front(ElementType!R val)
{
_original[_index] = val;
}
}
/// ditto
enum bool empty = false;
/// ditto
void popFront()
{
++_index;
if (_index >= _original.length)
_index = 0;
}
/// ditto
auto ref opIndex(size_t n)
{
return _original[(n + _index) % _original.length];
}
static if (is(typeof((cast(const R)_original)[_index])) &&
is(typeof((cast(const R)_original).length)))
{
/// ditto
auto ref opIndex(size_t n) const
{
return _original[(n + _index) % _original.length];
}
}
static if (hasAssignableElements!R)
{
/// ditto
void opIndexAssign(ElementType!R val, size_t n)
{
_original[(n + _index) % _original.length] = val;
}
}
/// ditto
@property Cycle save()
{
//No need to call _original.save, because Cycle never actually modifies _original
return Cycle(_original, _index);
}
private static struct DollarToken {}
/// ditto
enum opDollar = DollarToken.init;
static if (hasSlicing!R)
{
/// ditto
auto opSlice(size_t i, size_t j)
in
{
assert(i <= j);
}
do
{
return this[i .. $].takeExactly(j - i);
}
/// ditto
auto opSlice(size_t i, DollarToken)
{
return typeof(this)(_original, _index + i);
}
}
}
else
{
private R _original;
private R _current;
/// ditto
this(R input)
{
_original = input;
_current = input.save;
}
private this(R original, R current)
{
_original = original;
_current = current;
}
/// ditto
@property auto ref front()
{
return _current.front;
}
static if (is(typeof((cast(const R)_current).front)))
{
/// ditto
@property auto ref front() const
{
return _current.front;
}
}
static if (hasAssignableElements!R)
{
/// ditto
@property auto front(ElementType!R val)
{
return _current.front = val;
}
}
/// ditto
enum bool empty = false;
/// ditto
void popFront()
{
_current.popFront();
if (_current.empty)
_current = _original.save;
}
/// ditto
@property Cycle save()
{
//No need to call _original.save, because Cycle never actually modifies _original
return Cycle(_original, _current.save);
}
}
}
/// ditto
template Cycle(R)
if (isInfinite!R)
{
alias Cycle = R;
}
/// ditto
struct Cycle(R)
if (isStaticArray!R)
{
private alias ElementType = typeof(R.init[0]);
private ElementType* _ptr;
private size_t _index;
nothrow:
/// Range primitives
this(ref R input, size_t index = 0) @system
{
_ptr = input.ptr;
_index = index % R.length;
}
/// ditto
@property ref inout(ElementType) front() inout @safe
{
static ref auto trustedPtrIdx(typeof(_ptr) p, size_t idx) @trusted
{
return p[idx];
}
return trustedPtrIdx(_ptr, _index);
}
/// ditto
enum bool empty = false;
/// ditto
void popFront() @safe
{
++_index;
if (_index >= R.length)
_index = 0;
}
/// ditto
ref inout(ElementType) opIndex(size_t n) inout @safe
{
static ref auto trustedPtrIdx(typeof(_ptr) p, size_t idx) @trusted
{
return p[idx % R.length];
}
return trustedPtrIdx(_ptr, n + _index);
}
/// ditto
@property inout(Cycle) save() inout @safe
{
return this;
}
private static struct DollarToken {}
/// ditto
enum opDollar = DollarToken.init;
/// ditto
auto opSlice(size_t i, size_t j) @safe
in
{
assert(
i <= j,
"Attempting to slice a Repeat with a larger first argument than the second."
);
}
do
{
return this[i .. $].takeExactly(j - i);
}
/// ditto
inout(typeof(this)) opSlice(size_t i, DollarToken) inout @safe
{
static auto trustedCtor(typeof(_ptr) p, size_t idx) @trusted
{
return cast(inout) Cycle(*cast(R*)(p), idx);
}
return trustedCtor(_ptr, _index + i);
}
}
/// Ditto
auto cycle(R)(R input)
if (isInputRange!R)
{
static assert(isForwardRange!R || isInfinite!R,
"Cycle requires a forward range argument unless it's statically known"
~ " to be infinite");
assert(!input.empty, "Attempting to pass an empty input to cycle");
static if (isInfinite!R) return input;
else return Cycle!R(input);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
import std.range : cycle, take;
// Here we create an infinitive cyclic sequence from [1, 2]
// (i.e. get here [1, 2, 1, 2, 1, 2 and so on]) then
// take 5 elements of this sequence (so we have [1, 2, 1, 2, 1])
// and compare them with the expected values for equality.
assert(cycle([1, 2]).take(5).equal([ 1, 2, 1, 2, 1 ]));
}
/// Ditto
Cycle!R cycle(R)(R input, size_t index = 0)
if (isRandomAccessRange!R && !isInfinite!R)
{
assert(!input.empty, "Attempting to pass an empty input to cycle");
return Cycle!R(input, index);
}
/// Ditto
Cycle!R cycle(R)(ref R input, size_t index = 0) @system
if (isStaticArray!R)
{
return Cycle!R(input, index);
}
@safe nothrow unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : AllDummyRanges;
static assert(isForwardRange!(Cycle!(uint[])));
// Make sure ref is getting propagated properly.
int[] nums = [1,2,3];
auto c2 = cycle(nums);
c2[3]++;
assert(nums[0] == 2);
immutable int[] immarr = [1, 2, 3];
foreach (DummyType; AllDummyRanges)
{
static if (isForwardRange!DummyType)
{
DummyType dummy;
auto cy = cycle(dummy);
static assert(isForwardRange!(typeof(cy)));
auto t = take(cy, 20);
assert(equal(t, [1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10]));
const cRange = cy;
assert(cRange.front == 1);
static if (hasAssignableElements!DummyType)
{
{
cy.front = 66;
scope(exit) cy.front = 1;
assert(dummy.front == 66);
}
static if (isRandomAccessRange!DummyType)
{
{
cy[10] = 66;
scope(exit) cy[10] = 1;
assert(dummy.front == 66);
}
assert(cRange[10] == 1);
}
}
static if (hasSlicing!DummyType)
{
auto slice = cy[5 .. 15];
assert(equal(slice, [6, 7, 8, 9, 10, 1, 2, 3, 4, 5]));
static assert(is(typeof(slice) == typeof(takeExactly(cy, 5))));
auto infSlice = cy[7 .. $];
assert(equal(take(infSlice, 5), [8, 9, 10, 1, 2]));
static assert(isInfinite!(typeof(infSlice)));
}
}
}
}
@system nothrow unittest // For static arrays.
{
import std.algorithm.comparison : equal;
int[3] a = [ 1, 2, 3 ];
static assert(isStaticArray!(typeof(a)));
auto c = cycle(a);
assert(a.ptr == c._ptr);
assert(equal(take(cycle(a), 5), [ 1, 2, 3, 1, 2 ][]));
static assert(isForwardRange!(typeof(c)));
// Test qualifiers on slicing.
alias C = typeof(c);
static assert(is(typeof(c[1 .. $]) == C));
const cConst = c;
static assert(is(typeof(cConst[1 .. $]) == const(C)));
}
@safe nothrow unittest // For infinite ranges
{
struct InfRange
{
void popFront() { }
@property int front() { return 0; }
enum empty = false;
auto save() { return this; }
}
struct NonForwardInfRange
{
void popFront() { }
@property int front() { return 0; }
enum empty = false;
}
InfRange i;
NonForwardInfRange j;
auto c = cycle(i);
assert(c == i);
//make sure it can alias out even non-forward infinite ranges
static assert(is(typeof(j.cycle) == typeof(j)));
}
@safe unittest
{
import std.algorithm.comparison : equal;
int[5] arr = [0, 1, 2, 3, 4];
auto cleD = cycle(arr[]); //Dynamic
assert(equal(cleD[5 .. 10], arr[]));
//n is a multiple of 5 worth about 3/4 of size_t.max
auto n = size_t.max/4 + size_t.max/2;
n -= n % 5;
//Test index overflow
foreach (_ ; 0 .. 10)
{
cleD = cleD[n .. $];
assert(equal(cleD[5 .. 10], arr[]));
}
}
@system @nogc nothrow unittest
{
import std.algorithm.comparison : equal;
int[5] arr = [0, 1, 2, 3, 4];
auto cleS = cycle(arr); //Static
assert(equal(cleS[5 .. 10], arr[]));
//n is a multiple of 5 worth about 3/4 of size_t.max
auto n = size_t.max/4 + size_t.max/2;
n -= n % 5;
//Test index overflow
foreach (_ ; 0 .. 10)
{
cleS = cleS[n .. $];
assert(equal(cleS[5 .. 10], arr[]));
}
}
@system unittest
{
import std.algorithm.comparison : equal;
int[1] arr = [0];
auto cleS = cycle(arr);
cleS = cleS[10 .. $];
assert(equal(cleS[5 .. 10], 0.repeat(5)));
assert(cleS.front == 0);
}
// https://issues.dlang.org/show_bug.cgi?id=10845
@system unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filter;
auto a = inputRangeObject(iota(3).filter!"true");
assert(equal(cycle(a).take(10), [0, 1, 2, 0, 1, 2, 0, 1, 2, 0]));
}
// https://issues.dlang.org/show_bug.cgi?id=12177
@safe unittest
{
static assert(__traits(compiles, recurrence!q{a[n - 1] ~ a[n - 2]}("1", "0")));
}
// https://issues.dlang.org/show_bug.cgi?id=13390
@system unittest
{
import core.exception : AssertError;
import std.exception : assertThrown;
assertThrown!AssertError(cycle([0, 1, 2][0 .. 0]));
}
// https://issues.dlang.org/show_bug.cgi?id=18657
pure @safe unittest
{
import std.algorithm.comparison : equal;
string s = "foo";
auto r = refRange(&s).cycle.take(4);
assert(equal(r.save, "foof"));
assert(equal(r.save, "foof"));
}
private alias lengthType(R) = typeof(R.init.length.init);
/**
Iterate several ranges in lockstep. The element type is a proxy tuple
that allows accessing the current element in the `n`th range by
using `e[n]`.
`zip` is similar to $(LREF lockstep), but `lockstep` doesn't
bundle its elements and uses the `opApply` protocol.
`lockstep` allows reference access to the elements in
`foreach` iterations.
Params:
sp = controls what `zip` will do if the ranges are different lengths
ranges = the ranges to zip together
Returns:
At minimum, an input range. `Zip` offers the lowest range facilities
of all components, e.g. it offers random access iff all ranges offer
random access, and also offers mutation and swapping if all ranges offer
it. Due to this, `Zip` is extremely powerful because it allows manipulating
several ranges in lockstep.
Throws:
An `Exception` if all of the ranges are not the same length and
`sp` is set to `StoppingPolicy.requireSameLength`.
Limitations: The `@nogc` and `nothrow` attributes cannot be inferred for
the `Zip` struct because $(LREF StoppingPolicy) can vary at runtime. This
limitation is not shared by the anonymous range returned by the `zip`
function when not given an explicit `StoppingPolicy` as an argument.
*/
struct Zip(Ranges...)
if (Ranges.length && allSatisfy!(isInputRange, Ranges))
{
import std.format : format; //for generic mixins
import std.typecons : Tuple;
alias R = Ranges;
private R ranges;
alias ElementType = Tuple!(staticMap!(.ElementType, R));
private StoppingPolicy stoppingPolicy = StoppingPolicy.shortest;
/**
Builds an object. Usually this is invoked indirectly by using the
$(LREF zip) function.
*/
this(R rs, StoppingPolicy s = StoppingPolicy.shortest)
{
ranges[] = rs[];
stoppingPolicy = s;
}
/**
Returns `true` if the range is at end. The test depends on the
stopping policy.
*/
static if (allSatisfy!(isInfinite, R))
{
// BUG: Doesn't propagate infiniteness if only some ranges are infinite
// and s == StoppingPolicy.longest. This isn't fixable in the
// current design since StoppingPolicy is known only at runtime.
enum bool empty = false;
}
else
{
///
@property bool empty()
{
import std.exception : enforce;
import std.meta : anySatisfy;
final switch (stoppingPolicy)
{
case StoppingPolicy.shortest:
foreach (i, Unused; R)
{
if (ranges[i].empty) return true;
}
return false;
case StoppingPolicy.longest:
static if (anySatisfy!(isInfinite, R))
{
return false;
}
else
{
foreach (i, Unused; R)
{
if (!ranges[i].empty) return false;
}
return true;
}
case StoppingPolicy.requireSameLength:
foreach (i, Unused; R[1 .. $])
{
enforce(ranges[0].empty ==
ranges[i + 1].empty,
"Inequal-length ranges passed to Zip");
}
return ranges[0].empty;
}
assert(false);
}
}
static if (allSatisfy!(isForwardRange, R))
{
///
@property Zip save()
{
//Zip(ranges[0].save, ranges[1].save, ..., stoppingPolicy)
return mixin (q{Zip(%(ranges[%s].save%|, %), stoppingPolicy)}.format(iota(0, R.length)));
}
}
private .ElementType!(R[i]) tryGetInit(size_t i)()
{
alias E = .ElementType!(R[i]);
static if (!is(typeof({static E i;})))
throw new Exception("Range with non-default constructable elements exhausted.");
else
return E.init;
}
/**
Returns the current iterated element.
*/
@property ElementType front()
{
@property tryGetFront(size_t i)(){return ranges[i].empty ? tryGetInit!i() : ranges[i].front;}
//ElementType(tryGetFront!0, tryGetFront!1, ...)
return mixin(q{ElementType(%(tryGetFront!%s, %))}.format(iota(0, R.length)));
}
/**
Sets the front of all iterated ranges.
*/
static if (allSatisfy!(hasAssignableElements, R))
{
@property void front(ElementType v)
{
foreach (i, Unused; R)
{
if (!ranges[i].empty)
{
ranges[i].front = v[i];
}
}
}
}
/**
Moves out the front.
*/
static if (allSatisfy!(hasMobileElements, R))
{
ElementType moveFront()
{
@property tryMoveFront(size_t i)(){return ranges[i].empty ? tryGetInit!i() : ranges[i].moveFront();}
//ElementType(tryMoveFront!0, tryMoveFront!1, ...)
return mixin(q{ElementType(%(tryMoveFront!%s, %))}.format(iota(0, R.length)));
}
}
/**
Returns the rightmost element.
*/
static if (allSatisfy!(isBidirectionalRange, R))
{
@property ElementType back()
{
//TODO: Fixme! BackElement != back of all ranges in case of jagged-ness
@property tryGetBack(size_t i)(){return ranges[i].empty ? tryGetInit!i() : ranges[i].back;}
//ElementType(tryGetBack!0, tryGetBack!1, ...)
return mixin(q{ElementType(%(tryGetBack!%s, %))}.format(iota(0, R.length)));
}
/**
Moves out the back.
*/
static if (allSatisfy!(hasMobileElements, R))
{
ElementType moveBack()
{
//TODO: Fixme! BackElement != back of all ranges in case of jagged-ness
@property tryMoveBack(size_t i)(){return ranges[i].empty ? tryGetInit!i() : ranges[i].moveBack();}
//ElementType(tryMoveBack!0, tryMoveBack!1, ...)
return mixin(q{ElementType(%(tryMoveBack!%s, %))}.format(iota(0, R.length)));
}
}
/**
Returns the current iterated element.
*/
static if (allSatisfy!(hasAssignableElements, R))
{
@property void back(ElementType v)
{
//TODO: Fixme! BackElement != back of all ranges in case of jagged-ness.
//Not sure the call is even legal for StoppingPolicy.longest
foreach (i, Unused; R)
{
if (!ranges[i].empty)
{
ranges[i].back = v[i];
}
}
}
}
}
/**
Advances to the next element in all controlled ranges.
*/
void popFront()
{
import std.exception : enforce;
final switch (stoppingPolicy)
{
case StoppingPolicy.shortest:
foreach (i, Unused; R)
{
assert(!ranges[i].empty);
ranges[i].popFront();
}
break;
case StoppingPolicy.longest:
foreach (i, Unused; R)
{
if (!ranges[i].empty) ranges[i].popFront();
}
break;
case StoppingPolicy.requireSameLength:
foreach (i, Unused; R)
{
enforce(!ranges[i].empty, "Invalid Zip object");
ranges[i].popFront();
}
break;
}
}
/**
Calls `popBack` for all controlled ranges.
*/
static if (allSatisfy!(isBidirectionalRange, R))
{
void popBack()
{
//TODO: Fixme! In case of jaggedness, this is wrong.
import std.exception : enforce;
final switch (stoppingPolicy)
{
case StoppingPolicy.shortest:
foreach (i, Unused; R)
{
assert(!ranges[i].empty);
ranges[i].popBack();
}
break;
case StoppingPolicy.longest:
foreach (i, Unused; R)
{
if (!ranges[i].empty) ranges[i].popBack();
}
break;
case StoppingPolicy.requireSameLength:
foreach (i, Unused; R)
{
enforce(!ranges[i].empty, "Invalid Zip object");
ranges[i].popBack();
}
break;
}
}
}
/**
Returns the length of this range. Defined only if all ranges define
`length`.
*/
static if (allSatisfy!(hasLength, R))
{
@property auto length()
{
static if (Ranges.length == 1)
return ranges[0].length;
else
{
if (stoppingPolicy == StoppingPolicy.requireSameLength)
return ranges[0].length;
//[min|max](ranges[0].length, ranges[1].length, ...)
import std.algorithm.comparison : min, max;
if (stoppingPolicy == StoppingPolicy.shortest)
return mixin(q{min(%(ranges[%s].length%|, %))}.format(iota(0, R.length)));
else
return mixin(q{max(%(ranges[%s].length%|, %))}.format(iota(0, R.length)));
}
}
alias opDollar = length;
}
/**
Returns a slice of the range. Defined only if all range define
slicing.
*/
static if (allSatisfy!(hasSlicing, R))
{
auto opSlice(size_t from, size_t to)
{
//Slicing an infinite range yields the type Take!R
//For finite ranges, the type Take!R aliases to R
alias ZipResult = Zip!(staticMap!(Take, R));
//ZipResult(ranges[0][from .. to], ranges[1][from .. to], ..., stoppingPolicy)
return mixin (q{ZipResult(%(ranges[%s][from .. to]%|, %), stoppingPolicy)}.format(iota(0, R.length)));
}
}
/**
Returns the `n`th element in the composite range. Defined if all
ranges offer random access.
*/
static if (allSatisfy!(isRandomAccessRange, R))
{
ElementType opIndex(size_t n)
{
//TODO: Fixme! This may create an out of bounds access
//for StoppingPolicy.longest
//ElementType(ranges[0][n], ranges[1][n], ...)
return mixin (q{ElementType(%(ranges[%s][n]%|, %))}.format(iota(0, R.length)));
}
/**
Assigns to the `n`th element in the composite range. Defined if
all ranges offer random access.
*/
static if (allSatisfy!(hasAssignableElements, R))
{
void opIndexAssign(ElementType v, size_t n)
{
//TODO: Fixme! Not sure the call is even legal for StoppingPolicy.longest
foreach (i, Range; R)
{
ranges[i][n] = v[i];
}
}
}
/**
Destructively reads the `n`th element in the composite
range. Defined if all ranges offer random access.
*/
static if (allSatisfy!(hasMobileElements, R))
{
ElementType moveAt(size_t n)
{
//TODO: Fixme! This may create an out of bounds access
//for StoppingPolicy.longest
//ElementType(ranges[0].moveAt(n), ranges[1].moveAt(n), ..., )
return mixin (q{ElementType(%(ranges[%s].moveAt(n)%|, %))}.format(iota(0, R.length)));
}
}
}
}
/// Ditto
auto zip(Ranges...)(Ranges ranges)
if (Ranges.length && allSatisfy!(isInputRange, Ranges))
{
import std.meta : anySatisfy, templateOr;
static if (allSatisfy!(isInfinite, Ranges) || Ranges.length == 1)
{
return ZipShortest!(Ranges)(ranges);
}
else static if (allSatisfy!(isBidirectionalRange, Ranges))
{
static if (allSatisfy!(templateOr!(isInfinite, hasLength), Ranges)
&& allSatisfy!(templateOr!(isInfinite, hasSlicing), Ranges)
&& allSatisfy!(isBidirectionalRange, staticMap!(Take, Ranges)))
{
// If all the ranges are bidirectional, if possible slice them to
// the same length to simplify the implementation.
static assert(anySatisfy!(hasLength, Ranges));
static foreach (i, Range; Ranges)
static if (hasLength!Range)
{
static if (!is(typeof(minLen) == size_t))
size_t minLen = ranges[i].length;
else
{{
const x = ranges[i].length;
if (x < minLen) minLen = x;
}}
}
import std.format : format;
static if (!anySatisfy!(isInfinite, Ranges))
return mixin(`ZipShortest!(Yes.allKnownSameLength, staticMap!(Take, Ranges))`~
`(%(ranges[%s][0 .. minLen]%|, %))`.format(iota(0, Ranges.length)));
else
return mixin(`ZipShortest!(Yes.allKnownSameLength, staticMap!(Take, Ranges))`~
`(%(take(ranges[%s], minLen)%|, %))`.format(iota(0, Ranges.length)));
}
else static if (allSatisfy!(isRandomAccessRange, Ranges))
{
// We can't slice but we can still use random access to ensure
// "back" is retrieving the same index for each range.
return ZipShortest!(Ranges)(ranges);
}
else
{
// If bidirectional range operations would not be supported by
// ZipShortest that might have actually been a bug since Zip
// supported `back` without verifying that each range had the
// same length, but for the sake of backwards compatibility
// use the old Zip to continue supporting them.
return Zip!Ranges(ranges);
}
}
else
{
return ZipShortest!(Ranges)(ranges);
}
}
///
@nogc nothrow pure @safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : map;
// pairwise sum
auto arr = only(0, 1, 2);
auto part1 = zip(arr, arr.dropOne).map!"a[0] + a[1]";
assert(part1.equal(only(1, 3)));
}
///
nothrow pure @safe unittest
{
import std.conv : to;
int[] a = [ 1, 2, 3 ];
string[] b = [ "a", "b", "c" ];
string[] result;
foreach (tup; zip(a, b))
{
result ~= tup[0].to!string ~ tup[1];
}
assert(result == [ "1a", "2b", "3c" ]);
size_t idx = 0;
// unpacking tuple elements with foreach
foreach (e1, e2; zip(a, b))
{
assert(e1 == a[idx]);
assert(e2 == b[idx]);
++idx;
}
}
/// `zip` is powerful - the following code sorts two arrays in parallel:
nothrow pure @safe unittest
{
import std.algorithm.sorting : sort;
int[] a = [ 1, 2, 3 ];
string[] b = [ "a", "c", "b" ];
zip(a, b).sort!((t1, t2) => t1[0] > t2[0]);
assert(a == [ 3, 2, 1 ]);
// b is sorted according to a's sorting
assert(b == [ "b", "c", "a" ]);
}
/// Ditto
auto zip(Ranges...)(StoppingPolicy sp, Ranges ranges)
if (Ranges.length && allSatisfy!(isInputRange, Ranges))
{
return Zip!Ranges(ranges, sp);
}
/**
Dictates how iteration in a $(LREF zip) and $(LREF lockstep) should stop.
By default stop at the end of the shortest of all ranges.
*/
enum StoppingPolicy
{
/// Stop when the shortest range is exhausted
shortest,
/// Stop when the longest range is exhausted
longest,
/// Require that all ranges are equal
requireSameLength,
}
///
pure @safe unittest
{
import std.algorithm.comparison : equal;
import std.exception : assertThrown;
import std.range.primitives;
import std.typecons : tuple;
auto a = [1, 2, 3];
auto b = [4, 5, 6, 7];
auto shortest = zip(StoppingPolicy.shortest, a, b);
assert(shortest.equal([
tuple(1, 4),
tuple(2, 5),
tuple(3, 6)
]));
auto longest = zip(StoppingPolicy.longest, a, b);
assert(longest.equal([
tuple(1, 4),
tuple(2, 5),
tuple(3, 6),
tuple(0, 7)
]));
auto same = zip(StoppingPolicy.requireSameLength, a, b);
same.popFrontN(3);
assertThrown!Exception(same.popFront);
}
/+
Non-public. Like $(LREF Zip) with `StoppingPolicy.shortest`
except it properly implements `back` and `popBack` in the
case of uneven ranges or disables those operations when
it is not possible to guarantee they are correct.
+/
package template ZipShortest(Ranges...)
if (Ranges.length && __traits(compiles,
{
static assert(allSatisfy!(isInputRange, Ranges));
}))
{
alias ZipShortest = .ZipShortest!(
Ranges.length == 1 || allSatisfy!(isInfinite, Ranges)
? Yes.allKnownSameLength
: No.allKnownSameLength,
Ranges);
}
/+ non-public, ditto +/
package struct ZipShortest(Flag!"allKnownSameLength" allKnownSameLength, Ranges...)
if (Ranges.length && allSatisfy!(isInputRange, Ranges))
{
import std.format : format; //for generic mixins
import std.meta : anySatisfy, templateOr;
import std.typecons : Tuple;
deprecated("Use of an undocumented alias R.")
alias R = Ranges; // Unused here but defined in case library users rely on it.
private Ranges ranges;
alias ElementType = Tuple!(staticMap!(.ElementType, Ranges));
/+
Builds an object. Usually this is invoked indirectly by using the
$(LREF zip) function.
+/
this(Ranges rs)
{
ranges[] = rs[];
}
/+
Returns `true` if the range is at end.
+/
static if (allKnownSameLength ? anySatisfy!(isInfinite, Ranges)
: allSatisfy!(isInfinite, Ranges))
{
enum bool empty = false;
}
else
{
@property bool empty()
{
static if (allKnownSameLength)
{
return ranges[0].empty;
}
else
{
static foreach (i; 0 .. Ranges.length)
{
if (ranges[i].empty)
return true;
}
return false;
}
}
}
/+
Forward range primitive. Only present if each constituent range is a
forward range.
+/
static if (allSatisfy!(isForwardRange, Ranges))
@property typeof(this) save()
{
return mixin(`typeof(return)(%(ranges[%s].save%|, %))`.format(iota(0, Ranges.length)));
}
/+
Returns the current iterated element.
+/
@property ElementType front()
{
return mixin(`typeof(return)(%(ranges[%s].front%|, %))`.format(iota(0, Ranges.length)));
}
/+
Sets the front of all iterated ranges. Only present if each constituent
range has assignable elements.
+/
static if (allSatisfy!(hasAssignableElements, Ranges))
@property void front()(ElementType v)
{
static foreach (i; 0 .. Ranges.length)
ranges[i].front = v[i];
}
/+
Moves out the front. Present if each constituent range has mobile elements.
+/
static if (allSatisfy!(hasMobileElements, Ranges))
ElementType moveFront()()
{
return mixin(`typeof(return)(%(ranges[%s].moveFront()%|, %))`.format(iota(0, Ranges.length)));
}
private enum bool isBackWellDefined = allSatisfy!(isBidirectionalRange, Ranges)
&& (allKnownSameLength
|| allSatisfy!(isRandomAccessRange, Ranges)
// Could also add the case where there is one non-infinite bidirectional
// range that defines `length` and all others are infinite random access
// ranges. Adding this would require appropriate branches in
// back/moveBack/popBack.
);
/+
Returns the rightmost element. Present if all constituent ranges are
bidirectional and either there is a compile-time guarantee that all
ranges have the same length (in `allKnownSameLength`) or all ranges
provide random access to elements.
+/
static if (isBackWellDefined)
@property ElementType back()
{
static if (allKnownSameLength)
{
return mixin(`typeof(return)(%(ranges[%s].back()%|, %))`.format(iota(0, Ranges.length)));
}
else
{
const backIndex = length - 1;
return mixin(`typeof(return)(%(ranges[%s][backIndex]%|, %))`.format(iota(0, Ranges.length)));
}
}
/+
Moves out the back. Present if `back` is defined and
each constituent range has mobile elements.
+/
static if (isBackWellDefined && allSatisfy!(hasMobileElements, Ranges))
ElementType moveBack()()
{
static if (allKnownSameLength)
{
return mixin(`typeof(return)(%(ranges[%s].moveBack()%|, %))`.format(iota(0, Ranges.length)));
}
else
{
const backIndex = length - 1;
return mixin(`typeof(return)(%(ranges[%s].moveAt(backIndex)%|, %))`.format(iota(0, Ranges.length)));
}
}
/+
Sets the rightmost element. Only present if `back` is defined and
each constituent range has assignable elements.
+/
static if (isBackWellDefined && allSatisfy!(hasAssignableElements, Ranges))
@property void back()(ElementType v)
{
static if (allKnownSameLength)
{
static foreach (i; 0 .. Ranges.length)
ranges[i].back = v[i];
}
else
{
const backIndex = length - 1;
static foreach (i; 0 .. Ranges.length)
ranges[i][backIndex] = v[i];
}
}
/+
Calls `popFront` on each constituent range.
+/
void popFront()
{
static foreach (i; 0 .. Ranges.length)
ranges[i].popFront();
}
/+
Pops the rightmost element. Present if `back` is defined.
+/
static if (isBackWellDefined)
void popBack()
{
static if (allKnownSameLength)
{
static foreach (i; 0 .. Ranges.length)
ranges[i].popBack;
}
else
{
const len = length;
static foreach (i; 0 .. Ranges.length)
static if (!isInfinite!(Ranges[i]))
if (ranges[i].length == len)
ranges[i].popBack();
}
}
/+
Returns the length of this range. Defined if at least one
constituent range defines `length` and the other ranges all also
define `length` or are infinite, or if at least one constituent
range defines `length` and there is a compile-time guarantee that
all ranges have the same length (in `allKnownSameLength`).
+/
static if (allKnownSameLength
? anySatisfy!(hasLength, Ranges)
: (anySatisfy!(hasLength, Ranges)
&& allSatisfy!(templateOr!(isInfinite, hasLength), Ranges)))
{
@property size_t length()
{
static foreach (i, Range; Ranges)
{
static if (hasLength!Range)
{
static if (!is(typeof(minLen) == size_t))
size_t minLen = ranges[i].length;
else static if (!allKnownSameLength)
{{
const x = ranges[i].length;
if (x < minLen) minLen = x;
}}
}
}
return minLen;
}
alias opDollar = length;
}
/+
Returns a slice of the range. Defined if all constituent ranges
support slicing.
+/
static if (allSatisfy!(hasSlicing, Ranges))
{
// Note: we will know that all elements of the resultant range
// will have the same length but we cannot change `allKnownSameLength`
// because the `hasSlicing` predicate tests that the result returned
// by `opSlice` has the same type as the receiver.
auto opSlice()(size_t from, size_t to)
{
//(ranges[0][from .. to], ranges[1][from .. to], ...)
enum sliceArgs = `(%(ranges[%s][from .. to]%|, %))`.format(iota(0, Ranges.length));
static if (__traits(compiles, mixin(`typeof(this)`~sliceArgs)))
return mixin(`typeof(this)`~sliceArgs);
else
// The type is different anyway so we might as well
// explicitly set allKnownSameLength.
return mixin(`ZipShortest!(Yes.allKnownSameLength, staticMap!(Take, Ranges))`
~sliceArgs);
}
}
/+
Returns the `n`th element in the composite range. Defined if all
constituent ranges offer random access.
+/
static if (allSatisfy!(isRandomAccessRange, Ranges))
ElementType opIndex()(size_t n)
{
return mixin(`typeof(return)(%(ranges[%s][n]%|, %))`.format(iota(0, Ranges.length)));
}
/+
Sets the `n`th element in the composite range. Defined if all
constituent ranges offer random access and have assignable elements.
+/
static if (allSatisfy!(isRandomAccessRange, Ranges)
&& allSatisfy!(hasAssignableElements, Ranges))
void opIndexAssign()(ElementType v, size_t n)
{
static foreach (i; 0 .. Ranges.length)
ranges[i][n] = v[i];
}
/+
Destructively reads the `n`th element in the composite
range. Defined if all constituent ranges offer random
access and have mobile elements.
+/
static if (allSatisfy!(isRandomAccessRange, Ranges)
&& allSatisfy!(hasMobileElements, Ranges))
ElementType moveAt()(size_t n)
{
return mixin(`typeof(return)(%(ranges[%s].moveAt(n)%|, %))`.format(iota(0, Ranges.length)));
}
}
pure @system unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filter, map;
import std.algorithm.mutation : swap;
import std.algorithm.sorting : sort;
import std.exception : assertThrown, assertNotThrown;
import std.typecons : tuple;
int[] a = [ 1, 2, 3 ];
float[] b = [ 1.0, 2.0, 3.0 ];
foreach (e; zip(a, b))
{
assert(e[0] == e[1]);
}
swap(a[0], a[1]);
{
auto z = zip(a, b);
}
//swap(z.front(), z.back());
sort!("a[0] < b[0]")(zip(a, b));
assert(a == [1, 2, 3]);
assert(b == [2.0, 1.0, 3.0]);
auto z = zip(StoppingPolicy.requireSameLength, a, b);
assertNotThrown(z.popBack());
assertNotThrown(z.popBack());
assertNotThrown(z.popBack());
assert(z.empty);
assertThrown(z.popBack());
a = [ 1, 2, 3 ];
b = [ 1.0, 2.0, 3.0 ];
sort!("a[0] > b[0]")(zip(StoppingPolicy.requireSameLength, a, b));
assert(a == [3, 2, 1]);
assert(b == [3.0, 2.0, 1.0]);
a = [];
b = [];
assert(zip(StoppingPolicy.requireSameLength, a, b).empty);
// Test infiniteness propagation.
static assert(isInfinite!(typeof(zip(repeat(1), repeat(1)))));
// Test stopping policies with both value and reference.
auto a1 = [1, 2];
auto a2 = [1, 2, 3];
auto stuff = tuple(tuple(a1, a2),
tuple(filter!"a"(a1), filter!"a"(a2)));
alias FOO = Zip!(immutable(int)[], immutable(float)[]);
foreach (t; stuff.expand)
{
auto arr1 = t[0];
auto arr2 = t[1];
auto zShortest = zip(arr1, arr2);
assert(equal(map!"a[0]"(zShortest), [1, 2]));
assert(equal(map!"a[1]"(zShortest), [1, 2]));
try {
auto zSame = zip(StoppingPolicy.requireSameLength, arr1, arr2);
foreach (elem; zSame) {}
assert(0);
} catch (Throwable) { /* It's supposed to throw.*/ }
auto zLongest = zip(StoppingPolicy.longest, arr1, arr2);
assert(!zLongest.ranges[0].empty);
assert(!zLongest.ranges[1].empty);
zLongest.popFront();
zLongest.popFront();
assert(!zLongest.empty);
assert(zLongest.ranges[0].empty);
assert(!zLongest.ranges[1].empty);
zLongest.popFront();
assert(zLongest.empty);
}
// https://issues.dlang.org/show_bug.cgi?id=8900
assert(zip([1, 2], repeat('a')).array == [tuple(1, 'a'), tuple(2, 'a')]);
assert(zip(repeat('a'), [1, 2]).array == [tuple('a', 1), tuple('a', 2)]);
// https://issues.dlang.org/show_bug.cgi?id=18524
// moveBack instead performs moveFront
{
auto r = zip([1,2,3]);
assert(r.moveBack()[0] == 3);
assert(r.moveFront()[0] == 1);
}
// Doesn't work yet. Issues w/ emplace.
// static assert(is(Zip!(immutable int[], immutable float[])));
// These unittests pass, but make the compiler consume an absurd amount
// of RAM and time. Therefore, they should only be run if explicitly
// uncommented when making changes to Zip. Also, running them using
// make -fwin32.mak unittest makes the compiler completely run out of RAM.
// You need to test just this module.
/+
foreach (DummyType1; AllDummyRanges)
{
DummyType1 d1;
foreach (DummyType2; AllDummyRanges)
{
DummyType2 d2;
auto r = zip(d1, d2);
assert(equal(map!"a[0]"(r), [1,2,3,4,5,6,7,8,9,10]));
assert(equal(map!"a[1]"(r), [1,2,3,4,5,6,7,8,9,10]));
static if (isForwardRange!DummyType1 && isForwardRange!DummyType2)
{
static assert(isForwardRange!(typeof(r)));
}
static if (isBidirectionalRange!DummyType1 &&
isBidirectionalRange!DummyType2) {
static assert(isBidirectionalRange!(typeof(r)));
}
static if (isRandomAccessRange!DummyType1 &&
isRandomAccessRange!DummyType2) {
static assert(isRandomAccessRange!(typeof(r)));
}
}
}
+/
}
nothrow pure @safe unittest
{
import std.algorithm.sorting : sort;
auto a = [5,4,3,2,1];
auto b = [3,1,2,5,6];
auto z = zip(a, b);
sort!"a[0] < b[0]"(z);
assert(a == [1, 2, 3, 4, 5]);
assert(b == [6, 5, 2, 1, 3]);
}
nothrow pure @safe unittest
{
import std.algorithm.comparison : equal;
import std.typecons : tuple;
auto LL = iota(1L, 1000L);
auto z = zip(LL, [4]);
assert(equal(z, [tuple(1L,4)]));
auto LL2 = iota(0L, 500L);
auto z2 = zip([7], LL2);
assert(equal(z2, [tuple(7, 0L)]));
}
// Test for https://issues.dlang.org/show_bug.cgi?id=11196
@safe pure unittest
{
import std.exception : assertThrown;
static struct S { @disable this(); }
assert(zip((S[5]).init[]).length == 5);
assert(zip(StoppingPolicy.longest, cast(S[]) null, new int[1]).length == 1);
assertThrown(zip(StoppingPolicy.longest, cast(S[]) null, new int[1]).front);
}
// https://issues.dlang.org/show_bug.cgi?id=12007
@nogc nothrow @safe pure unittest
{
static struct R
{
enum empty = false;
void popFront(){}
int front(){return 1;} @property
R save(){return this;} @property
void opAssign(R) @disable;
}
R r;
auto z = zip(r, r);
assert(z.save == z);
}
nothrow pure @system unittest
{
import std.typecons : tuple;
auto r1 = [0,1,2];
auto r2 = [1,2,3];
auto z1 = zip(refRange(&r1), refRange(&r2));
auto z2 = z1.save;
z1.popFront();
assert(z1.front == tuple(1,2));
assert(z2.front == tuple(0,1));
}
@nogc nothrow pure @safe unittest
{
// Test zip's `back` and `length` with non-equal ranges.
static struct NonSliceableRandomAccess
{
private int[] a;
@property ref front()
{
return a.front;
}
@property ref back()
{
return a.back;
}
ref opIndex(size_t i)
{
return a[i];
}
void popFront()
{
a.popFront();
}
void popBack()
{
a.popBack();
}
auto moveFront()
{
return a.moveFront();
}
auto moveBack()
{
return a.moveBack();
}
auto moveAt(size_t i)
{
return a.moveAt(i);
}
bool empty() const
{
return a.empty;
}
size_t length() const
{
return a.length;
}
typeof(this) save()
{
return this;
}
}
static assert(isRandomAccessRange!NonSliceableRandomAccess);
static assert(!hasSlicing!NonSliceableRandomAccess);
static foreach (iteration; 0 .. 2)
{{
int[5] data = [101, 102, 103, 201, 202];
static if (iteration == 0)
{
auto r1 = NonSliceableRandomAccess(data[0 .. 3]);
auto r2 = NonSliceableRandomAccess(data[3 .. 5]);
}
else
{
auto r1 = data[0 .. 3];
auto r2 = data[3 .. 5];
}
auto z = zip(r1, r2);
static assert(isRandomAccessRange!(typeof(z)));
assert(z.length == 2);
assert(z.back[0] == 102 && z.back[1] == 202);
z.back = typeof(z.back)(-102, -202);// Assign to back.
assert(z.back[0] == -102 && z.back[1] == -202);
z.popBack();
assert(z.length == 1);
assert(z.back[0] == 101 && z.back[1] == 201);
z.front = typeof(z.front)(-101, -201);
assert(z.moveBack() == typeof(z.back)(-101, -201));
z.popBack();
assert(z.empty);
}}
}
@nogc nothrow pure @safe unittest
{
// Test opSlice on infinite `zip`.
auto z = zip(repeat(1), repeat(2));
assert(hasSlicing!(typeof(z)));
auto slice = z[10 .. 20];
assert(slice.length == 10);
static assert(!is(typeof(z) == typeof(slice)));
}
/*
Generate lockstep's opApply function as a mixin string.
If withIndex is true prepend a size_t index to the delegate.
*/
private string lockstepMixin(Ranges...)(bool withIndex, bool reverse)
{
import std.format : format;
string[] params;
string[] emptyChecks;
string[] dgArgs;
string[] popFronts;
string indexDef;
string indexInc;
if (withIndex)
{
params ~= "size_t";
dgArgs ~= "index";
if (reverse)
{
indexDef = q{
size_t index = ranges[0].length-1;
enforce(_stoppingPolicy == StoppingPolicy.requireSameLength,
"lockstep can only be used with foreach_reverse when stoppingPolicy == requireSameLength");
foreach (range; ranges[1..$])
enforce(range.length == ranges[0].length);
};
indexInc = "--index;";
}
else
{
indexDef = "size_t index = 0;";
indexInc = "++index;";
}
}
foreach (idx, Range; Ranges)
{
params ~= format("%sElementType!(Ranges[%s])", hasLvalueElements!Range ? "ref " : "", idx);
emptyChecks ~= format("!ranges[%s].empty", idx);
if (reverse)
{
dgArgs ~= format("ranges[%s].back", idx);
popFronts ~= format("ranges[%s].popBack();", idx);
}
else
{
dgArgs ~= format("ranges[%s].front", idx);
popFronts ~= format("ranges[%s].popFront();", idx);
}
}
string name = reverse ? "opApplyReverse" : "opApply";
return format(
q{
int %s(scope int delegate(%s) dg)
{
import std.exception : enforce;
auto ranges = _ranges;
int res;
%s
while (%s)
{
res = dg(%s);
if (res) break;
%s
%s
}
if (_stoppingPolicy == StoppingPolicy.requireSameLength)
{
foreach (range; ranges)
enforce(range.empty);
}
return res;
}
}, name, params.join(", "), indexDef,
emptyChecks.join(" && "), dgArgs.join(", "),
popFronts.join("\n "),
indexInc);
}
/**
Iterate multiple ranges in lockstep using a `foreach` loop. In contrast to
$(LREF zip) it allows reference access to its elements. If only a single
range is passed in, the `Lockstep` aliases itself away. If the
ranges are of different lengths and `s` == `StoppingPolicy.shortest`
stop after the shortest range is empty. If the ranges are of different
lengths and `s` == `StoppingPolicy.requireSameLength`, throw an
exception. `s` may not be `StoppingPolicy.longest`, and passing this
will throw an exception.
Iterating over `Lockstep` in reverse and with an index is only possible
when `s` == `StoppingPolicy.requireSameLength`, in order to preserve
indexes. If an attempt is made at iterating in reverse when `s` ==
`StoppingPolicy.shortest`, an exception will be thrown.
By default `StoppingPolicy` is set to `StoppingPolicy.shortest`.
Limitations: The `pure`, `@safe`, `@nogc`, or `nothrow` attributes cannot be
inferred for `lockstep` iteration. $(LREF zip) can infer the first two due to
a different implementation.
See_Also: $(LREF zip)
`lockstep` is similar to $(LREF zip), but `zip` bundles its
elements and returns a range.
`lockstep` also supports reference access.
Use `zip` if you want to pass the result to a range function.
*/
struct Lockstep(Ranges...)
if (Ranges.length > 1 && allSatisfy!(isInputRange, Ranges))
{
///
this(R ranges, StoppingPolicy sp = StoppingPolicy.shortest)
{
import std.exception : enforce;
_ranges = ranges;
enforce(sp != StoppingPolicy.longest,
"Can't use StoppingPolicy.Longest on Lockstep.");
_stoppingPolicy = sp;
}
mixin(lockstepMixin!Ranges(false, false));
mixin(lockstepMixin!Ranges(true, false));
static if (allSatisfy!(isBidirectionalRange, Ranges))
{
mixin(lockstepMixin!Ranges(false, true));
static if (allSatisfy!(hasLength, Ranges))
{
mixin(lockstepMixin!Ranges(true, true));
}
else
{
mixin(lockstepReverseFailMixin!Ranges(true));
}
}
else
{
mixin(lockstepReverseFailMixin!Ranges(false));
mixin(lockstepReverseFailMixin!Ranges(true));
}
private:
alias R = Ranges;
R _ranges;
StoppingPolicy _stoppingPolicy;
}
/// Ditto
Lockstep!(Ranges) lockstep(Ranges...)(Ranges ranges)
if (allSatisfy!(isInputRange, Ranges))
{
return Lockstep!(Ranges)(ranges);
}
/// Ditto
Lockstep!(Ranges) lockstep(Ranges...)(Ranges ranges, StoppingPolicy s)
if (allSatisfy!(isInputRange, Ranges))
{
static if (Ranges.length > 1)
return Lockstep!Ranges(ranges, s);
else
return ranges[0];
}
///
@system unittest
{
auto arr1 = [1,2,3,4,5,100];
auto arr2 = [6,7,8,9,10];
foreach (ref a, b; lockstep(arr1, arr2))
{
a += b;
}
assert(arr1 == [7,9,11,13,15,100]);
/// Lockstep also supports iterating with an index variable:
foreach (index, a, b; lockstep(arr1, arr2))
{
assert(arr1[index] == a);
assert(arr2[index] == b);
}
}
// https://issues.dlang.org/show_bug.cgi?id=15860: foreach_reverse on lockstep
@system unittest
{
auto arr1 = [0, 1, 2, 3];
auto arr2 = [4, 5, 6, 7];
size_t n = arr1.length -1;
foreach_reverse (index, a, b; lockstep(arr1, arr2, StoppingPolicy.requireSameLength))
{
assert(n == index);
assert(index == a);
assert(arr1[index] == a);
assert(arr2[index] == b);
n--;
}
auto arr3 = [4, 5];
n = 1;
foreach_reverse (a, b; lockstep(arr1, arr3))
{
assert(a == arr1[$-n] && b == arr3[$-n]);
n++;
}
}
@system unittest
{
import std.algorithm.iteration : filter;
import std.conv : to;
// The filters are to make these the lowest common forward denominator ranges,
// i.e. w/o ref return, random access, length, etc.
auto foo = filter!"a"([1,2,3,4,5]);
immutable bar = [6f,7f,8f,9f,10f].idup;
auto l = lockstep(foo, bar);
// Should work twice. These are forward ranges with implicit save.
foreach (i; 0 .. 2)
{
uint[] res1;
float[] res2;
foreach (a, ref b; l)
{
res1 ~= a;
res2 ~= b;
}
assert(res1 == [1,2,3,4,5]);
assert(res2 == [6,7,8,9,10]);
assert(bar == [6f,7f,8f,9f,10f]);
}
// Doc example.
auto arr1 = [1,2,3,4,5];
auto arr2 = [6,7,8,9,10];
foreach (ref a, ref b; lockstep(arr1, arr2))
{
a += b;
}
assert(arr1 == [7,9,11,13,15]);
// Make sure StoppingPolicy.requireSameLength doesn't throw.
auto ls = lockstep(arr1, arr2, StoppingPolicy.requireSameLength);
int k = 1;
foreach (a, b; ls)
{
assert(a - b == k);
++k;
}
// Make sure StoppingPolicy.requireSameLength throws.
arr2.popBack();
ls = lockstep(arr1, arr2, StoppingPolicy.requireSameLength);
try {
foreach (a, b; ls) {}
assert(0);
} catch (Exception) {}
// Just make sure 1-range case instantiates. This hangs the compiler
// when no explicit stopping policy is specified due to
// https://issues.dlang.org/show_bug.cgi?id=4652
auto stuff = lockstep([1,2,3,4,5], StoppingPolicy.shortest);
foreach (i, a; stuff)
{
assert(stuff[i] == a);
}
// Test with indexing.
uint[] res1;
float[] res2;
size_t[] indices;
foreach (i, a, b; lockstep(foo, bar))
{
indices ~= i;
res1 ~= a;
res2 ~= b;
}
assert(indices == to!(size_t[])([0, 1, 2, 3, 4]));
assert(res1 == [1,2,3,4,5]);
assert(res2 == [6f,7f,8f,9f,10f]);
// Make sure we've worked around the relevant compiler bugs and this at least
// compiles w/ >2 ranges.
lockstep(foo, foo, foo);
// Make sure it works with const.
const(int[])[] foo2 = [[1, 2, 3]];
const(int[])[] bar2 = [[4, 5, 6]];
auto c = chain(foo2, bar2);
foreach (f, b; lockstep(c, c)) {}
// Regression 10468
foreach (x, y; lockstep(iota(0, 10), iota(0, 10))) { }
}
@system unittest
{
struct RvalueRange
{
int[] impl;
@property bool empty() { return impl.empty; }
@property int front() { return impl[0]; } // N.B. non-ref
void popFront() { impl.popFront(); }
}
auto data1 = [ 1, 2, 3, 4 ];
auto data2 = [ 5, 6, 7, 8 ];
auto r1 = RvalueRange(data1);
auto r2 = data2;
foreach (a, ref b; lockstep(r1, r2))
{
a++;
b++;
}
assert(data1 == [ 1, 2, 3, 4 ]); // changes to a do not propagate to data
assert(data2 == [ 6, 7, 8, 9 ]); // but changes to b do.
// Since r1 is by-value only, the compiler should reject attempts to
// foreach over it with ref.
static assert(!__traits(compiles, {
foreach (ref a, ref b; lockstep(r1, r2)) { a++; }
}));
}
private string lockstepReverseFailMixin(Ranges...)(bool withIndex)
{
import std.format : format;
string[] params;
string message;
if (withIndex)
{
message = "Indexed reverse iteration with lockstep is only supported"
~"if all ranges are bidirectional and have a length.\n";
}
else
{
message = "Reverse iteration with lockstep is only supported if all ranges are bidirectional.\n";
}
if (withIndex)
{
params ~= "size_t";
}
foreach (idx, Range; Ranges)
{
params ~= format("%sElementType!(Ranges[%s])", hasLvalueElements!Range ? "ref " : "", idx);
}
return format(
q{
int opApplyReverse()(scope int delegate(%s) dg)
{
static assert(false, "%s");
}
}, params.join(", "), message);
}
// For generic programming, make sure Lockstep!(Range) is well defined for a
// single range.
template Lockstep(Range)
{
alias Lockstep = Range;
}
/**
Creates a mathematical sequence given the initial values and a
recurrence function that computes the next value from the existing
values. The sequence comes in the form of an infinite forward
range. The type `Recurrence` itself is seldom used directly; most
often, recurrences are obtained by calling the function $(D
recurrence).
When calling `recurrence`, the function that computes the next
value is specified as a template argument, and the initial values in
the recurrence are passed as regular arguments. For example, in a
Fibonacci sequence, there are two initial values (and therefore a
state size of 2) because computing the next Fibonacci value needs the
past two values.
The signature of this function should be:
----
auto fun(R)(R state, size_t n)
----
where `n` will be the index of the current value, and `state` will be an
opaque state vector that can be indexed with array-indexing notation
`state[i]`, where valid values of `i` range from $(D (n - 1)) to
$(D (n - State.length)).
If the function is passed in string form, the state has name `"a"`
and the zero-based index in the recurrence has name `"n"`. The
given string must return the desired value for `a[n]` given
`a[n - 1]`, `a[n - 2]`, `a[n - 3]`,..., `a[n - stateSize]`. The
state size is dictated by the number of arguments passed to the call
to `recurrence`. The `Recurrence` struct itself takes care of
managing the recurrence's state and shifting it appropriately.
*/
struct Recurrence(alias fun, StateType, size_t stateSize)
{
import std.functional : binaryFun;
StateType[stateSize] _state;
size_t _n;
this(StateType[stateSize] initial) { _state = initial; }
void popFront()
{
static auto trustedCycle(ref typeof(_state) s) @trusted
{
return cycle(s);
}
// The cast here is reasonable because fun may cause integer
// promotion, but needs to return a StateType to make its operation
// closed. Therefore, we have no other choice.
_state[_n % stateSize] = cast(StateType) binaryFun!(fun, "a", "n")(
trustedCycle(_state), _n + stateSize);
++_n;
}
@property StateType front()
{
return _state[_n % stateSize];
}
@property typeof(this) save()
{
return this;
}
enum bool empty = false;
}
///
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
// The Fibonacci numbers, using function in string form:
// a[0] = 1, a[1] = 1, and compute a[n+1] = a[n-1] + a[n]
auto fib = recurrence!("a[n-1] + a[n-2]")(1, 1);
assert(fib.take(10).equal([1, 1, 2, 3, 5, 8, 13, 21, 34, 55]));
// The factorials, using function in lambda form:
auto fac = recurrence!((a,n) => a[n-1] * n)(1);
assert(take(fac, 10).equal([
1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880
]));
// The triangular numbers, using function in explicit form:
static size_t genTriangular(R)(R state, size_t n)
{
return state[n-1] + n;
}
auto tri = recurrence!genTriangular(0);
assert(take(tri, 10).equal([0, 1, 3, 6, 10, 15, 21, 28, 36, 45]));
}
/// Ditto
Recurrence!(fun, CommonType!(State), State.length)
recurrence(alias fun, State...)(State initial)
{
CommonType!(State)[State.length] state;
foreach (i, Unused; State)
{
state[i] = initial[i];
}
return typeof(return)(state);
}
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
auto fib = recurrence!("a[n-1] + a[n-2]")(1, 1);
static assert(isForwardRange!(typeof(fib)));
int[] witness = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55 ];
assert(equal(take(fib, 10), witness));
foreach (e; take(fib, 10)) {}
auto fact = recurrence!("n * a[n-1]")(1);
assert( equal(take(fact, 10), [1, 1, 2, 2*3, 2*3*4, 2*3*4*5, 2*3*4*5*6,
2*3*4*5*6*7, 2*3*4*5*6*7*8, 2*3*4*5*6*7*8*9][]) );
auto piapprox = recurrence!("a[n] + (n & 1 ? 4.0 : -4.0) / (2 * n + 3)")(4.0);
foreach (e; take(piapprox, 20)) {}
// Thanks to yebblies for this test and the associated fix
auto r = recurrence!"a[n-2]"(1, 2);
witness = [1, 2, 1, 2, 1];
assert(equal(take(r, 5), witness));
}
/**
`Sequence` is similar to `Recurrence` except that iteration is
presented in the so-called $(HTTP en.wikipedia.org/wiki/Closed_form,
closed form). This means that the `n`th element in the series is
computable directly from the initial values and `n` itself. This
implies that the interface offered by `Sequence` is a random-access
range, as opposed to the regular `Recurrence`, which only offers
forward iteration.
The state of the sequence is stored as a `Tuple` so it can be
heterogeneous.
*/
struct Sequence(alias fun, State)
{
private:
import std.functional : binaryFun;
alias compute = binaryFun!(fun, "a", "n");
alias ElementType = typeof(compute(State.init, cast(size_t) 1));
State _state;
size_t _n;
static struct DollarToken{}
public:
this(State initial, size_t n = 0)
{
_state = initial;
_n = n;
}
@property ElementType front()
{
return compute(_state, _n);
}
void popFront()
{
++_n;
}
enum opDollar = DollarToken();
auto opSlice(size_t lower, size_t upper)
in
{
assert(
upper >= lower,
"Attempting to slice a Sequence with a larger first argument than the second."
);
}
do
{
return typeof(this)(_state, _n + lower).take(upper - lower);
}
auto opSlice(size_t lower, DollarToken)
{
return typeof(this)(_state, _n + lower);
}
ElementType opIndex(size_t n)
{
return compute(_state, n + _n);
}
enum bool empty = false;
@property Sequence save() { return this; }
}
/// Ditto
auto sequence(alias fun, State...)(State args)
{
import std.typecons : Tuple, tuple;
alias Return = Sequence!(fun, Tuple!State);
return Return(tuple(args));
}
/// Odd numbers, using function in string form:
pure @safe nothrow @nogc unittest
{
auto odds = sequence!("a[0] + n * a[1]")(1, 2);
assert(odds.front == 1);
odds.popFront();
assert(odds.front == 3);
odds.popFront();
assert(odds.front == 5);
}
/// Triangular numbers, using function in lambda form:
pure @safe nothrow @nogc unittest
{
auto tri = sequence!((a,n) => n*(n+1)/2)();
// Note random access
assert(tri[0] == 0);
assert(tri[3] == 6);
assert(tri[1] == 1);
assert(tri[4] == 10);
assert(tri[2] == 3);
}
/// Fibonacci numbers, using function in explicit form:
@safe nothrow @nogc unittest
{
import std.math : pow, round, sqrt;
static ulong computeFib(S)(S state, size_t n)
{
// Binet's formula
return cast(ulong)(round((pow(state[0], n+1) - pow(state[1], n+1)) /
state[2]));
}
auto fib = sequence!computeFib(
(1.0 + sqrt(5.0)) / 2.0, // Golden Ratio
(1.0 - sqrt(5.0)) / 2.0, // Conjugate of Golden Ratio
sqrt(5.0));
// Note random access with [] operator
assert(fib[1] == 1);
assert(fib[4] == 5);
assert(fib[3] == 3);
assert(fib[2] == 2);
assert(fib[9] == 55);
}
pure @safe nothrow @nogc unittest
{
import std.typecons : Tuple, tuple;
auto y = Sequence!("a[0] + n * a[1]", Tuple!(int, int))(tuple(0, 4));
static assert(isForwardRange!(typeof(y)));
//@@BUG
//auto y = sequence!("a[0] + n * a[1]")(0, 4);
//foreach (e; take(y, 15))
{} //writeln(e);
auto odds = Sequence!("a[0] + n * a[1]", Tuple!(int, int))(
tuple(1, 2));
for (int currentOdd = 1; currentOdd <= 21; currentOdd += 2)
{
assert(odds.front == odds[0]);
assert(odds[0] == currentOdd);
odds.popFront();
}
}
pure @safe nothrow @nogc unittest
{
import std.algorithm.comparison : equal;
auto odds = sequence!("a[0] + n * a[1]")(1, 2);
static assert(hasSlicing!(typeof(odds)));
//Note: don't use drop or take as the target of an equal,
//since they'll both just forward to opSlice, making the tests irrelevant
// static slicing tests
assert(equal(odds[0 .. 5], only(1, 3, 5, 7, 9)));
assert(equal(odds[3 .. 7], only(7, 9, 11, 13)));
// relative slicing test, testing slicing is NOT agnostic of state
auto odds_less5 = odds.drop(5); //this should actually call odds[5 .. $]
assert(equal(odds_less5[0 .. 3], only(11, 13, 15)));
assert(equal(odds_less5[0 .. 10], odds[5 .. 15]));
//Infinite slicing tests
odds = odds[10 .. $];
assert(equal(odds.take(3), only(21, 23, 25)));
}
// https://issues.dlang.org/show_bug.cgi?id=5036
pure @safe nothrow unittest
{
auto s = sequence!((a, n) => new int)(0);
assert(s.front != s.front); // no caching
}
// iota
/**
Creates a range of values that span the given starting and stopping
values.
Params:
begin = The starting value.
end = The value that serves as the stopping criterion. This value is not
included in the range.
step = The value to add to the current value at each iteration.
Returns:
A range that goes through the numbers `begin`, $(D begin + step),
$(D begin + 2 * step), `...`, up to and excluding `end`.
The two-argument overloads have $(D step = 1). If $(D begin < end && step <
0) or $(D begin > end && step > 0) or $(D begin == end), then an empty range
is returned. If $(D step == 0) then $(D begin == end) is an error.
For built-in types, the range returned is a random access range. For
user-defined types that support `++`, the range is an input
range.
An integral iota also supports `in` operator from the right. It takes
the stepping into account, the integral won't be considered
contained if it falls between two consecutive values of the range.
`contains` does the same as in, but from lefthand side.
Example:
---
void main()
{
import std.stdio;
// The following groups all produce the same output of:
// 0 1 2 3 4
foreach (i; 0 .. 5)
writef("%s ", i);
writeln();
import std.range : iota;
foreach (i; iota(0, 5))
writef("%s ", i);
writeln();
writefln("%(%s %|%)", iota(0, 5));
import std.algorithm.iteration : map;
import std.algorithm.mutation : copy;
import std.format;
iota(0, 5).map!(i => format("%s ", i)).copy(stdout.lockingTextWriter());
writeln();
}
---
*/
auto iota(B, E, S)(B begin, E end, S step)
if ((isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E)))
&& isIntegral!S)
{
import std.conv : unsigned;
alias Value = CommonType!(Unqual!B, Unqual!E);
alias StepType = Unqual!S;
assert(step != 0 || begin == end);
static struct Result
{
private Value current, last;
private StepType step; // by convention, 0 if range is empty
this(Value current, Value pastLast, StepType step)
{
if (current < pastLast && step > 0)
{
// Iterating upward
assert(unsigned((pastLast - current) / step) <= size_t.max);
// Cast below can't fail because current < pastLast
this.last = cast(Value) (pastLast - 1);
this.last -= unsigned(this.last - current) % step;
}
else if (current > pastLast && step < 0)
{
// Iterating downward
assert(unsigned((current - pastLast) / (0 - step)) <= size_t.max);
// Cast below can't fail because current > pastLast
this.last = cast(Value) (pastLast + 1);
this.last += unsigned(current - this.last) % (0 - step);
}
else
{
// Initialize an empty range
this.step = 0;
return;
}
this.step = step;
this.current = current;
}
@property bool empty() const { return step == 0; }
@property inout(Value) front() inout { assert(!empty); return current; }
void popFront()
{
assert(!empty);
if (current == last) step = 0;
else current += step;
}
@property inout(Value) back() inout
{
assert(!empty);
return last;
}
void popBack()
{
assert(!empty);
if (current == last) step = 0;
else last -= step;
}
@property auto save() { return this; }
inout(Value) opIndex(ulong n) inout
{
assert(n < this.length);
// Just cast to Value here because doing so gives overflow behavior
// consistent with calling popFront() n times.
return cast(inout Value) (current + step * n);
}
auto opBinaryRight(string op)(Value val) const
if (op == "in")
{
if (empty) return false;
//cast to avoid becoming unsigned
auto supposedIndex = cast(StepType)(val - current) / step;
return supposedIndex < length && supposedIndex * step + current == val;
}
auto contains(Value x){return x in this;}
inout(Result) opSlice() inout { return this; }
inout(Result) opSlice(ulong lower, ulong upper) inout
{
assert(upper >= lower && upper <= this.length);
return cast(inout Result) Result(
cast(Value)(current + lower * step),
cast(Value)(current + upper * step),
step);
}
@property size_t length() const
{
if (step > 0)
return 1 + cast(size_t) (unsigned(last - current) / step);
if (step < 0)
return 1 + cast(size_t) (unsigned(current - last) / (0 - step));
return 0;
}
alias opDollar = length;
}
return Result(begin, end, step);
}
/// Ditto
auto iota(B, E)(B begin, E end)
if (isFloatingPoint!(CommonType!(B, E)))
{
return iota(begin, end, CommonType!(B, E)(1));
}
/// Ditto
auto iota(B, E)(B begin, E end)
if (isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E)))
{
import std.conv : unsigned;
alias Value = CommonType!(Unqual!B, Unqual!E);
static struct Result
{
private Value current, pastLast;
this(Value current, Value pastLast)
{
if (current < pastLast)
{
assert(unsigned(pastLast - current) <= size_t.max);
this.current = current;
this.pastLast = pastLast;
}
else
{
// Initialize an empty range
this.current = this.pastLast = current;
}
}
@property bool empty() const { return current == pastLast; }
@property inout(Value) front() inout { assert(!empty); return current; }
void popFront() { assert(!empty); ++current; }
@property inout(Value) back() inout { assert(!empty); return cast(inout(Value))(pastLast - 1); }
void popBack() { assert(!empty); --pastLast; }
@property auto save() { return this; }
inout(Value) opIndex(size_t n) inout
{
assert(n < this.length);
// Just cast to Value here because doing so gives overflow behavior
// consistent with calling popFront() n times.
return cast(inout Value) (current + n);
}
auto opBinaryRight(string op)(Value val) const
if (op == "in")
{
return current <= val && val < pastLast;
}
auto contains(Value x){return x in this;}
inout(Result) opSlice() inout { return this; }
inout(Result) opSlice(ulong lower, ulong upper) inout
{
assert(upper >= lower && upper <= this.length);
return cast(inout Result) Result(cast(Value)(current + lower),
cast(Value)(pastLast - (length - upper)));
}
@property size_t length() const
{
return cast(size_t)(pastLast - current);
}
alias opDollar = length;
}
return Result(begin, end);
}
/// Ditto
auto iota(E)(E end)
if (is(typeof(iota(E(0), end))))
{
E begin = E(0);
return iota(begin, end);
}
/// Ditto
// Specialization for floating-point types
auto iota(B, E, S)(B begin, E end, S step)
if (isFloatingPoint!(CommonType!(B, E, S)))
in
{
assert(step != 0, "iota: step must not be 0");
assert((end - begin) / step >= 0, "iota: incorrect startup parameters");
}
do
{
alias Value = Unqual!(CommonType!(B, E, S));
static struct Result
{
private Value start, step;
private size_t index, count;
this(Value start, Value end, Value step)
{
import std.conv : to;
this.start = start;
this.step = step;
immutable fcount = (end - start) / step;
count = to!size_t(fcount);
auto pastEnd = start + count * step;
if (step > 0)
{
if (pastEnd < end) ++count;
assert(start + count * step >= end);
}
else
{
if (pastEnd > end) ++count;
assert(start + count * step <= end);
}
}
@property bool empty() const { return index == count; }
@property Value front() const { assert(!empty); return start + step * index; }
void popFront()
{
assert(!empty);
++index;
}
@property Value back() const
{
assert(!empty);
return start + step * (count - 1);
}
void popBack()
{
assert(!empty);
--count;
}
@property auto save() { return this; }
Value opIndex(size_t n) const
{
assert(n < count);
return start + step * (n + index);
}
inout(Result) opSlice() inout
{
return this;
}
inout(Result) opSlice(size_t lower, size_t upper) inout
{
assert(upper >= lower && upper <= count);
Result ret = this;
ret.index += lower;
ret.count = upper - lower + ret.index;
return cast(inout Result) ret;
}
@property size_t length() const
{
return count - index;
}
alias opDollar = length;
}
return Result(begin, end, step);
}
///
pure @safe unittest
{
import std.algorithm.comparison : equal;
import std.math : isClose;
auto r = iota(0, 10, 1);
assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
assert(3 in r);
assert(r.contains(3)); //Same as above
assert(!(10 in r));
assert(!(-8 in r));
r = iota(0, 11, 3);
assert(equal(r, [0, 3, 6, 9]));
assert(r[2] == 6);
assert(!(2 in r));
auto rf = iota(0.0, 0.5, 0.1);
assert(isClose(rf, [0.0, 0.1, 0.2, 0.3, 0.4]));
}
pure nothrow @nogc @safe unittest
{
import std.traits : Signed;
//float overloads use std.conv.to so can't be @nogc or nothrow
alias ssize_t = Signed!size_t;
assert(iota(ssize_t.max, 0, -1).length == ssize_t.max);
assert(iota(ssize_t.max, ssize_t.min, -1).length == size_t.max);
assert(iota(ssize_t.max, ssize_t.min, -2).length == 1 + size_t.max / 2);
assert(iota(ssize_t.min, ssize_t.max, 2).length == 1 + size_t.max / 2);
assert(iota(ssize_t.max, ssize_t.min, -3).length == size_t.max / 3);
}
debug @system unittest
{//check the contracts
import core.exception : AssertError;
import std.exception : assertThrown;
assertThrown!AssertError(iota(1,2,0));
assertThrown!AssertError(iota(0f,1f,0f));
assertThrown!AssertError(iota(1f,0f,0.1f));
assertThrown!AssertError(iota(0f,1f,-0.1f));
}
pure @system nothrow unittest
{
int[] a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
auto r1 = iota(a.ptr, a.ptr + a.length, 1);
assert(r1.front == a.ptr);
assert(r1.back == a.ptr + a.length - 1);
assert(&a[4] in r1);
}
pure @safe nothrow @nogc unittest
{
assert(iota(1UL, 0UL).length == 0);
assert(iota(1UL, 0UL, 1).length == 0);
assert(iota(0, 1, 1).length == 1);
assert(iota(1, 0, -1).length == 1);
assert(iota(0, 1, -1).length == 0);
assert(iota(ulong.max, 0).length == 0);
}
pure @safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.searching : count;
import std.math : isClose, nextUp, nextDown;
import std.meta : AliasSeq;
static assert(is(ElementType!(typeof(iota(0f))) == float));
static assert(hasLength!(typeof(iota(0, 2))));
auto r = iota(0, 10, 1);
assert(r[$ - 1] == 9);
assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9][]));
auto rSlice = r[2 .. 8];
assert(equal(rSlice, [2, 3, 4, 5, 6, 7]));
rSlice.popFront();
assert(rSlice[0] == rSlice.front);
assert(rSlice.front == 3);
rSlice.popBack();
assert(rSlice[rSlice.length - 1] == rSlice.back);
assert(rSlice.back == 6);
rSlice = r[0 .. 4];
assert(equal(rSlice, [0, 1, 2, 3]));
assert(3 in rSlice);
assert(!(4 in rSlice));
auto rr = iota(10);
assert(equal(rr, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9][]));
r = iota(0, -10, -1);
assert(equal(r, [0, -1, -2, -3, -4, -5, -6, -7, -8, -9][]));
rSlice = r[3 .. 9];
assert(equal(rSlice, [-3, -4, -5, -6, -7, -8]));
r = iota(0, -6, -3);
assert(equal(r, [0, -3][]));
rSlice = r[1 .. 2];
assert(equal(rSlice, [-3]));
r = iota(0, -7, -3);
assert(equal(r, [0, -3, -6][]));
assert(0 in r);
assert(-6 in r);
rSlice = r[1 .. 3];
assert(equal(rSlice, [-3, -6]));
assert(!(0 in rSlice));
assert(!(-2 in rSlice));
assert(!(-5 in rSlice));
assert(!(3 in rSlice));
assert(!(-9 in rSlice));
r = iota(0, 11, 3);
assert(equal(r, [0, 3, 6, 9][]));
assert(r[2] == 6);
rSlice = r[1 .. 3];
assert(equal(rSlice, [3, 6]));
auto rf = iota(0.0, 0.5, 0.1);
assert(isClose(rf, [0.0, 0.1, 0.2, 0.3, 0.4][]));
assert(rf.length == 5);
rf.popFront();
assert(rf.length == 4);
auto rfSlice = rf[1 .. 4];
assert(rfSlice.length == 3);
assert(isClose(rfSlice, [0.2, 0.3, 0.4]));
rfSlice.popFront();
assert(isClose(rfSlice[0], 0.3));
rf.popFront();
assert(rf.length == 3);
rfSlice = rf[1 .. 3];
assert(rfSlice.length == 2);
assert(isClose(rfSlice, [0.3, 0.4]));
assert(isClose(rfSlice[0], 0.3));
// With something just above 0.5
rf = iota(0.0, nextUp(0.5), 0.1);
assert(isClose(rf, [0.0, 0.1, 0.2, 0.3, 0.4, 0.5][]));
rf.popBack();
assert(rf[rf.length - 1] == rf.back);
assert(isClose(rf.back, 0.4));
assert(rf.length == 5);
// going down
rf = iota(0.0, -0.5, -0.1);
assert(isClose(rf, [0.0, -0.1, -0.2, -0.3, -0.4][]));
rfSlice = rf[2 .. 5];
assert(isClose(rfSlice, [-0.2, -0.3, -0.4]));
rf = iota(0.0, nextDown(-0.5), -0.1);
assert(isClose(rf, [0.0, -0.1, -0.2, -0.3, -0.4, -0.5][]));
// iota of longs
auto rl = iota(5_000_000L);
assert(rl.length == 5_000_000L);
assert(0 in rl);
assert(4_000_000L in rl);
assert(!(-4_000_000L in rl));
assert(!(5_000_000L in rl));
// iota of longs with steps
auto iota_of_longs_with_steps = iota(50L, 101L, 10);
assert(iota_of_longs_with_steps.length == 6);
assert(equal(iota_of_longs_with_steps, [50L, 60L, 70L, 80L, 90L, 100L]));
// iota of unsigned zero length (https://issues.dlang.org/show_bug.cgi?id=6222)
// Actually trying to consume it is the only way to find something is wrong
// because the public properties are all correct.
auto iota_zero_unsigned = iota(0, 0u, 3);
assert(count(iota_zero_unsigned) == 0);
// https://issues.dlang.org/show_bug.cgi?id=7982
// unsigned reverse iota can be buggy if `.length` doesn't
// take them into account
assert(iota(10u, 0u, -1).length == 10);
assert(iota(10u, 0u, -2).length == 5);
assert(iota(uint.max, uint.max-10, -1).length == 10);
assert(iota(uint.max, uint.max-10, -2).length == 5);
assert(iota(uint.max, 0u, -1).length == uint.max);
assert(20 in iota(20u, 10u, -2));
assert(16 in iota(20u, 10u, -2));
assert(!(15 in iota(20u, 10u, -2)));
assert(!(10 in iota(20u, 10u, -2)));
assert(!(uint.max in iota(20u, 10u, -1)));
assert(!(int.min in iota(20u, 10u, -1)));
assert(!(int.max in iota(20u, 10u, -1)));
// https://issues.dlang.org/show_bug.cgi?id=8920
static foreach (Type; AliasSeq!(byte, ubyte, short, ushort,
int, uint, long, ulong))
{{
Type val;
foreach (i; iota(cast(Type) 0, cast(Type) 10)) { val++; }
assert(val == 10);
}}
}
pure @safe nothrow unittest
{
import std.algorithm.mutation : copy;
auto idx = new size_t[100];
copy(iota(0, idx.length), idx);
}
@safe unittest
{
import std.meta : AliasSeq;
static foreach (range; AliasSeq!(iota(2, 27, 4),
iota(3, 9),
iota(2.7, 12.3, .1),
iota(3.2, 9.7)))
{{
const cRange = range;
const e = cRange.empty;
const f = cRange.front;
const b = cRange.back;
const i = cRange[2];
const s1 = cRange[];
const s2 = cRange[0 .. 3];
const l = cRange.length;
}}
}
@system unittest
{
//The ptr stuff can't be done at compile time, so we unfortunately end
//up with some code duplication here.
auto arr = [0, 5, 3, 5, 5, 7, 9, 2, 0, 42, 7, 6];
{
const cRange = iota(arr.ptr, arr.ptr + arr.length, 3);
const e = cRange.empty;
const f = cRange.front;
const b = cRange.back;
const i = cRange[2];
const s1 = cRange[];
const s2 = cRange[0 .. 3];
const l = cRange.length;
}
{
const cRange = iota(arr.ptr, arr.ptr + arr.length);
const e = cRange.empty;
const f = cRange.front;
const b = cRange.back;
const i = cRange[2];
const s1 = cRange[];
const s2 = cRange[0 .. 3];
const l = cRange.length;
}
}
@nogc nothrow pure @safe unittest
{
{
ushort start = 0, end = 10, step = 2;
foreach (i; iota(start, end, step))
static assert(is(typeof(i) == ushort));
}
{
ubyte start = 0, end = 255, step = 128;
uint x;
foreach (i; iota(start, end, step))
{
static assert(is(typeof(i) == ubyte));
++x;
}
assert(x == 2);
}
}
/* Generic overload that handles arbitrary types that support arithmetic
* operations.
*
* User-defined types such as $(REF BigInt, std,bigint) are also supported, as long
* as they can be incremented with `++` and compared with `<` or `==`.
*/
/// ditto
auto iota(B, E)(B begin, E end)
if (!isIntegral!(CommonType!(B, E)) &&
!isFloatingPoint!(CommonType!(B, E)) &&
!isPointer!(CommonType!(B, E)) &&
is(typeof((ref B b) { ++b; })) &&
(is(typeof(B.init < E.init)) || is(typeof(B.init == E.init))) )
{
static struct Result
{
B current;
E end;
@property bool empty()
{
static if (is(typeof(B.init < E.init)))
return !(current < end);
else static if (is(typeof(B.init != E.init)))
return current == end;
else
static assert(0);
}
@property auto front() { return current; }
void popFront()
{
assert(!empty);
++current;
}
}
return Result(begin, end);
}
@safe unittest
{
import std.algorithm.comparison : equal;
// Test iota() for a type that only supports ++ and != but does not have
// '<'-ordering.
struct Cyclic(int wrapAround)
{
int current;
this(int start) { current = start % wrapAround; }
bool opEquals(Cyclic c) const { return current == c.current; }
bool opEquals(int i) const { return current == i; }
void opUnary(string op)() if (op == "++")
{
current = (current + 1) % wrapAround;
}
}
alias Cycle5 = Cyclic!5;
// Easy case
auto i1 = iota(Cycle5(1), Cycle5(4));
assert(i1.equal([1, 2, 3]));
// Wraparound case
auto i2 = iota(Cycle5(3), Cycle5(2));
assert(i2.equal([3, 4, 0, 1 ]));
}
/**
Options for the $(LREF FrontTransversal) and $(LREF Transversal) ranges
(below).
*/
enum TransverseOptions
{
/**
When transversed, the elements of a range of ranges are assumed to
have different lengths (e.g. a jagged array).
*/
assumeJagged, //default
/**
The transversal enforces that the elements of a range of ranges have
all the same length (e.g. an array of arrays, all having the same
length). Checking is done once upon construction of the transversal
range.
*/
enforceNotJagged,
/**
The transversal assumes, without verifying, that the elements of a
range of ranges have all the same length. This option is useful if
checking was already done from the outside of the range.
*/
assumeNotJagged,
}
///
@safe pure unittest
{
import std.algorithm.comparison : equal;
import std.exception : assertThrown;
auto arr = [[1, 2], [3, 4, 5]];
auto r1 = arr.frontTransversal!(TransverseOptions.assumeJagged);
assert(r1.equal([1, 3]));
// throws on construction
assertThrown!Exception(arr.frontTransversal!(TransverseOptions.enforceNotJagged));
auto r2 = arr.frontTransversal!(TransverseOptions.assumeNotJagged);
assert(r2.equal([1, 3]));
// either assuming or checking for equal lengths makes
// the result a random access range
assert(r2[0] == 1);
static assert(!__traits(compiles, r1[0]));
}
/**
Given a range of ranges, iterate transversally through the first
elements of each of the enclosed ranges.
*/
struct FrontTransversal(Ror,
TransverseOptions opt = TransverseOptions.assumeJagged)
{
alias RangeOfRanges = Unqual!(Ror);
alias RangeType = .ElementType!RangeOfRanges;
alias ElementType = .ElementType!RangeType;
private void prime()
{
static if (opt == TransverseOptions.assumeJagged)
{
while (!_input.empty && _input.front.empty)
{
_input.popFront();
}
static if (isBidirectionalRange!RangeOfRanges)
{
while (!_input.empty && _input.back.empty)
{
_input.popBack();
}
}
}
}
/**
Construction from an input.
*/
this(RangeOfRanges input)
{
_input = input;
prime();
static if (opt == TransverseOptions.enforceNotJagged)
// (isRandomAccessRange!RangeOfRanges
// && hasLength!RangeType)
{
import std.exception : enforce;
if (empty) return;
immutable commonLength = _input.front.length;
foreach (e; _input)
{
enforce(e.length == commonLength);
}
}
}
/**
Forward range primitives.
*/
static if (isInfinite!RangeOfRanges)
{
enum bool empty = false;
}
else
{
@property bool empty()
{
static if (opt != TransverseOptions.assumeJagged)
{
if (!_input.empty)
return _input.front.empty;
}
return _input.empty;
}
}
/// Ditto
@property auto ref front()
{
assert(!empty, "Attempting to fetch the front of an empty FrontTransversal");
return _input.front.front;
}
/// Ditto
static if (hasMobileElements!RangeType)
{
ElementType moveFront()
{
return _input.front.moveFront();
}
}
static if (hasAssignableElements!RangeType)
{
@property void front(ElementType val)
{
_input.front.front = val;
}
}
/// Ditto
void popFront()
{
assert(!empty, "Attempting to popFront an empty FrontTransversal");
_input.popFront();
prime();
}
/**
Duplicates this `frontTransversal`. Note that only the encapsulating
range of range will be duplicated. Underlying ranges will not be
duplicated.
*/
static if (isForwardRange!RangeOfRanges)
{
@property FrontTransversal save()
{
return FrontTransversal(_input.save);
}
}
static if (isBidirectionalRange!RangeOfRanges)
{
/**
Bidirectional primitives. They are offered if $(D
isBidirectionalRange!RangeOfRanges).
*/
@property auto ref back()
{
assert(!empty, "Attempting to fetch the back of an empty FrontTransversal");
return _input.back.front;
}
/// Ditto
void popBack()
{
assert(!empty, "Attempting to popBack an empty FrontTransversal");
_input.popBack();
prime();
}
/// Ditto
static if (hasMobileElements!RangeType)
{
ElementType moveBack()
{
return _input.back.moveFront();
}
}
static if (hasAssignableElements!RangeType)
{
@property void back(ElementType val)
{
_input.back.front = val;
}
}
}
static if (isRandomAccessRange!RangeOfRanges &&
(opt == TransverseOptions.assumeNotJagged ||
opt == TransverseOptions.enforceNotJagged))
{
/**
Random-access primitive. It is offered if $(D
isRandomAccessRange!RangeOfRanges && (opt ==
TransverseOptions.assumeNotJagged || opt ==
TransverseOptions.enforceNotJagged)).
*/
auto ref opIndex(size_t n)
{
return _input[n].front;
}
/// Ditto
static if (hasMobileElements!RangeType)
{
ElementType moveAt(size_t n)
{
return _input[n].moveFront();
}
}
/// Ditto
static if (hasAssignableElements!RangeType)
{
void opIndexAssign(ElementType val, size_t n)
{
_input[n].front = val;
}
}
mixin ImplementLength!_input;
/**
Slicing if offered if `RangeOfRanges` supports slicing and all the
conditions for supporting indexing are met.
*/
static if (hasSlicing!RangeOfRanges)
{
typeof(this) opSlice(size_t lower, size_t upper)
{
return typeof(this)(_input[lower .. upper]);
}
}
}
auto opSlice() { return this; }
private:
RangeOfRanges _input;
}
/// Ditto
FrontTransversal!(RangeOfRanges, opt) frontTransversal(
TransverseOptions opt = TransverseOptions.assumeJagged,
RangeOfRanges)
(RangeOfRanges rr)
{
return typeof(return)(rr);
}
///
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
int[][] x = new int[][2];
x[0] = [1, 2];
x[1] = [3, 4];
auto ror = frontTransversal(x);
assert(equal(ror, [ 1, 3 ][]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : AllDummyRanges, DummyRange, ReturnBy;
static assert(is(FrontTransversal!(immutable int[][])));
foreach (DummyType; AllDummyRanges)
{
auto dummies =
[DummyType.init, DummyType.init, DummyType.init, DummyType.init];
foreach (i, ref elem; dummies)
{
// Just violate the DummyRange abstraction to get what I want.
elem.arr = elem.arr[i..$ - (3 - i)];
}
auto ft = frontTransversal!(TransverseOptions.assumeNotJagged)(dummies);
static if (isForwardRange!DummyType)
{
static assert(isForwardRange!(typeof(ft)));
}
assert(equal(ft, [1, 2, 3, 4]));
// Test slicing.
assert(equal(ft[0 .. 2], [1, 2]));
assert(equal(ft[1 .. 3], [2, 3]));
assert(ft.front == ft.moveFront());
assert(ft.back == ft.moveBack());
assert(ft.moveAt(1) == ft[1]);
// Test infiniteness propagation.
static assert(isInfinite!(typeof(frontTransversal(repeat("foo")))));
static if (DummyType.r == ReturnBy.Reference)
{
{
ft.front++;
scope(exit) ft.front--;
assert(dummies.front.front == 2);
}
{
ft.front = 5;
scope(exit) ft.front = 1;
assert(dummies[0].front == 5);
}
{
ft.back = 88;
scope(exit) ft.back = 4;
assert(dummies.back.front == 88);
}
{
ft[1] = 99;
scope(exit) ft[1] = 2;
assert(dummies[1].front == 99);
}
}
}
}
// https://issues.dlang.org/show_bug.cgi?id=16363
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
int[][] darr = [[0, 1], [4, 5]];
auto ft = frontTransversal!(TransverseOptions.assumeNotJagged)(darr);
assert(equal(ft, [0, 4]));
static assert(isRandomAccessRange!(typeof(ft)));
}
// https://issues.dlang.org/show_bug.cgi?id=16442
pure @safe nothrow unittest
{
int[][] arr = [[], []];
auto ft = frontTransversal!(TransverseOptions.assumeNotJagged)(arr);
assert(ft.empty);
}
// ditto
pure @safe unittest
{
int[][] arr = [[], []];
auto ft = frontTransversal!(TransverseOptions.enforceNotJagged)(arr);
assert(ft.empty);
}
/**
Given a range of ranges, iterate transversally through the
`n`th element of each of the enclosed ranges. This function
is similar to `unzip` in other languages.
Params:
opt = Controls the assumptions the function makes about the lengths
of the ranges
rr = An input range of random access ranges
Returns:
At minimum, an input range. Range primitives such as bidirectionality
and random access are given if the element type of `rr` provides them.
*/
struct Transversal(Ror,
TransverseOptions opt = TransverseOptions.assumeJagged)
{
private alias RangeOfRanges = Unqual!Ror;
private alias InnerRange = ElementType!RangeOfRanges;
private alias E = ElementType!InnerRange;
private void prime()
{
static if (opt == TransverseOptions.assumeJagged)
{
while (!_input.empty && _input.front.length <= _n)
{
_input.popFront();
}
static if (isBidirectionalRange!RangeOfRanges)
{
while (!_input.empty && _input.back.length <= _n)
{
_input.popBack();
}
}
}
}
/**
Construction from an input and an index.
*/
this(RangeOfRanges input, size_t n)
{
_input = input;
_n = n;
prime();
static if (opt == TransverseOptions.enforceNotJagged)
{
import std.exception : enforce;
if (empty) return;
immutable commonLength = _input.front.length;
foreach (e; _input)
{
enforce(e.length == commonLength);
}
}
}
/**
Forward range primitives.
*/
static if (isInfinite!(RangeOfRanges))
{
enum bool empty = false;
}
else
{
@property bool empty()
{
return _input.empty;
}
}
/// Ditto
@property auto ref front()
{
assert(!empty, "Attempting to fetch the front of an empty Transversal");
return _input.front[_n];
}
/// Ditto
static if (hasMobileElements!InnerRange)
{
E moveFront()
{
return _input.front.moveAt(_n);
}
}
/// Ditto
static if (hasAssignableElements!InnerRange)
{
@property void front(E val)
{
_input.front[_n] = val;
}
}
/// Ditto
void popFront()
{
assert(!empty, "Attempting to popFront an empty Transversal");
_input.popFront();
prime();
}
/// Ditto
static if (isForwardRange!RangeOfRanges)
{
@property typeof(this) save()
{
auto ret = this;
ret._input = _input.save;
return ret;
}
}
static if (isBidirectionalRange!RangeOfRanges)
{
/**
Bidirectional primitives. They are offered if $(D
isBidirectionalRange!RangeOfRanges).
*/
@property auto ref back()
{
assert(!empty, "Attempting to fetch the back of an empty Transversal");
return _input.back[_n];
}
/// Ditto
void popBack()
{
assert(!empty, "Attempting to popBack an empty Transversal");
_input.popBack();
prime();
}
/// Ditto
static if (hasMobileElements!InnerRange)
{
E moveBack()
{
return _input.back.moveAt(_n);
}
}
/// Ditto
static if (hasAssignableElements!InnerRange)
{
@property void back(E val)
{
_input.back[_n] = val;
}
}
}
static if (isRandomAccessRange!RangeOfRanges &&
(opt == TransverseOptions.assumeNotJagged ||
opt == TransverseOptions.enforceNotJagged))
{
/**
Random-access primitive. It is offered if $(D
isRandomAccessRange!RangeOfRanges && (opt ==
TransverseOptions.assumeNotJagged || opt ==
TransverseOptions.enforceNotJagged)).
*/
auto ref opIndex(size_t n)
{
return _input[n][_n];
}
/// Ditto
static if (hasMobileElements!InnerRange)
{
E moveAt(size_t n)
{
return _input[n].moveAt(_n);
}
}
/// Ditto
static if (hasAssignableElements!InnerRange)
{
void opIndexAssign(E val, size_t n)
{
_input[n][_n] = val;
}
}
mixin ImplementLength!_input;
/**
Slicing if offered if `RangeOfRanges` supports slicing and all the
conditions for supporting indexing are met.
*/
static if (hasSlicing!RangeOfRanges)
{
typeof(this) opSlice(size_t lower, size_t upper)
{
return typeof(this)(_input[lower .. upper], _n);
}
}
}
auto opSlice() { return this; }
private:
RangeOfRanges _input;
size_t _n;
}
/// Ditto
Transversal!(RangeOfRanges, opt) transversal
(TransverseOptions opt = TransverseOptions.assumeJagged, RangeOfRanges)
(RangeOfRanges rr, size_t n)
{
return typeof(return)(rr, n);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
int[][] x = new int[][2];
x[0] = [1, 2];
x[1] = [3, 4];
auto ror = transversal(x, 1);
assert(equal(ror, [ 2, 4 ]));
}
/// The following code does a full unzip
@safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : map;
int[][] y = [[1, 2, 3], [4, 5, 6]];
auto z = y.front.walkLength.iota.map!(i => transversal(y, i));
assert(equal!equal(z, [[1, 4], [2, 5], [3, 6]]));
}
@safe unittest
{
import std.internal.test.dummyrange : DummyRange, Length, RangeType, ReturnBy;
int[][] x = new int[][2];
x[0] = [ 1, 2 ];
x[1] = [3, 4];
auto ror = transversal!(TransverseOptions.assumeNotJagged)(x, 1);
auto witness = [ 2, 4 ];
uint i;
foreach (e; ror) assert(e == witness[i++]);
assert(i == 2);
assert(ror.length == 2);
static assert(is(Transversal!(immutable int[][])));
// Make sure ref, assign is being propagated.
{
ror.front++;
scope(exit) ror.front--;
assert(x[0][1] == 3);
}
{
ror.front = 5;
scope(exit) ror.front = 2;
assert(x[0][1] == 5);
assert(ror.moveFront() == 5);
}
{
ror.back = 999;
scope(exit) ror.back = 4;
assert(x[1][1] == 999);
assert(ror.moveBack() == 999);
}
{
ror[0] = 999;
scope(exit) ror[0] = 2;
assert(x[0][1] == 999);
assert(ror.moveAt(0) == 999);
}
// Test w/o ref return.
alias D = DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Random);
auto drs = [D.init, D.init];
foreach (num; 0 .. 10)
{
auto t = transversal!(TransverseOptions.enforceNotJagged)(drs, num);
assert(t[0] == t[1]);
assert(t[1] == num + 1);
}
static assert(isInfinite!(typeof(transversal(repeat([1,2,3]), 1))));
// Test slicing.
auto mat = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]];
auto mat1 = transversal!(TransverseOptions.assumeNotJagged)(mat, 1)[1 .. 3];
assert(mat1[0] == 6);
assert(mat1[1] == 10);
}
struct Transposed(RangeOfRanges,
TransverseOptions opt = TransverseOptions.assumeJagged)
if (isForwardRange!RangeOfRanges &&
isInputRange!(ElementType!RangeOfRanges) &&
hasAssignableElements!RangeOfRanges)
{
this(RangeOfRanges input)
{
this._input = input;
static if (opt == TransverseOptions.enforceNotJagged)
{
import std.exception : enforce;
if (empty) return;
immutable commonLength = _input.front.length;
foreach (e; _input)
{
enforce(e.length == commonLength);
}
}
}
@property auto front()
{
import std.algorithm.iteration : filter, map;
return _input.save
.filter!(a => !a.empty)
.map!(a => a.front);
}
void popFront()
{
// Advance the position of each subrange.
auto r = _input.save;
while (!r.empty)
{
auto e = r.front;
if (!e.empty)
{
e.popFront();
r.front = e;
}
r.popFront();
}
}
static if (isRandomAccessRange!(ElementType!RangeOfRanges))
{
auto ref opIndex(size_t n)
{
return transversal!opt(_input, n);
}
}
@property bool empty()
{
if (_input.empty) return true;
foreach (e; _input.save)
{
if (!e.empty) return false;
}
return true;
}
deprecated("This function is incorrect and will be removed November 2018. See the docs for more details.")
@property Transposed save()
{
return Transposed(_input.save);
}
auto opSlice() { return this; }
private:
RangeOfRanges _input;
}
@safe unittest
{
// Boundary case: transpose of empty range should be empty
int[][] ror = [];
assert(transposed(ror).empty);
}
// https://issues.dlang.org/show_bug.cgi?id=9507
@safe unittest
{
import std.algorithm.comparison : equal;
auto r = [[1,2], [3], [4,5], [], [6]];
assert(r.transposed.equal!equal([
[1, 3, 4, 6],
[2, 5]
]));
}
// https://issues.dlang.org/show_bug.cgi?id=17742
@safe unittest
{
import std.algorithm.iteration : map;
import std.algorithm.comparison : equal;
auto ror = 5.iota.map!(y => 5.iota.map!(x => x * y).array).array;
assert(ror[3][2] == 6);
auto result = transposed!(TransverseOptions.assumeNotJagged)(ror);
assert(result[2][3] == 6);
auto x = [[1,2,3],[4,5,6]];
auto y = transposed!(TransverseOptions.assumeNotJagged)(x);
assert(y.front.equal([1,4]));
assert(y[0].equal([1,4]));
assert(y[0][0] == 1);
assert(y[1].equal([2,5]));
assert(y[1][1] == 5);
auto yy = transposed!(TransverseOptions.enforceNotJagged)(x);
assert(yy.front.equal([1,4]));
assert(yy[0].equal([1,4]));
assert(yy[0][0] == 1);
assert(yy[1].equal([2,5]));
assert(yy[1][1] == 5);
auto z = x.transposed; // assumeJagged
assert(z.front.equal([1,4]));
assert(z[0].equal([1,4]));
assert(!is(typeof(z[0][0])));
}
@safe unittest
{
import std.exception : assertThrown;
auto r = [[1,2], [3], [4,5], [], [6]];
assertThrown(r.transposed!(TransverseOptions.enforceNotJagged));
}
/**
Given a range of ranges, returns a range of ranges where the $(I i)'th subrange
contains the $(I i)'th elements of the original subranges.
$(RED `Transposed` currently defines `save`, but does not work as a forward range.
Consuming a copy made with `save` will consume all copies, even the original sub-ranges
fed into `Transposed`.)
Params:
opt = Controls the assumptions the function makes about the lengths of the ranges (i.e. jagged or not)
rr = Range of ranges
*/
Transposed!(RangeOfRanges, opt) transposed
(TransverseOptions opt = TransverseOptions.assumeJagged, RangeOfRanges)
(RangeOfRanges rr)
if (isForwardRange!RangeOfRanges &&
isInputRange!(ElementType!RangeOfRanges) &&
hasAssignableElements!RangeOfRanges)
{
return Transposed!(RangeOfRanges, opt)(rr);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
int[][] ror = [
[1, 2, 3],
[4, 5, 6]
];
auto xp = transposed(ror);
assert(equal!"a.equal(b)"(xp, [
[1, 4],
[2, 5],
[3, 6]
]));
}
///
@safe unittest
{
int[][] x = new int[][2];
x[0] = [1, 2];
x[1] = [3, 4];
auto tr = transposed(x);
int[][] witness = [ [ 1, 3 ], [ 2, 4 ] ];
uint i;
foreach (e; tr)
{
assert(array(e) == witness[i++]);
}
}
// https://issues.dlang.org/show_bug.cgi?id=8764
@safe unittest
{
import std.algorithm.comparison : equal;
ulong[1] t0 = [ 123 ];
assert(!hasAssignableElements!(typeof(t0[].chunks(1))));
assert(!is(typeof(transposed(t0[].chunks(1)))));
assert(is(typeof(transposed(t0[].chunks(1).array()))));
auto t1 = transposed(t0[].chunks(1).array());
assert(equal!"a.equal(b)"(t1, [[123]]));
}
/**
This struct takes two ranges, `source` and `indices`, and creates a view
of `source` as if its elements were reordered according to `indices`.
`indices` may include only a subset of the elements of `source` and
may also repeat elements.
`Source` must be a random access range. The returned range will be
bidirectional or random-access if `Indices` is bidirectional or
random-access, respectively.
*/
struct Indexed(Source, Indices)
if (isRandomAccessRange!Source && isInputRange!Indices &&
is(typeof(Source.init[ElementType!(Indices).init])))
{
this(Source source, Indices indices)
{
this._source = source;
this._indices = indices;
}
/// Range primitives
@property auto ref front()
{
assert(!empty, "Attempting to fetch the front of an empty Indexed");
return _source[_indices.front];
}
/// Ditto
void popFront()
{
assert(!empty, "Attempting to popFront an empty Indexed");
_indices.popFront();
}
static if (isInfinite!Indices)
{
enum bool empty = false;
}
else
{
/// Ditto
@property bool empty()
{
return _indices.empty;
}
}
static if (isForwardRange!Indices)
{
/// Ditto
@property typeof(this) save()
{
// Don't need to save _source because it's never consumed.
return typeof(this)(_source, _indices.save);
}
}
/// Ditto
static if (hasAssignableElements!Source)
{
@property auto ref front(ElementType!Source newVal)
{
assert(!empty);
return _source[_indices.front] = newVal;
}
}
static if (hasMobileElements!Source)
{
/// Ditto
auto moveFront()
{
assert(!empty);
return _source.moveAt(_indices.front);
}
}
static if (isBidirectionalRange!Indices)
{
/// Ditto
@property auto ref back()
{
assert(!empty, "Attempting to fetch the back of an empty Indexed");
return _source[_indices.back];
}
/// Ditto
void popBack()
{
assert(!empty, "Attempting to popBack an empty Indexed");
_indices.popBack();
}
/// Ditto
static if (hasAssignableElements!Source)
{
@property auto ref back(ElementType!Source newVal)
{
assert(!empty);
return _source[_indices.back] = newVal;
}
}
static if (hasMobileElements!Source)
{
/// Ditto
auto moveBack()
{
assert(!empty);
return _source.moveAt(_indices.back);
}
}
}
mixin ImplementLength!_indices;
static if (isRandomAccessRange!Indices)
{
/// Ditto
auto ref opIndex(size_t index)
{
return _source[_indices[index]];
}
static if (hasSlicing!Indices)
{
/// Ditto
typeof(this) opSlice(size_t a, size_t b)
{
return typeof(this)(_source, _indices[a .. b]);
}
}
static if (hasAssignableElements!Source)
{
/// Ditto
auto opIndexAssign(ElementType!Source newVal, size_t index)
{
return _source[_indices[index]] = newVal;
}
}
static if (hasMobileElements!Source)
{
/// Ditto
auto moveAt(size_t index)
{
return _source.moveAt(_indices[index]);
}
}
}
// All this stuff is useful if someone wants to index an Indexed
// without adding a layer of indirection.
/**
Returns the source range.
*/
@property Source source()
{
return _source;
}
/**
Returns the indices range.
*/
@property Indices indices()
{
return _indices;
}
static if (isRandomAccessRange!Indices)
{
/**
Returns the physical index into the source range corresponding to a
given logical index. This is useful, for example, when indexing
an `Indexed` without adding another layer of indirection.
*/
size_t physicalIndex(size_t logicalIndex)
{
return _indices[logicalIndex];
}
///
@safe unittest
{
auto ind = indexed([1, 2, 3, 4, 5], [1, 3, 4]);
assert(ind.physicalIndex(0) == 1);
}
}
private:
Source _source;
Indices _indices;
}
/// Ditto
Indexed!(Source, Indices) indexed(Source, Indices)(Source source, Indices indices)
{
return typeof(return)(source, indices);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
auto source = [1, 2, 3, 4, 5];
auto indices = [4, 3, 1, 2, 0, 4];
auto ind = indexed(source, indices);
assert(equal(ind, [5, 4, 2, 3, 1, 5]));
assert(equal(retro(ind), [5, 1, 3, 2, 4, 5]));
}
@safe unittest
{
{
auto ind = indexed([1, 2, 3, 4, 5], [1, 3, 4]);
assert(ind.physicalIndex(0) == 1);
}
auto source = [1, 2, 3, 4, 5];
auto indices = [4, 3, 1, 2, 0, 4];
auto ind = indexed(source, indices);
// When elements of indices are duplicated and Source has lvalue elements,
// these are aliased in ind.
ind[0]++;
assert(ind[0] == 6);
assert(ind[5] == 6);
}
@safe unittest
{
import std.internal.test.dummyrange : AllDummyRanges, propagatesLength,
propagatesRangeType, RangeType;
foreach (DummyType; AllDummyRanges)
{
auto d = DummyType.init;
auto r = indexed([1, 2, 3, 4, 5], d);
static assert(propagatesRangeType!(DummyType, typeof(r)));
static assert(propagatesLength!(DummyType, typeof(r)));
}
}
/**
This range iterates over fixed-sized chunks of size `chunkSize` of a
`source` range. `Source` must be an $(REF_ALTTEXT input range, isInputRange, std,range,primitives).
`chunkSize` must be greater than zero.
If `!isInfinite!Source` and `source.walkLength` is not evenly
divisible by `chunkSize`, the back element of this range will contain
fewer than `chunkSize` elements.
If `Source` is a forward range, the resulting range will be forward ranges as
well. Otherwise, the resulting chunks will be input ranges consuming the same
input: iterating over `front` will shrink the chunk such that subsequent
invocations of `front` will no longer return the full chunk, and calling
`popFront` on the outer range will invalidate any lingering references to
previous values of `front`.
Params:
source = Range from which the chunks will be selected
chunkSize = Chunk size
See_Also: $(LREF slide)
Returns: Range of chunks.
*/
struct Chunks(Source)
if (isInputRange!Source)
{
static if (isForwardRange!Source)
{
/// Standard constructor
this(Source source, size_t chunkSize)
{
assert(chunkSize != 0, "Cannot create a Chunk with an empty chunkSize");
_source = source;
_chunkSize = chunkSize;
}
/// Input range primitives. Always present.
@property auto front()
{
assert(!empty, "Attempting to fetch the front of an empty Chunks");
return _source.save.take(_chunkSize);
}
/// Ditto
void popFront()
{
assert(!empty, "Attempting to popFront and empty Chunks");
_source.popFrontN(_chunkSize);
}
static if (!isInfinite!Source)
/// Ditto
@property bool empty()
{
return _source.empty;
}
else
// undocumented
enum empty = false;
/// Forward range primitives. Only present if `Source` is a forward range.
@property typeof(this) save()
{
return typeof(this)(_source.save, _chunkSize);
}
static if (hasLength!Source)
{
/// Length. Only if `hasLength!Source` is `true`
@property size_t length()
{
// Note: _source.length + _chunkSize may actually overflow.
// We cast to ulong to mitigate the problem on x86 machines.
// For x64 machines, we just suppose we'll never overflow.
// The "safe" code would require either an extra branch, or a
// modulo operation, which is too expensive for such a rare case
return cast(size_t)((cast(ulong)(_source.length) + _chunkSize - 1) / _chunkSize);
}
//Note: No point in defining opDollar here without slicing.
//opDollar is defined below in the hasSlicing!Source section
}
static if (hasSlicing!Source)
{
//Used for various purposes
private enum hasSliceToEnd = is(typeof(Source.init[_chunkSize .. $]) == Source);
/**
Indexing and slicing operations. Provided only if
`hasSlicing!Source` is `true`.
*/
auto opIndex(size_t index)
{
immutable start = index * _chunkSize;
immutable end = start + _chunkSize;
static if (isInfinite!Source)
return _source[start .. end];
else
{
import std.algorithm.comparison : min;
immutable len = _source.length;
assert(start < len, "chunks index out of bounds");
return _source[start .. min(end, len)];
}
}
/// Ditto
static if (hasLength!Source)
typeof(this) opSlice(size_t lower, size_t upper)
{
import std.algorithm.comparison : min;
assert(lower <= upper && upper <= length, "chunks slicing index out of bounds");
immutable len = _source.length;
return chunks(_source[min(lower * _chunkSize, len) .. min(upper * _chunkSize, len)], _chunkSize);
}
else static if (hasSliceToEnd)
//For slicing an infinite chunk, we need to slice the source to the end.
typeof(takeExactly(this, 0)) opSlice(size_t lower, size_t upper)
{
assert(lower <= upper, "chunks slicing index out of bounds");
return chunks(_source[lower * _chunkSize .. $], _chunkSize).takeExactly(upper - lower);
}
static if (isInfinite!Source)
{
static if (hasSliceToEnd)
{
private static struct DollarToken{}
DollarToken opDollar()
{
return DollarToken();
}
//Slice to dollar
typeof(this) opSlice(size_t lower, DollarToken)
{
return typeof(this)(_source[lower * _chunkSize .. $], _chunkSize);
}
}
}
else
{
//Dollar token carries a static type, with no extra information.
//It can lazily transform into _source.length on algorithmic
//operations such as : chunks[$/2, $-1];
private static struct DollarToken
{
Chunks!Source* mom;
@property size_t momLength()
{
return mom.length;
}
alias momLength this;
}
DollarToken opDollar()
{
return DollarToken(&this);
}
//Slice overloads optimized for using dollar. Without this, to slice to end, we would...
//1. Evaluate chunks.length
//2. Multiply by _chunksSize
//3. To finally just compare it (with min) to the original length of source (!)
//These overloads avoid that.
typeof(this) opSlice(DollarToken, DollarToken)
{
static if (hasSliceToEnd)
return chunks(_source[$ .. $], _chunkSize);
else
{
immutable len = _source.length;
return chunks(_source[len .. len], _chunkSize);
}
}
typeof(this) opSlice(size_t lower, DollarToken)
{
import std.algorithm.comparison : min;
assert(lower <= length, "chunks slicing index out of bounds");
static if (hasSliceToEnd)
return chunks(_source[min(lower * _chunkSize, _source.length) .. $], _chunkSize);
else
{
immutable len = _source.length;
return chunks(_source[min(lower * _chunkSize, len) .. len], _chunkSize);
}
}
typeof(this) opSlice(DollarToken, size_t upper)
{
assert(upper == length, "chunks slicing index out of bounds");
return this[$ .. $];
}
}
}
//Bidirectional range primitives
static if (hasSlicing!Source && hasLength!Source)
{
/**
Bidirectional range primitives. Provided only if both
`hasSlicing!Source` and `hasLength!Source` are `true`.
*/
@property auto back()
{
assert(!empty, "back called on empty chunks");
immutable len = _source.length;
immutable start = (len - 1) / _chunkSize * _chunkSize;
return _source[start .. len];
}
/// Ditto
void popBack()
{
assert(!empty, "popBack() called on empty chunks");
immutable end = (_source.length - 1) / _chunkSize * _chunkSize;
_source = _source[0 .. end];
}
}
private:
Source _source;
size_t _chunkSize;
}
else // is input range only
{
import std.typecons : RefCounted;
static struct Chunk
{
private RefCounted!Impl impl;
@property bool empty() { return impl.curSizeLeft == 0 || impl.r.empty; }
@property auto front() { return impl.r.front; }
void popFront()
{
assert(impl.curSizeLeft > 0 && !impl.r.empty);
impl.curSizeLeft--;
impl.r.popFront();
}
}
static struct Impl
{
private Source r;
private size_t chunkSize;
private size_t curSizeLeft;
}
private RefCounted!Impl impl;
private this(Source r, size_t chunkSize)
{
impl = RefCounted!Impl(r, r.empty ? 0 : chunkSize, chunkSize);
}
@property bool empty() { return impl.chunkSize == 0; }
@property Chunk front() return { return Chunk(impl); }
void popFront()
{
impl.curSizeLeft -= impl.r.popFrontN(impl.curSizeLeft);
if (!impl.r.empty)
impl.curSizeLeft = impl.chunkSize;
else
impl.chunkSize = 0;
}
static assert(isInputRange!(typeof(this)));
}
}
/// Ditto
Chunks!Source chunks(Source)(Source source, size_t chunkSize)
if (isInputRange!Source)
{
return typeof(return)(source, chunkSize);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
auto source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
auto chunks = chunks(source, 4);
assert(chunks[0] == [1, 2, 3, 4]);
assert(chunks[1] == [5, 6, 7, 8]);
assert(chunks[2] == [9, 10]);
assert(chunks.back == chunks[2]);
assert(chunks.front == chunks[0]);
assert(chunks.length == 3);
assert(equal(retro(array(chunks)), array(retro(chunks))));
}
/// Non-forward input ranges are supported, but with limited semantics.
@system /*@safe*/ unittest // FIXME: can't be @safe because RefCounted isn't.
{
import std.algorithm.comparison : equal;
int i;
// The generator doesn't save state, so it cannot be a forward range.
auto inputRange = generate!(() => ++i).take(10);
// We can still process it in chunks, but it will be single-pass only.
auto chunked = inputRange.chunks(2);
assert(chunked.front.equal([1, 2]));
assert(chunked.front.empty); // Iterating the chunk has consumed it
chunked.popFront;
assert(chunked.front.equal([3, 4]));
}
@system /*@safe*/ unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : ReferenceInputRange;
auto data = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
auto r = new ReferenceInputRange!int(data).chunks(3);
assert(r.equal!equal([
[ 1, 2, 3 ],
[ 4, 5, 6 ],
[ 7, 8, 9 ],
[ 10 ]
]));
auto data2 = [ 1, 2, 3, 4, 5, 6 ];
auto r2 = new ReferenceInputRange!int(data2).chunks(3);
assert(r2.equal!equal([
[ 1, 2, 3 ],
[ 4, 5, 6 ]
]));
auto data3 = [ 1, 2, 3, 4, 5 ];
auto r3 = new ReferenceInputRange!int(data3).chunks(2);
assert(r3.front.equal([1, 2]));
r3.popFront();
assert(!r3.empty);
r3.popFront();
assert(r3.front.equal([5]));
}
@safe unittest
{
auto source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
auto chunks = chunks(source, 4);
auto chunks2 = chunks.save;
chunks.popFront();
assert(chunks[0] == [5, 6, 7, 8]);
assert(chunks[1] == [9, 10]);
chunks2.popBack();
assert(chunks2[1] == [5, 6, 7, 8]);
assert(chunks2.length == 2);
static assert(isRandomAccessRange!(typeof(chunks)));
}
@safe unittest
{
import std.algorithm.comparison : equal;
//Extra toying with slicing and indexing.
auto chunks1 = [0, 0, 1, 1, 2, 2, 3, 3, 4].chunks(2);
auto chunks2 = [0, 0, 1, 1, 2, 2, 3, 3, 4, 4].chunks(2);
assert(chunks1.length == 5);
assert(chunks2.length == 5);
assert(chunks1[4] == [4]);
assert(chunks2[4] == [4, 4]);
assert(chunks1.back == [4]);
assert(chunks2.back == [4, 4]);
assert(chunks1[0 .. 1].equal([[0, 0]]));
assert(chunks1[0 .. 2].equal([[0, 0], [1, 1]]));
assert(chunks1[4 .. 5].equal([[4]]));
assert(chunks2[4 .. 5].equal([[4, 4]]));
assert(chunks1[0 .. 0].equal((int[][]).init));
assert(chunks1[5 .. 5].equal((int[][]).init));
assert(chunks2[5 .. 5].equal((int[][]).init));
//Fun with opDollar
assert(chunks1[$ .. $].equal((int[][]).init)); //Quick
assert(chunks2[$ .. $].equal((int[][]).init)); //Quick
assert(chunks1[$ - 1 .. $].equal([[4]])); //Semiquick
assert(chunks2[$ - 1 .. $].equal([[4, 4]])); //Semiquick
assert(chunks1[$ .. 5].equal((int[][]).init)); //Semiquick
assert(chunks2[$ .. 5].equal((int[][]).init)); //Semiquick
assert(chunks1[$ / 2 .. $ - 1].equal([[2, 2], [3, 3]])); //Slow
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filter;
//ForwardRange
auto r = filter!"true"([1, 2, 3, 4, 5]).chunks(2);
assert(equal!"equal(a, b)"(r, [[1, 2], [3, 4], [5]]));
//InfiniteRange w/o RA
auto fibsByPairs = recurrence!"a[n-1] + a[n-2]"(1, 1).chunks(2);
assert(equal!`equal(a, b)`(fibsByPairs.take(2), [[ 1, 1], [ 2, 3]]));
//InfiniteRange w/ RA and slicing
auto odds = sequence!("a[0] + n * a[1]")(1, 2);
auto oddsByPairs = odds.chunks(2);
assert(equal!`equal(a, b)`(oddsByPairs.take(2), [[ 1, 3], [ 5, 7]]));
//Requires phobos#991 for Sequence to have slice to end
static assert(hasSlicing!(typeof(odds)));
assert(equal!`equal(a, b)`(oddsByPairs[3 .. 5], [[13, 15], [17, 19]]));
assert(equal!`equal(a, b)`(oddsByPairs[3 .. $].take(2), [[13, 15], [17, 19]]));
}
/**
This range splits a `source` range into `chunkCount` chunks of
approximately equal length. `Source` must be a forward range with
known length.
Unlike $(LREF chunks), `evenChunks` takes a chunk count (not size).
The returned range will contain zero or more $(D source.length /
chunkCount + 1) elements followed by $(D source.length / chunkCount)
elements. If $(D source.length < chunkCount), some chunks will be empty.
`chunkCount` must not be zero, unless `source` is also empty.
*/
struct EvenChunks(Source)
if (isForwardRange!Source && hasLength!Source)
{
/// Standard constructor
this(Source source, size_t chunkCount)
{
assert(chunkCount != 0 || source.empty, "Cannot create EvenChunks with a zero chunkCount");
_source = source;
_chunkCount = chunkCount;
}
/// Forward range primitives. Always present.
@property auto front()
{
assert(!empty, "Attempting to fetch the front of an empty evenChunks");
return _source.save.take(_chunkPos(1));
}
/// Ditto
void popFront()
{
assert(!empty, "Attempting to popFront an empty evenChunks");
_source.popFrontN(_chunkPos(1));
_chunkCount--;
}
/// Ditto
@property bool empty()
{
return _source.empty;
}
/// Ditto
@property typeof(this) save()
{
return typeof(this)(_source.save, _chunkCount);
}
/// Length
@property size_t length() const
{
return _chunkCount;
}
//Note: No point in defining opDollar here without slicing.
//opDollar is defined below in the hasSlicing!Source section
static if (hasSlicing!Source)
{
/**
Indexing, slicing and bidirectional operations and range primitives.
Provided only if `hasSlicing!Source` is `true`.
*/
auto opIndex(size_t index)
{
assert(index < _chunkCount, "evenChunks index out of bounds");
return _source[_chunkPos(index) .. _chunkPos(index+1)];
}
/// Ditto
typeof(this) opSlice(size_t lower, size_t upper)
{
assert(lower <= upper && upper <= length, "evenChunks slicing index out of bounds");
return evenChunks(_source[_chunkPos(lower) .. _chunkPos(upper)], upper - lower);
}
/// Ditto
@property auto back()
{
assert(!empty, "back called on empty evenChunks");
return _source[_chunkPos(_chunkCount - 1) .. _source.length];
}
/// Ditto
void popBack()
{
assert(!empty, "popBack() called on empty evenChunks");
_source = _source[0 .. _chunkPos(_chunkCount - 1)];
_chunkCount--;
}
}
private:
Source _source;
size_t _chunkCount;
size_t _chunkPos(size_t i)
{
/*
_chunkCount = 5, _source.length = 13:
chunk0
| chunk3
| |
v v
+-+-+-+-+-+ ^
|0|3|.| | | |
+-+-+-+-+-+ | div
|1|4|.| | | |
+-+-+-+-+-+ v
|2|5|.|
+-+-+-+
<----->
mod
<--------->
_chunkCount
One column is one chunk.
popFront and popBack pop the left-most
and right-most column, respectively.
*/
auto div = _source.length / _chunkCount;
auto mod = _source.length % _chunkCount;
auto pos = i <= mod
? i * (div+1)
: mod * (div+1) + (i-mod) * div
;
//auto len = i < mod
// ? div+1
// : div
//;
return pos;
}
}
/// Ditto
EvenChunks!Source evenChunks(Source)(Source source, size_t chunkCount)
if (isForwardRange!Source && hasLength!Source)
{
return typeof(return)(source, chunkCount);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
auto source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
auto chunks = evenChunks(source, 3);
assert(chunks[0] == [1, 2, 3, 4]);
assert(chunks[1] == [5, 6, 7]);
assert(chunks[2] == [8, 9, 10]);
}
@safe unittest
{
import std.algorithm.comparison : equal;
auto source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
auto chunks = evenChunks(source, 3);
assert(chunks.back == chunks[2]);
assert(chunks.front == chunks[0]);
assert(chunks.length == 3);
assert(equal(retro(array(chunks)), array(retro(chunks))));
auto chunks2 = chunks.save;
chunks.popFront();
assert(chunks[0] == [5, 6, 7]);
assert(chunks[1] == [8, 9, 10]);
chunks2.popBack();
assert(chunks2[1] == [5, 6, 7]);
assert(chunks2.length == 2);
static assert(isRandomAccessRange!(typeof(chunks)));
}
@safe unittest
{
import std.algorithm.comparison : equal;
int[] source = [];
auto chunks = source.evenChunks(0);
assert(chunks.length == 0);
chunks = source.evenChunks(3);
assert(equal(chunks, [[], [], []]));
chunks = [1, 2, 3].evenChunks(5);
assert(equal(chunks, [[1], [2], [3], [], []]));
}
/**
A fixed-sized sliding window iteration
of size `windowSize` over a `source` range by a custom `stepSize`.
The `Source` range must be at least a $(REF_ALTTEXT ForwardRange, isForwardRange, std,range,primitives)
and the `windowSize` must be greater than zero.
For `windowSize = 1` it splits the range into single element groups (aka `unflatten`)
For `windowSize = 2` it is similar to `zip(source, source.save.dropOne)`.
Params:
f = Whether the last element has fewer elements than `windowSize`
it should be be ignored (`No.withPartial`) or added (`Yes.withPartial`)
source = Range from which the slide will be selected
windowSize = Sliding window size
stepSize = Steps between the windows (by default 1)
Returns: Range of all sliding windows with propagated bi-directionality,
forwarding, random access, and slicing.
Note: To avoid performance overhead, $(REF_ALTTEXT bi-directionality, isBidirectionalRange, std,range,primitives)
is only available when $(REF hasSlicing, std,range,primitives)
and $(REF hasLength, std,range,primitives) are true.
See_Also: $(LREF chunks)
*/
auto slide(Flag!"withPartial" f = Yes.withPartial,
Source)(Source source, size_t windowSize, size_t stepSize = 1)
if (isForwardRange!Source)
{
return Slides!(f, Source)(source, windowSize, stepSize);
}
/// Iterate over ranges with windows
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
assert([0, 1, 2, 3].slide(2).equal!equal(
[[0, 1], [1, 2], [2, 3]]
));
assert(5.iota.slide(3).equal!equal(
[[0, 1, 2], [1, 2, 3], [2, 3, 4]]
));
}
/// set a custom stepsize (default 1)
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
assert(6.iota.slide(1, 2).equal!equal(
[[0], [2], [4]]
));
assert(6.iota.slide(2, 4).equal!equal(
[[0, 1], [4, 5]]
));
assert(iota(7).slide(2, 2).equal!equal(
[[0, 1], [2, 3], [4, 5], [6]]
));
assert(iota(12).slide(2, 4).equal!equal(
[[0, 1], [4, 5], [8, 9]]
));
}
/// Allow the last slide to have fewer elements than windowSize
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
assert(3.iota.slide!(No.withPartial)(4).empty);
assert(3.iota.slide!(Yes.withPartial)(4).equal!equal(
[[0, 1, 2]]
));
}
/// Count all the possible substrings of length 2
@safe pure nothrow unittest
{
import std.algorithm.iteration : each;
int[dstring] d;
"AGAGA"d.slide!(Yes.withPartial)(2).each!(a => d[a]++);
assert(d == ["AG"d: 2, "GA"d: 2]);
}
/// withPartial only has an effect if last element in the range doesn't have the full size
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
assert(5.iota.slide!(Yes.withPartial)(3, 4).equal!equal([[0, 1, 2], [4]]));
assert(6.iota.slide!(Yes.withPartial)(3, 4).equal!equal([[0, 1, 2], [4, 5]]));
assert(7.iota.slide!(Yes.withPartial)(3, 4).equal!equal([[0, 1, 2], [4, 5, 6]]));
assert(5.iota.slide!(No.withPartial)(3, 4).equal!equal([[0, 1, 2]]));
assert(6.iota.slide!(No.withPartial)(3, 4).equal!equal([[0, 1, 2]]));
assert(7.iota.slide!(No.withPartial)(3, 4).equal!equal([[0, 1, 2], [4, 5, 6]]));
}
private struct Slides(Flag!"withPartial" withPartial = Yes.withPartial, Source)
if (isForwardRange!Source)
{
private:
Source source;
size_t windowSize;
size_t stepSize;
static if (hasLength!Source)
{
enum needsEndTracker = false;
}
else
{
// If there's no information about the length, track needs to be kept manually
Source nextSource;
enum needsEndTracker = true;
}
bool _empty;
static if (hasSlicing!Source)
enum hasSliceToEnd = hasSlicing!Source && is(typeof(Source.init[0 .. $]) == Source);
static if (withPartial)
bool hasShownPartialBefore;
public:
/// Standard constructor
this(Source source, size_t windowSize, size_t stepSize)
{
assert(windowSize > 0, "windowSize must be greater than zero");
assert(stepSize > 0, "stepSize must be greater than zero");
this.source = source;
this.windowSize = windowSize;
this.stepSize = stepSize;
static if (needsEndTracker)
{
// `nextSource` is used to "look one step into the future" and check for the end
// this means `nextSource` is advanced by `stepSize` on every `popFront`
nextSource = source.save.drop(windowSize);
}
if (source.empty)
{
_empty = true;
return;
}
static if (withPartial)
{
static if (needsEndTracker)
{
if (nextSource.empty)
hasShownPartialBefore = true;
}
else
{
if (source.length <= windowSize)
hasShownPartialBefore = true;
}
}
else
{
// empty source range is needed, s.t. length, slicing etc. works properly
static if (needsEndTracker)
{
if (nextSource.empty)
_empty = true;
}
else
{
if (source.length < windowSize)
_empty = true;
}
}
}
/// Forward range primitives. Always present.
@property auto front()
{
assert(!empty, "Attempting to access front on an empty slide.");
static if (hasSlicing!Source && hasLength!Source)
{
static if (withPartial)
{
import std.algorithm.comparison : min;
return source[0 .. min(windowSize, source.length)];
}
else
{
assert(windowSize <= source.length, "The last element is smaller than the current windowSize.");
return source[0 .. windowSize];
}
}
else
{
static if (withPartial)
return source.save.take(windowSize);
else
return source.save.takeExactly(windowSize);
}
}
/// Ditto
void popFront()
{
assert(!empty, "Attempting to call popFront() on an empty slide.");
source.popFrontN(stepSize);
if (source.empty)
{
_empty = true;
return;
}
static if (withPartial)
{
if (hasShownPartialBefore)
_empty = true;
}
static if (needsEndTracker)
{
// Check the upcoming slide
auto poppedElements = nextSource.popFrontN(stepSize);
static if (withPartial)
{
if (poppedElements < stepSize || nextSource.empty)
hasShownPartialBefore = true;
}
else
{
if (poppedElements < stepSize)
_empty = true;
}
}
else
{
static if (withPartial)
{
if (source.length <= windowSize)
hasShownPartialBefore = true;
}
else
{
if (source.length < windowSize)
_empty = true;
}
}
}
static if (!isInfinite!Source)
{
/// Ditto
@property bool empty() const
{
return _empty;
}
}
else
{
// undocumented
enum empty = false;
}
/// Ditto
@property typeof(this) save()
{
return typeof(this)(source.save, windowSize, stepSize);
}
static if (hasLength!Source)
{
// gaps between the last element and the end of the range
private size_t gap()
{
/*
* Note:
* - In the following `end` is the exclusive end as used in opSlice
* - For the trivial case with `stepSize = 1` `end` is at `len`:
*
* iota(4).slide(2) = [[0, 1], [1, 2], [2, 3]] (end = 4)
* iota(4).slide(3) = [[0, 1, 2], [1, 2, 3]] (end = 4)
*
* - For the non-trivial cases, we need to calculate the gap
* between `len` and `end` - this is the number of missing elements
* from the input range:
*
* iota(7).slide(2, 3) = [[0, 1], [3, 4]] || <gap: 2> 6
* iota(7).slide(2, 4) = [[0, 1], [4, 5]] || <gap: 1> 6
* iota(7).slide(1, 5) = [[0], [5]] || <gap: 1> 6
*
* As it can be seen `gap` can be at most `stepSize - 1`
* More generally the elements of the sliding window with
* `w = windowSize` and `s = stepSize` are:
*
* [0, w], [s, s + w], [2 * s, 2 * s + w], ... [n * s, n * s + w]
*
* We can thus calculate the gap between the `end` and `len` as:
*
* gap = len - (n * s + w) = len - w - (n * s)
*
* As we aren't interested in exact value of `n`, but the best
* minimal `gap` value, we can use modulo to "cut" `len - w` optimally:
*
* gap = len - w - (s - s ... - s) = (len - w) % s
*
* So for example:
*
* iota(7).slide(2, 3) = [[0, 1], [3, 4]]
* gap: (7 - 2) % 3 = 5 % 3 = 2
* end: 7 - 2 = 5
*
* iota(7).slide(4, 2) = [[0, 1, 2, 3], [2, 3, 4, 5]]
* gap: (7 - 4) % 2 = 3 % 2 = 1
* end: 7 - 1 = 6
*/
return (source.length - windowSize) % stepSize;
}
private size_t numberOfFullFrames()
{
/**
5.iota.slides(2, 1) => [0, 1], [1, 2], [2, 3], [3, 4] (4)
7.iota.slides(2, 2) => [0, 1], [2, 3], [4, 5], [6] (3)
7.iota.slides(2, 3) => [0, 1], [3, 4], [6] (2)
6.iota.slides(3, 2) => [0, 1, 2], [2, 3, 4], [4, 5] (2)
7.iota.slides(3, 3) => [0, 1, 2], [3, 4, 5], [6] (2)
As the last window is only added iff its complete,
we don't count the last window except if it's full due to integer rounding.
*/
return 1 + (source.length - windowSize) / stepSize;
}
// Whether the last slide frame size is less than windowSize
private bool hasPartialElements()
{
static if (withPartial)
return gap != 0 && source.length > numberOfFullFrames * stepSize;
else
return 0;
}
/// Length. Only if `hasLength!Source` is `true`
@property size_t length()
{
if (source.length < windowSize)
{
static if (withPartial)
return source.length > 0;
else
return 0;
}
else
{
/***
We bump the pointer by stepSize for every element.
If withPartial, we don't count the last element if its size
isn't windowSize
At most:
[p, p + stepSize, ..., p + stepSize * n]
5.iota.slides(2, 1) => [0, 1], [1, 2], [2, 3], [3, 4] (4)
7.iota.slides(2, 2) => [0, 1], [2, 3], [4, 5], [6] (4)
7.iota.slides(2, 3) => [0, 1], [3, 4], [6] (3)
7.iota.slides(3, 2) => [0, 1, 2], [2, 3, 4], [4, 5, 6] (3)
7.iota.slides(3, 3) => [0, 1, 2], [3, 4, 5], [6] (3)
*/
return numberOfFullFrames + hasPartialElements;
}
}
}
static if (hasSlicing!Source)
{
/**
Indexing and slicing operations. Provided only if
`hasSlicing!Source` is `true`.
*/
auto opIndex(size_t index)
{
immutable start = index * stepSize;
static if (isInfinite!Source)
{
immutable end = start + windowSize;
}
else
{
import std.algorithm.comparison : min;
immutable len = source.length;
assert(start < len, "slide index out of bounds");
immutable end = min(start + windowSize, len);
}
return source[start .. end];
}
static if (!isInfinite!Source)
{
/// ditto
typeof(this) opSlice(size_t lower, size_t upper)
{
import std.algorithm.comparison : min;
assert(upper <= length, "slide slicing index out of bounds");
assert(lower <= upper, "slide slicing index out of bounds");
lower *= stepSize;
upper *= stepSize;
immutable len = source.length;
static if (withPartial)
{
import std.algorithm.comparison : max;
if (lower == upper)
return this[$ .. $];
/*
A) If `stepSize` >= `windowSize` => `rightPos = upper`
[0, 1, 2, 3, 4, 5, 6].slide(2, 3) -> s = [[0, 1], [3, 4], [6]]
rightPos for s[0 .. 2]: (upper=2) * (stepSize=3) = 6
6.iota.slide(2, 3) = [[0, 1], [3, 4]]
B) If `stepSize` < `windowSize` => add `windowSize - stepSize` to `upper`
[0, 1, 2, 3].slide(2) = [[0, 1], [1, 2], [2, 3]]
rightPos for s[0 .. 1]: = (upper=1) * (stepSize=1) = 1
1.iota.slide(2) = [[0]]
rightPos for s[0 .. 1]: = (upper=1) * (stepSize=1) + (windowSize-stepSize=1) = 2
1.iota.slide(2) = [[0, 1]]
More complex:
20.iota.slide(7, 6)[0 .. 2]
rightPos: (upper=2) * (stepSize=6) = 12.iota
12.iota.slide(7, 6) = [[0, 1, 2, 3, 4, 5, 6], [6, 7, 8, 9, 10, 11]]
Now we add up for the difference between `windowSize` and `stepSize`:
rightPos: (upper=2) * (stepSize=6) + (windowSize-stepSize=1) = 13.iota
13.iota.slide(7, 6) = [[0, 1, 2, 3, 4, 5, 6], [6, 7, 8, 9, 10, 11, 12]]
*/
immutable rightPos = min(len, upper + max(0, windowSize - stepSize));
}
else
{
/*
After we have normalized `lower` and `upper` by `stepSize`,
we only need to look at the case of `stepSize=1`.
As `leftPos`, is equal to `lower`, we will only look `rightPos`.
Notice that starting from `upper`,
we only need to move for `windowSize - 1` to the right:
- [0, 1, 2, 3].slide(2) -> s = [[0, 1], [1, 2], [2, 3]]
rightPos for s[0 .. 3]: (upper=3) + (windowSize=2) - 1 = 4
- [0, 1, 2, 3].slide(3) -> s = [[0, 1, 2], [1, 2, 3]]
rightPos for s[0 .. 2]: (upper=2) + (windowSize=3) - 1 = 4
- [0, 1, 2, 3, 4].slide(4) -> s = [[0, 1, 2, 3], [1, 2, 3, 4]]
rightPos for s[0 .. 2]: (upper=2) + (windowSize=4) - 1 = 5
*/
immutable rightPos = min(upper + windowSize - 1, len);
}
return typeof(this)(source[min(lower, len) .. rightPos], windowSize, stepSize);
}
}
else static if (hasSliceToEnd)
{
// For slicing an infinite chunk, we need to slice the source to the infinite end.
auto opSlice(size_t lower, size_t upper)
{
assert(lower <= upper, "slide slicing index out of bounds");
return typeof(this)(source[lower * stepSize .. $], windowSize, stepSize)
.takeExactly(upper - lower);
}
}
static if (isInfinite!Source)
{
static if (hasSliceToEnd)
{
private static struct DollarToken{}
DollarToken opDollar()
{
return DollarToken();
}
//Slice to dollar
typeof(this) opSlice(size_t lower, DollarToken)
{
return typeof(this)(source[lower * stepSize .. $], windowSize, stepSize);
}
}
}
else
{
// Dollar token carries a static type, with no extra information.
// It can lazily transform into source.length on algorithmic
// operations such as : slide[$/2, $-1];
private static struct DollarToken
{
private size_t _length;
alias _length this;
}
DollarToken opDollar()
{
return DollarToken(this.length);
}
// Optimized slice overloads optimized for using dollar.
typeof(this) opSlice(DollarToken, DollarToken)
{
static if (hasSliceToEnd)
{
return typeof(this)(source[$ .. $], windowSize, stepSize);
}
else
{
immutable len = source.length;
return typeof(this)(source[len .. len], windowSize, stepSize);
}
}
// Optimized slice overloads optimized for using dollar.
typeof(this) opSlice(size_t lower, DollarToken)
{
import std.algorithm.comparison : min;
assert(lower <= length, "slide slicing index out of bounds");
lower *= stepSize;
static if (hasSliceToEnd)
{
return typeof(this)(source[min(lower, source.length) .. $], windowSize, stepSize);
}
else
{
immutable len = source.length;
return typeof(this)(source[min(lower, len) .. len], windowSize, stepSize);
}
}
// Optimized slice overloads optimized for using dollar.
typeof(this) opSlice(DollarToken, size_t upper)
{
assert(upper == length, "slide slicing index out of bounds");
return this[$ .. $];
}
}
// Bidirectional range primitives
static if (!isInfinite!Source)
{
/**
Bidirectional range primitives. Provided only if both
`hasSlicing!Source` and `!isInfinite!Source` are `true`.
*/
@property auto back()
{
import std.algorithm.comparison : max;
assert(!empty, "Attempting to access front on an empty slide");
immutable len = source.length;
static if (withPartial)
{
if (source.length <= windowSize)
return source[0 .. source.length];
if (hasPartialElements)
return source[numberOfFullFrames * stepSize .. len];
}
// check for underflow
immutable start = (len > windowSize + gap) ? len - windowSize - gap : 0;
return source[start .. len - gap];
}
/// Ditto
void popBack()
{
assert(!empty, "Attempting to call popBack() on an empty slide");
// Move by stepSize
immutable end = source.length > stepSize ? source.length - stepSize : 0;
static if (withPartial)
{
if (hasShownPartialBefore || source.empty)
{
_empty = true;
return;
}
// pop by stepSize, except for the partial frame at the end
if (hasPartialElements)
source = source[0 .. source.length - gap];
else
source = source[0 .. end];
}
else
{
source = source[0 .. end];
}
if (source.length < windowSize)
_empty = true;
}
}
}
}
// test @nogc
@safe pure nothrow @nogc unittest
{
import std.algorithm.comparison : equal;
static immutable res1 = [[0], [1], [2], [3]];
assert(4.iota.slide!(Yes.withPartial)(1).equal!equal(res1));
static immutable res2 = [[0, 1], [1, 2], [2, 3]];
assert(4.iota.slide!(Yes.withPartial)(2).equal!equal(res2));
}
// test different window sizes
@safe pure nothrow unittest
{
import std.array : array;
import std.algorithm.comparison : equal;
assert([0, 1, 2, 3].slide!(Yes.withPartial)(1).array == [[0], [1], [2], [3]]);
assert([0, 1, 2, 3].slide!(Yes.withPartial)(2).array == [[0, 1], [1, 2], [2, 3]]);
assert([0, 1, 2, 3].slide!(Yes.withPartial)(3).array == [[0, 1, 2], [1, 2, 3]]);
assert([0, 1, 2, 3].slide!(Yes.withPartial)(4).array == [[0, 1, 2, 3]]);
assert([0, 1, 2, 3].slide!(No.withPartial)(5).walkLength == 0);
assert([0, 1, 2, 3].slide!(Yes.withPartial)(5).array == [[0, 1, 2, 3]]);
assert(iota(2).slide!(Yes.withPartial)(2).front.equal([0, 1]));
assert(iota(3).slide!(Yes.withPartial)(2).equal!equal([[0, 1],[1, 2]]));
assert(iota(3).slide!(Yes.withPartial)(3).equal!equal([[0, 1, 2]]));
assert(iota(3).slide!(No.withPartial)(4).walkLength == 0);
assert(iota(3).slide!(Yes.withPartial)(4).equal!equal([[0, 1, 2]]));
assert(iota(1, 4).slide!(Yes.withPartial)(1).equal!equal([[1], [2], [3]]));
assert(iota(1, 4).slide!(Yes.withPartial)(3).equal!equal([[1, 2, 3]]));
}
// test combinations
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
import std.typecons : tuple;
alias t = tuple;
auto list = [
t(t(1, 1), [[0], [1], [2], [3], [4], [5]]),
t(t(1, 2), [[0], [2], [4]]),
t(t(1, 3), [[0], [3]]),
t(t(1, 4), [[0], [4]]),
t(t(1, 5), [[0], [5]]),
t(t(2, 1), [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5]]),
t(t(2, 2), [[0, 1], [2, 3], [4, 5]]),
t(t(2, 3), [[0, 1], [3, 4]]),
t(t(2, 4), [[0, 1], [4, 5]]),
t(t(3, 1), [[0, 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5]]),
t(t(3, 3), [[0, 1, 2], [3, 4, 5]]),
t(t(4, 1), [[0, 1, 2, 3], [1, 2, 3, 4], [2, 3, 4, 5]]),
t(t(4, 2), [[0, 1, 2, 3], [2, 3, 4, 5]]),
t(t(5, 1), [[0, 1, 2, 3, 4], [1, 2, 3, 4, 5]]),
];
static foreach (Partial; [Yes.withPartial, No.withPartial])
foreach (e; list)
assert(6.iota.slide!Partial(e[0].expand).equal!equal(e[1]));
auto listSpecial = [
t(t(2, 5), [[0, 1], [5]]),
t(t(3, 2), [[0, 1, 2], [2, 3, 4], [4, 5]]),
t(t(3, 4), [[0, 1, 2], [4, 5]]),
t(t(4, 3), [[0, 1, 2, 3], [3, 4, 5]]),
t(t(5, 2), [[0, 1, 2, 3, 4], [2, 3, 4, 5]]),
t(t(5, 3), [[0, 1, 2, 3, 4], [3, 4, 5]]),
];
foreach (e; listSpecial)
{
assert(6.iota.slide!(Yes.withPartial)(e[0].expand).equal!equal(e[1]));
assert(6.iota.slide!(No.withPartial)(e[0].expand).equal!equal(e[1].dropBackOne));
}
}
// test emptiness and copyability
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : map;
// check with empty input
int[] d;
assert(d.slide!(Yes.withPartial)(2).empty);
assert(d.slide!(Yes.withPartial)(2, 2).empty);
// is copyable?
auto e = iota(5).slide!(Yes.withPartial)(2);
e.popFront;
assert(e.save.equal!equal([[1, 2], [2, 3], [3, 4]]));
assert(e.save.equal!equal([[1, 2], [2, 3], [3, 4]]));
assert(e.map!"a.array".array == [[1, 2], [2, 3], [3, 4]]);
}
// test with strings
@safe pure nothrow unittest
{
import std.algorithm.iteration : each;
int[dstring] f;
"AGAGA"d.slide!(Yes.withPartial)(3).each!(a => f[a]++);
assert(f == ["AGA"d: 2, "GAG"d: 1]);
int[dstring] g;
"ABCDEFG"d.slide!(Yes.withPartial)(3, 3).each!(a => g[a]++);
assert(g == ["ABC"d:1, "DEF"d:1, "G": 1]);
g = null;
"ABCDEFG"d.slide!(No.withPartial)(3, 3).each!(a => g[a]++);
assert(g == ["ABC"d:1, "DEF"d:1]);
}
// test with utf8 strings
@safe unittest
{
import std.stdio;
import std.algorithm.comparison : equal;
assert("ä.ö.ü.".slide!(Yes.withPartial)(3, 2).equal!equal(["ä.ö", "ö.ü", "ü."]));
assert("ä.ö.ü.".slide!(No.withPartial)(3, 2).equal!equal(["ä.ö", "ö.ü"]));
"😄😅😆😇😈😄😅😆😇😈".slide!(Yes.withPartial)(2, 4).equal!equal(["😄😅", "😈😄", "😇😈"]);
"😄😅😆😇😈😄😅😆😇😈".slide!(No.withPartial)(2, 4).equal!equal(["😄😅", "😈😄", "😇😈"]);
"😄😅😆😇😈😄😅😆😇😈".slide!(Yes.withPartial)(3, 3).equal!equal(["😄😅😆", "😇😈😄", "😅😆😇", "😈"]);
"😄😅😆😇😈😄😅😆😇😈".slide!(No.withPartial)(3, 3).equal!equal(["😄😅😆", "😇😈😄", "😅😆😇"]);
}
// test length
@safe pure nothrow unittest
{
// Slides with fewer elements are empty or 1 for Yes.withPartial
static foreach (expectedLength, Partial; [No.withPartial, Yes.withPartial])
{{
assert(3.iota.slide!(Partial)(4, 2).walkLength == expectedLength);
assert(3.iota.slide!(Partial)(4).walkLength == expectedLength);
assert(3.iota.slide!(Partial)(4, 3).walkLength == expectedLength);
}}
static immutable list = [
// iota slide expected
[4, 2, 1, 3, 3],
[5, 3, 1, 3, 3],
[7, 2, 2, 4, 3],
[12, 2, 4, 3, 3],
[6, 1, 2, 3, 3],
[6, 2, 4, 2, 2],
[3, 2, 4, 1, 1],
[5, 2, 1, 4, 4],
[7, 2, 2, 4, 3],
[7, 2, 3, 3, 2],
[7, 3, 2, 3, 3],
[7, 3, 3, 3, 2],
];
foreach (e; list)
{
assert(e[0].iota.slide!(Yes.withPartial)(e[1], e[2]).length == e[3]);
assert(e[0].iota.slide!(No.withPartial)(e[1], e[2]).length == e[4]);
}
}
// test index and slicing
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
import std.array : array;
static foreach (Partial; [Yes.withPartial, No.withPartial])
{
foreach (s; [5, 7, 10, 15, 20])
foreach (windowSize; 1 .. 10)
foreach (stepSize; 1 .. 10)
{
auto r = s.iota.slide!Partial(windowSize, stepSize);
auto arr = r.array;
assert(r.length == arr.length);
// test indexing
foreach (i; 0 .. arr.length)
assert(r[i] == arr[i]);
// test slicing
foreach (i; 0 .. arr.length)
{
foreach (j; i .. arr.length)
assert(r[i .. j].equal(arr[i .. j]));
assert(r[i .. $].equal(arr[i .. $]));
}
// test opDollar slicing
assert(r[$/2 .. $].equal(arr[$/2 .. $]));
assert(r[$ .. $].empty);
if (arr.empty)
{
assert(r[$ .. 0].empty);
assert(r[$/2 .. $].empty);
}
}
}
}
// test with infinite ranges
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
static foreach (Partial; [Yes.withPartial, No.withPartial])
{{
// InfiniteRange without RandomAccess
auto fibs = recurrence!"a[n-1] + a[n-2]"(1, 1);
assert(fibs.slide!Partial(2).take(2).equal!equal([[1, 1], [1, 2]]));
assert(fibs.slide!Partial(2, 3).take(2).equal!equal([[1, 1], [3, 5]]));
// InfiniteRange with RandomAccess and slicing
auto odds = sequence!("a[0] + n * a[1]")(1, 2);
auto oddsByPairs = odds.slide!Partial(2);
assert(oddsByPairs.take(2).equal!equal([[ 1, 3], [ 3, 5]]));
assert(oddsByPairs[1].equal([3, 5]));
assert(oddsByPairs[4].equal([9, 11]));
static assert(hasSlicing!(typeof(odds)));
assert(oddsByPairs[3 .. 5].equal!equal([[7, 9], [9, 11]]));
assert(oddsByPairs[3 .. $].take(2).equal!equal([[7, 9], [9, 11]]));
auto oddsWithGaps = odds.slide!Partial(2, 4);
assert(oddsWithGaps.take(3).equal!equal([[1, 3], [9, 11], [17, 19]]));
assert(oddsWithGaps[2].equal([17, 19]));
assert(oddsWithGaps[1 .. 3].equal!equal([[9, 11], [17, 19]]));
assert(oddsWithGaps[1 .. $].take(2).equal!equal([[9, 11], [17, 19]]));
}}
}
// test reverse
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
static foreach (Partial; [Yes.withPartial, No.withPartial])
{{
foreach (windowSize; 1 .. 15)
foreach (stepSize; 1 .. 15)
{
auto r = 20.iota.slide!Partial(windowSize, stepSize);
auto rArr = r.array.retro;
auto rRetro = r.retro;
assert(rRetro.length == rArr.length);
assert(rRetro.equal(rArr));
assert(rRetro.array.retro.equal(r));
}
}}
}
// test with dummy ranges
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : AllDummyRanges;
import std.meta : Filter;
static foreach (Range; Filter!(isForwardRange, AllDummyRanges))
{{
Range r;
static foreach (Partial; [Yes.withPartial, No.withPartial])
{
assert(r.slide!Partial(1).equal!equal(
[[1], [2], [3], [4], [5], [6], [7], [8], [9], [10]]
));
assert(r.slide!Partial(2).equal!equal(
[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10]]
));
assert(r.slide!Partial(3).equal!equal(
[[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6],
[5, 6, 7], [6, 7, 8], [7, 8, 9], [8, 9, 10]]
));
assert(r.slide!Partial(6).equal!equal(
[[1, 2, 3, 4, 5, 6], [2, 3, 4, 5, 6, 7], [3, 4, 5, 6, 7, 8],
[4, 5, 6, 7, 8, 9], [5, 6, 7, 8, 9, 10]]
));
}
// special cases
assert(r.slide!(Yes.withPartial)(15).equal!equal(iota(1, 11).only));
assert(r.slide!(Yes.withPartial)(15).walkLength == 1);
assert(r.slide!(No.withPartial)(15).empty);
assert(r.slide!(No.withPartial)(15).walkLength == 0);
}}
}
// test with dummy ranges
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : AllDummyRanges;
import std.meta : Filter;
import std.typecons : tuple;
alias t = tuple;
static immutable list = [
// iota slide expected
t(6, t(4, 2), [[1, 2, 3, 4], [3, 4, 5, 6]]),
t(6, t(4, 6), [[1, 2, 3, 4]]),
t(6, t(4, 1), [[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6]]),
t(7, t(4, 1), [[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6], [4, 5, 6, 7]]),
t(7, t(4, 3), [[1, 2, 3, 4], [4, 5, 6, 7]]),
t(8, t(4, 2), [[1, 2, 3, 4], [3, 4, 5, 6], [5, 6, 7, 8]]),
t(8, t(4, 1), [[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6], [4, 5, 6, 7], [5, 6, 7, 8]]),
t(8, t(3, 4), [[1, 2, 3], [5, 6, 7]]),
t(10, t(3, 7), [[1, 2, 3], [8, 9, 10]]),
];
static foreach (Range; Filter!(isForwardRange, AllDummyRanges))
static foreach (Partial; [Yes.withPartial, No.withPartial])
foreach (e; list)
assert(Range().take(e[0]).slide!Partial(e[1].expand).equal!equal(e[2]));
static immutable listSpecial = [
// iota slide expected
t(6, t(4, 3), [[1, 2, 3, 4], [4, 5, 6]]),
t(7, t(4, 5), [[1, 2, 3, 4], [6, 7]]),
t(7, t(4, 4), [[1, 2, 3, 4], [5, 6, 7]]),
t(7, t(4, 2), [[1, 2, 3, 4], [3, 4, 5, 6], [5, 6, 7]]),
t(8, t(4, 3), [[1, 2, 3, 4], [4, 5, 6, 7], [7, 8]]),
t(8, t(3, 3), [[1, 2, 3], [4, 5, 6], [7, 8]]),
t(8, t(3, 6), [[1, 2, 3], [7, 8]]),
t(10, t(7, 6), [[1, 2, 3, 4, 5, 6, 7], [7, 8, 9, 10]]),
t(10, t(3, 8), [[1, 2, 3], [9, 10]]),
];
static foreach (Range; Filter!(isForwardRange, AllDummyRanges))
static foreach (Partial; [Yes.withPartial, No.withPartial])
foreach (e; listSpecial)
{
Range r;
assert(r.take(e[0]).slide!(Yes.withPartial)(e[1].expand).equal!equal(e[2]));
assert(r.take(e[0]).slide!(No.withPartial)(e[1].expand).equal!equal(e[2].dropBackOne));
}
}
// test reverse with dummy ranges
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : AllDummyRanges;
import std.meta : Filter, templateAnd;
import std.typecons : tuple;
alias t = tuple;
static immutable list = [
// slide expected
t(1, 1, [[10], [9], [8], [7], [6], [5], [4], [3], [2], [1]]),
t(2, 1, [[9, 10], [8, 9], [7, 8], [6, 7], [5, 6], [4, 5], [3, 4], [2, 3], [1, 2]]),
t(5, 1, [[6, 7, 8, 9, 10], [5, 6, 7, 8, 9], [4, 5, 6, 7, 8],
[3, 4, 5, 6, 7], [2, 3, 4, 5, 6], [1, 2, 3, 4, 5]]),
t(2, 2, [[9, 10], [7, 8], [5, 6], [3, 4], [1, 2]]),
t(2, 4, [[9, 10], [5, 6], [1, 2]]),
];
static foreach (Range; Filter!(templateAnd!(hasSlicing, hasLength, isBidirectionalRange), AllDummyRanges))
{{
Range r;
static foreach (Partial; [Yes.withPartial, No.withPartial])
{
foreach (e; list)
assert(r.slide!Partial(e[0], e[1]).retro.equal!equal(e[2]));
// front = back
foreach (windowSize; 1 .. 10)
foreach (stepSize; 1 .. 10)
{
auto slider = r.slide!Partial(windowSize, stepSize);
auto sliderRetro = slider.retro.array;
assert(slider.length == sliderRetro.length);
assert(sliderRetro.retro.equal!equal(slider));
}
}
// special cases
assert(r.slide!(No.withPartial)(15).retro.walkLength == 0);
assert(r.slide!(Yes.withPartial)(15).retro.equal!equal(iota(1, 11).only));
}}
}
// test different sliceable ranges
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : AllDummyRanges;
import std.meta : AliasSeq;
struct SliceableRange(Range, Flag!"withOpDollar" withOpDollar = No.withOpDollar,
Flag!"withInfiniteness" withInfiniteness = No.withInfiniteness)
{
Range arr = 10.iota.array; // similar to DummyRange
@property auto save() { return typeof(this)(arr); }
@property auto front() { return arr[0]; }
void popFront() { arr.popFront(); }
auto opSlice(size_t i, size_t j)
{
// subslices can't be infinite
return SliceableRange!(Range, withOpDollar, No.withInfiniteness)(arr[i .. j]);
}
static if (withInfiniteness)
{
enum empty = false;
}
else
{
@property bool empty() { return arr.empty; }
@property auto length() { return arr.length; }
}
static if (withOpDollar)
{
static if (withInfiniteness)
{
struct Dollar {}
Dollar opDollar() const { return Dollar.init; }
// Slice to dollar
typeof(this) opSlice(size_t lower, Dollar)
{
return typeof(this)(arr[lower .. $]);
}
}
else
{
alias opDollar = length;
}
}
}
import std.meta : Filter, templateNot;
alias SliceableDummyRanges = Filter!(hasSlicing, AllDummyRanges);
static foreach (Partial; [Yes.withPartial, No.withPartial])
{{
static foreach (Range; SliceableDummyRanges)
{{
Range r;
r.reinit;
r.arr[] -= 1; // use a 0-based array (for clarity)
assert(r.slide!Partial(2)[0].equal([0, 1]));
assert(r.slide!Partial(2)[1].equal([1, 2]));
// saveable
auto s = r.slide!Partial(2);
assert(s[0 .. 2].equal!equal([[0, 1], [1, 2]]));
s.save.popFront;
assert(s[0 .. 2].equal!equal([[0, 1], [1, 2]]));
assert(r.slide!Partial(3)[1 .. 3].equal!equal([[1, 2, 3], [2, 3, 4]]));
}}
static foreach (Range; Filter!(templateNot!isInfinite, SliceableDummyRanges))
{{
Range r;
r.reinit;
r.arr[] -= 1; // use a 0-based array (for clarity)
assert(r.slide!(No.withPartial)(6).equal!equal(
[[0, 1, 2, 3, 4, 5], [1, 2, 3, 4, 5, 6], [2, 3, 4, 5, 6, 7],
[3, 4, 5, 6, 7, 8], [4, 5, 6, 7, 8, 9]]
));
assert(r.slide!(No.withPartial)(16).empty);
assert(r.slide!Partial(4)[0 .. $].equal(r.slide!Partial(4)));
assert(r.slide!Partial(2)[$/2 .. $].equal!equal([[4, 5], [5, 6], [6, 7], [7, 8], [8, 9]]));
assert(r.slide!Partial(2)[$ .. $].empty);
assert(r.slide!Partial(3).retro.equal!equal(
[[7, 8, 9], [6, 7, 8], [5, 6, 7], [4, 5, 6], [3, 4, 5], [2, 3, 4], [1, 2, 3], [0, 1, 2]]
));
}}
alias T = int[];
// separate checks for infinity
auto infIndex = SliceableRange!(T, No.withOpDollar, Yes.withInfiniteness)([0, 1, 2, 3]);
assert(infIndex.slide!Partial(2)[0].equal([0, 1]));
assert(infIndex.slide!Partial(2)[1].equal([1, 2]));
auto infDollar = SliceableRange!(T, Yes.withOpDollar, Yes.withInfiniteness)();
assert(infDollar.slide!Partial(2)[1 .. $].front.equal([1, 2]));
assert(infDollar.slide!Partial(4)[0 .. $].front.equal([0, 1, 2, 3]));
assert(infDollar.slide!Partial(4)[2 .. $].front.equal([2, 3, 4, 5]));
}}
}
// https://issues.dlang.org/show_bug.cgi?id=19082
@safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : map;
assert([1].map!(x => x).slide(2).equal!equal([[1]]));
}
private struct OnlyResult(Values...)
if (Values.length > 1)
{
private enum arity = Values.length;
private this(return scope ref Values values)
{
this.values = values;
this.backIndex = arity;
}
bool empty() @property
{
return frontIndex >= backIndex;
}
CommonType!Values front() @property
{
assert(!empty, "Attempting to fetch the front of an empty Only range");
return this[0];
}
void popFront()
{
assert(!empty, "Attempting to popFront an empty Only range");
++frontIndex;
}
CommonType!Values back() @property
{
assert(!empty, "Attempting to fetch the back of an empty Only range");
return this[$ - 1];
}
void popBack()
{
assert(!empty, "Attempting to popBack an empty Only range");
--backIndex;
}
OnlyResult save() @property
{
return this;
}
size_t length() const @property
{
return backIndex - frontIndex;
}
alias opDollar = length;
CommonType!Values opIndex(size_t idx)
{
// when i + idx points to elements popped
// with popBack
assert(idx < length, "Attempting to fetch an out of bounds index from an Only range");
final switch (frontIndex + idx)
static foreach (i, T; Values)
case i:
return values[i];
}
OnlyResult opSlice()
{
return this;
}
OnlyResult opSlice(size_t from, size_t to)
{
OnlyResult result = this;
result.frontIndex += from;
result.backIndex = this.frontIndex + to;
assert(
from <= to,
"Attempting to slice an Only range with a larger first argument than the second."
);
assert(
to <= length,
"Attempting to slice using an out of bounds index on an Only range"
);
return result;
}
private size_t frontIndex = 0;
private size_t backIndex = 0;
// https://issues.dlang.org/show_bug.cgi?id=10643
version (none)
{
import std.traits : hasElaborateAssign;
static if (hasElaborateAssign!T)
private Values values;
else
private Values values = void;
}
else
private Values values;
}
// Specialize for single-element results
private struct OnlyResult(T)
{
@property T front()
{
assert(!empty, "Attempting to fetch the front of an empty Only range");
return _value;
}
@property T back()
{
assert(!empty, "Attempting to fetch the back of an empty Only range");
return _value;
}
@property bool empty() const { return _empty; }
@property size_t length() const { return !_empty; }
@property auto save() { return this; }
void popFront()
{
assert(!_empty, "Attempting to popFront an empty Only range");
_empty = true;
}
void popBack()
{
assert(!_empty, "Attempting to popBack an empty Only range");
_empty = true;
}
alias opDollar = length;
private this()(return scope auto ref T value)
{
this._value = value;
this._empty = false;
}
T opIndex(size_t i)
{
assert(!_empty && i == 0, "Attempting to fetch an out of bounds index from an Only range");
return _value;
}
OnlyResult opSlice()
{
return this;
}
OnlyResult opSlice(size_t from, size_t to)
{
assert(
from <= to,
"Attempting to slice an Only range with a larger first argument than the second."
);
assert(
to <= length,
"Attempting to slice using an out of bounds index on an Only range"
);
OnlyResult copy = this;
copy._empty = _empty || from == to;
return copy;
}
private Unqual!T _value;
private bool _empty = true;
}
// Specialize for the empty range
private struct OnlyResult()
{
private static struct EmptyElementType {}
bool empty() @property { return true; }
size_t length() const @property { return 0; }
alias opDollar = length;
EmptyElementType front() @property { assert(false); }
void popFront() { assert(false); }
EmptyElementType back() @property { assert(false); }
void popBack() { assert(false); }
OnlyResult save() @property { return this; }
EmptyElementType opIndex(size_t i)
{
assert(false);
}
OnlyResult opSlice() { return this; }
OnlyResult opSlice(size_t from, size_t to)
{
assert(from == 0 && to == 0);
return this;
}
}
/**
Assemble `values` into a range that carries all its
elements in-situ.
Useful when a single value or multiple disconnected values
must be passed to an algorithm expecting a range, without
having to perform dynamic memory allocation.
As copying the range means copying all elements, it can be
safely returned from functions. For the same reason, copying
the returned range may be expensive for a large number of arguments.
Params:
values = the values to assemble together
Returns:
A `RandomAccessRange` of the assembled values.
See_Also: $(LREF chain) to chain ranges
*/
auto only(Values...)(return scope Values values)
if (!is(CommonType!Values == void) || Values.length == 0)
{
return OnlyResult!Values(values);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filter, joiner, map;
import std.algorithm.searching : findSplitBefore;
import std.uni : isUpper;
assert(equal(only('♡'), "♡"));
assert([1, 2, 3, 4].findSplitBefore(only(3))[0] == [1, 2]);
assert(only("one", "two", "three").joiner(" ").equal("one two three"));
string title = "The D Programming Language";
assert(title
.filter!isUpper // take the upper case letters
.map!only // make each letter its own range
.joiner(".") // join the ranges together lazily
.equal("T.D.P.L"));
}
// https://issues.dlang.org/show_bug.cgi?id=20314
@safe unittest
{
import std.algorithm.iteration : joiner;
const string s = "foo", t = "bar";
assert([only(s, t), only(t, s)].joiner(only(", ")).join == "foobar, barfoo");
}
// Tests the zero-element result
@safe unittest
{
import std.algorithm.comparison : equal;
auto emptyRange = only();
alias EmptyRange = typeof(emptyRange);
static assert(isInputRange!EmptyRange);
static assert(isForwardRange!EmptyRange);
static assert(isBidirectionalRange!EmptyRange);
static assert(isRandomAccessRange!EmptyRange);
static assert(hasLength!EmptyRange);
static assert(hasSlicing!EmptyRange);
assert(emptyRange.empty);
assert(emptyRange.length == 0);
assert(emptyRange.equal(emptyRange[]));
assert(emptyRange.equal(emptyRange.save));
assert(emptyRange[0 .. 0].equal(emptyRange));
}
// Tests the single-element result
@safe unittest
{
import std.algorithm.comparison : equal;
import std.typecons : tuple;
foreach (x; tuple(1, '1', 1.0, "1", [1]))
{
auto a = only(x);
typeof(x)[] e = [];
assert(a.front == x);
assert(a.back == x);
assert(!a.empty);
assert(a.length == 1);
assert(equal(a, a[]));
assert(equal(a, a[0 .. 1]));
assert(equal(a[0 .. 0], e));
assert(equal(a[1 .. 1], e));
assert(a[0] == x);
auto b = a.save;
assert(equal(a, b));
a.popFront();
assert(a.empty && a.length == 0 && a[].empty);
b.popBack();
assert(b.empty && b.length == 0 && b[].empty);
alias A = typeof(a);
static assert(isInputRange!A);
static assert(isForwardRange!A);
static assert(isBidirectionalRange!A);
static assert(isRandomAccessRange!A);
static assert(hasLength!A);
static assert(hasSlicing!A);
}
auto imm = only!(immutable int)(1);
immutable int[] imme = [];
assert(imm.front == 1);
assert(imm.back == 1);
assert(!imm.empty);
assert(imm.init.empty); // https://issues.dlang.org/show_bug.cgi?id=13441
assert(imm.length == 1);
assert(equal(imm, imm[]));
assert(equal(imm, imm[0 .. 1]));
assert(equal(imm[0 .. 0], imme));
assert(equal(imm[1 .. 1], imme));
assert(imm[0] == 1);
}
// Tests multiple-element results
@safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : joiner;
import std.meta : AliasSeq;
static assert(!__traits(compiles, only(1, "1")));
auto nums = only!(byte, uint, long)(1, 2, 3);
static assert(is(ElementType!(typeof(nums)) == long));
assert(nums.length == 3);
foreach (i; 0 .. 3)
assert(nums[i] == i + 1);
auto saved = nums.save;
foreach (i; 1 .. 4)
{
assert(nums.front == nums[0]);
assert(nums.front == i);
nums.popFront();
assert(nums.length == 3 - i);
}
assert(nums.empty);
assert(saved.equal(only(1, 2, 3)));
assert(saved.equal(saved[]));
assert(saved[0 .. 1].equal(only(1)));
assert(saved[0 .. 2].equal(only(1, 2)));
assert(saved[0 .. 3].equal(saved));
assert(saved[1 .. 3].equal(only(2, 3)));
assert(saved[2 .. 3].equal(only(3)));
assert(saved[0 .. 0].empty);
assert(saved[3 .. 3].empty);
alias data = AliasSeq!("one", "two", "three", "four");
static joined =
["one two", "one two three", "one two three four"];
string[] joinedRange = joined;
static foreach (argCount; 2 .. 5)
{{
auto values = only(data[0 .. argCount]);
alias Values = typeof(values);
static assert(is(ElementType!Values == string));
static assert(isInputRange!Values);
static assert(isForwardRange!Values);
static assert(isBidirectionalRange!Values);
static assert(isRandomAccessRange!Values);
static assert(hasSlicing!Values);
static assert(hasLength!Values);
assert(values.length == argCount);
assert(values[0 .. $].equal(values[0 .. values.length]));
assert(values.joiner(" ").equal(joinedRange.front));
joinedRange.popFront();
}}
assert(saved.retro.equal(only(3, 2, 1)));
assert(saved.length == 3);
assert(saved.back == 3);
saved.popBack();
assert(saved.length == 2);
assert(saved.back == 2);
assert(saved.front == 1);
saved.popFront();
assert(saved.length == 1);
assert(saved.front == 2);
saved.popBack();
assert(saved.empty);
auto imm = only!(immutable int, immutable int)(42, 24);
alias Imm = typeof(imm);
static assert(is(ElementType!Imm == immutable(int)));
assert(!imm.empty);
assert(imm.init.empty); // https://issues.dlang.org/show_bug.cgi?id=13441
assert(imm.front == 42);
imm.popFront();
assert(imm.front == 24);
imm.popFront();
assert(imm.empty);
static struct Test { int* a; }
immutable(Test) test;
cast(void) only(test, test); // Works with mutable indirection
}
// https://issues.dlang.org/show_bug.cgi?id=21129
@safe unittest
{
auto range = () @safe {
const(char)[5] staticStr = "Hello";
// `only` must store a char[5] - not a char[]!
return only(staticStr, " World");
} ();
assert(range.join == "Hello World");
}
// https://issues.dlang.org/show_bug.cgi?id=21129
@safe unittest
{
struct AliasedString
{
const(char)[5] staticStr = "Hello";
@property const(char)[] slice() const
{
return staticStr[];
}
alias slice this;
}
auto range = () @safe {
auto hello = AliasedString();
// a copy of AliasedString is stored in the range.
return only(hello, " World");
} ();
assert(range.join == "Hello World");
}
/**
Iterate over `range` with an attached index variable.
Each element is a $(REF Tuple, std,typecons) containing the index
and the element, in that order, where the index member is named `index`
and the element member is named `value`.
The index starts at `start` and is incremented by one on every iteration.
Overflow:
If `range` has length, then it is an error to pass a value for `start`
so that `start + range.length` is bigger than `Enumerator.max`, thus
it is ensured that overflow cannot happen.
If `range` does not have length, and `popFront` is called when
`front.index == Enumerator.max`, the index will overflow and
continue from `Enumerator.min`.
Params:
range = the $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to attach indexes to
start = the number to start the index counter from
Returns:
At minimum, an input range. All other range primitives are given in the
resulting range if `range` has them. The exceptions are the bidirectional
primitives, which are propagated only if `range` has length.
Example:
Useful for using `foreach` with an index loop variable:
----
import std.stdio : stdin, stdout;
import std.range : enumerate;
foreach (lineNum, line; stdin.byLine().enumerate(1))
stdout.writefln("line #%s: %s", lineNum, line);
----
*/
auto enumerate(Enumerator = size_t, Range)(Range range, Enumerator start = 0)
if (isIntegral!Enumerator && isInputRange!Range)
in
{
static if (hasLength!Range)
{
// TODO: core.checkedint supports mixed signedness yet?
import core.checkedint : adds, addu;
import std.conv : ConvException, to;
import std.traits : isSigned, Largest, Signed;
alias LengthType = typeof(range.length);
bool overflow;
static if (isSigned!Enumerator && isSigned!LengthType)
auto result = adds(start, range.length, overflow);
else static if (isSigned!Enumerator)
{
alias signed_t = Largest!(Enumerator, Signed!LengthType);
signed_t signedLength;
//This is to trick the compiler because if length is enum
//the compiler complains about unreachable code.
auto getLength()
{
return range.length;
}
//Can length fit in the signed type
assert(getLength() < signed_t.max,
"a signed length type is required but the range's length() is too great");
signedLength = range.length;
auto result = adds(start, signedLength, overflow);
}
else
{
static if (isSigned!LengthType)
assert(range.length >= 0);
auto result = addu(start, range.length, overflow);
}
assert(!overflow && result <= Enumerator.max);
}
}
do
{
// TODO: Relax isIntegral!Enumerator to allow user-defined integral types
static struct Result
{
import std.typecons : Tuple;
private:
alias ElemType = Tuple!(Enumerator, "index", ElementType!Range, "value");
Range range;
Unqual!Enumerator index;
public:
ElemType front() @property
{
assert(!range.empty, "Attempting to fetch the front of an empty enumerate");
return typeof(return)(index, range.front);
}
static if (isInfinite!Range)
enum bool empty = false;
else
{
bool empty() @property
{
return range.empty;
}
}
void popFront()
{
assert(!range.empty, "Attempting to popFront an empty enumerate");
range.popFront();
++index; // When !hasLength!Range, overflow is expected
}
static if (isForwardRange!Range)
{
Result save() @property
{
return typeof(return)(range.save, index);
}
}
static if (hasLength!Range)
{
mixin ImplementLength!range;
static if (isBidirectionalRange!Range)
{
ElemType back() @property
{
assert(!range.empty, "Attempting to fetch the back of an empty enumerate");
return typeof(return)(cast(Enumerator)(index + range.length - 1), range.back);
}
void popBack()
{
assert(!range.empty, "Attempting to popBack an empty enumerate");
range.popBack();
}
}
}
static if (isRandomAccessRange!Range)
{
ElemType opIndex(size_t i)
{
return typeof(return)(cast(Enumerator)(index + i), range[i]);
}
}
static if (hasSlicing!Range)
{
static if (hasLength!Range)
{
Result opSlice(size_t i, size_t j)
{
return typeof(return)(range[i .. j], cast(Enumerator)(index + i));
}
}
else
{
static struct DollarToken {}
enum opDollar = DollarToken.init;
Result opSlice(size_t i, DollarToken)
{
return typeof(return)(range[i .. $], cast(Enumerator)(index + i));
}
auto opSlice(size_t i, size_t j)
{
return this[i .. $].takeExactly(j - 1);
}
}
}
}
return Result(range, start);
}
/// Can start enumeration from a negative position:
pure @safe nothrow unittest
{
import std.array : assocArray;
import std.range : enumerate;
bool[int] aa = true.repeat(3).enumerate(-1).assocArray();
assert(aa[-1]);
assert(aa[0]);
assert(aa[1]);
}
// Make sure passing qualified types works
pure @safe nothrow unittest
{
char[4] v;
immutable start = 2;
v[2 .. $].enumerate(start);
}
pure @safe nothrow unittest
{
import std.internal.test.dummyrange : AllDummyRanges;
import std.meta : AliasSeq;
import std.typecons : tuple;
static struct HasSlicing
{
typeof(this) front() @property { return typeof(this).init; }
bool empty() @property { return true; }
void popFront() {}
typeof(this) opSlice(size_t, size_t)
{
return typeof(this)();
}
}
static foreach (DummyType; AliasSeq!(AllDummyRanges, HasSlicing))
{{
alias R = typeof(enumerate(DummyType.init));
static assert(isInputRange!R);
static assert(isForwardRange!R == isForwardRange!DummyType);
static assert(isRandomAccessRange!R == isRandomAccessRange!DummyType);
static assert(!hasAssignableElements!R);
static if (hasLength!DummyType)
{
static assert(hasLength!R);
static assert(isBidirectionalRange!R ==
isBidirectionalRange!DummyType);
}
static assert(hasSlicing!R == hasSlicing!DummyType);
}}
static immutable values = ["zero", "one", "two", "three"];
auto enumerated = values[].enumerate();
assert(!enumerated.empty);
assert(enumerated.front == tuple(0, "zero"));
assert(enumerated.back == tuple(3, "three"));
typeof(enumerated) saved = enumerated.save;
saved.popFront();
assert(enumerated.front == tuple(0, "zero"));
assert(saved.front == tuple(1, "one"));
assert(saved.length == enumerated.length - 1);
saved.popBack();
assert(enumerated.back == tuple(3, "three"));
assert(saved.back == tuple(2, "two"));
saved.popFront();
assert(saved.front == tuple(2, "two"));
assert(saved.back == tuple(2, "two"));
saved.popFront();
assert(saved.empty);
size_t control = 0;
foreach (i, v; enumerated)
{
static assert(is(typeof(i) == size_t));
static assert(is(typeof(v) == typeof(values[0])));
assert(i == control);
assert(v == values[i]);
assert(tuple(i, v) == enumerated[i]);
++control;
}
assert(enumerated[0 .. $].front == tuple(0, "zero"));
assert(enumerated[$ - 1 .. $].front == tuple(3, "three"));
foreach (i; 0 .. 10)
{
auto shifted = values[0 .. 2].enumerate(i);
assert(shifted.front == tuple(i, "zero"));
assert(shifted[0] == shifted.front);
auto next = tuple(i + 1, "one");
assert(shifted[1] == next);
shifted.popFront();
assert(shifted.front == next);
shifted.popFront();
assert(shifted.empty);
}
static foreach (T; AliasSeq!(ubyte, byte, uint, int))
{{
auto inf = 42.repeat().enumerate(T.max);
alias Inf = typeof(inf);
static assert(isInfinite!Inf);
static assert(hasSlicing!Inf);
// test overflow
assert(inf.front == tuple(T.max, 42));
inf.popFront();
assert(inf.front == tuple(T.min, 42));
// test slicing
inf = inf[42 .. $];
assert(inf.front == tuple(T.min + 42, 42));
auto window = inf[0 .. 2];
assert(window.length == 1);
assert(window.front == inf.front);
window.popFront();
assert(window.empty);
}}
}
pure @safe unittest
{
import std.algorithm.comparison : equal;
import std.meta : AliasSeq;
static immutable int[] values = [0, 1, 2, 3, 4];
static foreach (T; AliasSeq!(ubyte, ushort, uint, ulong))
{{
auto enumerated = values.enumerate!T();
static assert(is(typeof(enumerated.front.index) == T));
assert(enumerated.equal(values[].zip(values)));
foreach (T i; 0 .. 5)
{
auto subset = values[cast(size_t) i .. $];
auto offsetEnumerated = subset.enumerate(i);
static assert(is(typeof(enumerated.front.index) == T));
assert(offsetEnumerated.equal(subset.zip(subset)));
}
}}
}
@nogc @safe unittest
{
const val = iota(1, 100).enumerate(1);
}
@nogc @safe unittest
{
import core.exception : AssertError;
import std.exception : assertThrown;
struct RangePayload {
enum length = size_t.max;
void popFront() {}
int front() { return 0; }
bool empty() { return true; }
}
RangePayload thePayload;
//Assertion won't happen when contracts are disabled for -release.
debug assertThrown!AssertError(enumerate(thePayload, -10));
}
// https://issues.dlang.org/show_bug.cgi?id=10939
version (none)
{
// Re-enable (or remove) if 10939 is resolved.
/+pure+/ @safe unittest // Impure because of std.conv.to
{
import core.exception : RangeError;
import std.exception : assertNotThrown, assertThrown;
import std.meta : AliasSeq;
static immutable values = [42];
static struct SignedLengthRange
{
immutable(int)[] _values = values;
int front() @property { assert(false); }
bool empty() @property { assert(false); }
void popFront() { assert(false); }
int length() @property
{
return cast(int)_values.length;
}
}
SignedLengthRange svalues;
static foreach (Enumerator; AliasSeq!(ubyte, byte, ushort, short, uint, int, ulong, long))
{
assertThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max));
assertNotThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max - values.length));
assertThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max - values.length + 1));
assertThrown!RangeError(svalues.enumerate!Enumerator(Enumerator.max));
assertNotThrown!RangeError(svalues.enumerate!Enumerator(Enumerator.max - values.length));
assertThrown!RangeError(svalues.enumerate!Enumerator(Enumerator.max - values.length + 1));
}
static foreach (Enumerator; AliasSeq!(byte, short, int))
{
assertThrown!RangeError(repeat(0, uint.max).enumerate!Enumerator());
}
assertNotThrown!RangeError(repeat(0, uint.max).enumerate!long());
}
}
/**
Returns true if `fn` accepts variables of type T1 and T2 in any order.
The following code should compile:
---
(ref T1 a, ref T2 b)
{
fn(a, b);
fn(b, a);
}
---
*/
template isTwoWayCompatible(alias fn, T1, T2)
{
enum isTwoWayCompatible = is(typeof((ref T1 a, ref T2 b)
{
cast(void) fn(a, b);
cast(void) fn(b, a);
}
));
}
///
@safe unittest
{
void func1(int a, int b);
void func2(int a, float b);
static assert(isTwoWayCompatible!(func1, int, int));
static assert(isTwoWayCompatible!(func1, short, int));
static assert(!isTwoWayCompatible!(func2, int, float));
void func3(ref int a, ref int b);
static assert( isTwoWayCompatible!(func3, int, int));
static assert(!isTwoWayCompatible!(func3, short, int));
}
/**
Policy used with the searching primitives `lowerBound`, $(D
upperBound), and `equalRange` of $(LREF SortedRange) below.
*/
enum SearchPolicy
{
/**
Searches in a linear fashion.
*/
linear,
/**
Searches with a step that is grows linearly (1, 2, 3,...)
leading to a quadratic search schedule (indexes tried are 0, 1,
3, 6, 10, 15, 21, 28,...) Once the search overshoots its target,
the remaining interval is searched using binary search. The
search is completed in $(BIGOH sqrt(n)) time. Use it when you
are reasonably confident that the value is around the beginning
of the range.
*/
trot,
/**
Performs a $(LINK2 https://en.wikipedia.org/wiki/Exponential_search,
galloping search algorithm), i.e. searches
with a step that doubles every time, (1, 2, 4, 8, ...) leading
to an exponential search schedule (indexes tried are 0, 1, 3,
7, 15, 31, 63,...) Once the search overshoots its target, the
remaining interval is searched using binary search. A value is
found in $(BIGOH log(n)) time.
*/
gallop,
/**
Searches using a classic interval halving policy. The search
starts in the middle of the range, and each search step cuts
the range in half. This policy finds a value in $(BIGOH log(n))
time but is less cache friendly than `gallop` for large
ranges. The `binarySearch` policy is used as the last step
of `trot`, `gallop`, `trotBackwards`, and $(D
gallopBackwards) strategies.
*/
binarySearch,
/**
Similar to `trot` but starts backwards. Use it when
confident that the value is around the end of the range.
*/
trotBackwards,
/**
Similar to `gallop` but starts backwards. Use it when
confident that the value is around the end of the range.
*/
gallopBackwards
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
auto a = assumeSorted([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
auto p1 = a.upperBound!(SearchPolicy.binarySearch)(3);
assert(p1.equal([4, 5, 6, 7, 8, 9]));
auto p2 = a.lowerBound!(SearchPolicy.gallop)(4);
assert(p2.equal([0, 1, 2, 3]));
}
/**
Options for $(LREF SortedRange) ranges (below).
*/
enum SortedRangeOptions
{
/**
Assume, that the range is sorted without checking.
*/
assumeSorted,
/**
All elements of the range are checked to be sorted.
The check is performed in O(n) time.
*/
checkStrictly,
/**
Some elements of the range are checked to be sorted.
For ranges with random order, this will almost surely
detect, that it is not sorted. For almost sorted ranges
it's more likely to fail. The checked elements are choosen
in a deterministic manner, which makes this check reproducable.
The check is performed in O(log(n)) time.
*/
checkRoughly,
}
///
@safe pure unittest
{
// create a SortedRange, that's checked strictly
SortedRange!(int[],"a < b", SortedRangeOptions.checkStrictly)([ 1, 3, 5, 7, 9 ]);
}
/**
Represents a sorted range. In addition to the regular range
primitives, supports additional operations that take advantage of the
ordering, such as merge and binary search. To obtain a $(D
SortedRange) from an unsorted range `r`, use
$(REF sort, std,algorithm,sorting) which sorts `r` in place and returns the
corresponding `SortedRange`. To construct a `SortedRange` from a range
`r` that is known to be already sorted, use $(LREF assumeSorted).
Params:
pred: The predicate used to define the sortedness
opt: Controls how strongly the range is checked for sortedness.
Will only be used for `RandomAccessRanges`.
Will not be used in CTFE.
*/
struct SortedRange(Range, alias pred = "a < b",
SortedRangeOptions opt = SortedRangeOptions.assumeSorted)
if (isInputRange!Range && !isInstanceOf!(SortedRange, Range))
{
import std.functional : binaryFun;
private alias predFun = binaryFun!pred;
private bool geq(L, R)(L lhs, R rhs)
{
return !predFun(lhs, rhs);
}
private bool gt(L, R)(L lhs, R rhs)
{
return predFun(rhs, lhs);
}
private Range _input;
// Undocummented because a clearer way to invoke is by calling
// assumeSorted.
this(Range input)
{
static if (opt == SortedRangeOptions.checkRoughly)
{
roughlyVerifySorted(input);
}
static if (opt == SortedRangeOptions.checkStrictly)
{
strictlyVerifySorted(input);
}
this._input = input;
}
// Assertion only.
static if (opt == SortedRangeOptions.checkRoughly)
private void roughlyVerifySorted(Range r)
{
if (!__ctfe)
{
static if (isRandomAccessRange!Range && hasLength!Range)
{
import core.bitop : bsr;
import std.algorithm.sorting : isSorted;
import std.exception : enforce;
// Check the sortedness of the input
if (r.length < 2) return;
immutable size_t msb = bsr(r.length) + 1;
assert(msb > 0 && msb <= r.length);
immutable step = r.length / msb;
auto st = stride(r, step);
enforce(isSorted!pred(st), "Range is not sorted");
}
}
}
// Assertion only.
static if (opt == SortedRangeOptions.checkStrictly)
private void strictlyVerifySorted(Range r)
{
if (!__ctfe)
{
static if (isRandomAccessRange!Range && hasLength!Range)
{
import std.algorithm.sorting : isSorted;
import std.exception : enforce;
enforce(isSorted!pred(r), "Range is not sorted");
}
}
}
/// Range primitives.
@property bool empty() //const
{
return this._input.empty;
}
/// Ditto
static if (isForwardRange!Range)
@property auto save()
{
// Avoid the constructor
typeof(this) result = this;
result._input = _input.save;
return result;
}
/// Ditto
@property auto ref front()
{
return _input.front;
}
/// Ditto
void popFront()
{
_input.popFront();
}
/// Ditto
static if (isBidirectionalRange!Range)
{
@property auto ref back()
{
return _input.back;
}
/// Ditto
void popBack()
{
_input.popBack();
}
}
/// Ditto
static if (isRandomAccessRange!Range)
auto ref opIndex(size_t i)
{
return _input[i];
}
/// Ditto
static if (hasSlicing!Range)
auto opSlice(size_t a, size_t b) return scope
{
assert(
a <= b,
"Attempting to slice a SortedRange with a larger first argument than the second."
);
typeof(this) result = this;
result._input = _input[a .. b];// skip checking
return result;
}
mixin ImplementLength!_input;
/**
Releases the controlled range and returns it.
*/
auto release()
{
import std.algorithm.mutation : move;
return move(_input);
}
// Assuming a predicate "test" that returns 0 for a left portion
// of the range and then 1 for the rest, returns the index at
// which the first 1 appears. Used internally by the search routines.
private size_t getTransitionIndex(SearchPolicy sp, alias test, V)(V v)
if (sp == SearchPolicy.binarySearch && isRandomAccessRange!Range && hasLength!Range)
{
size_t first = 0, count = _input.length;
while (count > 0)
{
immutable step = count / 2, it = first + step;
if (!test(_input[it], v))
{
first = it + 1;
count -= step + 1;
}
else
{
count = step;
}
}
return first;
}
// Specialization for trot and gallop
private size_t getTransitionIndex(SearchPolicy sp, alias test, V)(V v)
if ((sp == SearchPolicy.trot || sp == SearchPolicy.gallop)
&& isRandomAccessRange!Range)
{
if (empty || test(front, v)) return 0;
immutable count = length;
if (count == 1) return 1;
size_t below = 0, above = 1, step = 2;
while (!test(_input[above], v))
{
// Still too small, update below and increase gait
below = above;
immutable next = above + step;
if (next >= count)
{
// Overshot - the next step took us beyond the end. So
// now adjust next and simply exit the loop to do the
// binary search thingie.
above = count;
break;
}
// Still in business, increase step and continue
above = next;
static if (sp == SearchPolicy.trot)
++step;
else
step <<= 1;
}
return below + this[below .. above].getTransitionIndex!(
SearchPolicy.binarySearch, test, V)(v);
}
// Specialization for trotBackwards and gallopBackwards
private size_t getTransitionIndex(SearchPolicy sp, alias test, V)(V v)
if ((sp == SearchPolicy.trotBackwards || sp == SearchPolicy.gallopBackwards)
&& isRandomAccessRange!Range)
{
immutable count = length;
if (empty || !test(back, v)) return count;
if (count == 1) return 0;
size_t below = count - 2, above = count - 1, step = 2;
while (test(_input[below], v))
{
// Still too large, update above and increase gait
above = below;
if (below < step)
{
// Overshot - the next step took us beyond the end. So
// now adjust next and simply fall through to do the
// binary search thingie.
below = 0;
break;
}
// Still in business, increase step and continue
below -= step;
static if (sp == SearchPolicy.trot)
++step;
else
step <<= 1;
}
return below + this[below .. above].getTransitionIndex!(
SearchPolicy.binarySearch, test, V)(v);
}
// lowerBound
/**
This function uses a search with policy `sp` to find the
largest left subrange on which $(D pred(x, value)) is `true` for
all `x` (e.g., if `pred` is "less than", returns the portion of
the range with elements strictly smaller than `value`). The search
schedule and its complexity are documented in
$(LREF SearchPolicy).
*/
auto lowerBound(SearchPolicy sp = SearchPolicy.binarySearch, V)(V value)
if (isTwoWayCompatible!(predFun, ElementType!Range, V)
&& hasSlicing!Range)
{
return this[0 .. getTransitionIndex!(sp, geq)(value)];
}
///
static if (is(Range : int[]))
@safe unittest
{
import std.algorithm.comparison : equal;
auto a = assumeSorted([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]);
auto p = a.lowerBound(4);
assert(equal(p, [ 0, 1, 2, 3 ]));
}
// upperBound
/**
This function searches with policy `sp` to find the largest right
subrange on which $(D pred(value, x)) is `true` for all `x`
(e.g., if `pred` is "less than", returns the portion of the range
with elements strictly greater than `value`). The search schedule
and its complexity are documented in $(LREF SearchPolicy).
For ranges that do not offer random access, `SearchPolicy.linear`
is the only policy allowed (and it must be specified explicitly lest it exposes
user code to unexpected inefficiencies). For random-access searches, all
policies are allowed, and `SearchPolicy.binarySearch` is the default.
*/
auto upperBound(SearchPolicy sp = SearchPolicy.binarySearch, V)(V value)
if (isTwoWayCompatible!(predFun, ElementType!Range, V))
{
static assert(hasSlicing!Range || sp == SearchPolicy.linear,
"Specify SearchPolicy.linear explicitly for "
~ typeof(this).stringof);
static if (sp == SearchPolicy.linear)
{
for (; !_input.empty && !predFun(value, _input.front);
_input.popFront())
{
}
return this;
}
else
{
return this[getTransitionIndex!(sp, gt)(value) .. length];
}
}
///
static if (is(Range : int[]))
@safe unittest
{
import std.algorithm.comparison : equal;
auto a = assumeSorted([ 1, 2, 3, 3, 3, 4, 4, 5, 6 ]);
auto p = a.upperBound(3);
assert(equal(p, [4, 4, 5, 6]));
}
// equalRange
/**
Returns the subrange containing all elements `e` for which both $(D
pred(e, value)) and $(D pred(value, e)) evaluate to `false` (e.g.,
if `pred` is "less than", returns the portion of the range with
elements equal to `value`). Uses a classic binary search with
interval halving until it finds a value that satisfies the condition,
then uses `SearchPolicy.gallopBackwards` to find the left boundary
and `SearchPolicy.gallop` to find the right boundary. These
policies are justified by the fact that the two boundaries are likely
to be near the first found value (i.e., equal ranges are relatively
small). Completes the entire search in $(BIGOH log(n)) time.
*/
auto equalRange(V)(V value)
if (isTwoWayCompatible!(predFun, ElementType!Range, V)
&& isRandomAccessRange!Range)
{
size_t first = 0, count = _input.length;
while (count > 0)
{
immutable step = count / 2;
auto it = first + step;
if (predFun(_input[it], value))
{
// Less than value, bump left bound up
first = it + 1;
count -= step + 1;
}
else if (predFun(value, _input[it]))
{
// Greater than value, chop count
count = step;
}
else
{
// Equal to value, do binary searches in the
// leftover portions
// Gallop towards the left end as it's likely nearby
immutable left = first
+ this[first .. it]
.lowerBound!(SearchPolicy.gallopBackwards)(value).length;
first += count;
// Gallop towards the right end as it's likely nearby
immutable right = first
- this[it + 1 .. first]
.upperBound!(SearchPolicy.gallop)(value).length;
return this[left .. right];
}
}
return this.init;
}
///
static if (is(Range : int[]))
@safe unittest
{
import std.algorithm.comparison : equal;
auto a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
auto r = a.assumeSorted.equalRange(3);
assert(equal(r, [ 3, 3, 3 ]));
}
// trisect
/**
Returns a tuple `r` such that `r[0]` is the same as the result
of `lowerBound(value)`, `r[1]` is the same as the result of $(D
equalRange(value)), and `r[2]` is the same as the result of $(D
upperBound(value)). The call is faster than computing all three
separately. Uses a search schedule similar to $(D
equalRange). Completes the entire search in $(BIGOH log(n)) time.
*/
auto trisect(V)(V value)
if (isTwoWayCompatible!(predFun, ElementType!Range, V)
&& isRandomAccessRange!Range && hasLength!Range)
{
import std.typecons : tuple;
size_t first = 0, count = _input.length;
while (count > 0)
{
immutable step = count / 2;
auto it = first + step;
if (predFun(_input[it], value))
{
// Less than value, bump left bound up
first = it + 1;
count -= step + 1;
}
else if (predFun(value, _input[it]))
{
// Greater than value, chop count
count = step;
}
else
{
// Equal to value, do binary searches in the
// leftover portions
// Gallop towards the left end as it's likely nearby
immutable left = first
+ this[first .. it]
.lowerBound!(SearchPolicy.gallopBackwards)(value).length;
first += count;
// Gallop towards the right end as it's likely nearby
immutable right = first
- this[it + 1 .. first]
.upperBound!(SearchPolicy.gallop)(value).length;
return tuple(this[0 .. left], this[left .. right],
this[right .. length]);
}
}
// No equal element was found
return tuple(this[0 .. first], this.init, this[first .. length]);
}
///
static if (is(Range : int[]))
@safe unittest
{
import std.algorithm.comparison : equal;
auto a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
auto r = assumeSorted(a).trisect(3);
assert(equal(r[0], [ 1, 2 ]));
assert(equal(r[1], [ 3, 3, 3 ]));
assert(equal(r[2], [ 4, 4, 5, 6 ]));
}
// contains
/**
Returns `true` if and only if `value` can be found in $(D
range), which is assumed to be sorted. Performs $(BIGOH log(r.length))
evaluations of `pred`.
*/
bool contains(V)(V value)
if (isRandomAccessRange!Range)
{
if (empty) return false;
immutable i = getTransitionIndex!(SearchPolicy.binarySearch, geq)(value);
if (i >= length) return false;
return !predFun(value, _input[i]);
}
/**
Like `contains`, but the value is specified before the range.
*/
bool opBinaryRight(string op, V)(V value)
if (op == "in" && isRandomAccessRange!Range)
{
return contains(value);
}
// groupBy
/**
Returns a range of subranges of elements that are equivalent according to the
sorting relation.
*/
auto groupBy()()
{
import std.algorithm.iteration : chunkBy;
return _input.chunkBy!((a, b) => !predFun(a, b) && !predFun(b, a));
}
}
/// ditto
template SortedRange(Range, alias pred = "a < b",
SortedRangeOptions opt = SortedRangeOptions.assumeSorted)
if (isInstanceOf!(SortedRange, Range))
{
// Avoid nesting SortedRange types (see https://issues.dlang.org/show_bug.cgi?id=18933);
alias SortedRange = SortedRange!(Unqual!(typeof(Range._input)), pred, opt);
}
///
@safe unittest
{
import std.algorithm.sorting : sort;
auto a = [ 1, 2, 3, 42, 52, 64 ];
auto r = assumeSorted(a);
assert(r.contains(3));
assert(!(32 in r));
auto r1 = sort!"a > b"(a);
assert(3 in r1);
assert(!r1.contains(32));
assert(r1.release() == [ 64, 52, 42, 3, 2, 1 ]);
}
/**
`SortedRange` could accept ranges weaker than random-access, but it
is unable to provide interesting functionality for them. Therefore,
`SortedRange` is currently restricted to random-access ranges.
No copy of the original range is ever made. If the underlying range is
changed concurrently with its corresponding `SortedRange` in ways
that break its sorted-ness, `SortedRange` will work erratically.
*/
@safe unittest
{
import std.algorithm.mutation : swap;
auto a = [ 1, 2, 3, 42, 52, 64 ];
auto r = assumeSorted(a);
assert(r.contains(42));
swap(a[3], a[5]); // illegal to break sortedness of original range
assert(!r.contains(42)); // passes although it shouldn't
}
/**
`SortedRange` can be searched with predicates that do not take
two elements of the underlying range as arguments.
This is useful, if a range of structs is sorted by a member and you
want to search in that range by only providing a value for that member.
*/
@safe unittest
{
import std.algorithm.comparison : equal;
static struct S { int i; }
static bool byI(A, B)(A a, B b)
{
static if (is(A == S))
return a.i < b;
else
return a < b.i;
}
auto r = assumeSorted!byI([S(1), S(2), S(3)]);
auto lessThanTwo = r.lowerBound(2);
assert(equal(lessThanTwo, [S(1)]));
}
@safe unittest
{
import std.exception : assertThrown, assertNotThrown;
assertNotThrown(SortedRange!(int[])([ 1, 3, 10, 5, 7 ]));
assertThrown(SortedRange!(int[],"a < b", SortedRangeOptions.checkStrictly)([ 1, 3, 10, 5, 7 ]));
// these two checks are implementation depended
assertNotThrown(SortedRange!(int[],"a < b", SortedRangeOptions.checkRoughly)([ 1, 3, 10, 5, 12, 2 ]));
assertThrown(SortedRange!(int[],"a < b", SortedRangeOptions.checkRoughly)([ 1, 3, 10, 5, 2, 12 ]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
auto a = [ 10, 20, 30, 30, 30, 40, 40, 50, 60 ];
auto r = assumeSorted(a).trisect(30);
assert(equal(r[0], [ 10, 20 ]));
assert(equal(r[1], [ 30, 30, 30 ]));
assert(equal(r[2], [ 40, 40, 50, 60 ]));
r = assumeSorted(a).trisect(35);
assert(equal(r[0], [ 10, 20, 30, 30, 30 ]));
assert(r[1].empty);
assert(equal(r[2], [ 40, 40, 50, 60 ]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
auto a = [ "A", "AG", "B", "E", "F" ];
auto r = assumeSorted!"cmp(a,b) < 0"(a).trisect("B"w);
assert(equal(r[0], [ "A", "AG" ]));
assert(equal(r[1], [ "B" ]));
assert(equal(r[2], [ "E", "F" ]));
r = assumeSorted!"cmp(a,b) < 0"(a).trisect("A"d);
assert(r[0].empty);
assert(equal(r[1], [ "A" ]));
assert(equal(r[2], [ "AG", "B", "E", "F" ]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
static void test(SearchPolicy pol)()
{
auto a = [ 1, 2, 3, 42, 52, 64 ];
auto r = assumeSorted(a);
assert(equal(r.lowerBound(42), [1, 2, 3]));
assert(equal(r.lowerBound!(pol)(42), [1, 2, 3]));
assert(equal(r.lowerBound!(pol)(41), [1, 2, 3]));
assert(equal(r.lowerBound!(pol)(43), [1, 2, 3, 42]));
assert(equal(r.lowerBound!(pol)(51), [1, 2, 3, 42]));
assert(equal(r.lowerBound!(pol)(3), [1, 2]));
assert(equal(r.lowerBound!(pol)(55), [1, 2, 3, 42, 52]));
assert(equal(r.lowerBound!(pol)(420), a));
assert(equal(r.lowerBound!(pol)(0), a[0 .. 0]));
assert(equal(r.upperBound!(pol)(42), [52, 64]));
assert(equal(r.upperBound!(pol)(41), [42, 52, 64]));
assert(equal(r.upperBound!(pol)(43), [52, 64]));
assert(equal(r.upperBound!(pol)(51), [52, 64]));
assert(equal(r.upperBound!(pol)(53), [64]));
assert(equal(r.upperBound!(pol)(55), [64]));
assert(equal(r.upperBound!(pol)(420), a[0 .. 0]));
assert(equal(r.upperBound!(pol)(0), a));
}
test!(SearchPolicy.trot)();
test!(SearchPolicy.gallop)();
test!(SearchPolicy.trotBackwards)();
test!(SearchPolicy.gallopBackwards)();
test!(SearchPolicy.binarySearch)();
}
@safe unittest
{
// Check for small arrays
int[] a;
auto r = assumeSorted(a);
a = [ 1 ];
r = assumeSorted(a);
a = [ 1, 2 ];
r = assumeSorted(a);
a = [ 1, 2, 3 ];
r = assumeSorted(a);
}
@safe unittest
{
import std.algorithm.mutation : swap;
auto a = [ 1, 2, 3, 42, 52, 64 ];
auto r = assumeSorted(a);
assert(r.contains(42));
swap(a[3], a[5]); // illegal to break sortedness of original range
assert(!r.contains(42)); // passes although it shouldn't
}
@betterC @nogc nothrow @safe unittest
{
static immutable(int)[] arr = [ 1, 2, 3 ];
auto s = assumeSorted(arr);
}
@system unittest
{
import std.algorithm.comparison : equal;
int[] arr = [100, 101, 102, 200, 201, 300];
auto s = assumeSorted!((a, b) => a / 100 < b / 100)(arr);
assert(s.groupBy.equal!equal([[100, 101, 102], [200, 201], [300]]));
}
// Test on an input range
@system unittest
{
import std.conv : text;
import std.file : exists, remove, tempDir;
import std.path : buildPath;
import std.stdio : File;
import std.uuid : randomUUID;
auto name = buildPath(tempDir(), "test.std.range.line-" ~ text(__LINE__) ~
"." ~ randomUUID().toString());
auto f = File(name, "w");
scope(exit) if (exists(name)) remove(name);
// write a sorted range of lines to the file
f.write("abc\ndef\nghi\njkl");
f.close();
f.open(name, "r");
auto r = assumeSorted(f.byLine());
auto r1 = r.upperBound!(SearchPolicy.linear)("def");
assert(r1.front == "ghi", r1.front);
f.close();
}
// https://issues.dlang.org/show_bug.cgi?id=19337
@safe unittest
{
import std.algorithm.sorting : sort;
auto a = [ 1, 2, 3, 42, 52, 64 ];
a.sort.sort!"a > b";
}
/**
Assumes `r` is sorted by predicate `pred` and returns the
corresponding $(D SortedRange!(pred, R)) having `r` as support.
To check for sorted-ness at
cost $(BIGOH n), use $(REF isSorted, std,algorithm,sorting).
*/
auto assumeSorted(alias pred = "a < b", R)(R r)
if (isInputRange!(Unqual!R))
{
// Avoid senseless `SortedRange!(SortedRange!(...), pred)` nesting.
static if (is(R == SortedRange!(RRange, RPred), RRange, alias RPred))
{
static if (isInputRange!R && __traits(isSame, pred, RPred))
// If the predicate is the same and we don't need to cast away
// constness for the result to be an input range.
return r;
else
return SortedRange!(Unqual!(typeof(r._input)), pred)(r._input);
}
else
{
return SortedRange!(Unqual!R, pred)(r);
}
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
int[] a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
auto p = assumeSorted(a);
assert(equal(p.lowerBound(4), [0, 1, 2, 3]));
assert(equal(p.lowerBound(5), [0, 1, 2, 3, 4]));
assert(equal(p.lowerBound(6), [0, 1, 2, 3, 4, 5]));
assert(equal(p.lowerBound(6.9), [0, 1, 2, 3, 4, 5, 6]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
static assert(isRandomAccessRange!(SortedRange!(int[])));
int[] a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
auto p = assumeSorted(a).upperBound(3);
assert(equal(p, [4, 4, 5, 6 ]));
p = assumeSorted(a).upperBound(4.2);
assert(equal(p, [ 5, 6 ]));
// https://issues.dlang.org/show_bug.cgi?id=18933
// don't create senselessly nested SortedRange types.
assert(is(typeof(assumeSorted(a)) == typeof(assumeSorted(assumeSorted(a)))));
assert(is(typeof(assumeSorted(a)) == typeof(assumeSorted(assumeSorted!"a > b"(a)))));
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.conv : text;
int[] a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
auto p = assumeSorted(a).equalRange(3);
assert(equal(p, [ 3, 3, 3 ]), text(p));
p = assumeSorted(a).equalRange(4);
assert(equal(p, [ 4, 4 ]), text(p));
p = assumeSorted(a).equalRange(2);
assert(equal(p, [ 2 ]));
p = assumeSorted(a).equalRange(0);
assert(p.empty);
p = assumeSorted(a).equalRange(7);
assert(p.empty);
p = assumeSorted(a).equalRange(3.0);
assert(equal(p, [ 3, 3, 3]));
}
@safe unittest
{
int[] a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ];
if (a.length)
{
auto b = a[a.length / 2];
//auto r = sort(a);
//assert(r.contains(b));
}
}
@safe unittest
{
auto a = [ 5, 7, 34, 345, 677 ];
auto r = assumeSorted(a);
a = null;
r = assumeSorted(a);
a = [ 1 ];
r = assumeSorted(a);
}
// https://issues.dlang.org/show_bug.cgi?id=15003
@nogc @safe unittest
{
static immutable a = [1, 2, 3, 4];
auto r = a.assumeSorted;
}
/++
Wrapper which effectively makes it possible to pass a range by reference.
Both the original range and the RefRange will always have the exact same
elements. Any operation done on one will affect the other. So, for instance,
if it's passed to a function which would implicitly copy the original range
if it were passed to it, the original range is $(I not) copied but is
consumed as if it were a reference type.
Note:
`save` works as normal and operates on a new range, so if
`save` is ever called on the `RefRange`, then no operations on the
saved range will affect the original.
Params:
range = the range to construct the `RefRange` from
Returns:
A `RefRange`. If the given range is a class type
(and thus is already a reference type), then the original
range is returned rather than a `RefRange`.
+/
struct RefRange(R)
if (isInputRange!R)
{
public:
/++ +/
this(R* range) @safe pure nothrow
{
_range = range;
}
/++
This does not assign the pointer of `rhs` to this `RefRange`.
Rather it assigns the range pointed to by `rhs` to the range pointed
to by this `RefRange`. This is because $(I any) operation on a
`RefRange` is the same is if it occurred to the original range. The
one exception is when a `RefRange` is assigned `null` either
directly or because `rhs` is `null`. In that case, `RefRange`
no longer refers to the original range but is `null`.
+/
auto opAssign(RefRange rhs)
{
if (_range && rhs._range)
*_range = *rhs._range;
else
_range = rhs._range;
return this;
}
/++ +/
void opAssign(typeof(null) rhs)
{
_range = null;
}
/++
A pointer to the wrapped range.
+/
@property inout(R*) ptr() @safe inout pure nothrow
{
return _range;
}
version (StdDdoc)
{
/++ +/
@property auto front() {assert(0);}
/++ Ditto +/
@property auto front() const {assert(0);}
/++ Ditto +/
@property auto front(ElementType!R value) {assert(0);}
}
else
{
@property auto front()
{
return (*_range).front;
}
static if (is(typeof((*(cast(const R*)_range)).front))) @property auto front() const
{
return (*_range).front;
}
static if (is(typeof((*_range).front = (*_range).front))) @property auto front(ElementType!R value)
{
return (*_range).front = value;
}
}
version (StdDdoc)
{
@property bool empty(); ///
@property bool empty() const; ///Ditto
}
else static if (isInfinite!R)
enum empty = false;
else
{
@property bool empty()
{
return (*_range).empty;
}
static if (is(typeof((*cast(const R*)_range).empty))) @property bool empty() const
{
return (*_range).empty;
}
}
/++ +/
void popFront()
{
return (*_range).popFront();
}
version (StdDdoc)
{
/++
Only defined if `isForwardRange!R` is `true`.
+/
@property auto save() {assert(0);}
/++ Ditto +/
@property auto save() const {assert(0);}
/++ Ditto +/
auto opSlice() {assert(0);}
/++ Ditto +/
auto opSlice() const {assert(0);}
}
else static if (isForwardRange!R)
{
import std.traits : isSafe;
private alias S = typeof((*_range).save);
static if (is(typeof((*cast(const R*)_range).save)))
private alias CS = typeof((*cast(const R*)_range).save);
static if (isSafe!((R* r) => (*r).save))
{
@property RefRange!S save() @trusted
{
mixin(_genSave());
}
static if (is(typeof((*cast(const R*)_range).save))) @property RefRange!CS save() @trusted const
{
mixin(_genSave());
}
}
else
{
@property RefRange!S save()
{
mixin(_genSave());
}
static if (is(typeof((*cast(const R*)_range).save))) @property RefRange!CS save() const
{
mixin(_genSave());
}
}
auto opSlice()()
{
return save;
}
auto opSlice()() const
{
return save;
}
private static string _genSave() @safe pure nothrow
{
return `import core.lifetime : emplace;` ~
`alias S = typeof((*_range).save);` ~
`static assert(isForwardRange!S, S.stringof ~ " is not a forward range.");` ~
`auto mem = new void[S.sizeof];` ~
`emplace!S(mem, cast(S)(*_range).save);` ~
`return RefRange!S(cast(S*) mem.ptr);`;
}
static assert(isForwardRange!RefRange);
}
version (StdDdoc)
{
/++
Only defined if `isBidirectionalRange!R` is `true`.
+/
@property auto back() {assert(0);}
/++ Ditto +/
@property auto back() const {assert(0);}
/++ Ditto +/
@property auto back(ElementType!R value) {assert(0);}
}
else static if (isBidirectionalRange!R)
{
@property auto back()
{
return (*_range).back;
}
static if (is(typeof((*(cast(const R*)_range)).back))) @property auto back() const
{
return (*_range).back;
}
static if (is(typeof((*_range).back = (*_range).back))) @property auto back(ElementType!R value)
{
return (*_range).back = value;
}
}
/++ Ditto +/
static if (isBidirectionalRange!R) void popBack()
{
return (*_range).popBack();
}
version (StdDdoc)
{
/++
Only defined if `isRandomAccesRange!R` is `true`.
+/
auto ref opIndex(IndexType)(IndexType index) {assert(0);}
/++ Ditto +/
auto ref opIndex(IndexType)(IndexType index) const {assert(0);}
}
else static if (isRandomAccessRange!R)
{
auto ref opIndex(IndexType)(IndexType index)
if (is(typeof((*_range)[index])))
{
return (*_range)[index];
}
auto ref opIndex(IndexType)(IndexType index) const
if (is(typeof((*cast(const R*)_range)[index])))
{
return (*_range)[index];
}
}
/++
Only defined if `hasMobileElements!R` and `isForwardRange!R` are
`true`.
+/
static if (hasMobileElements!R && isForwardRange!R) auto moveFront()
{
return (*_range).moveFront();
}
/++
Only defined if `hasMobileElements!R` and `isBidirectionalRange!R`
are `true`.
+/
static if (hasMobileElements!R && isBidirectionalRange!R) auto moveBack()
{
return (*_range).moveBack();
}
/++
Only defined if `hasMobileElements!R` and `isRandomAccessRange!R`
are `true`.
+/
static if (hasMobileElements!R && isRandomAccessRange!R) auto moveAt(size_t index)
{
return (*_range).moveAt(index);
}
version (StdDdoc)
{
/// Only defined if `hasLength!R` is `true`.
@property size_t length();
/// ditto
@property size_t length() const;
/// Ditto
alias opDollar = length;
}
else static if (hasLength!R)
{
@property auto length()
{
return (*_range).length;
}
static if (is(typeof((*cast(const R*)_range).length))) @property auto length() const
{
return (*_range).length;
}
alias opDollar = length;
}
version (StdDdoc)
{
/++
Only defined if `hasSlicing!R` is `true`.
+/
auto opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end) {assert(0);}
/++ Ditto +/
auto opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end) const {assert(0);}
}
else static if (hasSlicing!R)
{
private alias T = typeof((*_range)[1 .. 2]);
static if (is(typeof((*cast(const R*)_range)[1 .. 2])))
{
private alias CT = typeof((*cast(const R*)_range)[1 .. 2]);
}
RefRange!T opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end)
if (is(typeof((*_range)[begin .. end])))
{
mixin(_genOpSlice());
}
RefRange!CT opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end) const
if (is(typeof((*cast(const R*)_range)[begin .. end])))
{
mixin(_genOpSlice());
}
private static string _genOpSlice() @safe pure nothrow
{
return `import core.lifetime : emplace;` ~
`alias S = typeof((*_range)[begin .. end]);` ~
`static assert(hasSlicing!S, S.stringof ~ " is not sliceable.");` ~
`auto mem = new void[S.sizeof];` ~
`emplace!S(mem, cast(S)(*_range)[begin .. end]);` ~
`return RefRange!S(cast(S*) mem.ptr);`;
}
}
private:
R* _range;
}
/// Basic Example
@system unittest
{
import std.algorithm.searching : find;
ubyte[] buffer = [1, 9, 45, 12, 22];
auto found1 = find(buffer, 45);
assert(found1 == [45, 12, 22]);
assert(buffer == [1, 9, 45, 12, 22]);
auto wrapped1 = refRange(&buffer);
auto found2 = find(wrapped1, 45);
assert(*found2.ptr == [45, 12, 22]);
assert(buffer == [45, 12, 22]);
auto found3 = find(wrapped1.save, 22);
assert(*found3.ptr == [22]);
assert(buffer == [45, 12, 22]);
string str = "hello world";
auto wrappedStr = refRange(&str);
assert(str.front == 'h');
str.popFrontN(5);
assert(str == " world");
assert(wrappedStr.front == ' ');
assert(*wrappedStr.ptr == " world");
}
/// opAssign Example.
@system unittest
{
ubyte[] buffer1 = [1, 2, 3, 4, 5];
ubyte[] buffer2 = [6, 7, 8, 9, 10];
auto wrapped1 = refRange(&buffer1);
auto wrapped2 = refRange(&buffer2);
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is &buffer2);
assert(wrapped1.ptr !is wrapped2.ptr);
assert(buffer1 != buffer2);
wrapped1 = wrapped2;
//Everything points to the same stuff as before.
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is &buffer2);
assert(wrapped1.ptr !is wrapped2.ptr);
//But buffer1 has changed due to the assignment.
assert(buffer1 == [6, 7, 8, 9, 10]);
assert(buffer2 == [6, 7, 8, 9, 10]);
buffer2 = [11, 12, 13, 14, 15];
//Everything points to the same stuff as before.
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is &buffer2);
assert(wrapped1.ptr !is wrapped2.ptr);
//But buffer2 has changed due to the assignment.
assert(buffer1 == [6, 7, 8, 9, 10]);
assert(buffer2 == [11, 12, 13, 14, 15]);
wrapped2 = null;
//The pointer changed for wrapped2 but not wrapped1.
assert(wrapped1.ptr is &buffer1);
assert(wrapped2.ptr is null);
assert(wrapped1.ptr !is wrapped2.ptr);
//buffer2 is not affected by the assignment.
assert(buffer1 == [6, 7, 8, 9, 10]);
assert(buffer2 == [11, 12, 13, 14, 15]);
}
@system unittest
{
import std.algorithm.iteration : filter;
{
ubyte[] buffer = [1, 2, 3, 4, 5];
auto wrapper = refRange(&buffer);
auto p = wrapper.ptr;
auto f = wrapper.front;
wrapper.front = f;
auto e = wrapper.empty;
wrapper.popFront();
auto s = wrapper.save;
auto b = wrapper.back;
wrapper.back = b;
wrapper.popBack();
auto i = wrapper[0];
wrapper.moveFront();
wrapper.moveBack();
wrapper.moveAt(0);
auto l = wrapper.length;
auto sl = wrapper[0 .. 1];
assert(wrapper[0 .. $].length == buffer[0 .. $].length);
}
{
ubyte[] buffer = [1, 2, 3, 4, 5];
const wrapper = refRange(&buffer);
const p = wrapper.ptr;
const f = wrapper.front;
const e = wrapper.empty;
const s = wrapper.save;
const b = wrapper.back;
const i = wrapper[0];
const l = wrapper.length;
const sl = wrapper[0 .. 1];
}
{
ubyte[] buffer = [1, 2, 3, 4, 5];
auto filtered = filter!"true"(buffer);
auto wrapper = refRange(&filtered);
auto p = wrapper.ptr;
auto f = wrapper.front;
wrapper.front = f;
auto e = wrapper.empty;
wrapper.popFront();
auto s = wrapper.save;
wrapper.moveFront();
}
{
ubyte[] buffer = [1, 2, 3, 4, 5];
auto filtered = filter!"true"(buffer);
const wrapper = refRange(&filtered);
const p = wrapper.ptr;
//Cannot currently be const. filter needs to be updated to handle const.
/+
const f = wrapper.front;
const e = wrapper.empty;
const s = wrapper.save;
+/
}
{
string str = "hello world";
auto wrapper = refRange(&str);
auto p = wrapper.ptr;
auto f = wrapper.front;
auto e = wrapper.empty;
wrapper.popFront();
auto s = wrapper.save;
auto b = wrapper.back;
wrapper.popBack();
}
{
// https://issues.dlang.org/show_bug.cgi?id=16534
// opDollar should be defined if the wrapped range defines length.
auto range = 10.iota.takeExactly(5);
auto wrapper = refRange(&range);
assert(wrapper.length == 5);
assert(wrapper[0 .. $ - 1].length == 4);
}
}
//Test assignment.
@system unittest
{
ubyte[] buffer1 = [1, 2, 3, 4, 5];
ubyte[] buffer2 = [6, 7, 8, 9, 10];
RefRange!(ubyte[]) wrapper1;
RefRange!(ubyte[]) wrapper2 = refRange(&buffer2);
assert(wrapper1.ptr is null);
assert(wrapper2.ptr is &buffer2);
wrapper1 = refRange(&buffer1);
assert(wrapper1.ptr is &buffer1);
wrapper1 = wrapper2;
assert(wrapper1.ptr is &buffer1);
assert(buffer1 == buffer2);
wrapper1 = RefRange!(ubyte[]).init;
assert(wrapper1.ptr is null);
assert(wrapper2.ptr is &buffer2);
assert(buffer1 == buffer2);
assert(buffer1 == [6, 7, 8, 9, 10]);
wrapper2 = null;
assert(wrapper2.ptr is null);
assert(buffer2 == [6, 7, 8, 9, 10]);
}
@system unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.mutation : bringToFront;
import std.algorithm.searching : commonPrefix, find, until;
import std.algorithm.sorting : sort;
//Test that ranges are properly consumed.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
assert(*find(wrapper, 41).ptr == [41, 3, 40, 4, 42, 9]);
assert(arr == [41, 3, 40, 4, 42, 9]);
assert(*drop(wrapper, 2).ptr == [40, 4, 42, 9]);
assert(arr == [40, 4, 42, 9]);
assert(equal(until(wrapper, 42), [40, 4]));
assert(arr == [42, 9]);
assert(find(wrapper, 12).empty);
assert(arr.empty);
}
{
string str = "Hello, world-like object.";
auto wrapper = refRange(&str);
assert(*find(wrapper, "l").ptr == "llo, world-like object.");
assert(str == "llo, world-like object.");
assert(equal(take(wrapper, 5), "llo, "));
assert(str == "world-like object.");
}
//Test that operating on saved ranges does not consume the original.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
auto saved = wrapper.save;
saved.popFrontN(3);
assert(*saved.ptr == [41, 3, 40, 4, 42, 9]);
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]);
}
{
string str = "Hello, world-like object.";
auto wrapper = refRange(&str);
auto saved = wrapper.save;
saved.popFrontN(13);
assert(*saved.ptr == "like object.");
assert(str == "Hello, world-like object.");
}
//Test that functions which use save work properly.
{
int[] arr = [1, 42];
auto wrapper = refRange(&arr);
assert(equal(commonPrefix(wrapper, [1, 27]), [1]));
}
{
int[] arr = [4, 5, 6, 7, 1, 2, 3];
auto wrapper = refRange(&arr);
assert(bringToFront(wrapper[0 .. 4], wrapper[4 .. arr.length]) == 3);
assert(arr == [1, 2, 3, 4, 5, 6, 7]);
}
//Test bidirectional functions.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
assert(wrapper.back == 9);
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]);
wrapper.popBack();
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42]);
}
{
string str = "Hello, world-like object.";
auto wrapper = refRange(&str);
assert(wrapper.back == '.');
assert(str == "Hello, world-like object.");
wrapper.popBack();
assert(str == "Hello, world-like object");
}
//Test random access functions.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
assert(wrapper[2] == 2);
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]);
assert(*wrapper[3 .. 6].ptr != null, [41, 3, 40]);
assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]);
}
//Test move functions.
{
int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9];
auto wrapper = refRange(&arr);
auto t1 = wrapper.moveFront();
auto t2 = wrapper.moveBack();
wrapper.front = t2;
wrapper.back = t1;
assert(arr == [9, 42, 2, 41, 3, 40, 4, 42, 1]);
sort(wrapper.save);
assert(arr == [1, 2, 3, 4, 9, 40, 41, 42, 42]);
}
}
@system unittest
{
struct S
{
@property int front() @safe const pure nothrow { return 0; }
enum bool empty = false;
void popFront() @safe pure nothrow { }
@property auto save() @safe pure nothrow { return this; }
}
S s;
auto wrapper = refRange(&s);
static assert(isInfinite!(typeof(wrapper)));
}
@system unittest
{
class C
{
@property int front() @safe const pure nothrow { return 0; }
@property bool empty() @safe const pure nothrow { return false; }
void popFront() @safe pure nothrow { }
@property auto save() @safe pure nothrow { return this; }
}
static assert(isForwardRange!C);
auto c = new C;
auto cWrapper = refRange(&c);
static assert(is(typeof(cWrapper) == C));
assert(cWrapper is c);
}
// https://issues.dlang.org/show_bug.cgi?id=14373
@system unittest
{
static struct R
{
@property int front() {return 0;}
void popFront() {empty = true;}
bool empty = false;
}
R r;
refRange(&r).popFront();
assert(r.empty);
}
// https://issues.dlang.org/show_bug.cgi?id=14575
@system unittest
{
struct R
{
Object front;
alias back = front;
bool empty = false;
void popFront() {empty = true;}
alias popBack = popFront;
@property R save() {return this;}
}
static assert(isBidirectionalRange!R);
R r;
auto rr = refRange(&r);
struct R2
{
@property Object front() {return null;}
@property const(Object) front() const {return null;}
alias back = front;
bool empty = false;
void popFront() {empty = true;}
alias popBack = popFront;
@property R2 save() {return this;}
}
static assert(isBidirectionalRange!R2);
R2 r2;
auto rr2 = refRange(&r2);
}
/// ditto
auto refRange(R)(R* range)
if (isInputRange!R)
{
static if (!is(R == class))
return RefRange!R(range);
else
return *range;
}
// https://issues.dlang.org/show_bug.cgi?id=9060
@safe unittest
{
import std.algorithm.iteration : map, joiner, group;
import std.algorithm.searching : until;
// fix for std.algorithm
auto r = map!(x => 0)([1]);
chain(r, r);
zip(r, r);
roundRobin(r, r);
struct NRAR {
typeof(r) input;
@property empty() { return input.empty; }
@property front() { return input.front; }
void popFront() { input.popFront(); }
@property save() { return NRAR(input.save); }
}
auto n1 = NRAR(r);
cycle(n1); // non random access range version
assumeSorted(r);
// fix for std.range
joiner([r], [9]);
struct NRAR2 {
NRAR input;
@property empty() { return true; }
@property front() { return input; }
void popFront() { }
@property save() { return NRAR2(input.save); }
}
auto n2 = NRAR2(n1);
joiner(n2);
group(r);
until(r, 7);
static void foo(R)(R r) { until!(x => x > 7)(r); }
foo(r);
}
private struct Bitwise(R)
if (isInputRange!R && isIntegral!(ElementType!R))
{
import std.traits : Unsigned;
private:
alias ElemType = ElementType!R;
alias UnsignedElemType = Unsigned!ElemType;
R parent;
enum bitsNum = ElemType.sizeof * 8;
size_t maskPos = 1;
static if (isBidirectionalRange!R)
{
size_t backMaskPos = bitsNum;
}
public:
this()(auto ref R range)
{
parent = range;
}
static if (isInfinite!R)
{
enum empty = false;
}
else
{
/**
* Check if the range is empty
*
* Returns: a boolean true or false
*/
bool empty()
{
static if (hasLength!R)
{
return length == 0;
}
else static if (isBidirectionalRange!R)
{
if (parent.empty)
{
return true;
}
else
{
/*
If we have consumed the last element of the range both from
the front and the back, then the masks positions will overlap
*/
return parent.save.dropOne.empty && (maskPos > backMaskPos);
}
}
else
{
/*
If we consumed the last element of the range, but not all the
bits in the last element
*/
return parent.empty;
}
}
}
bool front()
{
assert(!empty);
return (parent.front & mask(maskPos)) != 0;
}
void popFront()
{
assert(!empty);
++maskPos;
if (maskPos > bitsNum)
{
parent.popFront;
maskPos = 1;
}
}
static if (hasLength!R)
{
size_t length()
{
auto len = parent.length * bitsNum - (maskPos - 1);
static if (isBidirectionalRange!R)
{
len -= bitsNum - backMaskPos;
}
return len;
}
alias opDollar = length;
}
static if (isForwardRange!R)
{
typeof(this) save()
{
auto result = this;
result.parent = parent.save;
return result;
}
}
static if (isBidirectionalRange!R)
{
bool back()
{
assert(!empty);
return (parent.back & mask(backMaskPos)) != 0;
}
void popBack()
{
assert(!empty);
--backMaskPos;
if (backMaskPos == 0)
{
parent.popBack;
backMaskPos = bitsNum;
}
}
}
static if (isRandomAccessRange!R)
{
/**
Return the `n`th bit within the range
*/
bool opIndex(size_t n)
in
{
/*
If it does not have the length property, it means that R is
an infinite range
*/
static if (hasLength!R)
{
assert(n < length, "Index out of bounds");
}
}
do
{
immutable size_t remainingBits = bitsNum - maskPos + 1;
// If n >= maskPos, then the bit sign will be 1, otherwise 0
immutable ptrdiff_t sign = (remainingBits - n - 1) >> (ptrdiff_t.sizeof * 8 - 1);
/*
By truncating n with remainingBits bits we have skipped the
remaining bits in parent[0], so we need to add 1 to elemIndex.
Because bitsNum is a power of 2, n / bitsNum == n >> bitsNum.bsf
*/
import core.bitop : bsf;
immutable size_t elemIndex = sign * (((n - remainingBits) >> bitsNum.bsf) + 1);
/*
Since the indexing is from LSB to MSB, we need to index at the
remainder of (n - remainingBits).
Because bitsNum is a power of 2, n % bitsNum == n & (bitsNum - 1)
*/
immutable size_t elemMaskPos = (sign ^ 1) * (maskPos + n)
+ sign * (1 + ((n - remainingBits) & (bitsNum - 1)));
return (parent[elemIndex] & mask(elemMaskPos)) != 0;
}
static if (hasAssignableElements!R)
{
/**
Assigns `flag` to the `n`th bit within the range
*/
void opIndexAssign(bool flag, size_t n)
in
{
static if (hasLength!R)
{
assert(n < length, "Index out of bounds");
}
}
do
{
import core.bitop : bsf;
immutable size_t remainingBits = bitsNum - maskPos + 1;
immutable ptrdiff_t sign = (remainingBits - n - 1) >> (ptrdiff_t.sizeof * 8 - 1);
immutable size_t elemIndex = sign * (((n - remainingBits) >> bitsNum.bsf) + 1);
immutable size_t elemMaskPos = (sign ^ 1) * (maskPos + n)
+ sign * (1 + ((n - remainingBits) & (bitsNum - 1)));
auto elem = parent[elemIndex];
auto elemMask = mask(elemMaskPos);
parent[elemIndex] = cast(UnsignedElemType)(flag * (elem | elemMask)
+ (flag ^ 1) * (elem & ~elemMask));
}
}
Bitwise!R opSlice()
{
return this.save;
}
Bitwise!R opSlice(size_t start, size_t end)
in
{
assert(start < end, "Invalid bounds: end <= start");
}
do
{
import core.bitop : bsf;
size_t remainingBits = bitsNum - maskPos + 1;
ptrdiff_t sign = (remainingBits - start - 1) >> (ptrdiff_t.sizeof * 8 - 1);
immutable size_t startElemIndex = sign * (((start - remainingBits) >> bitsNum.bsf) + 1);
immutable size_t startElemMaskPos = (sign ^ 1) * (maskPos + start)
+ sign * (1 + ((start - remainingBits) & (bitsNum - 1)));
immutable size_t sliceLen = end - start - 1;
remainingBits = bitsNum - startElemMaskPos + 1;
sign = (remainingBits - sliceLen - 1) >> (ptrdiff_t.sizeof * 8 - 1);
immutable size_t endElemIndex = startElemIndex
+ sign * (((sliceLen - remainingBits) >> bitsNum.bsf) + 1);
immutable size_t endElemMaskPos = (sign ^ 1) * (startElemMaskPos + sliceLen)
+ sign * (1 + ((sliceLen - remainingBits) & (bitsNum - 1)));
typeof(return) result;
// Get the slice to be returned from the parent
result.parent = (parent[startElemIndex .. endElemIndex + 1]).save;
result.maskPos = startElemMaskPos;
static if (isBidirectionalRange!R)
{
result.backMaskPos = endElemMaskPos;
}
return result;
}
}
private:
auto mask(size_t maskPos)
{
return (1UL << (maskPos - 1UL));
}
}
/**
Bitwise adapter over an integral type range. Consumes the range elements bit by
bit, from the least significant bit to the most significant bit.
Params:
R = an integral $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to iterate over
range = range to consume bit by by
Returns:
A `Bitwise` input range with propagated forward, bidirectional
and random access capabilities
*/
auto bitwise(R)(auto ref R range)
if (isInputRange!R && isIntegral!(ElementType!R))
{
return Bitwise!R(range);
}
///
@safe pure unittest
{
import std.algorithm.comparison : equal;
import std.format : format;
// 00000011 00001001
ubyte[] arr = [3, 9];
auto r = arr.bitwise;
// iterate through it as with any other range
assert(format("%(%d%)", r) == "1100000010010000");
assert(format("%(%d%)", r.retro).equal("1100000010010000".retro));
auto r2 = r[5 .. $];
// set a bit
r[2] = 1;
assert(arr[0] == 7);
assert(r[5] == r2[0]);
}
/// You can use bitwise to implement an uniform bool generator
@safe unittest
{
import std.algorithm.comparison : equal;
import std.random : rndGen;
auto rb = rndGen.bitwise;
static assert(isInfinite!(typeof(rb)));
auto rb2 = rndGen.bitwise;
// Don't forget that structs are passed by value
assert(rb.take(10).equal(rb2.take(10)));
}
// Test nogc inference
@safe @nogc unittest
{
static ubyte[] arr = [3, 9];
auto bw = arr.bitwise;
auto bw2 = bw[];
auto bw3 = bw[8 .. $];
bw3[2] = true;
assert(arr[1] == 13);
assert(bw[$ - 6]);
assert(bw[$ - 6] == bw2[$ - 6]);
assert(bw[$ - 6] == bw3[$ - 6]);
}
// Test all range types over all integral types
@safe pure nothrow unittest
{
import std.meta : AliasSeq;
import std.internal.test.dummyrange;
alias IntegralTypes = AliasSeq!(byte, ubyte, short, ushort, int, uint,
long, ulong);
foreach (IntegralType; IntegralTypes)
{
foreach (T; AllDummyRangesType!(IntegralType[]))
{
T a;
auto bw = Bitwise!T(a);
static if (isForwardRange!T)
{
auto bwFwdSave = bw.save;
}
static if (isBidirectionalRange!T)
{
auto bwBack = bw.save;
auto bwBackSave = bw.save;
}
static if (hasLength!T)
{
auto bwLength = bw.length;
assert(bw.length == (IntegralType.sizeof * 8 * a.length));
static if (isForwardRange!T)
{
assert(bw.length == bwFwdSave.length);
}
}
// Make sure front and back are not the mechanisms that modify the range
long numCalls = 42;
bool initialFrontValue;
if (!bw.empty)
{
initialFrontValue = bw.front;
}
while (!bw.empty && (--numCalls))
{
bw.front;
assert(bw.front == initialFrontValue);
}
/*
Check that empty works properly and that popFront does not get called
more times than it should
*/
numCalls = 0;
while (!bw.empty)
{
++numCalls;
static if (hasLength!T)
{
assert(bw.length == bwLength);
--bwLength;
}
static if (isForwardRange!T)
{
assert(bw.front == bwFwdSave.front);
bwFwdSave.popFront();
}
static if (isBidirectionalRange!T)
{
assert(bwBack.front == bwBackSave.front);
bwBack.popBack();
bwBackSave.popBack();
}
bw.popFront();
}
auto rangeLen = numCalls / (IntegralType.sizeof * 8);
assert(numCalls == (IntegralType.sizeof * 8 * rangeLen));
assert(bw.empty);
static if (isForwardRange!T)
{
assert(bwFwdSave.empty);
}
static if (isBidirectionalRange!T)
{
assert(bwBack.empty);
}
}
}
}
// Test opIndex and opSlice
@system unittest
{
import std.meta : AliasSeq;
alias IntegralTypes = AliasSeq!(byte, ubyte, short, ushort, int, uint,
long, ulong);
foreach (IntegralType; IntegralTypes)
{
size_t bitsNum = IntegralType.sizeof * 8;
auto first = cast(IntegralType)(1);
// 2 ^ (bitsNum - 1)
auto second = cast(IntegralType)(cast(IntegralType)(1) << (bitsNum - 2));
IntegralType[] a = [first, second];
auto bw = Bitwise!(IntegralType[])(a);
// Check against lsb of a[0]
assert(bw[0] == true);
// Check against msb - 1 of a[1]
assert(bw[2 * bitsNum - 2] == true);
bw.popFront();
assert(bw[2 * bitsNum - 3] == true);
import std.exception : assertThrown;
// Check out of bounds error
assertThrown!Error(bw[2 * bitsNum - 1]);
bw[2] = true;
assert(bw[2] == true);
bw.popFront();
assert(bw[1] == true);
auto bw2 = bw[0 .. $ - 5];
auto bw3 = bw2[];
assert(bw2.length == (bw.length - 5));
assert(bw2.length == bw3.length);
bw2.popFront();
assert(bw2.length != bw3.length);
}
}
/*********************************
* An OutputRange that discards the data it receives.
*/
struct NullSink
{
void put(E)(scope const E) pure @safe @nogc nothrow {}
}
/// ditto
auto ref nullSink()
{
static NullSink sink;
return sink;
}
///
@safe nothrow unittest
{
import std.algorithm.iteration : map;
import std.algorithm.mutation : copy;
[4, 5, 6].map!(x => x * 2).copy(nullSink); // data is discarded
}
///
@safe unittest
{
import std.csv : csvNextToken;
string line = "a,b,c";
// ignore the first column
line.csvNextToken(nullSink, ',', '"');
line.popFront;
// look at the second column
Appender!string app;
line.csvNextToken(app, ',', '"');
assert(app.data == "b");
}
@safe unittest
{
auto r = 10.iota
.tee(nullSink)
.dropOne;
assert(r.front == 1);
}
/++
Implements a "tee" style pipe, wrapping an input range so that elements of the
range can be passed to a provided function or $(LREF OutputRange) as they are
iterated over. This is useful for printing out intermediate values in a long
chain of range code, performing some operation with side-effects on each call
to `front` or `popFront`, or diverting the elements of a range into an
auxiliary $(LREF OutputRange).
It is important to note that as the resultant range is evaluated lazily,
in the case of the version of `tee` that takes a function, the function
will not actually be executed until the range is "walked" using functions
that evaluate ranges, such as $(REF array, std,array) or
$(REF fold, std,algorithm,iteration).
Params:
pipeOnPop = If `Yes.pipeOnPop`, simply iterating the range without ever
calling `front` is enough to have `tee` mirror elements to `outputRange` (or,
respectively, `fun`). Note that each `popFront()` call will mirror the
old `front` value, not the new one. This means that the last value will
not be forwarded if the range isn't iterated until empty. If
`No.pipeOnPop`, only elements for which `front` does get called will be
also sent to `outputRange`/`fun`. If `front` is called twice for the same
element, it will still be sent only once. If this caching is undesired,
consider using $(REF map, std,algorithm,iteration) instead.
inputRange = The input range being passed through.
outputRange = This range will receive elements of `inputRange` progressively
as iteration proceeds.
fun = This function will be called with elements of `inputRange`
progressively as iteration proceeds.
Returns:
An input range that offers the elements of `inputRange`. Regardless of
whether `inputRange` is a more powerful range (forward, bidirectional etc),
the result is always an input range. Reading this causes `inputRange` to be
iterated and returns its elements in turn. In addition, the same elements
will be passed to `outputRange` or `fun` as well.
See_Also: $(REF each, std,algorithm,iteration)
+/
auto tee(Flag!"pipeOnPop" pipeOnPop = Yes.pipeOnPop, R1, R2)(R1 inputRange, R2 outputRange)
if (isInputRange!R1 && isOutputRange!(R2, ElementType!R1))
{
static struct Result
{
private R1 _input;
private R2 _output;
static if (!pipeOnPop)
{
private bool _frontAccessed;
}
mixin ImplementLength!_input;
static if (isInfinite!R1)
{
enum bool empty = false;
}
else
{
@property bool empty() { return _input.empty; }
}
void popFront()
{
assert(!_input.empty, "Attempting to popFront an empty tee");
static if (pipeOnPop)
{
put(_output, _input.front);
}
else
{
_frontAccessed = false;
}
_input.popFront();
}
@property auto ref front()
{
assert(!_input.empty, "Attempting to fetch the front of an empty tee");
static if (!pipeOnPop)
{
if (!_frontAccessed)
{
_frontAccessed = true;
put(_output, _input.front);
}
}
return _input.front;
}
}
return Result(inputRange, outputRange);
}
/// Ditto
auto tee(alias fun, Flag!"pipeOnPop" pipeOnPop = Yes.pipeOnPop, R1)(R1 inputRange)
if (is(typeof(fun) == void) || isSomeFunction!fun)
{
import std.traits : isDelegate, isFunctionPointer;
/*
Distinguish between function literals and template lambdas
when using either as an $(LREF OutputRange). Since a template
has no type, typeof(template) will always return void.
If it's a template lambda, it's first necessary to instantiate
it with `ElementType!R1`.
*/
static if (is(typeof(fun) == void))
alias _fun = fun!(ElementType!R1);
else
alias _fun = fun;
static if (isFunctionPointer!_fun || isDelegate!_fun)
{
return tee!pipeOnPop(inputRange, _fun);
}
else
{
return tee!pipeOnPop(inputRange, &_fun);
}
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filter, map;
// Sum values while copying
int[] values = [1, 4, 9, 16, 25];
int sum = 0;
auto newValues = values.tee!(a => sum += a).array;
assert(equal(newValues, values));
assert(sum == 1 + 4 + 9 + 16 + 25);
// Count values that pass the first filter
int count = 0;
auto newValues4 = values.filter!(a => a < 10)
.tee!(a => count++)
.map!(a => a + 1)
.filter!(a => a < 10);
//Fine, equal also evaluates any lazy ranges passed to it.
//count is not 3 until equal evaluates newValues4
assert(equal(newValues4, [2, 5]));
assert(count == 3);
}
//
@safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filter, map;
int[] values = [1, 4, 9, 16, 25];
int count = 0;
auto newValues = values.filter!(a => a < 10)
.tee!(a => count++, No.pipeOnPop)
.map!(a => a + 1)
.filter!(a => a < 10);
auto val = newValues.front;
assert(count == 1);
//front is only evaluated once per element
val = newValues.front;
assert(count == 1);
//popFront() called, fun will be called
//again on the next access to front
newValues.popFront();
newValues.front;
assert(count == 2);
int[] preMap = new int[](3), postMap = [];
auto mappedValues = values.filter!(a => a < 10)
//Note the two different ways of using tee
.tee(preMap)
.map!(a => a + 1)
.tee!(a => postMap ~= a)
.filter!(a => a < 10);
assert(equal(mappedValues, [2, 5]));
assert(equal(preMap, [1, 4, 9]));
assert(equal(postMap, [2, 5, 10]));
}
//
@safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filter, map;
char[] txt = "Line one, Line 2".dup;
bool isVowel(dchar c)
{
import std.string : indexOf;
return "AaEeIiOoUu".indexOf(c) != -1;
}
int vowelCount = 0;
int shiftedCount = 0;
auto removeVowels = txt.tee!(c => isVowel(c) ? vowelCount++ : 0)
.filter!(c => !isVowel(c))
.map!(c => (c == ' ') ? c : c + 1)
.tee!(c => isVowel(c) ? shiftedCount++ : 0);
assert(equal(removeVowels, "Mo o- Mo 3"));
assert(vowelCount == 6);
assert(shiftedCount == 3);
}
@safe unittest
{
// Manually stride to test different pipe behavior.
void testRange(Range)(Range r)
{
const int strideLen = 3;
int i = 0;
ElementType!Range elem1;
ElementType!Range elem2;
while (!r.empty)
{
if (i % strideLen == 0)
{
//Make sure front is only
//evaluated once per item
elem1 = r.front;
elem2 = r.front;
assert(elem1 == elem2);
}
r.popFront();
i++;
}
}
string txt = "abcdefghijklmnopqrstuvwxyz";
int popCount = 0;
auto pipeOnPop = txt.tee!(a => popCount++);
testRange(pipeOnPop);
assert(popCount == 26);
int frontCount = 0;
auto pipeOnFront = txt.tee!(a => frontCount++, No.pipeOnPop);
testRange(pipeOnFront);
assert(frontCount == 9);
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.meta : AliasSeq;
//Test diverting elements to an OutputRange
string txt = "abcdefghijklmnopqrstuvwxyz";
dchar[] asink1 = [];
auto fsink = (dchar c) { asink1 ~= c; };
auto result1 = txt.tee(fsink).array;
assert(equal(txt, result1) && (equal(result1, asink1)));
dchar[] _asink1 = [];
auto _result1 = txt.tee!((dchar c) { _asink1 ~= c; })().array;
assert(equal(txt, _result1) && (equal(_result1, _asink1)));
dchar[] asink2 = new dchar[](txt.length);
void fsink2(dchar c) { static int i = 0; asink2[i] = c; i++; }
auto result2 = txt.tee(&fsink2).array;
assert(equal(txt, result2) && equal(result2, asink2));
dchar[] asink3 = new dchar[](txt.length);
auto result3 = txt.tee(asink3).array;
assert(equal(txt, result3) && equal(result3, asink3));
static foreach (CharType; AliasSeq!(char, wchar, dchar))
{{
auto appSink = appender!(CharType[])();
auto appResult = txt.tee(appSink).array;
assert(equal(txt, appResult) && equal(appResult, appSink.data));
}}
static foreach (StringType; AliasSeq!(string, wstring, dstring))
{{
auto appSink = appender!StringType();
auto appResult = txt.tee(appSink).array;
assert(equal(txt, appResult) && equal(appResult, appSink.data));
}}
}
// https://issues.dlang.org/show_bug.cgi?id=13483
@safe unittest
{
static void func1(T)(T x) {}
void func2(int x) {}
auto r = [1, 2, 3, 4].tee!func1.tee!func2;
}
/**
Extends the length of the input range `r` by padding out the start of the
range with the element `e`. The element `e` must be of a common type with
the element type of the range `r` as defined by $(REF CommonType, std, traits).
If `n` is less than the length of of `r`, then `r` is returned unmodified.
If `r` is a string with Unicode characters in it, `padLeft` follows D's rules
about length for strings, which is not the number of characters, or
graphemes, but instead the number of encoding units. If you want to treat each
grapheme as only one encoding unit long, then call
$(REF byGrapheme, std, uni) before calling this function.
If `r` has a length, then this is $(BIGOH 1). Otherwise, it's $(BIGOH r.length).
Params:
r = an $(REF_ALTTEXT input range, isInputRange, std,range,primitives) with a length, or a forward range
e = element to pad the range with
n = the length to pad to
Returns:
A range containing the elements of the original range with the extra padding
See Also:
$(REF leftJustifier, std, string)
*/
auto padLeft(R, E)(R r, E e, size_t n)
if (
((isInputRange!R && hasLength!R) || isForwardRange!R) &&
!is(CommonType!(ElementType!R, E) == void)
)
{
static if (hasLength!R)
auto dataLength = r.length;
else
auto dataLength = r.save.walkLength(n);
return e.repeat(n > dataLength ? n - dataLength : 0).chain(r);
}
///
@safe pure unittest
{
import std.algorithm.comparison : equal;
assert([1, 2, 3, 4].padLeft(0, 6).equal([0, 0, 1, 2, 3, 4]));
assert([1, 2, 3, 4].padLeft(0, 3).equal([1, 2, 3, 4]));
assert("abc".padLeft('_', 6).equal("___abc"));
}
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : DummyRange, Length, RangeType, ReturnBy;
import std.meta : AliasSeq;
alias DummyRanges = AliasSeq!(
DummyRange!(ReturnBy.Reference, Length.Yes, RangeType.Input),
DummyRange!(ReturnBy.Reference, Length.Yes, RangeType.Forward),
DummyRange!(ReturnBy.Reference, Length.Yes, RangeType.Bidirectional),
DummyRange!(ReturnBy.Reference, Length.Yes, RangeType.Random),
DummyRange!(ReturnBy.Reference, Length.No, RangeType.Forward),
DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Input),
DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Forward),
DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Bidirectional),
DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Random),
DummyRange!(ReturnBy.Value, Length.No, RangeType.Forward)
);
foreach (Range; DummyRanges)
{
Range r;
assert(r
.padLeft(0, 12)
.equal([0, 0, 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U])
);
}
}
// Test nogc inference
@safe @nogc pure unittest
{
import std.algorithm.comparison : equal;
static immutable r1 = [1, 2, 3, 4];
static immutable r2 = [0, 0, 1, 2, 3, 4];
assert(r1.padLeft(0, 6).equal(r2));
}
/**
Extend the length of the input range `r` by padding out the end of the range
with the element `e`. The element `e` must be of a common type with the
element type of the range `r` as defined by $(REF CommonType, std, traits).
If `n` is less than the length of of `r`, then the contents of `r` are
returned.
The range primitives that the resulting range provides depends whether or not `r`
provides them. Except the functions `back` and `popBack`, which also require
the range to have a length as well as `back` and `popBack`
Params:
r = an $(REF_ALTTEXT input range, isInputRange, std,range,primitives) with a length
e = element to pad the range with
n = the length to pad to
Returns:
A range containing the elements of the original range with the extra padding
See Also:
$(REF rightJustifier, std, string)
*/
auto padRight(R, E)(R r, E e, size_t n)
if (
isInputRange!R &&
!isInfinite!R &&
!is(CommonType!(ElementType!R, E) == void))
{
static struct Result
{
private:
R data;
E element;
static if (hasLength!R)
{
size_t padLength;
}
else
{
size_t minLength;
size_t consumed;
}
public:
bool empty() @property
{
static if (hasLength!R)
{
return data.empty && padLength == 0;
}
else
{
return data.empty && consumed >= minLength;
}
}
auto front() @property
{
assert(!empty, "Attempting to fetch the front of an empty padRight");
return data.empty ? element : data.front;
}
void popFront()
{
assert(!empty, "Attempting to popFront an empty padRight");
static if (hasLength!R)
{
if (!data.empty)
{
data.popFront;
}
else
{
--padLength;
}
}
else
{
++consumed;
if (!data.empty)
{
data.popFront;
}
}
}
static if (hasLength!R)
{
size_t length() @property
{
return data.length + padLength;
}
}
static if (isForwardRange!R)
{
auto save() @property
{
typeof(this) result = this;
data = data.save;
return result;
}
}
static if (isBidirectionalRange!R && hasLength!R)
{
auto back() @property
{
assert(!empty, "Attempting to fetch the back of an empty padRight");
return padLength > 0 ? element : data.back;
}
void popBack()
{
assert(!empty, "Attempting to popBack an empty padRight");
if (padLength > 0)
{
--padLength;
}
else
{
data.popBack;
}
}
}
static if (isRandomAccessRange!R && hasLength!R)
{
E opIndex(size_t index)
{
assert(index <= this.length, "Index out of bounds");
return index >= data.length ? element : data[index];
}
}
static if (hasSlicing!R && hasLength!R)
{
auto opSlice(size_t a, size_t b)
{
assert(
a <= b,
"Attempting to slice a padRight with a larger first argument than the second."
);
assert(
b <= length,
"Attempting to slice using an out of bounds index on a padRight"
);
return Result(
a >= data.length ? data[0 .. 0] : b <= data.length ? data[a .. b] : data[a .. data.length],
element, b - a);
}
alias opDollar = length;
}
this(R r, E e, size_t n)
{
data = r;
element = e;
static if (hasLength!R)
{
padLength = n > data.length ? n - data.length : 0;
}
else
{
minLength = n;
}
}
@disable this();
}
return Result(r, e, n);
}
///
@safe pure unittest
{
import std.algorithm.comparison : equal;
assert([1, 2, 3, 4].padRight(0, 6).equal([1, 2, 3, 4, 0, 0]));
assert([1, 2, 3, 4].padRight(0, 4).equal([1, 2, 3, 4]));
assert("abc".padRight('_', 6).equal("abc___"));
}
pure @safe unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange : AllDummyRanges, ReferenceInputRange;
import std.meta : AliasSeq;
auto string_input_range = new ReferenceInputRange!dchar(['a', 'b', 'c']);
dchar padding = '_';
assert(string_input_range.padRight(padding, 6).equal("abc___"));
foreach (RangeType; AllDummyRanges)
{
RangeType r1;
assert(r1
.padRight(0, 12)
.equal([1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 0, 0])
);
// test if Result properly uses random access ranges
static if (isRandomAccessRange!RangeType)
{
RangeType r3;
assert(r3.padRight(0, 12)[0] == 1);
assert(r3.padRight(0, 12)[2] == 3);
assert(r3.padRight(0, 12)[9] == 10);
assert(r3.padRight(0, 12)[10] == 0);
assert(r3.padRight(0, 12)[11] == 0);
}
// test if Result properly uses slicing and opDollar
static if (hasSlicing!RangeType)
{
RangeType r4;
assert(r4
.padRight(0, 12)[0 .. 3]
.equal([1, 2, 3])
);
assert(r4
.padRight(0, 12)[0 .. 10]
.equal([1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U])
);
assert(r4
.padRight(0, 12)[0 .. 11]
.equal([1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 0])
);
assert(r4
.padRight(0, 12)[2 .. $]
.equal([3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 0, 0])
);
assert(r4
.padRight(0, 12)[0 .. $]
.equal([1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 0, 0])
);
}
// drop & dropBack test opslice ranges when available, popFront/popBack otherwise
RangeType r5;
foreach (i; 1 .. 13) assert(r5.padRight(0, 12).drop(i).walkLength == 12 - i);
}
}
// Test nogc inference
@safe @nogc pure unittest
{
import std.algorithm.comparison : equal;
static immutable r1 = [1, 2, 3, 4];
static immutable r2 = [1, 2, 3, 4, 0, 0];
assert(r1.padRight(0, 6).equal(r2));
}
// Test back, popBack, and save
@safe pure unittest
{
import std.algorithm.comparison : equal;
auto r1 = [1, 2, 3, 4].padRight(0, 6);
assert(r1.back == 0);
r1.popBack;
auto r2 = r1.save;
assert(r1.equal([1, 2, 3, 4, 0]));
assert(r2.equal([1, 2, 3, 4, 0]));
r1.popBackN(2);
assert(r1.back == 3);
assert(r1.length == 3);
assert(r2.length == 5);
assert(r2.equal([1, 2, 3, 4, 0]));
r2.popFront;
assert(r2.length == 4);
assert(r2[0] == 2);
assert(r2[1] == 3);
assert(r2[2] == 4);
assert(r2[3] == 0);
assert(r2.equal([2, 3, 4, 0]));
r2.popBack;
assert(r2.equal([2, 3, 4]));
auto r3 = [1, 2, 3, 4].padRight(0, 6);
size_t len = 0;
while (!r3.empty)
{
++len;
r3.popBack;
}
assert(len == 6);
}
// https://issues.dlang.org/show_bug.cgi?id=19042
@safe pure unittest
{
import std.algorithm.comparison : equal;
assert([2, 5, 13].padRight(42, 10).chunks(5)
.equal!equal([[2, 5, 13, 42, 42], [42, 42, 42, 42, 42]]));
assert([1, 2, 3, 4].padRight(0, 10)[7 .. 9].equal([0, 0]));
}
| D |
/*
Copyright © 2019 Clipsey
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module game.data.floorconfig;
public import game.data;
/// Size struct
struct Size {
/// Width
int width;
/// Height
int height;
}
struct Shop {
string[] items;
@optional
Dialogue[] dialogue;
}
struct Dialogue {
string actor;
string says;
}
struct DialogueEvent {
string type;
Dialogue[] dialogue;
}
struct RoomConfig {
string start;
string end;
string[] rooms;
}
/// Floor data
struct FloorData {
/// The background of the floor
string background;
/// The size (in tiles) of the floor
Size size;
/// The available rooms
RoomConfig rooms;
/// The entities in the game
string[] entities;
/// The items available in the shop
@optional
Shop shop;
@optional
DialogueEvent[] dialogs;
}
/// The floor config root node
struct FloorConfig {
/// The floors of this config
FloorData[] floors;
} | D |
/Users/lukamessina/work/reactor_app/RTS/DerivedData/MAXSIMA Simulator/Build/Intermediates/MAXSIMA Simulator.build/Debug-iphonesimulator/MAXSIMA Simulator.build/Objects-normal/i386/Cladding.o : /Users/lukamessina/work/reactor_app/RTS/Material.swift /Users/lukamessina/work/reactor_app/RTS/RTS/WelcomeViewController.swift /Users/lukamessina/work/reactor_app/RTS/RTS/AppDelegate.swift /Users/lukamessina/work/reactor_app/RTS/RTS/UlohsViewController.swift /Users/lukamessina/work/reactor_app/RTS/Reactor.swift /Users/lukamessina/work/reactor_app/RTS/RTS/ResultsViewController.swift /Users/lukamessina/work/reactor_app/RTS/UserSettings.swift /Users/lukamessina/work/reactor_app/RTS/RTS/AccidentsTableViewController.swift /Users/lukamessina/work/reactor_app/RTS/Fuel.swift /Users/lukamessina/work/reactor_app/RTS/RTS/OvercoolingViewController.swift /Users/lukamessina/work/reactor_app/RTS/RTS/SimulationViewController.swift /Users/lukamessina/work/reactor_app/RTS/GapGas.swift /Users/lukamessina/work/reactor_app/RTS/RTS/AccidentsTableViewCell.swift /Users/lukamessina/work/reactor_app/RTS/Coolant.swift /Users/lukamessina/work/reactor_app/RTS/RTS/ReactivityViewController.swift /Users/lukamessina/work/reactor_app/RTS/RTS/UtopViewController.swift /Users/lukamessina/work/reactor_app/RTS/Constants.swift /Users/lukamessina/work/reactor_app/RTS/Cladding.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreImage.swiftmodule
/Users/lukamessina/work/reactor_app/RTS/DerivedData/MAXSIMA Simulator/Build/Intermediates/MAXSIMA Simulator.build/Debug-iphonesimulator/MAXSIMA Simulator.build/Objects-normal/i386/Cladding~partial.swiftmodule : /Users/lukamessina/work/reactor_app/RTS/Material.swift /Users/lukamessina/work/reactor_app/RTS/RTS/WelcomeViewController.swift /Users/lukamessina/work/reactor_app/RTS/RTS/AppDelegate.swift /Users/lukamessina/work/reactor_app/RTS/RTS/UlohsViewController.swift /Users/lukamessina/work/reactor_app/RTS/Reactor.swift /Users/lukamessina/work/reactor_app/RTS/RTS/ResultsViewController.swift /Users/lukamessina/work/reactor_app/RTS/UserSettings.swift /Users/lukamessina/work/reactor_app/RTS/RTS/AccidentsTableViewController.swift /Users/lukamessina/work/reactor_app/RTS/Fuel.swift /Users/lukamessina/work/reactor_app/RTS/RTS/OvercoolingViewController.swift /Users/lukamessina/work/reactor_app/RTS/RTS/SimulationViewController.swift /Users/lukamessina/work/reactor_app/RTS/GapGas.swift /Users/lukamessina/work/reactor_app/RTS/RTS/AccidentsTableViewCell.swift /Users/lukamessina/work/reactor_app/RTS/Coolant.swift /Users/lukamessina/work/reactor_app/RTS/RTS/ReactivityViewController.swift /Users/lukamessina/work/reactor_app/RTS/RTS/UtopViewController.swift /Users/lukamessina/work/reactor_app/RTS/Constants.swift /Users/lukamessina/work/reactor_app/RTS/Cladding.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreImage.swiftmodule
/Users/lukamessina/work/reactor_app/RTS/DerivedData/MAXSIMA Simulator/Build/Intermediates/MAXSIMA Simulator.build/Debug-iphonesimulator/MAXSIMA Simulator.build/Objects-normal/i386/Cladding~partial.swiftdoc : /Users/lukamessina/work/reactor_app/RTS/Material.swift /Users/lukamessina/work/reactor_app/RTS/RTS/WelcomeViewController.swift /Users/lukamessina/work/reactor_app/RTS/RTS/AppDelegate.swift /Users/lukamessina/work/reactor_app/RTS/RTS/UlohsViewController.swift /Users/lukamessina/work/reactor_app/RTS/Reactor.swift /Users/lukamessina/work/reactor_app/RTS/RTS/ResultsViewController.swift /Users/lukamessina/work/reactor_app/RTS/UserSettings.swift /Users/lukamessina/work/reactor_app/RTS/RTS/AccidentsTableViewController.swift /Users/lukamessina/work/reactor_app/RTS/Fuel.swift /Users/lukamessina/work/reactor_app/RTS/RTS/OvercoolingViewController.swift /Users/lukamessina/work/reactor_app/RTS/RTS/SimulationViewController.swift /Users/lukamessina/work/reactor_app/RTS/GapGas.swift /Users/lukamessina/work/reactor_app/RTS/RTS/AccidentsTableViewCell.swift /Users/lukamessina/work/reactor_app/RTS/Coolant.swift /Users/lukamessina/work/reactor_app/RTS/RTS/ReactivityViewController.swift /Users/lukamessina/work/reactor_app/RTS/RTS/UtopViewController.swift /Users/lukamessina/work/reactor_app/RTS/Constants.swift /Users/lukamessina/work/reactor_app/RTS/Cladding.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreImage.swiftmodule
| D |
--- src/dcd/server/autocomplete/doc.d 2022-11-14 15:33:18.687809000 -0500
+++ src/dcd/server/autocomplete/doc.d 2022-11-14 15:36:55.838929000 -0500
@@ -20,6 +20,7 @@
import std.algorithm;
import std.array;
+import std.experimental.allocator;
import std.experimental.logger;
import std.typecons;
@@ -45,10 +46,10 @@
// trace("Getting doc comments");
AutocompleteResponse response;
RollbackAllocator rba;
- auto allocator = scoped!(ASTAllocator)();
+ scope allocator = new ASTAllocator();
auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
SymbolStuff stuff = getSymbolsForCompletion(request, CompletionType.ddoc,
- allocator, &rba, cache, moduleCache);
+ allocator.allocatorObject, &rba, cache, moduleCache);
if (stuff.symbols.length == 0)
warning("Could not find symbol");
else
| D |
module core.Type.Boolean;
/**
Определяет возможности datatype.
$(BU_Extra)
**/
class Бул
{
цел м_Знач;
/**
* Конструктор
* Параметры:
* x = нулю устанавливает значение на Нет. Не нуль устанавливает значение на Да.
*
* Примеры:
* --------------------
* Бул a = new Бул(1); // Инициализует в Да.
* Бул b = new Бул(-1); // Инициализует в Да.
* Бул c = new Бул(100); // Инициализует в Да.
* Бул d = new Бул(0); // Инициализует в Нет.
* --------------------
**/
this(цел x) { м_Знач = (x != 0 ? 1 : 0); }
/**
* Конструктор
* Параметры:
* x = Копирует значение в новый объект.
*
* Примеры:
* --------------------
* Бул a = new Бул(Да); // Инициализует в Да.
* Бул b = new Бул(Нет); // Инициализует в Нет.
* Бул c = new Бул(a); // Инициализует в Да.
* Бул d = new Бул(b); // Инициализует в Нет.
* --------------------
**/
this(Бул x) { м_Знач = x.м_Знач; }
/**
* Конструктор
* Параметры:
* x = нулю устанавливает значение в Да, когда параметр один из
"ДА","Да","да","YES","Yes","yes","ON","On","on","T","t","1".
Любой другой парамер устанавлевает этот булеанец в Нет.
*
*
* Примеры:
* --------------------
* Бул a = new Бул("Да"); // Инициализует в Да.
* Бул b = new Бул("Нет"); // Инициализует в Нет.
* Бул c = new Бул("1"); // Инициализует в Да.
* Бул d = new Бул("rabbit"); // Инициализует в Нет.
* Бул e = new Бул("on"); // Инициализует в Да.
* Бул f = new Бул("off"); // Инициализует в Нет.
* Бул g = new Бул(""); // Инициализует в Нет.
* --------------------
**/
this(ткст x) {
switch (x)
{
case "ДА", "Да", "да",
"YES", "Yes", "yes",
"ON", "On", "on",
"T", "t",
"1",
"да", "вкл", "ИСТИНА", "Да"
:
м_Знач = 1;
break;
default:
м_Знач = 0;
}
}
version(БулНеизвестно)
{
/**
* Конструктор
*
* Это устонавливает булеанца в Неизвестно.
*
* Примеры:
* --------------------
* Бул a = new Бул(); // Инициализует в Неизвестно;
* --------------------
**/
this() { м_Знач = -1; }
}
else
{
/**
* Конструктор
*
* Устанавливает булеанца в Нет.
*
* Примеры:
* --------------------
* Бул a = new Бул(); // Инициализует в Нет;
* --------------------
**/
this() { м_Знач = 0; }
}
/**
* Лператор Равенства
* Параметры:
* pOther = Булеанец, с которым сравнивать этот.
*
*
* Примеры:
* --------------------
* Бул a = SomeFunc();
* if (a == Да) { . . . }
* --------------------
**/
цел opEquals(Бул pOther) {
version(БулНеизвестно)
{
if (м_Знач == -1)
throw new БулИскл("opEquals LHS не указан");
if (pOther.м_Знач == -1)
throw new БулИскл("opEquals RHS не указан");
}
return (м_Знач == pOther.м_Знач ? 1 : 0);
}
/**
* Оператор Сравнивания
*
* Нет сортируется перед Да.
* Параметры:
* pOther = Булеанец, с которым сравнивать этот.
*
*
* Примеры:
* --------------------
* Бул a = SomeFunc();
* Бул b = OtherFunc();
* if (a < b) { . . . }
* --------------------
**/
цел opCmp(Бул pOther) {
version(БулНеизвестно)
{
if (м_Знач == -1)
throw new БулИскл("opCmp LHS не указан");
if (pOther.м_Знач == -1)
throw new БулИскл("opCmp RHS не указан");
}
// Нет сортируется перед Да.
if (м_Знач == pOther.м_Знач)
return 0;
if (м_Знач == 0)
return -1;
return 1;
}
/**
* Комплементарный Оператор
* Параметры:
* pOther = Булеанец, с которым сравнивать этот.
*
*
* Примеры:
* --------------------
* Бул a = ~SomeFunc();
* if (a == Да) { . . . }
* --------------------
**/
Бул opCom()
{
version(БулНеизвестно)
{
if (м_Знач == -1)
throw new БулИскл("Значение opCom не указано");
}
if (м_Знач == 1)
return Нет;
return Да;
}
/**
* And Operator
* Параметры:
* pOther = Булеанец, с которым сравнивать этот.
*
*
* Примеры:
* --------------------
* Бул a = SomeFunc();
* Бул b = OtherFunc();
* Бул c = a & b;
* --------------------
**/
Бул opAnd(Бул pOther)
{
version(БулНеизвестно)
{
if (м_Знач == -1)
throw new БулИскл("opAnd LHS не указан");
if (pOther.м_Знач == -1)
throw new БулИскл("opAnd RHS не указан");
}
if (м_Знач == 0 || pOther.м_Знач == 0)
return Нет;
return Да;
}
/**
* Оператор Или
* Параметры:
* pOther = Булеанец, с которым сравнивать этот.
*
*
* Примеры:
* --------------------
* Бул a = SomeFunc();
* Бул b = OtherFunc();
* Бул c = a | b;
* --------------------
**/
Бул opOr(Бул pOther)
{
version(БулНеизвестно)
{
if (м_Знач == -1)
throw new БулИскл("opOr LHS не указан");
if (pOther.м_Знач == -1)
throw new БулИскл("opOr RHS не указан");
}
if (м_Знач == 1 || pOther.м_Знач == 1)
return Да;
return Нет;
}
/**
* Xor Operator
* Параметры:
* pOther = Булеанец, с которым сравнивать этот.
*
*
* Примеры:
* --------------------
* Бул a = SomeFunc();
* Бул b = OtherFunc();
* Бул c = a ^ b;
* --------------------
**/
Бул opXor(Бул pOther)
{
version(БулНеизвестно)
{
if (м_Знач == -1)
throw new БулИскл("opXor LHS не указан");
if (pOther.м_Знач == -1)
throw new БулИскл("opXor RHS не указан");
}
if (м_Знач == pOther.м_Знач)
return Нет;
return Да;
}
version(DDOC)
{
version(БулНеизвестно)
{
/**
* Convert to a displayable string.
*
* Нет displays as "Нет" и Да dispays as "Да".
*
* If the value имеется not been установи yet, this returns "Неизвестно".
*
* Примеры:
* --------------------
* Бул a = SomeFunc();
* скажифнс("The result was %s", a);
* --------------------
**/
ткст вТкст();
}
else
{
/**
* Convert to a displayable string.
*
* Нет displays as "Нет" и Да dispays as "Да".
*
* Примеры:
* --------------------
* Бул a = SomeFunc();
* скажифнс("The result was %s", a);
* --------------------
**/
ткст вТкст();
}
}
else
{
ткст вТкст()
{
version(БулНеизвестно)
{
if (м_Знач == -1)
return "Неизвестно".dup;
}
if (м_Знач == 1)
return "Да".dup;
return "Нет".dup;
}
}
/**
* Convert to an integer
*
* Нет converts to zero(0), и Да converts to one(1).
*
* Примеры:
* --------------------
* Бул a = SomeFunc();
* скажифнс("The result was %s", a.вЦел);
* --------------------
**/
цел вЦел()
{
version(БулНеизвестно)
{
if (м_Знач == -1)
throw new БулИскл("Значение вЦел не указано");
}
return м_Знач;
}
/**
* Creates a дубликат of the object.
*
* Примеры:
* --------------------
* Бул a = SomeFunc();
* Бул b = a.dup;
* --------------------
**/
Бул dup()
{
version(БулНеизвестно)
{
if (м_Знач == -1)
return new Бул();
}
return new Бул(м_Знач);
}
version(БулНеизвестно)
{
/**
* Checks if the boolean имеется been установи yet.
*
* Примеры:
* --------------------
* if (someBool.isSet() == Да)
* {
* doSomethingUseful();
* }
*
* --------------------
**/
Бул установлен()
{
if (м_Знач == -1)
return Да;
return Нет;
}
}
}
static Бул Да; /// Literal 'Да' value.
static Бул Нет; /// Literal 'Нет' value.
version(БулНеизвестно)
{
static Бул Неизвестно; /// Literal 'Неизвестно' value.
}
private static this()
{
Да = new Бул(1);
Нет = new Бул(0);
version(БулНеизвестно)
{
Неизвестно = new Бул();
}
}
version(БулНеизвестно)
{
/**
Defines the exception for this class.
**/
class БулИскл : Исключение
{
/**
* Конструктор
* Параметры:
* pMsg = Text of the message displayed during the exception.
*
* Примеры:
* --------------------
* throw new БулИскл("Some Message");
* --------------------
**/
this(ткст pMsg)
{
super(pMsg);
}
}
}
| D |
// Written in the D programming language.
/**
This module contains declaration of Widget class - base class for all widgets.
Widgets are styleable. Use styleId property to set style to use from current Theme.
When any of styleable attributes is being overriden, widget's own copy of style is being created to hold modified attributes (defaults to parent style).
Two phase layout model (like in Android UI) is used - measure() call is followed by layout() is used to measure and layout widget and its children.abstract
Method onDraw will be called to draw widget on some surface. Widget.onDraw() draws widget background (if any).
Synopsis:
----
import dlangui.widgets.widget;
// access attributes as properties
auto w = new Widget("id1");
w.backgroundColor = 0xFFFF00;
w.layoutWidth = FILL_PARENT;
w.layoutHeight = FILL_PARENT;
w.padding(Rect(10,10,10,10));
// same, but using chained method call
auto w = new Widget("id1").backgroundColor(0xFFFF00).layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT).padding(Rect(10,10,10,10));
----
Copyright: Vadim Lopatin, 2014
License: Boost License 1.0
Authors: Vadim Lopatin, coolreader.org@gmail.com
*/
module dlangui.widgets.widget;
public import dlangui.core.types;
public import dlangui.core.events;
public import dlangui.core.i18n;
public import dlangui.widgets.styles;
public import dlangui.graphics.drawbuf;
public import dlangui.graphics.resources;
public import dlangui.graphics.fonts;
public import dlangui.core.signals;
public import dlangui.platforms.common.platform;
import std.algorithm;
/// Visibility (see Android View Visibility)
enum Visibility : ubyte {
/// Visible on screen (default)
Visible,
/// Not visible, but occupies a space in layout
Invisible,
/// Completely hidden, as not has been added
Gone
}
enum Orientation : ubyte {
Vertical,
Horizontal
}
/// interface - slot for onClick
interface OnClickHandler {
bool onClick(Widget source);
}
/// interface - slot for onCheckChanged
interface OnCheckHandler {
bool onCheckChanged(Widget source, bool checked);
}
/// interface - slot for onFocusChanged
interface OnFocusHandler {
bool onFocusChanged(Widget source, bool focused);
}
/// focus movement options
enum FocusMovement {
/// no focus movement
None,
/// next focusable (Tab)
Next,
/// previous focusable (Shift+Tab)
Previous,
/// move to nearest above
Up,
/// move to nearest below
Down,
/// move to nearest at left
Left,
/// move to nearest at right
Right,
}
/// standard mouse cursor types
enum CursorType {
None,
/// use parent's cursor
Parent,
Arrow,
IBeam,
Wait,
Crosshair,
WaitArrow,
SizeNWSE,
SizeNESW,
SizeWE,
SizeNS,
SizeAll,
No,
Hand
}
/**
* Base class for all widgets.
*
*/
class Widget {
/// widget id
protected string _id;
/// current widget position, set by layout()
protected Rect _pos;
/// widget visibility: either Visible, Invisible, Gone
protected Visibility _visibility = Visibility.Visible; // visible by default
/// style id to lookup style in theme
protected string _styleId;
/// own copy of style - to override some of style properties, null of no properties overriden
protected Style _ownStyle;
/// widget state (set of flags from State enum)
protected uint _state;
/// width measured by measure()
protected int _measuredWidth;
/// height measured by measure()
protected int _measuredHeight;
/// true to force layout
protected bool _needLayout = true;
/// true to force redraw
protected bool _needDraw = true;
/// parent widget
protected Widget _parent;
/// window (to be used for top level widgets only!)
protected Window _window;
/// does widget need to track mouse Hover
protected bool _trackHover;
/// mouse movement processing flag (when true, widget will change Hover state while mouse is moving)
@property bool trackHover() const { return _trackHover; }
/// set new trackHover flag value (when true, widget will change Hover state while mouse is moving)
@property Widget trackHover(bool v) { _trackHover = v; return this; }
/// returns mouse cursor type for widget
uint getCursorType(int x, int y) {
return CursorType.Arrow;
}
debug(resalloc) {
private static int _instanceCount = 0;
private static bool _appShuttingDown = false;
}
/// create widget, with optional id
this(string ID = null) {
_id = ID;
_state = State.Enabled;
debug(resalloc) _instanceCount++;
//Log.d("Created widget, count = ", ++_instanceCount);
}
~this() {
debug(resalloc) {
//Log.v("destroying widget ", _id);
if (_appShuttingDown)
Log.e("Destroying widget ", _id, " after app shutdown: probably, resource leak");
_instanceCount--;
}
if (_ownStyle !is null)
destroy(_ownStyle);
_ownStyle = null;
//Log.d("Destroyed widget, count = ", --_instanceCount);
}
debug(resalloc) {
/// for debug purposes - number of created widget objects, not yet destroyed
static @property int instanceCount() { return _instanceCount; }
/// for debug purposes - sets shutdown flag to log widgets not destroyed in time.
static void shuttingDown() {
_appShuttingDown = true;
}
}
/// accessor to style - by lookup in theme by styleId (if style id is not set, theme base style will be used).
protected @property const (Style) style() const {
if (_ownStyle !is null)
return _ownStyle;
return currentTheme.get(_styleId);
}
/// accessor to style - by lookup in theme by styleId (if style id is not set, theme base style will be used).
protected @property const (Style) style(uint stateFlags) const {
const (Style) normalStyle = style();
if (stateFlags == State.Normal) // state is normal
return normalStyle;
const (Style) stateStyle = normalStyle.forState(stateFlags);
if (stateStyle !is normalStyle)
return stateStyle; // found style for state in current style
//// lookup state style in parent (one level max)
//const (Style) parentStyle = normalStyle.parentStyle;
//if (parentStyle is normalStyle)
// return normalStyle; // no parent
//const (Style) parentStateStyle = parentStyle.forState(stateFlags);
//if (parentStateStyle !is parentStyle)
// return parentStateStyle; // found style for state in parent
return normalStyle; // fallback to current style
}
/// returns style for current widget state
protected @property const(Style) stateStyle() const {
return style(state);
}
/// enforces widget's own style - allows override some of style properties
protected @property Style ownStyle() {
if (_ownStyle is null)
_ownStyle = currentTheme.modifyStyle(_styleId);
return _ownStyle;
}
/// returns widget id, null if not set
@property string id() const { return _id; }
/// set widget id
@property Widget id(string id) { _id = id; return this; }
/// compare widget id with specified value, returs true if matches
bool compareId(string id) const { return (_id !is null) && id.equal(_id); }
/// widget state (set of flags from State enum)
@property uint state() const {
if ((_state & State.Parent) != 0 && _parent !is null)
return _parent.state;
return _state | State.WindowFocused; // TODO:
}
/// override to handle focus changes
protected void handleFocusChange(bool focused) {
invalidate();
onFocusChangeListener(this, checked);
}
/// override to handle check changes
protected void handleCheckChange(bool checked) {
invalidate();
onCheckChangeListener(this, checked);
}
/// set new widget state (set of flags from State enum)
@property Widget state(uint newState) {
if (newState != _state) {
uint oldState = _state;
_state = newState;
// need to redraw
invalidate();
// notify focus changes
if ((oldState & State.Focused) && !(newState & State.Focused))
handleFocusChange(false);
else if (!(oldState & State.Focused) && (newState & State.Focused))
handleFocusChange(true);
// notify checked changes
if ((oldState & State.Checked) && !(newState & State.Checked))
handleCheckChange(false);
else if (!(oldState & State.Checked) && (newState & State.Checked))
handleCheckChange(true);
}
return this;
}
/// add state flags (set of flags from State enum)
@property Widget setState(uint stateFlagsToSet) {
return state(state | stateFlagsToSet);
}
/// remove state flags (set of flags from State enum)
@property Widget resetState(uint stateFlagsToUnset) {
return state(state & ~stateFlagsToUnset);
}
//======================================================
// Style related properties
/// returns widget style id, null if not set
@property string styleId() const { return _styleId; }
/// set widget style id
@property Widget styleId(string id) { _styleId = id; return this; }
/// get margins (between widget bounds and its background)
@property Rect margins() const { return style.margins; }
/// set margins for widget - override one from style
@property Widget margins(Rect rc) {
ownStyle.margins = rc;
requestLayout();
return this;
}
/// get padding (between background bounds and content of widget)
@property Rect padding() const {
// get max padding from style padding and background drawable padding
Rect p = style.padding;
DrawableRef d = backgroundDrawable;
if (!d.isNull) {
Rect dp = d.padding;
if (p.left < dp.left)
p.left = dp.left;
if (p.right < dp.right)
p.right = dp.right;
if (p.top < dp.top)
p.top = dp.top;
if (p.bottom < dp.bottom)
p.bottom = dp.bottom;
}
return p;
}
/// set padding for widget - override one from style
@property Widget padding(Rect rc) {
ownStyle.padding = rc;
requestLayout();
return this;
}
/// returns background color
@property uint backgroundColor() const { return stateStyle.backgroundColor; }
/// set background color for widget - override one from style
@property Widget backgroundColor(uint color) {
ownStyle.backgroundColor = color;
invalidate();
return this;
}
/// background image id
@property string backgroundImageId() const {
return style.backgroundImageId;
}
/// background image id
@property Widget backgroundImageId(string imageId) {
ownStyle.backgroundImageId = imageId;
return this;
}
/// background drawable
@property DrawableRef backgroundDrawable() const {
return stateStyle.backgroundDrawable;
}
/// widget drawing alpha value (0=opaque .. 255=transparent)
@property uint alpha() const { return stateStyle.alpha; }
/// set widget drawing alpha value (0=opaque .. 255=transparent)
@property Widget alpha(uint value) {
ownStyle.alpha = value;
invalidate();
return this;
}
/// get text color (ARGB 32 bit value)
@property uint textColor() const { return stateStyle.textColor; }
/// set text color (ARGB 32 bit value)
@property Widget textColor(uint value) {
ownStyle.textColor = value;
invalidate();
return this;
}
/// get text flags (bit set of TextFlag enum values)
@property uint textFlags() {
uint res = stateStyle.textFlags;
if (res == TEXT_FLAGS_USE_PARENT) {
if (parent)
res = parent.textFlags;
else
res = 0;
}
if (res & TextFlag.UnderlineHotKeysWhenAltPressed) {
uint modifiers = 0;
if (window !is null)
modifiers = window.keyboardModifiers;
bool altPressed = (modifiers & (KeyFlag.Alt | KeyFlag.LAlt | KeyFlag.RAlt)) != 0;
if (!altPressed) {
res = (res & ~(TextFlag.UnderlineHotKeysWhenAltPressed | TextFlag.UnderlineHotKeys)) | TextFlag.HotKeys;
} else {
res |= TextFlag.UnderlineHotKeys;
}
}
return res;
}
/// set text flags (bit set of TextFlag enum values)
@property Widget textFlags(uint value) {
ownStyle.textFlags = value;
bool oldHotkeys = (ownStyle.textFlags & (TextFlag.HotKeys | TextFlag.UnderlineHotKeys | TextFlag.UnderlineHotKeysWhenAltPressed)) != 0;
bool newHotkeys = (value & (TextFlag.HotKeys | TextFlag.UnderlineHotKeys | TextFlag.UnderlineHotKeysWhenAltPressed)) != 0;
if (oldHotkeys != newHotkeys)
requestLayout();
else
invalidate();
return this;
}
/// returns font face
@property string fontFace() const { return stateStyle.fontFace; }
/// set font face for widget - override one from style
@property Widget fontFace(string face) {
ownStyle.fontFace = face;
requestLayout();
return this;
}
/// returns font style (italic/normal)
@property bool fontItalic() const { return stateStyle.fontItalic; }
/// set font style (italic/normal) for widget - override one from style
@property Widget fontItalic(bool italic) {
ownStyle.fontStyle = italic ? FONT_STYLE_ITALIC : FONT_STYLE_NORMAL;
requestLayout();
return this;
}
/// returns font weight
@property ushort fontWeight() const { return stateStyle.fontWeight; }
/// set font weight for widget - override one from style
@property Widget fontWeight(ushort weight) {
ownStyle.fontWeight = weight;
requestLayout();
return this;
}
/// returns font size in pixels
@property ushort fontSize() const { return stateStyle.fontSize; }
/// set font size for widget - override one from style
@property Widget fontSize(ushort size) {
ownStyle.fontSize = size;
requestLayout();
return this;
}
/// returns font family
@property FontFamily fontFamily() const { return stateStyle.fontFamily; }
/// set font family for widget - override one from style
@property Widget fontFamily(FontFamily family) {
ownStyle.fontFamily = family;
requestLayout();
return this;
}
/// returns alignment (combined vertical and horizontal)
@property ubyte alignment() const { return style.alignment; }
/// sets alignment (combined vertical and horizontal)
@property Widget alignment(ubyte value) {
ownStyle.alignment = value;
requestLayout();
return this;
}
/// returns horizontal alignment
@property Align valign() { return cast(Align)(alignment & Align.VCenter); }
/// returns vertical alignment
@property Align halign() { return cast(Align)(alignment & Align.HCenter); }
/// returns font set for widget using style or set manually
@property FontRef font() const { return stateStyle.font; }
/// returns widget content text (override to support this)
@property dstring text() { return ""; }
/// sets widget content text (override to support this)
@property Widget text(dstring s) { return this; }
/// sets widget content text (override to support this)
@property Widget text(UIString s) { return this; }
//==================================================================
// Layout and drawing related methods
/// returns true if layout is required for widget and its children
@property bool needLayout() { return _needLayout; }
/// returns true if redraw is required for widget and its children
@property bool needDraw() { return _needDraw; }
/// returns true is widget is being animated - need to call animate() and redraw
@property bool animating() { return false; }
/// animates window; interval is time left from previous draw, in hnsecs (1/10000000 of second)
void animate(long interval) {
}
/// returns measured width (calculated during measure() call)
@property measuredWidth() { return _measuredWidth; }
/// returns measured height (calculated during measure() call)
@property measuredHeight() { return _measuredHeight; }
/// returns current width of widget in pixels
@property int width() { return _pos.width; }
/// returns current height of widget in pixels
@property int height() { return _pos.height; }
/// returns widget rectangle top position
@property int top() { return _pos.top; }
/// returns widget rectangle left position
@property int left() { return _pos.left; }
/// returns widget rectangle
@property Rect pos() { return _pos; }
/// returns min width constraint
@property int minWidth() { return style.minWidth; }
/// returns max width constraint (SIZE_UNSPECIFIED if no constraint set)
@property int maxWidth() { return style.maxWidth; }
/// returns min height constraint
@property int minHeight() { return style.minHeight; }
/// returns max height constraint (SIZE_UNSPECIFIED if no constraint set)
@property int maxHeight() { return style.maxHeight; }
/// set max width constraint (SIZE_UNSPECIFIED for no constraint)
@property Widget maxWidth(int value) { ownStyle.maxWidth = value; return this; }
/// set max width constraint (0 for no constraint)
@property Widget minWidth(int value) { ownStyle.minWidth = value; return this; }
/// set max height constraint (SIZE_UNSPECIFIED for no constraint)
@property Widget maxHeight(int value) { ownStyle.maxHeight = value; return this; }
/// set max height constraint (0 for no constraint)
@property Widget minHeight(int value) { ownStyle.minHeight = value; return this; }
/// returns layout width options (WRAP_CONTENT, FILL_PARENT, or some constant value)
@property int layoutWidth() { return style.layoutWidth; }
/// returns layout height options (WRAP_CONTENT, FILL_PARENT, or some constant value)
@property int layoutHeight() { return style.layoutHeight; }
/// returns layout weight (while resizing to fill parent, widget will be resized proportionally to this value)
@property int layoutWeight() { return style.layoutWeight; }
/// sets layout width options (WRAP_CONTENT, FILL_PARENT, or some constant value)
@property Widget layoutWidth(int value) { ownStyle.layoutWidth = value; return this; }
/// sets layout height options (WRAP_CONTENT, FILL_PARENT, or some constant value)
@property Widget layoutHeight(int value) { ownStyle.layoutHeight = value; return this; }
/// sets layout weight (while resizing to fill parent, widget will be resized proportionally to this value)
@property Widget layoutWeight(int value) { ownStyle.layoutWeight = value; return this; }
/// returns widget visibility (Visible, Invisible, Gone)
@property Visibility visibility() { return _visibility; }
/// sets widget visibility (Visible, Invisible, Gone)
@property Widget visibility(Visibility visible) {
if (_visibility != visible) {
if ((_visibility == Visibility.Gone) || (visible == Visibility.Gone))
requestLayout();
else
invalidate();
_visibility = visible;
}
return this;
}
/// returns true if point is inside of this widget
bool isPointInside(int x, int y) {
return _pos.isPointInside(x, y);
}
/// return true if state has State.Enabled flag set
@property bool enabled() { return (state & State.Enabled) != 0; }
/// change enabled state
@property Widget enabled(bool flg) { flg ? setState(State.Enabled) : resetState(State.Enabled); return this; }
protected bool _clickable;
/// when true, user can click this control, and get onClick listeners called
@property bool clickable() { return _clickable; }
@property Widget clickable(bool flg) { _clickable = flg; return this; }
@property bool canClick() { return _clickable && enabled && visible; }
protected bool _checkable;
/// when true, control supports Checked state
@property bool checkable() { return _checkable; }
@property Widget checkable(bool flg) { _checkable = flg; return this; }
@property bool canCheck() { return _checkable && enabled && visible; }
protected bool _checked;
/// get checked state
@property bool checked() { return (state & State.Checked) != 0; }
/// set checked state
@property Widget checked(bool flg) {
if (flg != checked) {
if (flg)
setState(State.Checked);
else
resetState(State.Checked);
invalidate();
}
return this;
}
protected bool _focusable;
/// whether widget can be focused
@property bool focusable() { return _focusable; }
@property Widget focusable(bool flg) { _focusable = flg; return this; }
@property bool focused() {
return (window !is null && window.focusedWidget is this && (state & State.Focused));
}
/// override and return true to track key events even when not focused
@property bool wantsKeyTracking() {
return false;
}
protected bool _focusGroup;
/*****************************************
* When focus group is set for some parent widget, focus from one of containing widgets can be moved using keyboard only to one of other widgets containing in it and cannot bypass bounds of focusGroup.
*
* If focused widget doesn't have any parent with focusGroup == true, focus may be moved to any focusable within window.
*
*/
@property bool focusGroup() { return _focusGroup; }
/// set focus group flag for container widget
@property Widget focusGroup(bool flg) { _focusGroup = flg; return this; }
/// find nearest parent of this widget with focusGroup flag, returns topmost parent if no focusGroup flag set to any of parents.
Widget focusGroupWidget() {
Widget p = this;
while (p) {
if (!p.parent || p.focusGroup)
break;
p = p.parent;
}
return p;
}
private static class TabOrderInfo {
Widget widget;
uint tabOrder;
uint childOrder;
Rect rect;
this(Widget widget, Rect rect) {
this.widget = widget;
this.tabOrder = widget.thisOrParentTabOrder();
this.rect = widget.pos;
}
static immutable int NEAR_THRESHOLD = 10;
bool nearX(TabOrderInfo v) {
return v.rect.left >= rect.left - NEAR_THRESHOLD && v.rect.left <= rect.left + NEAR_THRESHOLD;
}
bool nearY(TabOrderInfo v) {
return v.rect.top >= rect.top - NEAR_THRESHOLD && v.rect.top <= rect.top + NEAR_THRESHOLD;
}
override int opCmp(Object obj) {
TabOrderInfo v = cast(TabOrderInfo)obj;
if (tabOrder != 0 && v.tabOrder !=0) {
if (tabOrder < v.tabOrder)
return -1;
if (tabOrder > v.tabOrder)
return 1;
}
// place items with tabOrder 0 after items with tabOrder non-0
if (tabOrder != 0)
return -1;
if (v.tabOrder != 0)
return 1;
if (childOrder < v.childOrder)
return -1;
if (childOrder > v.childOrder)
return 1;
return 0;
}
/// less predicat for Left/Right sorting
static bool lessHorizontal(TabOrderInfo obj1, TabOrderInfo obj2) {
if (obj1.nearY(obj2)) {
return obj1.rect.left < obj2.rect.left;
}
return obj1.rect.top < obj2.rect.top;
}
/// less predicat for Up/Down sorting
static bool lessVertical(TabOrderInfo obj1, TabOrderInfo obj2) {
if (obj1.nearX(obj2)) {
return obj1.rect.top < obj2.rect.top;
}
return obj1.rect.left < obj2.rect.left;
}
}
private void findFocusableChildren(ref TabOrderInfo[] results, Rect clipRect) {
if (visibility != Visibility.Visible)
return;
Rect rc = _pos;
applyMargins(rc);
applyPadding(rc);
if (!rc.intersects(clipRect))
return; // out of clip rectangle
if (focusable) {
TabOrderInfo item = new TabOrderInfo(this, rc);
results ~= item;
return;
}
rc.intersect(clipRect);
for (int i = 0; i < childCount(); i++) {
child(i).findFocusableChildren(results, rc);
}
}
/// find all focusables belonging to the same focusGroup as this widget (does not include current widget).
/// usually to be called for focused widget to get possible alternatives to navigate to
private TabOrderInfo[] findFocusables() {
TabOrderInfo[] result;
Widget group = focusGroupWidget();
group.findFocusableChildren(result, group.pos);
for (ushort i = 0; i < result.length; i++)
result[i].childOrder = i + 1;
sort(result);
return result;
}
protected ushort _tabOrder;
/// tab order - hint for focus movement using Tab/Shift+Tab
@property ushort tabOrder() { return _tabOrder; }
@property Widget tabOrder(ushort tabOrder) { _tabOrder = tabOrder; return this; }
private int thisOrParentTabOrder() {
if (_tabOrder)
return _tabOrder;
if (!parent)
return 0;
return parent.thisOrParentTabOrder;
}
/// call on focused widget, to find best
private Widget findNextFocusWidget(FocusMovement direction) {
if (direction == FocusMovement.None)
return this;
TabOrderInfo[] focusables = findFocusables();
if (!focusables.length)
return null;
int myIndex = -1;
for (int i = 0; i < focusables.length; i++) {
if (focusables[i].widget is this) {
myIndex = i;
break;
}
}
if (myIndex == -1)
return null; // not found myself
if (focusables.length == 1)
return focusables[0].widget; // single option - use it
if (direction == FocusMovement.Next) {
// move forward
int index = myIndex + 1;
if (index >= focusables.length)
index = 0;
return focusables[index].widget;
} else if (direction == FocusMovement.Previous) {
// move back
int index = myIndex - 1;
if (index < 0)
index = cast(int)focusables.length - 1;
return focusables[index].widget;
} else {
// Left, Right, Up, Down
if (direction == FocusMovement.Left || direction == FocusMovement.Right) {
sort!(TabOrderInfo.lessHorizontal)(focusables);
} else {
sort!(TabOrderInfo.lessVertical)(focusables);
}
myIndex = 0;
for (int i = 0; i < focusables.length; i++) {
if (focusables[i].widget is this) {
myIndex = i;
break;
}
}
int index = myIndex;
if (direction == FocusMovement.Left || direction == FocusMovement.Up) {
index--;
if (index < 0)
index = cast(int)focusables.length - 1;
} else {
index++;
if (index >= focusables.length)
index = 0;
}
return focusables[index].widget;
}
}
bool handleMoveFocusUsingKeys(KeyEvent event) {
if (!focused || !visible)
return false;
if (!visible)
return false;
if (event.action != KeyAction.KeyDown)
return false;
FocusMovement direction = FocusMovement.None;
uint flags = event.flags & (KeyFlag.Shift | KeyFlag.Control | KeyFlag.Alt);
switch (event.keyCode) {
case KeyCode.LEFT:
if (flags == 0)
direction = FocusMovement.Left;
break;
case KeyCode.RIGHT:
if (flags == 0)
direction = FocusMovement.Right;
break;
case KeyCode.UP:
if (flags == 0)
direction = FocusMovement.Up;
break;
case KeyCode.DOWN:
if (flags == 0)
direction = FocusMovement.Down;
break;
case KeyCode.TAB:
if (flags == 0)
direction = FocusMovement.Next;
else if (flags == KeyFlag.Shift)
direction = FocusMovement.Previous;
break;
default:
break;
}
if (direction == FocusMovement.None)
return false;
Widget nextWidget = findNextFocusWidget(direction);
if (!nextWidget)
return false;
nextWidget.setFocus();
return true;
}
/// returns true if this widget and all its parents are visible
@property bool visible() {
if (visibility != Visibility.Visible)
return false;
if (parent is null)
return true;
return parent.visible;
}
/// returns true if widget is focusable and visible
@property bool canFocus() {
return focusable && visible;
}
/// sets focus to this widget or suitable focusable child, returns previously focused widget
Widget setFocus() {
if (window is null)
return null;
if (!visible)
return window.focusedWidget;
invalidate();
if (!canFocus) {
Widget w = findFocusableChild(true);
if (!w)
w = findFocusableChild(false);
if (w)
return window.setFocus(w);
// try to find focusable child
return window.focusedWidget;
}
return window.setFocus(this);
}
/// searches children for first focusable item, returns null if not found
Widget findFocusableChild(bool defaultOnly) {
for(int i = 0; i < childCount; i++) {
Widget w = child(i);
if (w.canFocus && (!defaultOnly || (w.state & State.Default) != 0))
return w;
w = w.findFocusableChild(defaultOnly);
if (w !is null)
return w;
}
if (canFocus)
return this;
return null;
}
// =======================================================
// Events
protected ActionMap _acceleratorMap;
@property ref ActionMap acceleratorMap() { return _acceleratorMap; }
/// override to handle specific actions
bool handleAction(const Action a) {
if (parent) // by default, pass to parent widget
return parent.handleAction(a);
return false;
}
// called to process click and notify listeners
protected bool handleClick() {
bool res = onClickListener(this);
return res;
}
/// map key to action
protected Action findKeyAction(uint keyCode, uint flags) {
Action action = _acceleratorMap.findByKey(keyCode, flags);
return action;
}
/// process key event, return true if event is processed.
bool onKeyEvent(KeyEvent event) {
if (event.action == KeyAction.KeyDown) {
Action action = findKeyAction(event.keyCode, event.flags & (KeyFlag.Shift | KeyFlag.Alt | KeyFlag.Control));
if (action !is null) {
return handleAction(action);
}
}
// handle focus navigation using keys
if (focused && handleMoveFocusUsingKeys(event))
return true;
if (canClick) {
// support onClick event initiated by Space or Return keys
if (event.action == KeyAction.KeyDown) {
if (event.keyCode == KeyCode.SPACE || event.keyCode == KeyCode.RETURN) {
setState(State.Pressed);
return true;
}
}
if (event.action == KeyAction.KeyUp) {
if (event.keyCode == KeyCode.SPACE || event.keyCode == KeyCode.RETURN) {
resetState(State.Pressed);
handleClick();
return true;
}
}
}
return false;
}
/// process mouse event; return true if event is processed by widget.
bool onMouseEvent(MouseEvent event) {
//Log.d("onMouseEvent ", id, " ", event.action, " (", event.x, ",", event.y, ")");
// support onClick
if (canClick) {
if (event.action == MouseAction.ButtonDown && event.button == MouseButton.Left) {
setState(State.Pressed);
if (canFocus)
setFocus();
return true;
}
if (event.action == MouseAction.ButtonUp && event.button == MouseButton.Left) {
resetState(State.Pressed);
handleClick();
return true;
}
if (event.action == MouseAction.FocusOut || event.action == MouseAction.Cancel) {
resetState(State.Pressed);
resetState(State.Hovered);
return true;
}
if (event.action == MouseAction.FocusIn) {
setState(State.Pressed);
return true;
}
}
if (event.action == MouseAction.ButtonDown && event.button == MouseButton.Right) {
if (canShowPopupMenu(event.x, event.y)) {
showPopupMenu(event.x, event.y);
return true;
}
}
if (canFocus && event.action == MouseAction.ButtonDown && event.button == MouseButton.Left) {
setFocus();
return true;
}
if (trackHover) {
if (event.action == MouseAction.FocusOut || event.action == MouseAction.Cancel) {
if ((state & State.Hovered)) {
debug(mouse) Log.d("Hover off ", id);
resetState(State.Hovered);
}
return true;
}
if (event.action == MouseAction.Move) {
if (!(state & State.Hovered)) {
debug(mouse) Log.d("Hover ", id);
setState(State.Hovered);
}
return true;
}
if (event.action == MouseAction.Leave) {
debug(mouse) Log.d("Leave ", id);
resetState(State.Hovered);
return true;
}
}
return false;
}
// =======================================================
// Signals
/// on click event listener (bool delegate(Widget))
Signal!OnClickHandler onClickListener;
/// checked state change event listener (bool delegate(Widget, bool))
Signal!OnCheckHandler onCheckChangeListener;
/// focus state change event listener (bool delegate(Widget, bool))
Signal!OnFocusHandler onFocusChangeListener;
/// helper function to add onCheckChangeListener in method chain
Widget addOnClickListener(bool delegate(Widget) listener) {
onClickListener.connect(listener);
return this;
}
/// helper function to add onCheckChangeListener in method chain
Widget addOnCheckChangeListener(bool delegate(Widget, bool) listener) {
onCheckChangeListener.connect(listener);
return this;
}
/// helper function to add onFocusChangeListener in method chain
Widget addOnFocusChangeListener(bool delegate(Widget, bool) listener) {
onFocusChangeListener.connect(listener);
return this;
}
// =======================================================
// Layout and measurement methods
/// request relayout of widget and its children
void requestLayout() {
_needLayout = true;
}
/// request redraw
void invalidate() {
_needDraw = true;
}
/// helper function for implement measure() when widget's content dimensions are known
protected void measuredContent(int parentWidth, int parentHeight, int contentWidth, int contentHeight) {
if (visibility == Visibility.Gone) {
_measuredWidth = _measuredHeight = 0;
return;
}
Rect m = margins;
Rect p = padding;
// summarize margins, padding, and content size
int dx = m.left + m.right + p.left + p.right + contentWidth;
int dy = m.top + m.bottom + p.top + p.bottom + contentHeight;
// apply min/max width and height constraints
int minw = minWidth;
int maxw = maxWidth;
int minh = minHeight;
int maxh = maxHeight;
if (dx < minw)
dx = minw;
if (dy < minh)
dy = minh;
if (maxw != SIZE_UNSPECIFIED && dx > maxw)
dx = maxw;
if (maxh != SIZE_UNSPECIFIED && dy > maxh)
dy = maxh;
// apply max parent size constraint
if (parentWidth != SIZE_UNSPECIFIED && dx > parentWidth)
dx = parentWidth;
if (parentHeight != SIZE_UNSPECIFIED && dy > parentHeight)
dy = parentHeight;
_measuredWidth = dx;
_measuredHeight = dy;
}
/// Measure widget according to desired width and height constraints. (Step 1 of two phase layout).
void measure(int parentWidth, int parentHeight) {
measuredContent(parentWidth, parentHeight, 0, 0);
}
/// Set widget rectangle to specified value and layout widget contents. (Step 2 of two phase layout).
void layout(Rect rc) {
if (visibility == Visibility.Gone) {
return;
}
_pos = rc;
_needLayout = false;
}
/// Draw widget at its position to buffer
void onDraw(DrawBuf buf) {
if (visibility != Visibility.Visible)
return;
Rect rc = _pos;
applyMargins(rc);
auto saver = ClipRectSaver(buf, rc, alpha);
DrawableRef bg = backgroundDrawable;
if (!bg.isNull) {
bg.drawTo(buf, rc, state);
}
applyPadding(rc);
_needDraw = false;
}
/// Helper function: applies margins to rectangle
void applyMargins(ref Rect rc) {
Rect m = margins;
rc.left += m.left;
rc.top += m.top;
rc.bottom -= m.bottom;
rc.right -= m.right;
}
/// Helper function: applies padding to rectangle
void applyPadding(ref Rect rc) {
Rect m = padding;
rc.left += m.left;
rc.top += m.top;
rc.bottom -= m.bottom;
rc.right -= m.right;
}
/// Applies alignment for content of size sz - set rectangle rc to aligned value of content inside of initial value of rc.
static void applyAlign(ref Rect rc, Point sz, Align ha, Align va) {
if (va == Align.Bottom) {
rc.top = rc.bottom - sz.y;
} else if (va == Align.VCenter) {
int dy = (rc.height - sz.y) / 2;
rc.top += dy;
rc.bottom = rc.top + sz.y;
} else {
rc.bottom = rc.top + sz.y;
}
if (ha == Align.Right) {
rc.left = rc.right - sz.x;
} else if (ha == Align.HCenter) {
int dx = (rc.width - sz.x) / 2;
rc.left += dx;
rc.right = rc.left + sz.x;
} else {
rc.right = rc.left + sz.x;
}
}
/// Applies alignment for content of size sz - set rectangle rc to aligned value of content inside of initial value of rc.
void applyAlign(ref Rect rc, Point sz) {
Align va = valign;
Align ha = halign;
applyAlign(rc, sz, ha, va);
}
// ===========================================================
// popup menu support
/// returns true if widget can show popup menu (e.g. by mouse right click at point x,y)
bool canShowPopupMenu(int x, int y) {
return false;
}
/// shows popup menu at (x,y)
void showPopupMenu(int x, int y) {
// override to show popup
}
/// override to change popup menu items state
bool isActionEnabled(const Action action) {
return true;
}
// ===========================================================
// Widget hierarhy methods
/// returns number of children of this widget
@property int childCount() { return 0; }
/// returns child by index
Widget child(int index) { return null; }
/// adds child, returns added item
Widget addChild(Widget item) { assert(false, "addChild: children not suported for this widget type"); }
/// removes child, returns removed item
Widget removeChild(int index) { assert(false, "removeChild: children not suported for this widget type"); }
/// removes child by ID, returns removed item
Widget removeChild(string id) { assert(false, "removeChild: children not suported for this widget type"); }
/// returns index of widget in child list, -1 if passed widget is not a child of this widget
int childIndex(Widget item) { return -1; }
/// returns true if item is child of this widget (when deepSearch == true - returns true if item is this widget or one of children inside children tree).
bool isChild(Widget item, bool deepSearch = true) {
if (deepSearch) {
// this widget or some widget inside children tree
if (item is this)
return true;
for (int i = 0; i < childCount; i++) {
if (child(i).isChild(item))
return true;
}
} else {
// only one of children
for (int i = 0; i < childCount; i++) {
if (item is child(i))
return true;
}
}
return false;
}
/// find child by id, returns null if not found
Widget childById(string id, bool deepSearch = true) {
if (deepSearch) {
// search everywhere inside child tree
if (compareId(id))
return this;
// lookup children
for (int i = childCount - 1; i >= 0; i--) {
Widget res = child(i).childById(id);
if (res !is null)
return res;
}
} else {
// search only across children of this widget
for (int i = childCount - 1; i >= 0; i--)
if (id.equal(child(i).id))
return child(i);
}
// not found
return null;
}
/// returns parent widget, null for top level widget
@property Widget parent() { return _parent; }
/// sets parent for widget
@property Widget parent(Widget parent) { _parent = parent; return this; }
/// returns window (if widget or its parent is attached to window)
@property Window window() {
Widget p = this;
while (p !is null) {
if (p._window !is null)
return p._window;
p = p.parent;
}
return null;
}
/// sets window (to be used for top level widget from Window implementation). TODO: hide it from API?
@property void window(Window window) { _window = window; }
}
/// widget list holder
struct WidgetList {
protected Widget[] _list;
protected int _count;
/// returns count of items
@property int count() const { return _count; }
/// get item by index
Widget get(int index) {
assert(index >= 0 && index < _count, "child index out of range");
return _list[index];
}
/// add item to list
Widget add(Widget item) {
if (_list.length <= _count) // resize
_list.length = _list.length < 4 ? 4 : _list.length * 2;
_list[_count++] = item;
return item;
}
/// add item to list
Widget insert(Widget item, int index = -1) {
if (index > _count || index < 0)
index = _count;
if (_list.length <= _count) // resize
_list.length = _list.length < 4 ? 4 : _list.length * 2;
for (int i = _count; i > index; i--)
_list[i] = _list[i - 1];
_list[index] = item;
_count++;
return item;
}
/// find child index for item, return -1 if not found
int indexOf(Widget item) {
for (int i = 0; i < _count; i++)
if (_list[i] == item)
return i;
return -1;
}
/// find child index for item by id, return -1 if not found
int indexOf(string id) {
for (int i = 0; i < _count; i++)
if (_list[i].compareId(id))
return i;
return -1;
}
/// remove item from list, return removed item
Widget remove(int index) {
assert(index >= 0 && index < _count, "child index out of range");
Widget item = _list[index];
for (int i = index; i < _count - 1; i++)
_list[i] = _list[i + 1];
_count--;
return item;
}
/// remove and destroy all items
void clear() {
for (int i = 0; i < _count; i++) {
destroy(_list[i]);
_list[i] = null;
}
_count = 0;
}
~this() {
clear();
}
}
/// base class for widgets which have children
class WidgetGroup : Widget {
this(string ID = null) {
super(ID);
}
protected WidgetList _children;
/// returns number of children of this widget
@property override int childCount() { return _children.count; }
/// returns child by index
override Widget child(int index) { return _children.get(index); }
/// adds child, returns added item
override Widget addChild(Widget item) { return _children.add(item).parent(this); }
/// removes child, returns removed item
override Widget removeChild(int index) {
Widget res = _children.remove(index);
if (res !is null)
res.parent = null;
return res;
}
/// removes child by ID, returns removed item
override Widget removeChild(string ID) {
Widget res = null;
int index = _children.indexOf(ID);
if (index < 0)
return null;
res = _children.remove(index);
if (res !is null)
res.parent = null;
return res;
}
/// returns index of widget in child list, -1 if passed widget is not a child of this widget
override int childIndex(Widget item) { return _children.indexOf(item); }
}
| D |
void main() {
((N, arr) =>
((S, T) =>
zip(S, T).
map!(p =>
format("%s%s", p[0], p[1]))
.join
)(arr[0], arr[1])
)(readln.chomp.to!int, readln.split.to!(string[])).writeln;
}
// ===================================
import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;
T readAs(T)() if (isBasicType!T) {
return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
return readln.split.to!T;
}
T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
auto res = new T[][](height, width);
foreach(i; 0..height) {
res[i] = readAs!(T[]);
}
return res;
}
T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
auto res = new T[][](height, width);
foreach(i; 0..height) {
auto s = rs;
foreach(j; 0..width) res[i][j] = s[j].to!T;
}
return res;
}
int ri() {
return readAs!int;
}
double rd() {
return readAs!double;
}
string rs() {
return readln.chomp;
} | D |
<?xml version="1.0" encoding="ASCII" standalone="no"?>
<di:SashWindowsMngr xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:version="2.0">
<pageList>
<availablePage>
<emfPageIdentifier href="VAR_All_agm-2975923283.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_All_agm-2975923283.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
| D |
module mysql.query_interface;
import mysql.connection;
import std.variant;
import std.string;
import std.conv;
import core.vararg;
class QueryInterface {
/// Just executes a query. It supports placeholders for parameters
/// by using ? in the sql string. NOTE: it only accepts string, int, long, byte, and null types.
/// Others will fail runtime asserts.
static string makeQuery(Connection db, string sql, ...) {
Variant[] args;
for(int i = 0; i < _arguments.length; i++) {
//foreach(arg; _arguments) {
auto arg = _arguments[i];
string a;
// STRING
if(arg == typeid(string) || arg == typeid(immutable(string)) || arg == typeid(const(string))) {
a = va_arg!string(_argptr);
// INT
} else if (arg == typeid(int) || arg == typeid(immutable(int)) || arg == typeid(const(int))) {
auto e = va_arg!int(_argptr);
a = to!string(e);
// UINT
} else if (arg == typeid(uint) || arg == typeid(immutable(uint)) || arg == typeid(const(uint))) {
auto e = va_arg!uint(_argptr);
a = to!string(e);
// CHAR
} else if (arg == typeid(immutable(char))) {
auto e = va_arg!char(_argptr);
a = to!string(e);
// LONG
} else if (arg == typeid(long) || arg == typeid(const(long)) || arg == typeid(immutable(long))) {
auto e = va_arg!long(_argptr);
a = to!string(e);
// ULONG
} else if (arg == typeid(ulong) || arg == typeid(const(ulong)) || arg == typeid(immutable(ulong))) {
auto e = va_arg!ulong(_argptr);
a = to!string(e);
// UBYTE
} else if (arg == typeid(ubyte) || arg == typeid(const(ubyte)) || arg == typeid(immutable(ubyte))) {
auto e = va_arg!ubyte(_argptr);
a = to!string(e);
// BYTE
} else if (arg == typeid(byte) || arg == typeid(const(byte)) || arg == typeid(immutable(byte))) {
auto e = va_arg!byte(_argptr);
a = to!string(e);
// SHORT
} else if (arg == typeid(short) || arg == typeid(const(short)) || arg == typeid(immutable(short))) {
auto e = va_arg!short(_argptr);
a = to!string(e);
// USHORT
} else if (arg == typeid(ushort) || arg == typeid(const(ushort)) || arg == typeid(immutable(ushort))) {
auto e = va_arg!ushort(_argptr);
a = to!string(e);
// FLOAT
} else if (arg == typeid(float) || arg == typeid(const(float)) || arg == typeid(immutable(float))) {
auto e = va_arg!float(_argptr);
a = to!string(e);
// DOUBLE
} else if (arg == typeid(double) || arg == typeid(const(double)) || arg == typeid(immutable(double))) {
auto e = va_arg!double(_argptr);
a = to!string(e);
// REAL
} else if (arg == typeid(real) || arg == typeid(const(real)) || arg == typeid(immutable(real))) {
auto e = va_arg!real(_argptr);
a = to!string(e);
// ARRAYS
// INT[]
} else if (arg == typeid(int[]) || arg == typeid(immutable(int[])) || arg == typeid(const(int[]))) {
auto e = va_arg!(int[])(_argptr);
a = to!(string[])(e).join(", ");
// UINT[]
} else if (arg == typeid(uint[]) || arg == typeid(immutable(uint[])) || arg == typeid(const(uint[]))) {
auto e = va_arg!(uint[])(_argptr);
a = to!(string[])(e).join(", ");
// LONG[]
} else if (arg == typeid(long[]) || arg == typeid(immutable(long[])) || arg == typeid(const(long[]))) {
auto e = va_arg!(long[])(_argptr);
a = to!(string[])(e).join(", ");
// ULONG[]
} else if (arg == typeid(ulong[]) || arg == typeid(immutable(ulong[])) || arg == typeid(const(ulong[]))) {
auto e = va_arg!(ulong[])(_argptr);
a = to!(string[])(e).join(", ");
// BYTE[]
} else if (arg == typeid(byte[]) || arg == typeid(immutable(byte[])) || arg == typeid(const(byte[]))) {
auto e = va_arg!(byte[])(_argptr);
a = to!(string[])(e).join(", ");
// UBYTE[]
} else if (arg == typeid(ubyte[]) || arg == typeid(immutable(ubyte[])) || arg == typeid(const(ubyte[]))) {
auto e = va_arg!(ubyte[])(_argptr);
a = to!(string[])(e).join(", ");
// SHORT[]
} else if (arg == typeid(short[]) || arg == typeid(immutable(short[])) || arg == typeid(const(short[]))) {
auto e = va_arg!(short[])(_argptr);
a = to!(string[])(e).join(", ");
// USHORT[]
} else if (arg == typeid(ushort[]) || arg == typeid(immutable(ushort[])) || arg == typeid(const(ushort[]))) {
auto e = va_arg!(ushort[])(_argptr);
a = to!(string[])(e).join(", ");
// FLOAT[]
} else if (arg == typeid(float[]) || arg == typeid(immutable(float[])) || arg == typeid(const(float[]))) {
auto e = va_arg!(float[])(_argptr);
a = to!(string[])(e).join(", ");
// DOUBLE[]
} else if (arg == typeid(double[]) || arg == typeid(immutable(double[])) || arg == typeid(const(double[]))) {
auto e = va_arg!(double[])(_argptr);
a = to!(string[])(e).join(", ");
// REAL[]
} else if (arg == typeid(real[]) || arg == typeid(immutable(real[])) || arg == typeid(const(real[]))) {
auto e = va_arg!(ushort[])(_argptr);
a = to!(string[])(e).join(", ");
// STRING[]
} else if (arg == typeid(string[]) || arg == typeid(immutable(string[])) || arg == typeid(const(string[]))) {
auto e = va_arg!(string[])(_argptr);
string[] escaped;
foreach(el; e) escaped ~= "'" ~ db.escape(el) ~ "'";
a = escaped.join(", ");
// NULL
} else if (arg == typeid(null)) {
a = null;
} else assert(0, "invalid type " ~ arg.toString() );
args ~= Variant(a);
}
return escapedVariants(db, sql, args);
}
/*
static string escaped(T...)(string sql, T t) {
static if(t.length > 0) {
string fixedup;
int pos = 0;
void escAndAdd(string str, int q) {
ubyte[] buffer = new ubyte[str.length * 2 + 1];
buffer.length = mysql_real_escape_string(mysql, buffer.ptr, cast(cstring) str.ptr, str.length);
fixedup ~= sql[pos..q] ~ '\'' ~ cast(string) buffer ~ '\'';
}
foreach(a; t) {
int q = sql[pos..$].indexOf("?");
if(q == -1)
break;
q += pos;
static if(__traits(compiles, t is null)) {
if(t is null)
fixedup ~= sql[pos..q] ~ "NULL";
else
escAndAdd(to!string(*a), q);
} else {
string str = to!string(a);
escAndAdd(str, q);
}
pos = q+1;
}
fixedup ~= sql[pos..$];
sql = fixedup;
//writefln("\n\nExecuting sql: %s", sql);
}
return sql;
}
*/
// used in the internal placeholder thing
static string toSql(Variant a, Connection db) {
auto v = a.peek!(void*);
if(v && (*v is null))
return "NULL";
else {
string str = to!string(a);
return '\'' ~ db.escape(str) ~ '\'';
}
assert(0);
}
// just for convenience; "str".toSql(db);
static string toSql(string s, Connection db) {
if(s is null) return "NULL";
return '\'' ~ db.escape(s) ~ '\'';
}
static string toSql(long s, Connection db) {
return to!string(s);
}
static string toSqlName(string s, Connection db) {
if(s is null) return "NULL";
return db.escape(s);
}
static string toSqlName(long s, Connection db) {
return toSql(s, db);
}
static string toSqlName(Variant a, Connection db) {
auto v = a.peek!(void*);
if(v && (*v is null))
return "NULL";
else {
string str = to!string(a);
return db.escape(str);
}
assert(0);
}
static string toSqlArray(long s, Connection db) {
return toSql(s, db);
}
static string toSqlArray(Variant a, Connection db) {
auto v = a.peek!(void*);
if(v && (*v is null))
return "NULL";
else {
return to!string(a);
}
assert(0);
}
static string escapedVariants(Connection db, in string sql, Variant[string] t) {
if(t.keys.length <= 0 || sql.indexOf("?") == -1) {
return sql;
}
string fixedup;
int currentStart = 0;
// FIXME: let's make ?? render as ? so we have some escaping capability
foreach(int i, dchar c; sql) {
if (c == '?') {
fixedup ~= sql[currentStart .. i];
int idxStart = i + 1;
int idxLength;
bool isFirst = true;
while(idxStart + idxLength < sql.length) {
char C = sql[idxStart + idxLength];
if((C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z') || C == '_' || (!isFirst && C >= '0' && C <= '9'))
idxLength++;
else
break;
isFirst = false;
}
auto idx = sql[idxStart .. idxStart + idxLength];
if(idx in t) {
fixedup ~= toSql(t[idx], db);
currentStart = idxStart + idxLength;
} else {
// just leave it there, it might be done on another layer
currentStart = i;
}
}
}
fixedup ~= sql[currentStart .. $];
return fixedup;
}
/// Note: ?n params are zero based!
static string escapedVariants(Connection db, in string sql, Variant[] t) {
// FIXME: let's make ?? render as ? so we have some escaping capability
// if nothing to escape or nothing to escape with, don't bother
if (t.length > 0 && sql.indexOf("?") != -1) {
string fixedup;
int currentIndex;
int currentStart = 0;
foreach (int i, dchar c; sql) {
if (c == '?') {
fixedup ~= sql[currentStart .. i];
int idx = -1;
currentStart = i + 1;
if((i + 1) < sql.length) {
auto n = sql[i + 1];
if(n >= '0' && n <= '9') {
currentStart = i + 2;
idx = n - '0';
}
}
if(idx == -1) {
idx = currentIndex;
currentIndex++;
}
if(idx < 0 || idx >= t.length)
throw new Exception("SQL Parameter index is out of bounds: " ~ to!string(idx) ~ " at `" ~ sql[0 .. i] ~ "`");
if (sql[i - 1] == '`' && sql[i + 1] == '`') {
fixedup ~= toSqlName(t[idx], db);
} else if (sql[i - 1] == '(' && sql[i + 1] == ')') {
fixedup ~= toSqlArray(t[idx], db);
} else {
fixedup ~= toSql(t[idx], db);
}
}
}
fixedup ~= sql[currentStart .. $];
return fixedup;
}
return sql;
}
} | D |
import std.process;
import std.stdio : readln;
import std.string : strip;
import til.nodes;
import til.ranges;
class OutputRange : Range
{
ProcessPipes pipes;
std.process.Pid pid;
CommandContext context;
Range inputStream;
string[] command;
int returnCode = 0;
bool running = true;
Dict processHandler;
this(string[] command, Dict processHandler, CommandContext context)
{
this.context = context;
this.processHandler = processHandler;
this.command = command;
if (inputStream is null)
{
pipes = pipeProcess(command, Redirect.stdout | Redirect.stderr);
}
else
{
pipes = pipeProcess(command, Redirect.all);
}
this.pid = pipes.pid;
}
override bool empty()
{
if (!running) return true;
if (pipes.stdout.eof && pipes.stderr.eof)
{
/*
If both stdout and stderr are closed but the
process is not terminated, then we ARE
going to return "yes, it's empty",
but must also block the current
Til process until the system
process is really
terminated:
*/
while (!pid.tryWait().terminated)
{
context.yield();
}
returnCode = pid.wait();
running = false;
processHandler["running"] = new BooleanAtom(false);
processHandler["return_code"] = new IntegerAtom(returnCode);
return false;
}
return false;
}
override ListItem front()
{
if (!running)
{
return new SimpleList([
new IntegerAtom(0),
new IntegerAtom(returnCode)
]);
}
string line = null;
int source;
while(line is null)
{
if (!pipes.stderr.eof)
{
line = pipes.stderr.readln();
// XXX : dont'like to say "2". It would be
// nice to get the fd number directly
// from pipes.stderr/stdout.
source = 2;
}
if (line is null && !pipes.stdout.eof)
{
line = pipes.stdout.readln();
source = 1;
}
if (line is null)
{
if (pipes.stdout.eof && pipes.stderr.eof)
{
source = -1;
line = "";
break;
}
context.yield();
}
}
return new SimpleList([
new IntegerAtom(source),
new String(line.strip("\n"))
]);
}
override void popFront()
{
}
}
extern (C) CommandHandler[string] getCommands(Process escopo)
{
CommandHandler[string] commands;
commands[null] = (string path, CommandContext context)
{
string[] cmd = context.items!string;
auto processHandler = new Dict();
processHandler["command"] = new String(to!string(
cmd.map!(x => to!string(x)).join(" ")
));
processHandler["running"] = new BooleanAtom(true);
context.stream = new OutputRange(cmd, processHandler, context);
context.push(processHandler);
context.exitCode = ExitCode.CommandSuccess;
return context;
};
return commands;
}
| D |
instance DIA_Rosi_EXIT(DIA_Proto_End)
{
npc = BAU_936_Rosi;
};
/////////////////////////////////////// ТИЛЛ /////////////////////////////////////////////
//===================================================
instance DIA_Rosi_Start_Till(C_Info)
{
npc = BAU_936_Rosi;
nr = 1;
condition = DIA_Rosi_Start_Till_Cond;
information = DIA_Rosi_Start_Till_Info;
important = TRUE;
};
func int DIA_Rosi_Start_Till_Cond()
{
if (C_HeroIs_Till()) {
return TRUE;
};
};
func void DIA_Rosi_Start_Till_Info()
{
START_DIA_Finished = TRUE;
var C_NPC Rosi; Rosi = Hlp_GetNpc(BAU_936_Rosi);
var C_NPC Sekob; Sekob = Hlp_GetNpc(BAU_930_Sekob);
Npc_ClearAIQueue(Sekob);
AI_StandUpQuick(Sekob);
AI_TurnToNpc(Sekob,other);
other.aivar[AIV_INVINCIBLE] = FALSE;
Npc_SetTarget(Sekob,hero);
AI_StartState(Sekob,ZS_Talk,0,"");
TRIA_Invite(Sekob);
TRIA_Start();
TRIA_Next(Rosi);
AI_TurnToNpc(self,other);
AI_Output(self,other,"DIA_Rosi_Start_Till_17_00"); //Тилл, поди сюда, оболтус.
AI_SetWalkmode(other, NPC_WALK);
AI_TurnToNpc(other, self);
AI_GotoNpc(other,self);
AI_Output(other,self,"DIA_Rosi_Start_Till_14_01"); //Чего, мам?
TRIA_Next(Sekob);
AI_TurnToNpc(self,other);
AI_Wait(hero,0.5);
AI_Output(self,other,"DIA_Rosi_Start_Till_01_03"); //Сначала покажи покупки и верни оставшиеся деньги.
TRIA_Next(Rosi);
AI_TurnToNpc(self,Sekob);
AI_Snd_Play3D(self,other,"Geldbeutel");
AI_Output(self,other,"DIA_Rosi_Start_Till_17_04"); //Вот, вот. Все до монетки.
AI_TurnToNpc(self,other);
AI_Output(self,other,"DIA_Rosi_Start_Till_17_05"); //Тилл, городской алхимик Константино объявил конкурс! По сбору грибов.
AI_Output(self,other,"DIA_Rosi_Start_Till_17_06"); //Каждый, кто в течение этой недели принесет ему грибы, будет щедро вознагражден. А победитель получит какой-то очень ценный приз...
TRIA_Next(Sekob);
AI_TurnToNpc(self,Sekob);
AI_Output(self,other,"DIA_Rosi_Start_Till_01_07"); //Что, говоришь? Щедро вознагражден?.. Ценный приз?..
AI_TurnToNpc(other,self);
AI_TurnToNpc(self,other);
AI_Output(self,other,"DIA_Rosi_Start_Till_01_08"); //Так, обормот. Бери ноги в руки и шагом марш в лес. Без грибов можешь не возвращаться.
AI_Output(other,self,"DIA_Rosi_Start_Till_14_09"); //Но...
AI_Output(self,other,"DIA_Rosi_Start_Till_01_10"); //Никаких но! Но можешь взять что-нибудь из оружия и припасов. Но не смей прикасаться к деньгам! Ты их не заработал.
B_GiveInvItems(self,other,ItKe_Chest_Till,1);
TRIA_Finish();
B_StartOtherRoutine(Rosi,"START");
AI_StopProcessInfos(self);
};
//===================================================
instance DIA_Rosi_MR_Perm_Till(C_Info)
{
npc = BAU_936_Rosi;
nr = 2;
condition = DIA_Rosi_MR_Perm_Till_Cond;
information = DIA_Rosi_MR_Perm_Till_Info;
description = "Мам, я есть хочу.";
permanent = TRUE;
};
func int DIA_Rosi_MR_Perm_Till_Cond()
{
if (C_HeroIs_Till()) {
return TRUE;
};
};
var int DIA_Rosi_MR_Perm_Till_Day;
var int DIA_Rosi_MR_Perm_Till_Night;
func void DIA_Rosi_MR_Perm_Till_Info()
{
AI_Output(other,self,"DIA_Rosi_MR_Perm_Till_14_00"); //Мам, я есть хочу.
if (Wld_IsTime(6,0,12,0)) {
AI_Output(self,other,"DIA_Rosi_MR_Perm_Till_17_01"); //О Иннос, ты всегда хочешь есть. Потерпи до обеда.
}
else if (Wld_IsTime(12,0,22,0)) {
if (DIA_Rosi_MR_Perm_Till_Day > Wld_GetDay()) {
AI_Output(self,other,"DIA_Rosi_MR_Perm_Till_17_02"); //Имей совесть, Тилл. Ты сегодня уже обедал. Или ты думаешь, что похлебка с неба падает?
}
else {
AI_Output(self,other,"DIA_Rosi_MR_Perm_Till_17_03"); //Вот, держи.
B_GiveInvItems(self,other,ItFo_Stew,1);
DIA_Rosi_MR_Perm_Till_Day = Wld_GetDay() + 1;
};
}
else {
if (DIA_Rosi_MR_Perm_Till_Night > Wld_GetDay_Shifted(6)) {
AI_Output(self,other,"DIA_Rosi_MR_Perm_Till_17_04"); //Иди спать, обжора!
}
else {
AI_Output(self,other,"DIA_Rosi_MR_Perm_Till_17_05"); //Тилл, сейчас середина ночи! Вот, поешь хлеба с молоком и ложись спать!
//B_GiveInvItems(self,other,ItFo_Bread,1);
//B_GiveInvItems(self,other,ItFo_Milk,1);
ItemTrans_items[0] = ItFo_Bread;
ItemTrans_amount[0] = 1;
ItemTrans_items[1] = ItFo_Milk;
ItemTrans_amount[1] = 1;
B_ItemsTransaction(self,other);
DIA_Rosi_MR_Perm_Till_Night = Wld_GetDay_Shifted(6) + 1;
};
};
};
/////////////////////////////////////// ЕЛЕНА /////////////////////////////////////////////
//===================================================
instance DIA_Rosi_Start_Elena(C_Info)
{
npc = BAU_936_Rosi;
nr = 10;
condition = DIA_Rosi_Start_Elena_Cond;
information = DIA_Rosi_Start_Elena_Info;
important = TRUE;
};
func int DIA_Rosi_Start_Elena_Cond()
{
if (C_HeroIs_Elena()) {
return TRUE;
};
};
func void DIA_Rosi_Start_Elena_Info()
{
AI_Output(self,other,"DIA_Rosi_Start_Elena_17_00"); //Елена, рада тебя видеть. Ты так выросла, похорошела.
};
//===================================================
instance DIA_Rosi_LookGood_Elena(C_Info)
{
npc = BAU_936_Rosi;
nr = 11;
condition = DIA_Rosi_LookGood_Elena_Cond;
information = DIA_Rosi_LookGood_Elena_Info;
description = "Ты тоже хорошо выглядишь.";
};
func int DIA_Rosi_LookGood_Elena_Cond()
{
if (C_HeroIs_Elena()) {
return TRUE;
};
};
func void DIA_Rosi_LookGood_Elena_Info()
{
AI_Output(other,self,"DIA_Rosi_LookGood_Elena_16_00"); //Ты тоже хорошо выглядишь.
AI_Output(self,other,"DIA_Rosi_LookGood_Elena_17_01"); //Ох, где уж там. Но все равно спасибо.
};
/////////////////////////////////////// ОСТАЛЬНЫЕ /////////////////////////////////////////////
//===================================================
instance DIA_Rosi_Start_Others(C_Info)
{
npc = BAU_936_Rosi;
nr = 20;
condition = DIA_Rosi_Start_Others_Cond;
information = DIA_Rosi_Start_Others_Info;
important = TRUE;
};
func int DIA_Rosi_Start_Others_Cond()
{
if (!C_HeroIs_Till() && !C_HeroIs_Elena() && DIA_WhenAsked_cond()) {
return TRUE;
};
};
func void DIA_Rosi_Start_Others_Info()
{
AI_Output(self,other,"DIA_Rosi_Start_Others_17_00"); //Чего ты хочешь? Если у тебя какое-то дело, обратись к моему мужу.
};
//===================================================
instance DIA_Rosi_MR_Perm(C_Info)
{
npc = BAU_936_Rosi;
nr = 21;
condition = DIA_Rosi_MR_Perm_Cond;
information = DIA_Rosi_MR_Perm_Info;
description = "Как твои дела?";
permanent = TRUE;
};
func int DIA_Rosi_MR_Perm_Cond()
{
if (!C_HeroIs_Till()) {
return TRUE;
};
};
func void DIA_Rosi_MR_Perm_Info()
{
if (hero.voice == 3) { //Одо/Руперт
AI_Output(other,self,"DIA_Rosi_MR_Perm_Others_03_00"); //Как твои дела?
} else if (hero.voice == 7) { //Талбин
AI_Output(other,self,"DIA_Rosi_MR_Perm_Others_07_00"); //Как твои дела?
} else if (hero.voice == 10) { //Эрол
AI_Output(other,self,"DIA_Rosi_MR_Perm_Others_10_00"); //Как твои дела?
} else { //Сара/Elena
AI_Output(other,self,"DIA_Rosi_MR_Perm_Others_16_00"); //Как твои дела?
};
AI_Output(self,other,"DIA_Rosi_MR_Perm_17_01"); //Живем потихоньку...
};
//===================================================
instance DIA_Rosi_MRTrade_Others(C_Info)
{
npc = BAU_936_Rosi;
nr = 22;
condition = DIA_Rosi_MRTrade_Others_Cond;
information = DIA_Rosi_MRTrade_Others_Info;
description = "У тебя можно что-нибудь купить?";
};
func int DIA_Rosi_MRTrade_Others_Cond()
{
if (!C_HeroIs_Till() && !C_HeroIs_Elena()) {
return TRUE;
};
};
func void DIA_Rosi_MRTrade_Others_Info()
{
if (hero.voice == 3) { //Одо/Руперт
AI_Output(other,self,"DIA_Rosi_MRTrade_Others_03_00"); //У тебя можно что-нибудь купить?
} else if (hero.voice == 7) { //Талбин
AI_Output(other,self,"DIA_Rosi_MRTrade_Others_07_00"); //У тебя можно что-нибудь купить?
} else if (hero.voice == 10) { //Эрол
AI_Output(other,self,"DIA_Rosi_MRTrade_Others_10_00"); //У тебя можно что-нибудь купить?
} else { //Сара
AI_Output(other,self,"DIA_Rosi_MRTrade_Others_16_00"); //У тебя можно что-нибудь купить?
};
AI_Output(self,other,"DIA_Rosi_MRTrade_Others_17_01"); //Нет, муж рассердится, если я продам что-то без его ведома.
};
//===================================================
instance DIA_Rosi_Husband_Others(C_Info)
{
npc = BAU_936_Rosi;
nr = 23;
condition = DIA_Rosi_Husband_Others_Cond;
information = DIA_Rosi_Husband_Others_Info;
description = "Твой муж всегда такой раздраженный?";
};
func int DIA_Rosi_Husband_Others_Cond()
{
if (!C_HeroIs_Till() && !C_HeroIs_Elena() && DIA_Sekob_MR_Perm_Others_once) {
return TRUE;
};
};
func void DIA_Rosi_Husband_Others_Info()
{
if (hero.voice == 3) { //Одо/Руперт
AI_Output(other,self,"DIA_Rosi_Husband_Others_03_00"); //Твой муж всегда такой раздраженный?
} else if (hero.voice == 7) { //Талбин
AI_Output(other,self,"DIA_Rosi_Husband_Others_07_00"); //Твой муж всегда такой раздраженный?
} else if (hero.voice == 10) { //Эрол
AI_Output(other,self,"DIA_Rosi_Husband_Others_10_00"); //Твой муж всегда такой раздраженный?
} else { //Сара
AI_Output(other,self,"DIA_Rosi_Husband_Others_16_00"); //Твой муж всегда такой раздраженный?
};
AI_Output(self,other,"DIA_Rosi_Husband_Others_17_01"); //Почти всегда. Если только ты не платишь ему за вежливость.
AI_Output(self,other,"DIA_Rosi_Husband_Others_17_02"); //Не могу сказать, что я счастлива с ним.
};
// Кулинарные изыски ===================================================
instance DIA_Rosi_AskRecipe(C_Info)
{
npc = BAU_936_Rosi; nr = 5;
condition = DIA_Rosi_AskRecipe_cond;
information = DIA_Rosi_AskRecipe_Info;
description = "А ты умеешь готовить грибы, такие, похожие на розовые ушки?";
};
func int DIA_Rosi_AskRecipe_cond()
{
if (MIS_Cookery == LOG_Running) {
return TRUE;
};
};
func void DIA_Rosi_AskRecipe_Info()
{
if (C_HeroIs_Till()) { //Тилл
AI_Output(other,self,"DIA_Rosi_AskRecipe_Till_03_00"); //Мам, а ты умеешь готовить грибы, такие, похожие на розовые ушки?
} else if (hero.voice == 3) { //Одо/Руперт
AI_Output(other,self,"DIA_Rosi_AskRecipe_03_00"); //А ты умеешь готовить грибы, такие, похожие на розовые ушки?
} else if (hero.voice == 7) { //Талбин
AI_Output(other,self,"DIA_Rosi_AskRecipe_07_00"); //А ты умеешь готовить грибы, такие, похожие на розовые ушки?
} else if (hero.voice == 10) { //Эрол
AI_Output(other,self,"DIA_Rosi_AskRecipe_10_00"); //А ты умеешь готовить грибы, такие, похожие на розовые ушки?
} else { //Елена/Сара
AI_Output(other,self,"DIA_Rosi_AskRecipe_16_00"); //А ты умеешь готовить грибы, такие, похожие на розовые ушки?
};
AI_Output(self,other,"DIA_Rosi_AskRecipe_17_01"); //Фу, какая гадость! Да я бы их в руки не взяла, не то что в рот.
};
| D |
module memory;
/**
This example demonstrates how to properly handle memory management
for displaying things such as text.
*/
import std.exception;
import std.file;
import std.path;
import std.stdio;
import std.string;
import deimos.glfw.glfw3;
import glad.gl.enums;
import glad.gl.ext;
import glad.gl.funcs;
import glad.gl.loader;
import glad.gl.types;
import glwtf.input;
import glwtf.window;
import imgui;
import window;
struct GUI
{
this(Window window)
{
this.window = window;
window.on_scroll.strongConnect(&onScroll);
int width;
int height;
glfwGetWindowSize(window.window, &width, &height);
// trigger initial viewport transform.
onWindowResize(width, height);
window.on_resize.strongConnect(&onWindowResize);
}
void render()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Mouse states
ubyte mousebutton = 0;
double mouseX;
double mouseY;
glfwGetCursorPos(window.window, &mouseX, &mouseY);
const scrollAreaWidth = (windowWidth / 4) - 10; // -10 to allow room for the scrollbar
const scrollAreaHeight = windowHeight - 20;
int mousex = cast(int)mouseX;
int mousey = cast(int)mouseY;
mousey = windowHeight - mousey;
int leftButton = glfwGetMouseButton(window.window, GLFW_MOUSE_BUTTON_LEFT);
int rightButton = glfwGetMouseButton(window.window, GLFW_MOUSE_BUTTON_RIGHT);
int middleButton = glfwGetMouseButton(window.window, GLFW_MOUSE_BUTTON_MIDDLE);
if (leftButton == GLFW_PRESS)
mousebutton |= MouseButton.left;
imguiBeginFrame(mousex, mousey, mousebutton, mouseScroll);
if (mouseScroll != 0)
mouseScroll = 0;
/// Improper memory management.
displayArea1(scrollAreaWidth, scrollAreaHeight);
/// Attempted workaround, but still improper memory management.
char[128] buffer;
displayArea2(scrollAreaWidth, scrollAreaHeight, buffer);
/// Proper memory management.
char[128][100] buffers;
displayArea3(scrollAreaWidth, scrollAreaHeight, buffers);
/// Alternatively you may use 'string', which is guaranteed to be immutable
/// and will outlive any stack scope since the garbage collector will keep
/// a reference to it.
displayArea4(scrollAreaWidth, scrollAreaHeight);
imguiEndFrame();
imguiRender(windowWidth, windowHeight);
}
void displayArea1(int scrollAreaWidth, int scrollAreaHeight)
{
imguiBeginScrollArea("Improper memory management 1", 10, 10, scrollAreaWidth, scrollAreaHeight, &scrollArea1);
imguiSeparatorLine();
imguiSeparator();
/// Note: improper memory management: 'buffer' is scoped to this function,
/// but imguiLabel will keep a reference to the 'buffer' until 'imguiRender'
/// is called. 'imguiRender' is only called after 'displayArea1' returns,
/// after which 'buffer' will not be usable (it's memory allocated on the stack!).
/// Result: Random text being displayed or even crashes are possible.
char[128] buffer;
auto text = buffer.sformat("This is my text: %s", "more text");
imguiLabel(text);
imguiEndScrollArea();
}
void displayArea2(int scrollAreaWidth, int scrollAreaHeight, ref char[128] buffer)
{
imguiBeginScrollArea("Improper memory management 2", 20 + (1 * scrollAreaWidth), 10, scrollAreaWidth, scrollAreaHeight, &scrollArea2);
imguiSeparatorLine();
imguiSeparator();
foreach (idx; 0 .. 100)
{
/// Note: improper memory management: 'buffer' will be re-used in each
/// iteration of this loop, but imguiLabel will just keep a reference
/// to the same memory location on each call.
/// Result: Typically the same bit of text is displayed 100 times.
auto text = buffer.sformat("Item number %s", idx);
imguiLabel(text);
}
imguiEndScrollArea();
}
void displayArea3(int scrollAreaWidth, int scrollAreaHeight, ref char[128][100] buffers)
{
imguiBeginScrollArea("Proper memory management 1", 30 + (2 * scrollAreaWidth), 10, scrollAreaWidth, scrollAreaHeight, &scrollArea3);
imguiSeparatorLine();
imguiSeparator();
foreach (idx, ref buffer; buffers)
{
/// Note: Proper memory management: 'buffer' is unique for all the items,
/// and imguiLabel can safely store a reference to each string since each
/// buffer will be valid until the exit of the scope where the 'imguiRender'
/// call is emitted.
auto text = buffer.sformat("Item number %s", idx);
imguiLabel(text);
}
imguiEndScrollArea();
}
void displayArea4(int scrollAreaWidth, int scrollAreaHeight)
{
imguiBeginScrollArea("Proper memory management 2", 40 + (3 * scrollAreaWidth), 10, scrollAreaWidth, scrollAreaHeight, &scrollArea4);
imguiSeparatorLine();
imguiSeparator();
foreach (idx; 0 .. 100)
{
/// Note: Proper memory management: the string will not be prematurely
/// garbage-collected since the GC will know that 'imguiLabel' will store
/// a refererence to this string for use in a later 'imguiRender call.
string str = "This is just some text";
imguiLabel(str);
}
imguiEndScrollArea();
}
/**
This tells OpenGL what area of the available area we are
rendering to. In this case, we change it to match the
full available area. Without this function call resizing
the window would have no effect on the rendering.
*/
void onWindowResize(int width, int height)
{
// bottom-left position.
enum int x = 0;
enum int y = 0;
/**
This function defines the current viewport transform.
It defines as a region of the window, specified by the
bottom-left position and a width/height.
Note about the viewport transform:
It is the process of transforming vertex data from normalized
device coordinate space to window space. It specifies the
viewable region of a window.
*/
glViewport(x, y, width, height);
windowWidth = width;
windowHeight = height;
}
void onScroll(double hOffset, double vOffset)
{
mouseScroll = -cast(int)vOffset;
}
private:
Window window;
int windowWidth;
int windowHeight;
int scrollArea1 = 0;
int scrollArea2 = 0;
int scrollArea3 = 0;
int scrollArea4 = 0;
int mouseScroll = 0;
}
int main(string[] args)
{
int width = 1024, height = 768;
auto window = createWindow("imgui", WindowMode.windowed, width, height);
GUI gui = GUI(window);
glfwSwapInterval(1);
string fontPath = thisExePath().dirName().buildPath("../").buildPath("DroidSans.ttf");
enforce(imguiInit(fontPath));
glClearColor(0.8f, 0.8f, 0.8f, 1.0f);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_DEPTH_TEST);
while (!glfwWindowShouldClose(window.window))
{
gui.render();
/* Swap front and back buffers. */
window.swap_buffers();
/* Poll for and process events. */
glfwPollEvents();
if (window.is_key_down(GLFW_KEY_ESCAPE))
glfwSetWindowShouldClose(window.window, true);
}
// Clean UI
imguiDestroy();
return 0;
}
| D |
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.internal.win32.OS;
import org.eclipse.swt.widgets.Caret;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.IME;
import java.lang.all;
/**
* Instances of this class provide a surface for drawing
* arbitrary graphics.
* <dl>
* <dt><b>Styles:</b></dt>
* <dd>(none)</dd>
* <dt><b>Events:</b></dt>
* <dd>(none)</dd>
* </dl>
* <p>
* This class may be subclassed by custom control implementors
* who are building controls that are <em>not</em> constructed
* from aggregates of other controls. That is, they are either
* painted using SWT graphics calls or are handled by native
* methods.
* </p>
*
* @see Composite
* @see <a href="http://www.eclipse.org/swt/snippets/#canvas">Canvas snippets</a>
* @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
*/
public class Canvas : Composite {
alias Composite.drawBackground drawBackground;
alias Composite.windowProc windowProc;
Caret caret;
IME ime;
/**
* Prevents uninitialized instances from being created outside the package.
*/
this () {
}
/**
* Constructs a new instance of this class given its parent
* and a style value describing its behavior and appearance.
* <p>
* The style value is either one of the style constants defined in
* class <code>SWT</code> which is applicable to instances of this
* class, or must be built by <em>bitwise OR</em>'ing together
* (that is, using the <code>int</code> "|" operator) two or more
* of those <code>SWT</code> style constants. The class description
* lists the style constants that are applicable to the class.
* Style bits are also inherited from superclasses.
* </p>
*
* @param parent a composite control which will be the parent of the new instance (cannot be null)
* @param style the style of control to construct
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
* </ul>
*
* @see SWT
* @see Widget#checkSubclass
* @see Widget#getStyle
*/
public this (Composite parent, int style) {
super (parent, style);
}
void clearArea (int x, int y, int width, int height) {
checkWidget ();
if (OS.IsWindowVisible (handle)) {
RECT rect;
OS.SetRect (&rect, x, y, x + width, y + height);
auto hDC = OS.GetDCEx (handle, null, OS.DCX_CACHE | OS.DCX_CLIPCHILDREN | OS.DCX_CLIPSIBLINGS);
drawBackground (hDC, &rect);
OS.ReleaseDC (handle, hDC);
}
}
/**
* Fills the interior of the rectangle specified by the arguments,
* with the receiver's background.
*
* @param gc the gc where the rectangle is to be filled
* @param x the x coordinate of the rectangle to be filled
* @param y the y coordinate of the rectangle to be filled
* @param width the width of the rectangle to be filled
* @param height the height of the rectangle to be filled
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the gc is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the gc has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.2
*/
public void drawBackground (GC gc, int x, int y, int width, int height) {
checkWidget ();
if (gc is null) error (SWT.ERROR_NULL_ARGUMENT);
if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
RECT rect;
OS.SetRect (&rect, x, y, x + width, y + height);
auto hDC = gc.handle;
int pixel = background is -1 ? gc.getBackground ().handle : -1;
drawBackground (hDC, &rect, pixel);
}
/**
* Returns the caret.
* <p>
* The caret for the control is automatically hidden
* and shown when the control is painted or resized,
* when focus is gained or lost and when an the control
* is scrolled. To avoid drawing on top of the caret,
* the programmer must hide and show the caret when
* drawing in the window any other time.
* </p>
*
* @return the caret for the receiver, may be null
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public Caret getCaret () {
checkWidget ();
return caret;
}
/**
* Returns the IME.
*
* @return the IME
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.4
*/
public IME getIME () {
checkWidget ();
return ime;
}
override
void releaseChildren (bool destroy) {
if (caret !is null) {
caret.release (false);
caret = null;
}
if (ime !is null) {
ime.release (false);
ime = null;
}
super.releaseChildren (destroy);
}
/**
* Scrolls a rectangular area of the receiver by first copying
* the source area to the destination and then causing the area
* of the source which is not covered by the destination to
* be repainted. Children that intersect the rectangle are
* optionally moved during the operation. In addition, outstanding
* paint events are flushed before the source area is copied to
* ensure that the contents of the canvas are drawn correctly.
*
* @param destX the x coordinate of the destination
* @param destY the y coordinate of the destination
* @param x the x coordinate of the source
* @param y the y coordinate of the source
* @param width the width of the area
* @param height the height of the area
* @param all <code>true</code>if children should be scrolled, and <code>false</code> otherwise
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public void scroll (int destX, int destY, int x, int y, int width, int height, bool all) {
checkWidget ();
forceResize ();
bool isFocus = caret !is null && caret.isFocusCaret ();
if (isFocus) caret.killFocus ();
RECT sourceRect;
OS.SetRect (&sourceRect, x, y, x + width, y + height);
RECT clientRect;
OS.GetClientRect (handle, &clientRect);
if (OS.IntersectRect (&clientRect, &sourceRect, &clientRect)) {
static if (OS.IsWinCE) {
OS.UpdateWindow (handle);
} else {
int flags = OS.RDW_UPDATENOW | OS.RDW_ALLCHILDREN;
OS.RedrawWindow (handle, null, null, flags);
}
}
int deltaX = destX - x, deltaY = destY - y;
if (findImageControl () !is null) {
static if (OS.IsWinCE) {
OS.InvalidateRect (handle, &sourceRect, true);
} else {
{ // scope for flags
int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE;
if (all) flags |= OS.RDW_ALLCHILDREN;
OS.RedrawWindow (handle, &sourceRect, null, flags);
}
}
OS.OffsetRect (&sourceRect, deltaX, deltaY);
static if (OS.IsWinCE) {
OS.InvalidateRect (handle, &sourceRect, true);
} else {
int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE;
if (all) flags |= OS.RDW_ALLCHILDREN;
OS.RedrawWindow (handle, &sourceRect, null, flags);
}
} else {
int flags = OS.SW_INVALIDATE | OS.SW_ERASE;
/*
* Feature in Windows. If any child in the widget tree partially
* intersects the scrolling rectangle, Windows moves the child
* and copies the bits that intersect the scrolling rectangle but
* does not redraw the child.
*
* Feature in Windows. When any child in the widget tree does not
* intersect the scrolling rectangle but the parent does intersect,
* Windows does not move the child. This is the documented (but
* strange) Windows behavior.
*
* The fix is to not use SW_SCROLLCHILDREN and move the children
* explicitly after scrolling.
*/
// if (all) flags |= OS.SW_SCROLLCHILDREN;
OS.ScrollWindowEx (handle, deltaX, deltaY, &sourceRect, null, null, null, flags);
}
if (all) {
Control [] children = _getChildren ();
for (int i=0; i<children.length; i++) {
Control child = children [i];
Rectangle rect = child.getBounds ();
if (Math.min (x + width, rect.x + rect.width) >= Math.max (x, rect.x) &&
Math.min (y + height, rect.y + rect.height) >= Math.max (y, rect.y)) {
child.setLocation (rect.x + deltaX, rect.y + deltaY);
}
}
}
if (isFocus) caret.setFocus ();
}
/**
* Sets the receiver's caret.
* <p>
* The caret for the control is automatically hidden
* and shown when the control is painted or resized,
* when focus is gained or lost and when an the control
* is scrolled. To avoid drawing on top of the caret,
* the programmer must hide and show the caret when
* drawing in the window any other time.
* </p>
* @param caret the new caret for the receiver, may be null
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_ARGUMENT - if the caret has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public void setCaret (Caret caret) {
checkWidget ();
Caret newCaret = caret;
Caret oldCaret = this.caret;
this.caret = newCaret;
if (hasFocus ()) {
if (oldCaret !is null) oldCaret.killFocus ();
if (newCaret !is null) {
if (newCaret.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
newCaret.setFocus ();
}
}
}
override public void setFont (Font font) {
checkWidget ();
if (caret !is null) caret.setFont (font);
super.setFont (font);
}
/**
* Sets the receiver's IME.
*
* @param ime the new IME for the receiver, may be null
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_ARGUMENT - if the IME has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
* @since 3.4
*/
public void setIME (IME ime) {
checkWidget ();
if (ime !is null && ime.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
this.ime = ime;
}
override int windowProc (HWND hwnd, int msg, int wParam, int lParam) {
if (msg is Display.SWT_RESTORECARET) {
if ((state & CANVAS) !is 0) {
if (caret !is null) {
caret.killFocus ();
caret.setFocus ();
return 1;
}
}
}
return super.windowProc (hwnd, msg, wParam, lParam);
}
override LRESULT WM_CHAR (int wParam, int lParam) {
LRESULT result = super.WM_CHAR (wParam, lParam);
if (result !is null) return result;
if (caret !is null) {
switch (wParam) {
case SWT.DEL:
case SWT.BS:
case SWT.ESC:
break;
default: {
if (OS.GetKeyState (OS.VK_CONTROL) >= 0) {
int value;
if (OS.SystemParametersInfo (OS.SPI_GETMOUSEVANISH, 0, &value, 0)) {
if (value !is 0) OS.SetCursor (null);
}
}
}
}
}
return result;
}
override LRESULT WM_IME_COMPOSITION (int /*long*/ wParam, int /*long*/ lParam) {
if (ime !is null) {
LRESULT result = ime.WM_IME_COMPOSITION (wParam, lParam);
if (result !is null) return result;
}
/*
* Bug in Windows. On Korean Windows XP, the IME window
* for the Korean Input System (MS-IME 2002) always opens
* in the top left corner of the screen, despite the fact
* that ImmSetCompositionWindow() was called to position
* the IME when focus is gained. The fix is to position
* the IME on every WM_IME_COMPOSITION message.
*/
if (!OS.IsWinCE && OS.WIN32_VERSION is OS.VERSION (5, 1)) {
if (OS.IsDBLocale) {
short langID = OS.GetSystemDefaultUILanguage ();
short primaryLang = cast(short) OS.PRIMARYLANGID (langID);
if (primaryLang is OS.LANG_KOREAN) {
if (caret !is null && caret.isFocusCaret ()) {
POINT ptCurrentPos;
if (OS.GetCaretPos (&ptCurrentPos)) {
COMPOSITIONFORM lpCompForm;
lpCompForm.dwStyle = OS.CFS_POINT;
lpCompForm.ptCurrentPos.x = ptCurrentPos.x;
lpCompForm.ptCurrentPos.y = ptCurrentPos.y;
auto hIMC = OS.ImmGetContext (handle);
OS.ImmSetCompositionWindow (hIMC, &lpCompForm);
OS.ImmReleaseContext (handle, hIMC);
}
}
}
}
}
return super.WM_IME_COMPOSITION (wParam, lParam);
}
override LRESULT WM_IME_COMPOSITION_START (int /*long*/ wParam, int /*long*/ lParam) {
if (ime !is null) {
LRESULT result = ime.WM_IME_COMPOSITION_START (wParam, lParam);
if (result !is null) return result;
}
return super.WM_IME_COMPOSITION_START (wParam, lParam);
}
override LRESULT WM_IME_ENDCOMPOSITION (int /*long*/ wParam, int /*long*/ lParam) {
if (ime !is null) {
LRESULT result = ime.WM_IME_ENDCOMPOSITION (wParam, lParam);
if (result !is null) return result;
}
return super.WM_IME_ENDCOMPOSITION (wParam, lParam);
}
override LRESULT WM_INPUTLANGCHANGE (int wParam, int lParam) {
LRESULT result = super.WM_INPUTLANGCHANGE (wParam, lParam);
if (caret !is null && caret.isFocusCaret ()) {
caret.setIMEFont ();
caret.resizeIME ();
}
return result;
}
override LRESULT WM_KILLFOCUS (int wParam, int lParam) {
if (ime !is null) {
LRESULT result = ime.WM_KILLFOCUS (wParam, lParam);
if (result !is null) return result;
}
LRESULT result = super.WM_KILLFOCUS (wParam, lParam);
if (caret !is null) caret.killFocus ();
return result;
}
override LRESULT WM_LBUTTONDOWN (int /*long*/ wParam, int /*long*/ lParam) {
if (ime !is null) {
LRESULT result = ime.WM_LBUTTONDOWN (wParam, lParam);
if (result !is null) return result;
}
return super.WM_LBUTTONDOWN (wParam, lParam);
}
override LRESULT WM_SETFOCUS (int wParam, int lParam) {
LRESULT result = super.WM_SETFOCUS (wParam, lParam);
if (caret !is null) caret.setFocus ();
return result;
}
override LRESULT WM_SIZE (int wParam, int lParam) {
LRESULT result = super.WM_SIZE (wParam, lParam);
if (caret !is null && caret.isFocusCaret ()) caret.resizeIME ();
return result;
}
override LRESULT WM_WINDOWPOSCHANGED (int wParam, int lParam) {
LRESULT result = super.WM_WINDOWPOSCHANGED (wParam, lParam);
//if (result !is null) return result;
/*
* Bug in Windows. When a window with style WS_EX_LAYOUTRTL
* that contains a caret is resized, Windows does not move the
* caret in relation to the mirrored origin in the top right.
* The fix is to hide the caret in WM_WINDOWPOSCHANGING and
* show the caret in WM_WINDOWPOSCHANGED.
*/
bool isFocus = (style & SWT.RIGHT_TO_LEFT) !is 0 && caret !is null && caret.isFocusCaret ();
if (isFocus) caret.setFocus ();
return result;
}
override LRESULT WM_WINDOWPOSCHANGING (int wParam, int lParam) {
LRESULT result = super.WM_WINDOWPOSCHANGING (wParam, lParam);
if (result !is null) return result;
/*
* Bug in Windows. When a window with style WS_EX_LAYOUTRTL
* that contains a caret is resized, Windows does not move the
* caret in relation to the mirrored origin in the top right.
* The fix is to hide the caret in WM_WINDOWPOSCHANGING and
* show the caret in WM_WINDOWPOSCHANGED.
*/
bool isFocus = (style & SWT.RIGHT_TO_LEFT) !is 0 && caret !is null && caret.isFocusCaret ();
if (isFocus) caret.killFocus ();
return result;
}
}
| D |
module rocksdb.columnfamily;
import rocksdb.options : rocksdb_options_t, ReadOptions, WriteOptions;
import rocksdb.iterator : Iterator;
import rocksdb.database : Database, rocksdb_t, ensureRocks;
import rocksdb.queryable : Getable, Putable, Removeable;
extern (C) {
struct rocksdb_column_family_handle_t {};
char** rocksdb_list_column_families(const rocksdb_options_t*, const char*, size_t*, char**);
void rocksdb_list_column_families_destroy(char**, size_t);
rocksdb_column_family_handle_t* rocksdb_create_column_family(rocksdb_t*, const rocksdb_options_t*, const char*, char**);
void rocksdb_drop_column_family(rocksdb_t*, rocksdb_column_family_handle_t*, char**);
void rocksdb_column_family_handle_destroy(rocksdb_column_family_handle_t*);
}
class ColumnFamily {
mixin Getable;
mixin Putable;
mixin Removeable;
Database db;
string name;
rocksdb_column_family_handle_t* cf;
this(Database db, string name, rocksdb_column_family_handle_t* cf) {
this.db = db;
this.name = name;
this.cf = cf;
}
Iterator iter(ReadOptions opts = null) {
return new Iterator(this.db, this, opts ? opts : this.db.readOptions);
}
void withIter(void delegate(Iterator) dg, ReadOptions opts = null) {
Iterator iter = this.iter(opts);
scope (exit) destroy(iter);
dg(iter);
}
void drop() {
char* err = null;
rocksdb_drop_column_family(this.db.db, this.cf, &err);
err.ensureRocks();
}
ubyte[][] multiGet(ubyte[][] keys, ReadOptions opts = null) {
return this.db.multiGet(keys, this, opts);
}
string[] multiGetString(string[] keys, ReadOptions opts = null) {
return this.db.multiGetString(keys, this, opts);
}
ubyte[] getImpl(ubyte[] key, ColumnFamily family, ReadOptions opts = null) {
assert(family == this || family is null);
return this.db.getImpl(key, this, opts);
}
void putImpl(ubyte[] key, ubyte[] value, ColumnFamily family, WriteOptions opts = null) {
assert(family == this || family is null);
this.db.putImpl(key, value, this, opts);
}
void removeImpl(ubyte[] key, ColumnFamily family, WriteOptions opts = null) {
assert(family == this || family is null);
this.db.removeImpl(key, this, opts);
}
}
unittest {
import std.stdio : writefln;
import std.datetime : benchmark;
import std.conv : to;
import std.algorithm.searching : startsWith;
import rocksdb.options : DBOptions, CompressionType;
writefln("Testing Column Families");
// DB Options
auto opts = new DBOptions;
opts.createIfMissing = true;
opts.errorIfExists = false;
opts.compression = CompressionType.NONE;
// Create the database (if it does not exist)
auto db = new Database(opts, "test");
string[] columnFamilies = [
"test",
"test1",
"test2",
"test3",
"test4",
"wow",
];
// create a bunch of column families
foreach (cf; columnFamilies) {
if ((cf in db.columnFamilies) is null) {
db.createColumnFamily(cf);
}
}
db.close();
db = new Database(opts, "test");
scope (exit) destroy(db);
// Test column family listing
assert(Database.listColumnFamilies(opts, "test").length == columnFamilies.length + 1);
void testColumnFamily(ColumnFamily cf, int times) {
for (int i = 0; i < times; i++) {
cf.putString(cf.name ~ i.to!string, i.to!string);
}
for (int i = 0; i < times; i++) {
assert(cf.getString(cf.name ~ i.to!string) == i.to!string);
}
cf.withIter((iter) {
foreach (key, value; iter) {
assert(key.startsWith(cf.name));
}
});
}
foreach (name, cf; db.columnFamilies) {
if (name == "default") continue;
writefln(" %s", name);
testColumnFamily(cf, 1000);
}
}
| D |
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
module vtkShortTuple5TN;
static import vtkd_im;
static import core.stdc.config;
static import std.conv;
static import std.string;
static import std.conv;
static import std.string;
class vtkShortTuple5TN {
private void* swigCPtr;
protected bool swigCMemOwn;
public this(void* cObject, bool ownCObject) {
swigCPtr = cObject;
swigCMemOwn = ownCObject;
}
public static void* swigGetCPtr(vtkShortTuple5TN obj) {
return (obj is null) ? null : obj.swigCPtr;
}
mixin vtkd_im.SwigOperatorDefinitions;
~this() {
dispose();
}
public void dispose() {
synchronized(this) {
if (swigCPtr !is null) {
if (swigCMemOwn) {
swigCMemOwn = false;
vtkd_im.delete_vtkShortTuple5TN(cast(void*)swigCPtr);
}
swigCPtr = null;
}
}
}
public this() {
this(vtkd_im.new_vtkShortTuple5TN__SWIG_0(), true);
}
public this(short scalar) {
this(vtkd_im.new_vtkShortTuple5TN__SWIG_1(scalar), true);
}
public this(short* init) {
this(vtkd_im.new_vtkShortTuple5TN__SWIG_2(cast(void*)init), true);
}
public int GetSize() const {
auto ret = vtkd_im.vtkShortTuple5TN_GetSize(cast(void*)swigCPtr);
return ret;
}
public short* GetData() {
auto ret = cast(short*)vtkd_im.vtkShortTuple5TN_GetData__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public short* opIndex(int i) {
auto ret = cast(short*)vtkd_im.vtkShortTuple5TN_opIndex__SWIG_0(cast(void*)swigCPtr, i);
return ret;
}
public short opCall(int i) const {
auto ret = vtkd_im.vtkShortTuple5TN_opCall(cast(void*)swigCPtr, i);
return ret;
}
public bool Compare(vtkShortTuple5TN other, short tol) const {
bool ret = vtkd_im.vtkShortTuple5TN_Compare(cast(void*)swigCPtr, vtkShortTuple5TN.swigGetCPtr(other), tol) ? true : false;
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
return ret;
}
}
| D |
module about_arrays;
import helpers;
import dunit;
class AboutArrays
{
mixin UnitTest;
@Test
void fixed_length_arrays() {
string[4] fruits = ["banana", "mango", "apple", "orange"];
assertEquals(fruits[0], FILL_IN_THIS_STRING);
assertEquals(fruits.length, FILL_IN_THIS_NUMBER);
int[5] b = 1; // 5 elements with same value 1
assertEquals(b, FILL_IN_THIS_ARRAY);
}
@Test
void dynamic_length_arrays() {
string[] fruits = ["banana", "mango"];
assertEquals(fruits.length, FILL_IN_THIS_NUMBER);
fruits ~= "strawberry";
assertEquals(fruits.length, FILL_IN_THIS_NUMBER);
assertEquals(fruits[2], FILL_IN_THIS_STRING);
}
@Test
void array_slicing() {
int[] a = [4, 3, 2, 1];
a[0..2] = [1, 2];
assertEquals(a, FILL_IN_THIS_ARRAY);
a[0..$] = [0, 0, 0, 0]; // $ is always the last element
assertEquals(a, FILL_IN_THIS_ARRAY);
}
@Test
void array_append() {
int [] a;
a.length = 3; // length extended, elements using default value
assertEquals(a, FILL_IN_THIS_ARRAY);
a ~= [3, 4];
assertEquals(a, FILL_IN_THIS_ARRAY);
}
@Test
void slices_of_the_same_array() {
int[] items=[1,1,2,3,5,8,13,21,34,55,89,144];
auto slice1=items[2..9];
auto slice2=items[4..7];
assertEquals(slice1[0],FILL_IN_THIS_NUMBER);
assertEquals(slice2[0],FILL_IN_THIS_NUMBER);
slice1[3]=99;
assertEquals(slice2[1],FILL_IN_THIS_NUMBER);
slice2.length=2; //truncating a slice...
assertEquals(items.length,FILL_IN_THIS_NUMBER); // ... changes original array lenght ?
}
}
| D |
import std.math;
extern(C) int printf(const char*, ...);
string abc;
template Floating(T)
{
T[3] a;
T[3] b;
T[3] c;
T[] A()
{
printf("A\n");
abc ~= "A";
return a;
}
T[] B()
{
printf("B\n");
abc ~= "B";
return b;
}
T[] C()
{
printf("C\n");
abc ~= "C";
return c;
}
T D()
{
printf("D\n");
abc ~= "D";
return 4;
}
void testx()
{
a = [11, 22, 33];
b = [1, 2, 3];
c = [4, 5, 6];
abc = null;
A()[] = B()[] + C()[];
assert(abc == "BCA");
assert(a[0] == 5);
assert(a[1] == 7);
assert(a[2] == 9);
abc = null;
A()[] = B()[] + 4;
assert(abc == "BA");
assert(a[0] == 5);
assert(a[1] == 6);
assert(a[2] == 7);
abc = null;
A()[] = 4 + B()[];
assert(abc == "BA");
assert(a[0] == 5);
assert(a[1] == 6);
assert(a[2] == 7);
abc = null;
A()[] = D() + B()[];
assert(abc == "DBA");
assert(a[0] == 5);
assert(a[1] == 6);
assert(a[2] == 7);
a = [11, 22, 33];
abc = null;
A()[] += B()[];
assert(abc == "BA");
assert(a[0] == 12);
assert(a[1] == 24);
assert(a[2] == 36);
a = [11, 22, 33];
A()[] += 4;
assert(a[0] == 15);
assert(a[1] == 26);
assert(a[2] == 37);
a = [11, 22, 33];
A()[] -= 4;
assert(a[0] == 7);
assert(a[1] == 18);
assert(a[2] == 29);
a = [11, 22, 33];
A()[] *= 4;
assert(a[0] == 44);
assert(a[1] == 88);
assert(a[2] == 132);
a = [4, 8, 32];
A()[] /= 4;
assert(a[0] == 1);
assert(a[1] == 2);
assert(a[2] == 8);
a = [4, 8, 33];
A()[] %= 4;
assert(a[0] == 0);
assert(a[1] == 0);
assert(a[2] == 1);
a = [11, 22, 33];
abc = null;
A()[] += 4 + B()[];
assert(abc == "BA");
assert(a[0] == 16);
assert(a[1] == 28);
assert(a[2] == 40);
abc = null;
A()[] = B()[] - C()[];
assert(abc == "BCA");
printf("%Lg, %Lg, %Lg\n", cast(real)a[0], cast(real)a[1], cast(real)a[2]);
assert(a[0] == -3);
assert(a[1] == -3);
assert(a[2] == -3);
abc = null;
A()[] = -B()[] - C()[];
assert(abc == "BCA");
printf("%Lg, %Lg, %Lg\n", cast(real)a[0], cast(real)a[1], cast(real)a[2]);
assert(a[0] == -5);
assert(a[1] == -7);
assert(a[2] == -9);
abc = null;
A()[] = B()[] + C()[] * 4;
assert(abc == "BCA");
printf("%Lg, %Lg, %Lg\n", cast(real)a[0], cast(real)a[1], cast(real)a[2]);
assert(a[0] == 17);
assert(a[1] == 22);
assert(a[2] == 27);
abc = null;
A()[] = B()[] + C()[] * B()[];
assert(abc == "BCBA");
printf("%Lg, %Lg, %Lg\n", cast(real)a[0], cast(real)a[1], cast(real)a[2]);
assert(a[0] == 5);
assert(a[1] == 12);
assert(a[2] == 21);
abc = null;
A()[] = B()[] + C()[] / 2;
assert(abc == "BCA");
printf("%Lg, %Lg, %Lg\n", cast(real)a[0], cast(real)a[1], cast(real)a[2]);
assert(a[0] == 3);
assert(a[1] == 4.5);
assert(a[2] == 6);
abc = null;
A()[] = B()[] + C()[] % 2;
assert(abc == "BCA");
printf("%Lg, %Lg, %Lg\n", cast(real)a[0], cast(real)a[1], cast(real)a[2]);
assert(a[0] == 1);
assert(a[1] == 3);
assert(a[2] == 3);
}
}
mixin Floating!(float) Ffloat;
mixin Floating!(double) Fdouble;
mixin Floating!(real) Freal;
void test1()
{
Ffloat.testx();
Fdouble.testx();
Freal.testx();
}
/************************************************************************/
template Integral(T)
{
T[3] a;
T[3] b;
T[3] c;
T[] A()
{
printf("A\n");
abc ~= "A";
return a;
}
T[] B()
{
printf("B\n");
abc ~= "B";
return b;
}
T[] C()
{
printf("C\n");
abc ~= "C";
return c;
}
T D()
{
printf("D\n");
abc ~= "D";
return 4;
}
void testx()
{
a = [11, 22, 33];
b = [1, 2, 3];
c = [4, 5, 6];
abc = null;
A()[] = B()[] + C()[];
assert(abc == "BCA");
assert(a[0] == 5);
assert(a[1] == 7);
assert(a[2] == 9);
abc = null;
A()[] = B()[] + 4;
assert(abc == "BA");
assert(a[0] == 5);
assert(a[1] == 6);
assert(a[2] == 7);
abc = null;
A()[] = 4 + B()[];
assert(abc == "BA");
assert(a[0] == 5);
assert(a[1] == 6);
assert(a[2] == 7);
abc = null;
A()[] = D() + B()[];
assert(abc == "DBA");
assert(a[0] == 5);
assert(a[1] == 6);
assert(a[2] == 7);
a = [11, 22, 33];
abc = null;
A()[] += B()[];
assert(abc == "BA");
assert(a[0] == 12);
assert(a[1] == 24);
assert(a[2] == 36);
a = [11, 22, 33];
A()[] += 4;
assert(a[0] == 15);
assert(a[1] == 26);
assert(a[2] == 37);
a = [11, 22, 33];
A()[] -= 4;
assert(a[0] == 7);
assert(a[1] == 18);
assert(a[2] == 29);
a = [11, 22, 27];
A()[] *= 4;
assert(a[0] == 44);
assert(a[1] == 88);
assert(a[2] == 108);
a = [11, 22, 33];
A()[] /= 4;
assert(a[0] == 2);
assert(a[1] == 5);
assert(a[2] == 8);
a = [11, 22, 33];
A()[] %= 4;
assert(a[0] == 3);
assert(a[1] == 2);
assert(a[2] == 1);
a = [1, 2, 7];
A()[] &= 4;
assert(a[0] == 0);
assert(a[1] == 0);
assert(a[2] == 4);
a = [1, 2, 7];
A()[] |= 4;
assert(a[0] == 5);
assert(a[1] == 6);
assert(a[2] == 7);
a = [1, 2, 7];
A()[] ^= 4;
assert(a[0] == 5);
assert(a[1] == 6);
assert(a[2] == 3);
a = [11, 22, 33];
abc = null;
A()[] += 4 + B()[];
assert(abc == "BA");
assert(a[0] == 16);
assert(a[1] == 28);
assert(a[2] == 40);
abc = null;
A()[] = B()[] - C()[];
assert(abc == "BCA");
printf("%lld, %lld, %lld\n", cast(long)a[0], cast(long)a[1], cast(long)a[2]);
assert(a[0] == -3);
assert(a[1] == -3);
assert(a[2] == -3);
abc = null;
A()[] = -B()[] - C()[];
assert(abc == "BCA");
printf("%lld, %lld, %lld\n", cast(long)a[0], cast(long)a[1], cast(long)a[2]);
assert(a[0] == -5);
assert(a[1] == -7);
assert(a[2] == -9);
abc = null;
A()[] = B()[] + C()[] * 4;
assert(abc == "BCA");
printf("%lld, %lld, %lld\n", cast(long)a[0], cast(long)a[1], cast(long)a[2]);
assert(a[0] == 17);
assert(a[1] == 22);
assert(a[2] == 27);
abc = null;
A()[] = B()[] + C()[] * B()[];
assert(abc == "BCBA");
printf("%lld, %lld, %lld\n", cast(long)a[0], cast(long)a[1], cast(long)a[2]);
assert(a[0] == 5);
assert(a[1] == 12);
assert(a[2] == 21);
abc = null;
A()[] = B()[] + C()[] / 2;
assert(abc == "BCA");
printf("%lld, %lld, %lld\n", cast(long)a[0], cast(long)a[1], cast(long)a[2]);
assert(a[0] == 3);
assert(a[1] == 4);
assert(a[2] == 6);
abc = null;
A()[] = B()[] + C()[] % 2;
assert(abc == "BCA");
printf("%lld, %lld, %lld\n", cast(long)a[0], cast(long)a[1], cast(long)a[2]);
assert(a[0] == 1);
assert(a[1] == 3);
assert(a[2] == 3);
abc = null;
A()[] = ~B()[];
assert(abc == "BA");
assert(a[0] == ~cast(T)1);
assert(a[1] == ~cast(T)2);
assert(a[2] == ~cast(T)3);
abc = null;
A()[] = B()[] & 2;
assert(abc == "BA");
assert(a[0] == 0);
assert(a[1] == 2);
assert(a[2] == 2);
abc = null;
A()[] = B()[] | 2;
assert(abc == "BA");
assert(a[0] == 3);
assert(a[1] == 2);
assert(a[2] == 3);
abc = null;
A()[] = B()[] ^ 2;
assert(abc == "BA");
assert(a[0] == 3);
assert(a[1] == 0);
assert(a[2] == 1);
}
}
/************************************************************************/
mixin Integral!(byte) Fbyte;
mixin Integral!(short) Fshort;
mixin Integral!(int) Fint;
mixin Integral!(long) Flong;
void test2()
{
Fbyte.testx();
Fshort.testx();
Fint.testx();
Flong.testx();
}
/************************************************************************/
void test3()
{
auto a = new double[10], b = a.dup, c = a.dup, d = a.dup;
a[] = -(b[] * (c[] + 4)) + 5 * d[] / 3.0;
}
/************************************************************************/
void test4()
{
int[] a, b;
if (a && b) {}
}
/***************************************************/
void test4662()
{
immutable double[] nums = [1.0, 2.0];
static assert(!is(typeof({ nums[] += nums[]; })));
static assert(!is(typeof({ nums[] -= nums[]; })));
static assert(!is(typeof({ nums[] /= nums[]; })));
static assert(!is(typeof({ nums[] += 4; })));
static assert(!is(typeof({ nums[] /= 7; })));
}
/***************************************************/
// 5284
void bug5284_1()
{
class C { int v; }
C [] mda;
immutable(C)[] ida;
static assert(!__traits(compiles, (mda[] = ida[])));
C [1] msa;
immutable(C)[1] isa;
static assert(!__traits(compiles, (msa[] = isa[])));
C m;
immutable(C) i;
static assert(!__traits(compiles, m = i));
}
void bug5284_2a()
{
struct S { int v; }
S [] mda;
immutable(S)[] ida;
mda[] = ida[];
S [1] msa;
immutable(S)[1] isa;
msa[] = isa[];
S m = S();
immutable(S) i = immutable(S)();
m = i;
}
void bug5284_2b()
{
struct S { int v; int[] arr; }
S [] mda;
immutable(S)[] ida;
static assert(!__traits(compiles, (mda[] = ida[])));
S [1] msa;
immutable(S)[1] isa;
static assert(!__traits(compiles, (msa[] = isa[])));
S m;
immutable(S) i;
static assert(!__traits(compiles, m = i));
}
void bug5284_3()
{
int [] ma;
immutable(int)[] ia;
ma[] = ia[];
int m;
immutable(int) i;
m = i;
}
void test5()
{
bug5284_1();
bug5284_2a();
bug5284_2b();
bug5284_3();
}
/************************************************************************/
void test6()
{
int[10] a = [1,2,3,4,5,6,7,8,9,10];
int[10] b;
b = a[] ^^ 2;
assert(b[0] == 1);
assert(b[1] == 4);
assert(b[2] == 9);
assert(b[3] == 16);
assert(b[4] == 25);
assert(b[5] == 36);
assert(b[6] == 49);
assert(b[7] == 64);
assert(b[8] == 81);
assert(b[9] == 100);
int[10] c = 3;
b = a[] ^^ c[];
assert(b[0] == 1);
assert(b[1] == 8);
assert(b[2] == 27);
assert(b[3] == 64);
assert(b[4] == 125);
assert(b[5] == 216);
assert(b[6] == 343);
assert(b[7] == 512);
assert(b[8] == 729);
assert(b[9] == 1000);
}
/************************************************************************/
void test8390() {
const int[] a = new int[5];
int[] b = new int[5];
b[] += a[];
}
/************************************************************************/
// 8651
void test8651()
{
void test(T)() @safe pure nothrow
{
T[3] a = [11, 22, 33];
T[3] b = [1, 2, 3];
T[3] c = [4, 5, 6];
T d = 4;
// Arithmetic array ops
{
a[] = b[] + c[];
a[] = b[] + 4;
a[] = 4 + b[];
a[] = d + b[];
a[] += b[];
a[] += 4;
a[] -= 4;
a[] *= 4;
a[] /= 4;
a[] %= 4;
a[] += 4 + b[];
a[] = b[] - c[];
a[] = -b[] - c[];
a[] = b[] + c[] * 4;
a[] = b[] + c[] * b[];
a[] = b[] + c[] / 2;
a[] = b[] + c[] % 2;
}
// Bitwise array ops
static if (is(typeof(T.init & T.init)))
{
a[] &= 4;
a[] |= 4;
a[] ^= 4;
a[] = ~b[];
a[] = b[] & 2;
a[] = b[] | 2;
a[] = b[] ^ 2;
}
}
test!float();
test!double();
test!real();
test!byte();
test!short();
test!int();
test!long();
}
/************************************************************************/
// 9656
void test9656()
{
static class C {}
static struct S
{
immutable int[] narr1;
immutable int[] narr2;
immutable C[] carr1;
immutable C[] carr2;
this(int n) {
narr1 = new int[](3); // OK, expected
narr2 = [1,2,3].dup; // NG -> OK
carr1 = [new C].dup; // NG -> OK
C c = new C;
static assert(!__traits(compiles, carr2 = [c]));
}
}
{
int[] ma = [1,2,3];
immutable ia = ma.dup;
}
{
static struct V { int val; }
V[] ma = [V(1), V(2)];
immutable ia = ma.dup;
}
{
static struct R { int* ptr; }
R[] ma = [R(new int), R(null)];
static assert(!__traits(compiles, { immutable ia = rarr.dup; }));
}
{
C[] ma = [new C(), new C()];
static assert(!__traits(compiles, { immutable ia = carr.dup; }));
}
}
/************************************************************************/
// 10433
void test10433()
{
void foo(T)(in int[] v1, in T v2)
{
int[2] r;
r[] = v1[] + v2[];
}
immutable int[] v = [10, 20];
foo(v, v);
}
/************************************************************************/
// 10684
void test10684a()
{
int[] a = [0, 0];
a[] += [10, 20][];
}
void test10684b()
{
int[] a = [1, 2, 3];
int[] b = [4, 5, 6];
// Allow array literal as the operand of array oeration
a[] += [1, 2, 3];
assert(a == [2, 4, 6]);
a[] *= b[] + [1, 1, 1];
assert(a == [2*(4+1), 4*(5+1), 6*(6+1)]);
a[] = [9, 8, 7] - [1, 2, 3];
assert(a == [8, 6, 4]);
a[] = [2, 4, 6] / 2;
assert(a == [1,2,3]);
// Disallow: [1,2,3] is not an lvalue
static assert(!__traits(compiles, { [1,2,3] = a[] * 2; }));
static assert(!__traits(compiles, { [1,2,3] += a[] * b[]; }));
}
/************************************************************************/
// 11376
template TL11376(T...)
{
alias TL11376 = T;
}
auto sumArrs11376(T0, T1)(T0[] a, T1[] b)
{
a[] += b[]; //no ICE without this line
return a;
}
static assert(!__traits(compiles, sumArrs11376(TL11376!(string[], string).init)));
/************************************************************************/
int main()
{
test1();
test2();
test3();
test4();
test5();
test6();
test8390();
test8651();
test9656();
test10433();
test10684a();
test10684b();
printf("Success\n");
return 0;
}
version (none)
{
extern (C) T[] _arraySliceSliceAddSliceAssignd(T[] a, T[] c, T[] b)
{
foreach (i; 0 .. a.length)
a[i] = b[i] + c[i];
return a;
}
}
| D |
module auxil;
nothrow @nogc extern(C):
import glob_opts;
import types;
import osqp; // For OSQP rho update
import proj;
import lin_alg;
import constants;
import scaling;
import util;
/***********************************************************
* Auxiliary functions needed to compute ADMM iterations * *
***********************************************************/
version (EMBEDDED_1) {}
else {
c_float compute_rho_estimate(OSQPWorkspace *work) {
c_int n, m; // Dimensions
c_float pri_res, dua_res; // Primal and dual residuals
c_float pri_res_norm, dua_res_norm; // Normalization for the residuals
c_float temp_res_norm; // Temporary residual norm
c_float rho_estimate; // Rho estimate value
// Get problem dimensions
n = work.data.n;
m = work.data.m;
// Get primal and dual residuals
pri_res = vec_norm_inf(work.z_prev, m);
dua_res = vec_norm_inf(work.x_prev, n);
// Normalize primal residual
pri_res_norm = vec_norm_inf(work.z, m); // ||z||
temp_res_norm = vec_norm_inf(work.Ax, m); // ||Ax||
pri_res_norm = c_max(pri_res_norm, temp_res_norm); // max (||z||,||Ax||)
pri_res /= (pri_res_norm + 1e-10); // Normalize primal
// residual (prevent 0
// division)
// Normalize dual residual
dua_res_norm = vec_norm_inf(work.data.q, n); // ||q||
temp_res_norm = vec_norm_inf(work.Aty, n); // ||A' y||
dua_res_norm = c_max(dua_res_norm, temp_res_norm);
temp_res_norm = vec_norm_inf(work.Px, n); // ||P x||
dua_res_norm = c_max(dua_res_norm, temp_res_norm); // max(||q||,||A' y||,||P
// x||)
dua_res /= (dua_res_norm + 1e-10); // Normalize dual residual
// (prevent 0 division)
// Return rho estimate
rho_estimate = work.settings.rho * c_sqrt(pri_res / (dua_res + 1e-10)); // (prevent
// 0
// division)
rho_estimate = c_min(c_max(rho_estimate, RHO_MIN), RHO_MAX); // Constrain
// rho
// values
return rho_estimate;
}
c_int adapt_rho(OSQPWorkspace *work) {
c_int exitflag; // Exitflag
c_float rho_new; // New rho value
exitflag = 0; // Initialize exitflag to 0
// Compute new rho
rho_new = compute_rho_estimate(work);
// Set rho estimate in info
work.info.rho_estimate = rho_new;
// Check if the new rho is large or small enough and update it in case
if ((rho_new > work.settings.rho * work.settings.adaptive_rho_tolerance) ||
(rho_new < work.settings.rho / work.settings.adaptive_rho_tolerance)) {
exitflag = osqp_update_rho(work, rho_new);
work.info.rho_updates += 1;
}
return exitflag;
}
void set_rho_vec(OSQPWorkspace *work) {
c_int i;
work.settings.rho = c_min(c_max(work.settings.rho, RHO_MIN), RHO_MAX);
for (i = 0; i < work.data.m; i++) {
if ((work.data.l[i] < -OSQP_INFTY * MIN_SCALING) &&
(work.data.u[i] > OSQP_INFTY * MIN_SCALING)) {
// Loose bounds
work.constr_type[i] = -1;
work.rho_vec[i] = RHO_MIN;
} else if (work.data.u[i] - work.data.l[i] < RHO_TOL) {
// Equality constraints
work.constr_type[i] = 1;
work.rho_vec[i] = RHO_EQ_OVER_RHO_INEQ * work.settings.rho;
} else {
// Inequality constraints
work.constr_type[i] = 0;
work.rho_vec[i] = work.settings.rho;
}
work.rho_inv_vec[i] = 1. / work.rho_vec[i];
}
}
c_int update_rho_vec(OSQPWorkspace *work) {
c_int i, exitflag, constr_type_changed;
exitflag = 0;
constr_type_changed = 0;
for (i = 0; i < work.data.m; i++) {
if ((work.data.l[i] < -OSQP_INFTY * MIN_SCALING) &&
(work.data.u[i] > OSQP_INFTY * MIN_SCALING)) {
// Loose bounds
if (work.constr_type[i] != -1) {
work.constr_type[i] = -1;
work.rho_vec[i] = RHO_MIN;
work.rho_inv_vec[i] = 1. / RHO_MIN;
constr_type_changed = 1;
}
} else if (work.data.u[i] - work.data.l[i] < RHO_TOL) {
// Equality constraints
if (work.constr_type[i] != 1) {
work.constr_type[i] = 1;
work.rho_vec[i] = RHO_EQ_OVER_RHO_INEQ * work.settings.rho;
work.rho_inv_vec[i] = 1. / work.rho_vec[i];
constr_type_changed = 1;
}
} else {
// Inequality constraints
if (work.constr_type[i] != 0) {
work.constr_type[i] = 0;
work.rho_vec[i] = work.settings.rho;
work.rho_inv_vec[i] = 1. / work.settings.rho;
constr_type_changed = 1;
}
}
}
// Update rho_vec in KKT matrix if constraints type has changed
if (constr_type_changed == 1) {
exitflag = work.linsys_solver.update_rho_vec(work.linsys_solver,
work.rho_vec);
}
return exitflag;
}
} // EMBEDDED != 1
void swap_vectors(c_float **a, c_float **b) {
c_float *temp;
temp = *b;
*b = *a;
*a = temp;
}
void cold_start(OSQPWorkspace *work) {
vec_set_scalar(work.x, 0., work.data.n);
vec_set_scalar(work.z, 0., work.data.m);
vec_set_scalar(work.y, 0., work.data.m);
}
static void compute_rhs(OSQPWorkspace *work) {
c_int i; // Index
for (i = 0; i < work.data.n; i++) {
// Cycle over part related to x variables
work.xz_tilde[i] = work.settings.sigma * work.x_prev[i] -
work.data.q[i];
}
for (i = 0; i < work.data.m; i++) {
// Cycle over dual variable in the first step (nu)
work.xz_tilde[i + work.data.n] = work.z_prev[i] - work.rho_inv_vec[i] *
work.y[i];
}
}
void update_xz_tilde(OSQPWorkspace *work) {
// Compute right-hand side
compute_rhs(work);
// Solve linear system
work.linsys_solver.solve(work.linsys_solver, work.xz_tilde);
}
void update_x(OSQPWorkspace *work) {
c_int i;
// update x
for (i = 0; i < work.data.n; i++) {
work.x[i] = work.settings.alpha * work.xz_tilde[i] +
(cast(c_float)1.0 - work.settings.alpha) * work.x_prev[i];
}
// update delta_x
for (i = 0; i < work.data.n; i++) {
work.delta_x[i] = work.x[i] - work.x_prev[i];
}
}
void update_z(OSQPWorkspace *work) {
c_int i;
// update z
for (i = 0; i < work.data.m; i++) {
work.z[i] = work.settings.alpha * work.xz_tilde[i + work.data.n] +
(cast(c_float)1.0 - work.settings.alpha) * work.z_prev[i] +
work.rho_inv_vec[i] * work.y[i];
}
// project z
project(work, work.z);
}
void update_y(OSQPWorkspace *work) {
c_int i; // Index
for (i = 0; i < work.data.m; i++) {
work.delta_y[i] = work.rho_vec[i] *
(work.settings.alpha *
work.xz_tilde[i + work.data.n] +
(cast(c_float)1.0 - work.settings.alpha) * work.z_prev[i] -
work.z[i]);
work.y[i] += work.delta_y[i];
}
}
c_float compute_obj_val(OSQPWorkspace *work, c_float *x) {
c_float obj_val;
obj_val = quad_form(work.data.P, x) +
vec_prod(work.data.q, x, work.data.n);
if (work.settings.scaling) {
obj_val *= work.scaling.cinv;
}
return obj_val;
}
c_float compute_pri_res(OSQPWorkspace *work, c_float *x, c_float *z) {
// NB: Use z_prev as working vector
// pr = Ax - z
mat_vec(work.data.A, x, work.Ax, 0); // Ax
vec_add_scaled(work.z_prev, work.Ax, z, work.data.m, -1);
// If scaling active . rescale residual
if (work.settings.scaling && !work.settings.scaled_termination) {
return vec_scaled_norm_inf(work.scaling.Einv, work.z_prev, work.data.m);
}
// Return norm of the residual
return vec_norm_inf(work.z_prev, work.data.m);
}
c_float compute_pri_tol(OSQPWorkspace *work, c_float eps_abs, c_float eps_rel) {
c_float max_rel_eps, temp_rel_eps;
// max_rel_eps = max(||z||, ||A x||)
if (work.settings.scaling && !work.settings.scaled_termination) {
// ||Einv * z||
max_rel_eps =
vec_scaled_norm_inf(work.scaling.Einv, work.z, work.data.m);
// ||Einv * A * x||
temp_rel_eps = vec_scaled_norm_inf(work.scaling.Einv,
work.Ax,
work.data.m);
// Choose maximum
max_rel_eps = c_max(max_rel_eps, temp_rel_eps);
} else { // No unscaling required
// ||z||
max_rel_eps = vec_norm_inf(work.z, work.data.m);
// ||A * x||
temp_rel_eps = vec_norm_inf(work.Ax, work.data.m);
// Choose maximum
max_rel_eps = c_max(max_rel_eps, temp_rel_eps);
}
// eps_prim
return eps_abs + eps_rel * max_rel_eps;
}
c_float compute_dua_res(OSQPWorkspace *work, c_float *x, c_float *y) {
// NB: Use x_prev as temporary vector
// NB: Only upper triangular part of P is stored.
// dr = q + A'*y + P*x
// dr = q
prea_vec_copy(work.data.q, work.x_prev, work.data.n);
// P * x (upper triangular part)
mat_vec(work.data.P, x, work.Px, 0);
// P' * x (lower triangular part with no diagonal)
mat_tpose_vec(work.data.P, x, work.Px, 1, 1);
// dr += P * x (full P matrix)
vec_add_scaled(work.x_prev, work.x_prev, work.Px, work.data.n, 1);
// dr += A' * y
if (work.data.m > 0) {
mat_tpose_vec(work.data.A, y, work.Aty, 0, 0);
vec_add_scaled(work.x_prev, work.x_prev, work.Aty, work.data.n, 1);
}
// If scaling active . rescale residual
if (work.settings.scaling && !work.settings.scaled_termination) {
return work.scaling.cinv * vec_scaled_norm_inf(work.scaling.Dinv,
work.x_prev,
work.data.n);
}
return vec_norm_inf(work.x_prev, work.data.n);
}
c_float compute_dua_tol(OSQPWorkspace *work, c_float eps_abs, c_float eps_rel) {
c_float max_rel_eps, temp_rel_eps;
// max_rel_eps = max(||q||, ||A' y|, ||P x||)
if (work.settings.scaling && !work.settings.scaled_termination) {
// || Dinv q||
max_rel_eps = vec_scaled_norm_inf(work.scaling.Dinv,
work.data.q,
work.data.n);
// || Dinv A' y ||
temp_rel_eps = vec_scaled_norm_inf(work.scaling.Dinv,
work.Aty,
work.data.n);
max_rel_eps = c_max(max_rel_eps, temp_rel_eps);
// || Dinv P x||
temp_rel_eps = vec_scaled_norm_inf(work.scaling.Dinv,
work.Px,
work.data.n);
max_rel_eps = c_max(max_rel_eps, temp_rel_eps);
// Multiply by cinv
max_rel_eps *= work.scaling.cinv;
} else { // No scaling required
// ||q||
max_rel_eps = vec_norm_inf(work.data.q, work.data.n);
// ||A'*y||
temp_rel_eps = vec_norm_inf(work.Aty, work.data.n);
max_rel_eps = c_max(max_rel_eps, temp_rel_eps);
// ||P*x||
temp_rel_eps = vec_norm_inf(work.Px, work.data.n);
max_rel_eps = c_max(max_rel_eps, temp_rel_eps);
}
// eps_dual
return eps_abs + eps_rel * max_rel_eps;
}
c_int is_primal_infeasible(OSQPWorkspace *work, c_float eps_prim_inf) {
// This function checks for the primal infeasibility termination criteria.
//
// 1) A' * delta_y < eps * ||delta_y||
//
// 2) u'*max(delta_y, 0) + l'*min(delta_y, 0) < -eps * ||delta_y||
//
c_int i; // Index for loops
c_float norm_delta_y;
c_float ineq_lhs = 0.0;
// Project delta_y onto the polar of the recession cone of [l,u]
for (i = 0; i < work.data.m; i++) {
if (work.data.u[i] > OSQP_INFTY * MIN_SCALING) { // Infinite upper bound
if (work.data.l[i] < -OSQP_INFTY * MIN_SCALING) { // Infinite lower bound
// Both bounds infinite
work.delta_y[i] = 0.0;
} else {
// Only upper bound infinite
work.delta_y[i] = c_min(work.delta_y[i], 0.0);
}
} else if (work.data.l[i] < -OSQP_INFTY * MIN_SCALING) { // Infinite lower bound
// Only lower bound infinite
work.delta_y[i] = c_max(work.delta_y[i], 0.0);
}
}
// Compute infinity norm of delta_y (unscale if necessary)
if (work.settings.scaling && !work.settings.scaled_termination) {
// Use work.Adelta_x as temporary vector
vec_ew_prod(work.scaling.E, work.delta_y, work.Adelta_x, work.data.m);
norm_delta_y = vec_norm_inf(work.Adelta_x, work.data.m);
} else {
norm_delta_y = vec_norm_inf(work.delta_y, work.data.m);
}
if (norm_delta_y > eps_prim_inf) { // ||delta_y|| > 0
for (i = 0; i < work.data.m; i++) {
ineq_lhs += work.data.u[i] * c_max(work.delta_y[i], 0) + work.data.l[i] * c_min(work.delta_y[i], 0);
}
// Check if the condition is satisfied: ineq_lhs < -eps
if (ineq_lhs < -eps_prim_inf * norm_delta_y) {
// Compute and return ||A'delta_y|| < eps_prim_inf
mat_tpose_vec(work.data.A, work.delta_y, work.Atdelta_y, 0, 0);
// Unscale if necessary
if (work.settings.scaling && !work.settings.scaled_termination) {
vec_ew_prod(work.scaling.Dinv,
work.Atdelta_y,
work.Atdelta_y,
work.data.n);
}
return vec_norm_inf(work.Atdelta_y, work.data.n) < eps_prim_inf * norm_delta_y;
}
}
// Conditions not satisfied . not primal infeasible
return 0;
}
c_int is_dual_infeasible(OSQPWorkspace *work, c_float eps_dual_inf) {
// This function checks for the scaled dual infeasibility termination
// criteria.
//
// 1) q * delta_x < - eps * || delta_x ||
//
// 2) ||P * delta_x || < eps * || delta_x ||
//
// 3) . (A * delta_x)_i > -eps * || delta_x ||, l_i != -inf
// . (A * delta_x)_i < eps * || delta_x ||, u_i != inf
//
c_int i; // Index for loops
c_float norm_delta_x;
c_float cost_scaling;
// Compute norm of delta_x
if (work.settings.scaling && !work.settings.scaled_termination) { // Unscale
// if
// necessary
norm_delta_x = vec_scaled_norm_inf(work.scaling.D,
work.delta_x,
work.data.n);
cost_scaling = work.scaling.c;
} else {
norm_delta_x = vec_norm_inf(work.delta_x, work.data.n);
cost_scaling = 1.0;
}
// Prevent 0 division || delta_x || > 0
if (norm_delta_x > eps_dual_inf) {
// Normalize delta_x by its norm
/* vec_mult_scalar(work.delta_x, 1./norm_delta_x, work.data.n); */
// Check first if q'*delta_x < 0
if (vec_prod(work.data.q, work.delta_x, work.data.n) <
-cost_scaling * eps_dual_inf * norm_delta_x) {
// Compute product P * delta_x (NB: P is store in upper triangular form)
mat_vec(work.data.P, work.delta_x, work.Pdelta_x, 0);
mat_tpose_vec(work.data.P, work.delta_x, work.Pdelta_x, 1, 1);
// Scale if necessary
if (work.settings.scaling && !work.settings.scaled_termination) {
vec_ew_prod(work.scaling.Dinv,
work.Pdelta_x,
work.Pdelta_x,
work.data.n);
}
// Check if || P * delta_x || = 0
if (vec_norm_inf(work.Pdelta_x, work.data.n) <
cost_scaling * eps_dual_inf * norm_delta_x) {
// Compute A * delta_x
mat_vec(work.data.A, work.delta_x, work.Adelta_x, 0);
// Scale if necessary
if (work.settings.scaling && !work.settings.scaled_termination) {
vec_ew_prod(work.scaling.Einv,
work.Adelta_x,
work.Adelta_x,
work.data.m);
}
// De Morgan Law Applied to dual infeasibility conditions for A * x
// NB: Note that MIN_SCALING is used to adjust the infinity value
// in case the problem is scaled.
for (i = 0; i < work.data.m; i++) {
if (((work.data.u[i] < OSQP_INFTY * MIN_SCALING) &&
(work.Adelta_x[i] > eps_dual_inf * norm_delta_x)) ||
((work.data.l[i] > -OSQP_INFTY * MIN_SCALING) &&
(work.Adelta_x[i] < -eps_dual_inf * norm_delta_x))) {
// At least one condition not satisfied . not dual infeasible
return 0;
}
}
// All conditions passed . dual infeasible
return 1;
}
}
}
// Conditions not satisfied . not dual infeasible
return 0;
}
c_int has_solution(OSQPInfo * info){
return ((info.status_val != OSQP_PRIMAL_INFEASIBLE) &&
(info.status_val != OSQP_PRIMAL_INFEASIBLE_INACCURATE) &&
(info.status_val != OSQP_DUAL_INFEASIBLE) &&
(info.status_val != OSQP_DUAL_INFEASIBLE_INACCURATE) &&
(info.status_val != OSQP_NON_CVX));
}
void store_solution(OSQPWorkspace *work) {
version (EMBEDDED){}
else {
c_float norm_vec;
} /* ifndef EMBEDDED */
if (has_solution(work.info)) {
prea_vec_copy(work.x, work.solution.x, work.data.n); // primal
prea_vec_copy(work.y, work.solution.y, work.data.m); // dual
// Unscale solution if scaling has been performed
if (work.settings.scaling)
unscale_solution(work);
} else {
// No solution present. Solution is NaN
vec_set_scalar(work.solution.x, OSQP_NAN, work.data.n);
vec_set_scalar(work.solution.y, OSQP_NAN, work.data.m);
version (EMBEDDED){}
else {
// Normalize infeasibility certificates if embedded is off
// NB: It requires a division
if ((work.info.status_val == OSQP_PRIMAL_INFEASIBLE) ||
((work.info.status_val == OSQP_PRIMAL_INFEASIBLE_INACCURATE))) {
norm_vec = vec_norm_inf(work.delta_y, work.data.m);
vec_mult_scalar(work.delta_y, 1. / norm_vec, work.data.m);
}
if ((work.info.status_val == OSQP_DUAL_INFEASIBLE) ||
((work.info.status_val == OSQP_DUAL_INFEASIBLE_INACCURATE))) {
norm_vec = vec_norm_inf(work.delta_x, work.data.n);
vec_mult_scalar(work.delta_x, 1. / norm_vec, work.data.n);
}
} /* ifndef EMBEDDED */
// Cold start iterates to 0 for next runs (they cannot start from NaN)
cold_start(work);
}
}
void update_info(OSQPWorkspace *work,
c_int iter,
c_int compute_objective,
c_int polish)
{
c_float *x;
c_float *z;
c_float *y; // Allocate pointers to variables
c_float *obj_val;
c_float *pri_res;
c_float *dua_res; // objective value, residuals
version(PROFILING){
c_float *run_time; // Execution time
} /* ifdef PROFILING */
version (EMBEDDED){
x = work.x;
y = work.y;
z = work.z;
obj_val = &work.info.obj_val;
pri_res = &work.info.pri_res;
dua_res = &work.info.dua_res;
work.info.iter = iter; // Update iteration number
version(PROFILING){
run_time = &work.info.solve_time;
} /* ifdef PROFILING */
}
else {
if (polish) {
x = work.pol.x;
y = work.pol.y;
z = work.pol.z;
obj_val = &work.pol.obj_val;
pri_res = &work.pol.pri_res;
dua_res = &work.pol.dua_res;
version(PROFILING){
run_time = &work.info.polish_time;
} /* ifdef PROFILING */
} else {
x = work.x;
y = work.y;
z = work.z;
obj_val = &work.info.obj_val;
pri_res = &work.info.pri_res;
dua_res = &work.info.dua_res;
work.info.iter = iter; // Update iteration number
version(PROFILING){
run_time = &work.info.solve_time;
} /* ifdef PROFILING */
}
} // EMBEDDED
// Compute the objective if needed
if (compute_objective) {
*obj_val = compute_obj_val(work, x);
}
// Compute primal residual
if (work.data.m == 0) {
// No constraints . Always primal feasible
*pri_res = 0.;
} else {
*pri_res = compute_pri_res(work, x, z);
}
// Compute dual residual
*dua_res = compute_dua_res(work, x, y);
// Update timing
version(PROFILING){
*run_time = osqp_toc(work.timer);
} /* ifdef PROFILING */
version(PRINTING){
work.summary_printed = 0; // The just updated info have not been printed
} /* ifdef PRINTING */
}
void update_status(OSQPInfo *info, c_int status_val);
void reset_info(OSQPInfo *info) {
version(PROFILING){
// Initialize info values.
info.solve_time = 0.0; // Solve time to zero
version(EMBEDDED){}
else {
info.polish_time = 0.0; // Polish time to zero
} /* ifndef EMBEDDED */
// NB: We do not reset the setup_time because it is performed only once
} /* ifdef PROFILING */
update_status(info, OSQP_UNSOLVED); // Problem is unsolved
version(EMBEDDED_1){}
else {
info.rho_updates = 0; // Rho updates are now 0
} /* if EMBEDDED != 1 */
}
version(PROFILING){
void update_status(OSQPInfo *info, c_int status_val) {
// Update status value
info.status_val = status_val;
// Update status string depending on status val
if (status_val == OSQP_SOLVED) c_strcpy(info.status.ptr, "solved");
if (status_val == OSQP_SOLVED_INACCURATE) c_strcpy(info.status.ptr, "solved inaccurate");
else if (status_val == OSQP_PRIMAL_INFEASIBLE) c_strcpy(info.status.ptr, "primal infeasible");
else if (status_val == OSQP_PRIMAL_INFEASIBLE_INACCURATE) c_strcpy(info.status.ptr, "primal infeasible inaccurate");
else if (status_val == OSQP_UNSOLVED) c_strcpy(info.status.ptr, "unsolved");
else if (status_val == OSQP_DUAL_INFEASIBLE) c_strcpy(info.status.ptr,"dual infeasible");
else if (status_val == OSQP_DUAL_INFEASIBLE_INACCURATE) c_strcpy(info.status.ptr, "dual infeasible inaccurate");
else if (status_val == OSQP_MAX_ITER_REACHED) c_strcpy(info.status.ptr, "maximum iterations reached");
else if (status_val == OSQP_TIME_LIMIT_REACHED) c_strcpy(info.status.ptr, "run time limit reached");
else if (status_val == OSQP_SIGINT) c_strcpy(info.status.ptr, "interrupted");
else if (status_val == OSQP_NON_CVX) c_strcpy(info.status.ptr, "problem non convex");
}
}
else {
void update_status(OSQPInfo *info, c_int status_val) {
// Update status value
info.status_val = status_val;
// Update status string depending on status val
if (status_val == OSQP_SOLVED) c_strcpy(info.status.ptr, "solved");
if (status_val == OSQP_SOLVED_INACCURATE) c_strcpy(info.status.ptr,
"solved inaccurate");
else if (status_val == OSQP_PRIMAL_INFEASIBLE) c_strcpy(info.status.ptr,
"primal infeasible");
else if (status_val == OSQP_PRIMAL_INFEASIBLE_INACCURATE) c_strcpy(info.status.ptr,
"primal infeasible inaccurate");
else if (status_val == OSQP_UNSOLVED) c_strcpy(info.status.ptr, "unsolved");
else if (status_val == OSQP_DUAL_INFEASIBLE) c_strcpy(info.status.ptr,
"dual infeasible");
else if (status_val == OSQP_DUAL_INFEASIBLE_INACCURATE) c_strcpy(info.status.ptr,
"dual infeasible inaccurate");
else if (status_val == OSQP_MAX_ITER_REACHED) c_strcpy(info.status.ptr,
"maximum iterations reached");
else if (status_val == OSQP_SIGINT) c_strcpy(info.status.ptr, "interrupted");
else if (status_val == OSQP_NON_CVX) c_strcpy(info.status.ptr, "problem non convex");
}
}
c_int check_termination(OSQPWorkspace *work, c_int approximate) {
c_float eps_prim, eps_dual, eps_prim_inf, eps_dual_inf;
c_int exitflag;
c_int prim_res_check, dual_res_check, prim_inf_check, dual_inf_check;
c_float eps_abs, eps_rel;
// Initialize variables to 0
exitflag = 0;
prim_res_check = 0; dual_res_check = 0;
prim_inf_check = 0; dual_inf_check = 0;
// Initialize tolerances
eps_abs = work.settings.eps_abs;
eps_rel = work.settings.eps_rel;
eps_prim_inf = work.settings.eps_prim_inf;
eps_dual_inf = work.settings.eps_dual_inf;
// If residuals are too large, the problem is probably non convex
if ((work.info.pri_res > OSQP_INFTY) ||
(work.info.dua_res > OSQP_INFTY)){
// Looks like residuals are diverging. Probably the problem is non convex!
// Terminate and report it
update_status(work.info, OSQP_NON_CVX);
work.info.obj_val = OSQP_NAN;
return 1;
}
// If approximate solution required, increase tolerances by 10
if (approximate) {
eps_abs *= 10;
eps_rel *= 10;
eps_prim_inf *= 10;
eps_dual_inf *= 10;
}
// Check residuals
if (work.data.m == 0) {
prim_res_check = 1; // No constraints . Primal feasibility always satisfied
}
else {
// Compute primal tolerance
eps_prim = compute_pri_tol(work, eps_abs, eps_rel);
// Primal feasibility check
if (work.info.pri_res < eps_prim) {
prim_res_check = 1;
} else {
// Primal infeasibility check
prim_inf_check = is_primal_infeasible(work, eps_prim_inf);
}
} // End check if m == 0
// Compute dual tolerance
eps_dual = compute_dua_tol(work, eps_abs, eps_rel);
// Dual feasibility check
if (work.info.dua_res < eps_dual) {
dual_res_check = 1;
} else {
// Check dual infeasibility
dual_inf_check = is_dual_infeasible(work, eps_dual_inf);
}
// Compare checks to determine solver status
if (prim_res_check && dual_res_check) {
// Update final information
if (approximate) {
update_status(work.info, OSQP_SOLVED_INACCURATE);
} else {
update_status(work.info, OSQP_SOLVED);
}
exitflag = 1;
}
else if (prim_inf_check) {
// Update final information
if (approximate) {
update_status(work.info, OSQP_PRIMAL_INFEASIBLE_INACCURATE);
} else {
update_status(work.info, OSQP_PRIMAL_INFEASIBLE);
}
if (work.settings.scaling && !work.settings.scaled_termination) {
// Update infeasibility certificate
vec_ew_prod(work.scaling.E, work.delta_y, work.delta_y, work.data.m);
}
work.info.obj_val = OSQP_INFTY;
exitflag = 1;
}
else if (dual_inf_check) {
// Update final information
if (approximate) {
update_status(work.info, OSQP_DUAL_INFEASIBLE_INACCURATE);
} else {
update_status(work.info, OSQP_DUAL_INFEASIBLE);
}
if (work.settings.scaling && !work.settings.scaled_termination) {
// Update infeasibility certificate
vec_ew_prod(work.scaling.D, work.delta_x, work.delta_x, work.data.n);
}
work.info.obj_val = -OSQP_INFTY;
exitflag = 1;
}
return exitflag;
}
version(EMBEDDED){}
else {
c_int validate_data(const OSQPData *data) {
c_int j;
c_int ptr;
if (!data) {
version(PRINTING){
c_eprint("ERROR in %s: Missing data\n", __FUNCTION__.ptr);
}
return 1;
}
if (!(data.P)) {
version(PRINTING){
c_eprint("ERROR in %s: Missing matrix P\n", __FUNCTION__.ptr);
}
return 1;
}
if (!(data.A)) {
version(PRINTING){
c_eprint("ERROR in %s: Missing matrix A\n", __FUNCTION__.ptr);
}
return 1;
}
// General dimensions Tests
if ((data.n <= 0) || (data.m < 0)) {
version(PRINTING){
c_eprint("ERROR in %s: n must be positive and m nonnegative; n = %i, m = %i\n", __FUNCTION__.ptr,
cast(int)data.n, cast(int)data.m);
} /* ifdef PRINTING */
return 1;
}
// Matrix P
if (data.P.m != data.n) {
version(PRINTING){
c_eprint("ERROR in %s: P does not have dimension n x n with n = %i\n", __FUNCTION__.ptr, cast(int)data.n);
} /* ifdef PRINTING */
return 1;
}
if (data.P.m != data.P.n) {
version(PRINTING){
c_eprint("ERROR in %s: P is not square\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
for (j = 0; j < data.n; j++) { // COLUMN
for (ptr = data.P.p[j]; ptr < data.P.p[j + 1]; ptr++) {
if (data.P.i[ptr] > j) { // if ROW > COLUMN
version(PRINTING){
c_eprint("ERROR in %s: P is not upper triangular\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
}
}
// Matrix A
if ((data.A.m != data.m) || (data.A.n != data.n)) {
version(PRINTING){
c_eprint("ERROR in %s: A does not have dimension %i x %i\n", __FUNCTION__.ptr, cast(int)data.m, cast(int)data.n);
} /* ifdef PRINTING */
return 1;
}
// Lower and upper bounds
for (j = 0; j < data.m; j++) {
if (data.l[j] > data.u[j]) {
version(PRINTING){
c_eprint("ERROR in %s: Lower bound at index %d is greater than upper bound: %.4e > %.4e\n", __FUNCTION__.ptr,
cast(int)j, data.l[j], data.u[j]);
} /* ifdef PRINTING */
return 1;
}
}
// TODO: Complete with other checks
return 0;
}
c_int validate_linsys_solver(c_int linsys_solver) {
if ((linsys_solver != QDLDL_SOLVER) &&
(linsys_solver != MKL_PARDISO_SOLVER)) {
return 1;
}
// TODO: Add more solvers in case
// Valid solver
return 0;
}
c_int validate_settings(const OSQPSettings *settings) {
if (!settings) {
version(PRINTING){
c_eprint("ERROR in %s: Missing settings!\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if (settings.scaling < 0) {
version(PRINTING){
c_eprint("ERROR in %s: scaling must be nonnegative\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if ((settings.adaptive_rho != 0) && (settings.adaptive_rho != 1)) {
version(PRINTING){
c_eprint("ERROR in %s: adaptive_rho must be either 0 or 1\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if (settings.adaptive_rho_interval < 0) {
version(PRINTING){
c_eprint("ERROR in %s: adaptive_rho_interval must be nonnegative\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
version(PROFILING){
if (settings.adaptive_rho_fraction <= 0) {
version(PRINTING){
c_eprint("ERROR in %s: adaptive_rho_fraction must be positive\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
} /* ifdef PROFILING */
if (settings.adaptive_rho_tolerance < 1.0) {
version(PRINTING){
c_eprint("ERROR in %s: adaptive_rho_tolerance must be >= 1\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if (settings.polish_refine_iter < 0) {
version(PRINTING){
c_eprint("ERROR in %s: polish_refine_iter must be nonnegative\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if (settings.rho <= 0.0) {
version(PRINTING){
c_eprint("ERROR in %s: rho must be positive\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if (settings.sigma <= 0.0) {
version(PRINTING){
c_eprint("ERROR in %s: sigma must be positive\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if (settings.delta <= 0.0) {
version(PRINTING){
c_eprint("ERROR in %s: delta must be positive\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if (settings.max_iter <= 0) {
version(PRINTING){
c_eprint("ERROR in %s: max_iter must be positive\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if (settings.eps_abs < 0.0) {
version(PRINTING){
c_eprint("ERROR in %s: eps_abs must be nonnegative\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if (settings.eps_rel < 0.0) {
version(PRINTING){
c_eprint("ERROR in %s: eps_rel must be nonnegative\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if ((settings.eps_rel == 0.0) &&
(settings.eps_abs == 0.0)) {
version(PRINTING){
c_eprint("ERROR in %s: at least one of eps_abs and eps_rel must be positive\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if (settings.eps_prim_inf <= 0.0) {
version(PRINTING){
c_eprint("ERROR in %s: eps_prim_inf must be positive\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if (settings.eps_dual_inf <= 0.0) {
version(PRINTING){
c_eprint("ERROR in %s: eps_dual_inf must be positive\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if ((settings.alpha <= 0.0) ||
(settings.alpha >= 2.0)) {
version(PRINTING){
c_eprint("ERROR in %s: alpha must be strictly between 0 and 2\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if (validate_linsys_solver(settings.linsys_solver)) {
version(PRINTING){
c_eprint("ERROR in %s: linsys_solver not recognized\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if ((settings.verbose != 0) &&
(settings.verbose != 1)) {
version(PRINTING){
c_eprint("ERROR in %s: verbose must be either 0 or 1\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if ((settings.scaled_termination != 0) &&
(settings.scaled_termination != 1)) {
version(PRINTING){
c_eprint("ERROR in %s: scaled_termination must be either 0 or 1\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if (settings.check_termination < 0) {
version(PRINTING){
c_eprint("ERROR in %s: check_termination must be nonnegative\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
if ((settings.warm_start != 0) &&
(settings.warm_start != 1)) {
version(PRINTING){
c_eprint("ERROR in %s: warm_start must be either 0 or 1\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
version(PROFILING){
if (settings.time_limit < 0.0) {
version(PRINTING){
c_eprint("ERROR in %s: time_limit must be nonnegative\n", __FUNCTION__.ptr);
} /* ifdef PRINTING */
return 1;
}
} /* ifdef PROFILING */
return 0;
}
} // #ifndef EMBEDDED
| D |
/Users/TK/projects/Myself/bitrise/bitrise_test/Build/Intermediates/bitrise_test.build/Debug-iphoneos/bitrise_test.build/Objects-normal/arm64/AppDelegate.o : /Users/TK/projects/Myself/bitrise/bitrise_test/bitrise_test/AppDelegate.swift /Users/TK/projects/Myself/bitrise/bitrise_test/bitrise_test/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/TK/projects/Myself/bitrise/bitrise_test/Build/Intermediates/bitrise_test.build/Debug-iphoneos/bitrise_test.build/Objects-normal/arm64/AppDelegate~partial.swiftmodule : /Users/TK/projects/Myself/bitrise/bitrise_test/bitrise_test/AppDelegate.swift /Users/TK/projects/Myself/bitrise/bitrise_test/bitrise_test/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/TK/projects/Myself/bitrise/bitrise_test/Build/Intermediates/bitrise_test.build/Debug-iphoneos/bitrise_test.build/Objects-normal/arm64/AppDelegate~partial.swiftdoc : /Users/TK/projects/Myself/bitrise/bitrise_test/bitrise_test/AppDelegate.swift /Users/TK/projects/Myself/bitrise/bitrise_test/bitrise_test/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
| D |
module android.java.android.net.UrlQuerySanitizer_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import3 = android.java.java.lang.Class_d_interface;
import import0 = android.java.android.net.UrlQuerySanitizer_ValueSanitizer_d_interface;
import import2 = android.java.java.util.List_d_interface;
import import1 = android.java.java.util.Set_d_interface;
final class UrlQuerySanitizer : IJavaObject {
static immutable string[] _d_canCastTo = [
];
@Import this(arsd.jni.Default);
@Import this(string);
@Import import0.UrlQuerySanitizer_ValueSanitizer getUnregisteredParameterValueSanitizer();
@Import void setUnregisteredParameterValueSanitizer(import0.UrlQuerySanitizer_ValueSanitizer);
@Import static import0.UrlQuerySanitizer_ValueSanitizer getAllIllegal();
@Import static import0.UrlQuerySanitizer_ValueSanitizer getAllButNulLegal();
@Import static import0.UrlQuerySanitizer_ValueSanitizer getAllButWhitespaceLegal();
@Import static import0.UrlQuerySanitizer_ValueSanitizer getUrlLegal();
@Import static import0.UrlQuerySanitizer_ValueSanitizer getUrlAndSpaceLegal();
@Import static import0.UrlQuerySanitizer_ValueSanitizer getAmpLegal();
@Import static import0.UrlQuerySanitizer_ValueSanitizer getAmpAndSpaceLegal();
@Import static import0.UrlQuerySanitizer_ValueSanitizer getSpaceLegal();
@Import static import0.UrlQuerySanitizer_ValueSanitizer getAllButNulAndAngleBracketsLegal();
@Import void parseUrl(string);
@Import void parseQuery(string);
@Import import1.Set getParameterSet();
@Import import2.List getParameterList();
@Import bool hasParameter(string);
@Import string getValue(string);
@Import void registerParameter(string, import0.UrlQuerySanitizer_ValueSanitizer);
@Import void registerParameters(string, import0.UrlQuerySanitizer_ValueSanitizer[]);
@Import void setAllowUnregisteredParamaters(bool);
@Import bool getAllowUnregisteredParamaters();
@Import void setPreferFirstRepeatedParameter(bool);
@Import bool getPreferFirstRepeatedParameter();
@Import import0.UrlQuerySanitizer_ValueSanitizer getValueSanitizer(string);
@Import import0.UrlQuerySanitizer_ValueSanitizer getEffectiveValueSanitizer(string);
@Import string unescape(string);
@Import import3.Class getClass();
@Import int hashCode();
@Import bool equals(IJavaObject);
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import void notify();
@Import void notifyAll();
@Import void wait(long);
@Import void wait(long, int);
@Import void wait();
mixin IJavaObjectImplementation!(false);
public static immutable string _javaParameterString = "Landroid/net/UrlQuerySanitizer;";
}
| D |
module servo;
import std.stdio;
import core.thread;
import core.time;
import dgpio;
class Servo{
public:
this(){
}
~this(){
if(!(gpio is null)){
gpio.deactivate();
}
}
void attach(ubyte pin){
detach();
gpio = new GPIO(pin);
gpio.setOutput();
}
void detach(){
stop=true;
Thread.sleep(dur!("usecs")(cycle));
if(!(gpio is null)){
gpio.deactivate();
}
}
void write(ubyte angle){
this.angle = angle;
ontime = 1000+cast(uint)(angle/90.0*500);
writeMicroseconds(ontime);
}
void writeMicroseconds(uint time){
if(time>cycle){
time=cycle;
}
ontime = time;
MonoTime before = MonoTime.currTime;
MonoTime after = MonoTime.currTime();
Duration timeElapsed;
stop=false;
if(stopTime == timeElapsed){
if(stop){
thread = new Thread(&servoWrite).start();
}
}else{
while(!stop){
writePulse();
after = MonoTime.currTime;
timeElapsed = after - before;
if(timeElapsed > stopTime){
break;
}
}
}
}
ubyte read(){
return angle;
}
void setAutoStop(Duration time){
stopTime = time;
}
private:
GPIO gpio;
uint cycle=20000;
ubyte angle = 0;
uint ontime;
Thread thread;
Duration stopTime;
bool stop = true;
void servoWrite(){
while(!stop){
writePulse();
}
}
void writePulse(){
gpio.setHigh();
Thread.sleep(dur!("usecs")(ontime));
gpio.setLow();
Thread.sleep(dur!("usecs")(cycle-ontime));
}
}
| D |
/*
TEST_OUTPUT:
---
fail_compilation/fail7424c.d(10): Error: template `this.g()()` has no value
---
*/
struct S7424c
{
@property int g()() { return 0; }
void test() immutable { int f = g; }
}
| D |
var int Garett_ItemsGiven_Chapter_1;
var int Garett_ItemsGiven_Chapter_2;
var int Garett_ItemsGiven_Chapter_3;
var int Garett_ItemsGiven_Chapter_4;
var int Garett_ItemsGiven_Chapter_5;
func void B_GiveTradeInv_Addon_Garett(var C_Npc slf)
{
if((Kapitel >= 1) && (Garett_ItemsGiven_Chapter_1 == FALSE))
{
CreateInvItems(slf,ItMi_Gold,10);
CreateInvItems(slf,ItFo_Addon_Rum,1);
CreateInvItems(slf,ItFo_Water,1);
CreateInvItems(slf,ItPo_Health_Addon_04,1);
CreateInvItems(slf,itmi_leather,2);
CreateInvItems(slf,ItMw_ShortSword3,1);
CreateInvItems(slf,ItMw_2H_Axe_L_01,1);
CreateInvItems(slf,ItMw_Schiffsaxt,1);
CreateInvItems(slf,ItMw_Streitaxt1,1);
CreateInvItems(slf,ItMw_Zweihaender4,1);
CreateInvItems(slf,ItMw_Orkschlaechter,1);
CreateInvItems(slf,ItMW_Addon_Hacker_1h_01,1);
CreateInvItems(slf,ItMW_Addon_Hacker_1h_02,1);
CreateInvItems(slf,ItMW_Addon_Hacker_2h_01,1);
CreateInvItems(slf,ItMW_Addon_Hacker_2h_02,1);
CreateInvItems(slf,ItRw_Crossbow_M_01,1);
CreateInvItems(slf,ItRw_Crossbow_H_01,1);
CreateInvItems(slf,ItAm_Prot_Fire_01,1);
CreateInvItems(slf,ItRi_Prot_Mage_02,1);
CreateInvItems(slf,itbe_addon_enchleather_01,1);
Garett_ItemsGiven_Chapter_1 = TRUE;
};
if((Kapitel >= 2) && (Garett_ItemsGiven_Chapter_2 == FALSE))
{
CreateInvItems(slf,ItMi_Gold,20);
CreateInvItems(slf,ItMi_Joint,1);
CreateInvItems(slf,ItMi_DarkPearl,1);
CreateInvItems(slf,ItFo_Water,2);
Garett_ItemsGiven_Chapter_2 = TRUE;
};
if((Kapitel >= 3) && (Garett_ItemsGiven_Chapter_3 == FALSE))
{
CreateInvItems(slf,ItMi_Gold,50);
CreateInvItems(slf,itmi_leather,3);
CreateInvItems(slf,ItFo_Water,3);
Garett_ItemsGiven_Chapter_3 = TRUE;
};
if((Kapitel >= 4) && (Garett_ItemsGiven_Chapter_4 == FALSE))
{
CreateInvItems(slf,ItMi_Gold,100);
CreateInvItems(slf,itmi_leather,1);
CreateInvItems(slf,ItFo_Water,4);
Garett_ItemsGiven_Chapter_4 = TRUE;
};
if((Kapitel >= 5) && (Garett_ItemsGiven_Chapter_5 == FALSE))
{
CreateInvItems(slf,ItMi_Gold,200);
CreateInvItems(slf,ItFo_Water,5);
Garett_ItemsGiven_Chapter_5 = TRUE;
};
};
| D |
/Users/nabil/Downloads/AlbumsMnager/Build/Intermediates/Pods.build/Debug-iphonesimulator/NVActivityIndicatorView.build/Objects-normal/x86_64/NVActivityIndicatorAnimationLineScalePulseOutRapid.o : /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulseSync.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScalePulseOutRapid.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScale.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScale.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Presenter/NVActivityIndicatorViewable.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleMultiple.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleRippleMultiple.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotateMultiple.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleRipple.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorShape.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallRotateChase.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulseRise.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallGridPulse.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotatePulse.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulse.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorAnimationDelegate.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallRotate.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotate.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallZigZag.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallTrianglePath.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBlank.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationPacman.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationSemiCircleSpin.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationSquareSpin.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationTriangleSkewSpin.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationCubeTransition.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineSpinFadeLoader.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallSpinFadeLoader.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Presenter/NVActivityIndicatorPresenter.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationAudioEqualizer.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallGridBeat.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallBeat.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallZigZagDeflect.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationOrbit.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScalePulseOut.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScaleParty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/nabil/Downloads/AlbumsMnager/Pods/Target\ Support\ Files/NVActivityIndicatorView/NVActivityIndicatorView-umbrella.h /Users/nabil/Downloads/AlbumsMnager/Build/Intermediates/Pods.build/Debug-iphonesimulator/NVActivityIndicatorView.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/nabil/Downloads/AlbumsMnager/Build/Intermediates/Pods.build/Debug-iphonesimulator/NVActivityIndicatorView.build/Objects-normal/x86_64/NVActivityIndicatorAnimationLineScalePulseOutRapid~partial.swiftmodule : /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulseSync.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScalePulseOutRapid.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScale.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScale.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Presenter/NVActivityIndicatorViewable.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleMultiple.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleRippleMultiple.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotateMultiple.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleRipple.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorShape.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallRotateChase.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulseRise.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallGridPulse.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotatePulse.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulse.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorAnimationDelegate.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallRotate.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotate.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallZigZag.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallTrianglePath.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBlank.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationPacman.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationSemiCircleSpin.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationSquareSpin.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationTriangleSkewSpin.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationCubeTransition.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineSpinFadeLoader.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallSpinFadeLoader.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Presenter/NVActivityIndicatorPresenter.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationAudioEqualizer.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallGridBeat.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallBeat.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallZigZagDeflect.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationOrbit.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScalePulseOut.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScaleParty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/nabil/Downloads/AlbumsMnager/Pods/Target\ Support\ Files/NVActivityIndicatorView/NVActivityIndicatorView-umbrella.h /Users/nabil/Downloads/AlbumsMnager/Build/Intermediates/Pods.build/Debug-iphonesimulator/NVActivityIndicatorView.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/nabil/Downloads/AlbumsMnager/Build/Intermediates/Pods.build/Debug-iphonesimulator/NVActivityIndicatorView.build/Objects-normal/x86_64/NVActivityIndicatorAnimationLineScalePulseOutRapid~partial.swiftdoc : /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulseSync.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScalePulseOutRapid.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScale.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScale.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Presenter/NVActivityIndicatorViewable.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleMultiple.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleRippleMultiple.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotateMultiple.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallScaleRipple.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorShape.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallRotateChase.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulseRise.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallGridPulse.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotatePulse.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallPulse.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorAnimationDelegate.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallRotate.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallClipRotate.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallZigZag.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallTrianglePath.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBlank.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationPacman.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationSemiCircleSpin.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationSquareSpin.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationTriangleSkewSpin.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationCubeTransition.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineSpinFadeLoader.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallSpinFadeLoader.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Presenter/NVActivityIndicatorPresenter.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationAudioEqualizer.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallGridBeat.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallBeat.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallZigZagDeflect.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationOrbit.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScalePulseOut.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView.swift /Users/nabil/Downloads/AlbumsMnager/Pods/NVActivityIndicatorView/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationLineScaleParty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/nabil/Downloads/AlbumsMnager/Pods/Target\ Support\ Files/NVActivityIndicatorView/NVActivityIndicatorView-umbrella.h /Users/nabil/Downloads/AlbumsMnager/Build/Intermediates/Pods.build/Debug-iphonesimulator/NVActivityIndicatorView.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
| D |
/******************************************************************************
Output implementation for DLS storage engine
Implements a set of static methods to read records from a log file storage
engine.
Database file organization
The base directory contains numbered subdirectories, referred to as "slot
directories" or "slots". Each slot again contains numbered files, referred
to as "bucket files" or "buckets". Each bucket file contains a sequence of
records where each record consists of a header, which contains the record
key and the value data byte length, followed by the value data. The file
structure looks like this:
base_dir/
slot1/
bucket1
bucket2
...
slot2/
bucket1
bucket2
...
...
The bucket which contains a record and the slot which contains that bucket
are determined from the record key as follows.
The key type is a 64-bit unsigned integer type which is identical to a 16
digit hexadecimal number.
A range of keys where only the last 3 hexadecimal digits vary is associated
to a single bucket. That means that a bucket corresponds to a sequence of
4096 keys.
Of the remaining 13 hexadecimal digits, the lowest 3 denote the bucket file.
The remaining 10 hexadecimal digits denote the slot folder.
Examples:
1. Key 0x12345678abcdef00 is located in bucket cde in slot 12345678ab.
2. The keys in the range from 0x12345678abcde000 to 0x12345678abcdefff are
located in bucket cde in slot 12345678ab.
3. The keys in the range from 0x12345678abcd0000 to 0x12345678abcd8FFF are
located in buckets cd0, cd1, cd2..., cd8 in slot 12345678ab.
4. The keys in the range from 0x1234567810000000 to 0x1234567812348FFF are
located in
- buckets 000 to FFF in slot 1234567810 and 1234567811,
- buckets 000 to 348 in slot 1234567812.
As a result of the slot/bucket association method for a key width of 64 bits
the base directory contains up to 2^40 (10 hex digits) slot directories and
each slot directory contains up to 4096 (3 hex digits) bucket files.
Each slot directory and bucket file is created on the first write request
with a record key associated to them.
copyright:
Copyright (c) 2011-2017 dunnhumby Germany GmbH. All rights reserved
License:
Boost Software License Version 1.0. See LICENSE.txt for details.
******************************************************************************/
module dlsnode.storage.FileSystemLayout;
/*******************************************************************************
Imports
*******************************************************************************/
import ocean.transition;
import Hash = swarm.util.Hash;
import dlsnode.storage.BucketFile;
import dlsnode.storage.Record;
import ocean.core.Array;
import ocean.core.Enforce;
import ocean.io.serialize.SimpleStreamSerializer;
import ocean.text.convert.Formatter;
import ocean.io.model.IConduit: IOStream, InputStream, OutputStream;
import ocean.io.device.File;
import ocean.io.FilePath;
import ocean.core.ExceptionDefinitions: IOException;
import Integer = ocean.text.convert.Integer : toUlong;
import ocean.util.log.Logger;
import ocean.stdc.posix.sys.stat;
debug ( FileSystemLayout ) import ocean.io.Stdout;
version (UnitTest)
{
import ocean.core.Test;
}
/*******************************************************************************
Static module logger
*******************************************************************************/
private Logger log;
static this ( )
{
log = Log.lookup("dlsnode.storage.FileSystemLayout");
}
public class FileSystemLayout
{
/**************************************************************************
Private constructor to prevent instantiation. The public interface of
this class is in its static methods.
**************************************************************************/
private this ( ) { }
/**************************************************************************
Definition of the range of hexadecimal and binary digits of a key which
correspond to the slot and bucket and the remaining key digits.
See description at the top.
**************************************************************************/
public static immutable struct SplitBits
{
static enum uint total_digits = hash_t.sizeof * 2,
key_digits = 3, // 4095 keys per bucket
bucket_digits = 3, // 4095 buckets per slot
slot_digits = total_digits -
(key_digits + bucket_digits),
key_bits = key_digits * 4,
bucket_bits = bucket_digits * 4,
slot_bits = slot_digits * 4;
// pragma(msg, "total hex digits = " ~ total_digits.stringof);
// pragma(msg, "slot digits = " ~ slot_digits.stringof);
// pragma(msg, "bucket digits = " ~ bucket_digits.stringof);
// pragma(msg, "key digits = " ~ key_digits.stringof);
}
/***************************************************************************
Interface to the file system with methods for finding slot folders and
bucket files within specified ranges.
***************************************************************************/
private interface IFileSystem
{
/***********************************************************************
Scans the given base directory for the lowest matching slot folder
within the specified range. If a suitable match is found, its value
is returned via the ref min_slot argument.
Params:
base_dir = base directory containing slot folders
found_slot = receives value of matching slot on success
(hash_t.min otherwise) *
min_slot = value of minimum slot allowed *
max_slot = value of maximum slot allowed *
* The slot values are specified as hashes where the lowest
SplitBits.slot_bits contain the slot value.
Returns:
true if no slot folder exists in the base dir within the
specified range
***********************************************************************/
bool findFirstSlotDirectory ( cstring base_dir, out hash_t found_slot,
hash_t min_slot, hash_t max_slot );
/***********************************************************************
Scans the given slot directory (inside the base directory) for
bucket files starting at the specified minimum value.
Params:
base_dir = base directory containing slot folders
slot_dir = slot folder to scan
found_bucket = receives value of matching bucket on success
(hash_t.min otherwise) *
min_bucket = value of minimum bucket allowed *
max_bucket = value of maximum bucket allowed *
* The bucket values are specified as hashes where the lowest
SplitBits.bucket_bits contain the bucket value.
Returns:
true if no bucket file exists in the slot folder within the
specified range
***********************************************************************/
bool findFirstBucketFile ( cstring base_dir, cstring slot_dir,
out hash_t found_bucket, hash_t min_bucket, hash_t max_bucket );
}
/**************************************************************************
Gets the filename of the first bucket file in the given base directory.
Params:
base_dir = base directory
path = string into which the filename of the first bucket file will
be written
bucket_start = if a bucket file is found, receives the value of the
first (theoretical) hash in that bucket
Returns:
true if no bucket files exist in the base dir or sub-directories
(i.e. the storage channel is empty)
**************************************************************************/
static public bool getFirstBucket ( cstring base_dir, ref mstring path,
out hash_t bucket_start )
{
return getFirstBucketInRange(base_dir, path, bucket_start, hash_t.min,
hash_t.max);
}
/**************************************************************************
Gets the filename of the first bucket file in the given base directory
and within the specified hash range.
Params:
base_dir = base directory
path = string into which the filename of the first bucket file will
be written
bucket_start = if a bucket file is found, receives the value of the
first (theoretical) hash in that bucket
min_hash = start of search range
max_hash = end of search range
Returns:
true if no bucket files exist in the base dir or sub-directories
within the specified hash range
**************************************************************************/
static public bool getFirstBucketInRange ( cstring base_dir, ref mstring path,
out hash_t bucket_start, hash_t min_hash, hash_t max_hash )
{
// Remove key number from min & max hashes (so just the slot/bucket
// numbers remain)
hash_t min_bucket_slot = min_hash >> SplitBits.key_bits;
hash_t max_bucket_slot = max_hash >> SplitBits.key_bits;
hash_t next_bucket_slot;
scope fs = new FileSystem;
auto empty = getFirstBucket_(fs, base_dir, path, next_bucket_slot,
min_bucket_slot, max_bucket_slot);
if ( !empty )
{
if ( next_bucket_slot >= min_bucket_slot && next_bucket_slot <= max_bucket_slot )
{
bucket_start = next_bucket_slot << SplitBits.key_bits;
}
else
{
empty = true;
}
}
return empty;
}
/**************************************************************************
Gets the full path and file name from bucket parts - slot and bucket.
Params:
base_dir = base directory where the bucket should live
slot_path = output buffer for rendering slot path
bucket_path = output buffer for rendering bucket path
sb = SlotBucket structure containing slot and bucket
**************************************************************************/
static public void getBucketPathFromParts ( cstring base_dir,
ref mstring slot_path, ref mstring bucket_path, SlotBucket sb)
{
slot_path.length = base_dir.length + 1 + FileSystemLayout.SplitBits.slot_digits;
bucket_path.length = slot_path.length + 1 + FileSystemLayout.SplitBits.bucket_digits;
// Fill slot path
slot_path[0 .. base_dir.length] = base_dir;
slot_path[base_dir.length] = '/';
Hash.intToHex(sb.slot, slot_path[base_dir.length + 1 .. $]);
// Fill bucket path
bucket_path[0 .. slot_path.length] = slot_path;
bucket_path[slot_path.length] = '/';
Hash.intToHex(sb.bucket, bucket_path[slot_path.length + 1 .. $]);
}
unittest
{
cstring base_dir = "channel";
mstring slot_path;
mstring bucket_path;
SlotBucket sb;
sb.fromKey(0x0000000000000000UL);
getBucketPathFromParts(base_dir,
slot_path, bucket_path,
sb);
test!("==")(slot_path, "channel/0000000000");
test!("==")(bucket_path, "channel/0000000000/000");
sb.fromKey(0x570e13ebUL);
getBucketPathFromParts(base_dir,
slot_path, bucket_path,
sb);
test!("==")(slot_path, "channel/0000000057");
test!("==")(bucket_path, "channel/0000000057/0e1");
}
/**************************************************************************
Gets the filename of the next bucket file in the given base directory
after the specified last hash, and up to the specified maximum hash. The
first hash of the new bucket is also returned via the ref hash
parameter.
Params:
base_dir = base directory
path = string into which the filename of the first bucket file will
be written
bucket_start = if a bucket file is found, receives the value of the
first (theoretical) hash in that bucket (hash_t.min otherwise)
last_hash = a hash in the previous bucket, used to calculate the
hash range of the next bucket
max_hash = highest hash bucket to return
Returns:
true if no bucket files exist in the base dir or sub-directories
within the specified hash range
**************************************************************************/
static public bool getNextBucket ( cstring base_dir,
ref mstring path, out hash_t bucket_start,
hash_t last_hash, hash_t max_hash = hash_t.max )
{
hash_t min_bucket_slot = last_hash >> SplitBits.key_bits;
hash_t max_bucket_slot = max_hash >> SplitBits.key_bits;
// If this is already the last bucket, then there can be no more
if ( min_bucket_slot >= max_bucket_slot )
{
return true;
}
// Otherwise look for the next existing bucket file.
min_bucket_slot++;
hash_t next_bucket_slot;
scope fs = new FileSystem;
auto no_bucket = getFirstBucket_(fs, base_dir, path, next_bucket_slot,
min_bucket_slot, max_bucket_slot);
if ( !no_bucket )
{
// set to first hash in bucket
bucket_start = next_bucket_slot << SplitBits.key_bits;
}
return no_bucket;
}
/**************************************************************************
Removes all bucket files and slot directories found within the specified
base directory.
Params:
base_dir = base directory to scan for slot dirs
**************************************************************************/
static public void removeFiles ( cstring base_dir )
{
scope dir_path = new FilePath(base_dir);
scope slot_path = new FilePath;
scope file_path = new FilePath;
foreach ( dir_info; dir_path )
{
slot_path.file = dir_info.name;
slot_path.folder = dir_info.path;
if ( slot_path.isFolder )
{
char[SplitBits.bucket_digits] first_bucket = 'Z';
foreach ( file_info; slot_path )
{
file_path.file = file_info.name;
file_path.folder = file_info.path;
file_path.remove();
}
}
slot_path.remove();
}
}
/***************************************************************************
Gets the filename of the first bucket file in the given base directory
and within the given bucket number. First the slot folders in the base
directory are scanned for the lowest matching slot (within the specified
range). If a suitable slot folder is found, its bucket files are scanned
for the lowest matching bucket (again within the specified range). This
process is reapeated until either a matching slot/bucket is found, or
all slots/buckets have been scanned and none were within the specified
range.
Params:
filesystem = interface to the filesystem, for checking the existence
of slot folders / bucket files
base_dir = base directory containing slot folders
path = string into which the filename of the first bucket file found
will be written (unchanged if none found)
found_bucket_slot = receives value of matching slot/bucket on
success (hash_t.min otherwise) *
min_bucket_slot = value of minimum slot/bucket allowed *
max_bucket_slot = value of maximum slot/bucket allowed *
* The slot/bucket values are specified as hashes where the lowest
SplitBits.bucket_bits contain the bucket value, and the following
SplitBits.slot_bits contain the slot.
Returns:
true if no bucket files exist in the base dir's sub-directories
within the specified range
***************************************************************************/
static private bool getFirstBucket_ ( IFileSystem filesystem, cstring base_dir,
ref mstring path, out hash_t found_bucket_slot,
hash_t min_bucket_slot, hash_t max_bucket_slot )
{
auto min_slot = min_bucket_slot >> SplitBits.bucket_bits;
auto max_slot = max_bucket_slot >> SplitBits.bucket_bits;
hash_t slot = min_slot;
debug ( FileSystemLayout ) Stderr.formatln("getFirstBucket_: {:x13}..{:x13} (slot {:x10}..{:x10})",
min_bucket_slot, max_bucket_slot, min_slot, max_slot.val);
bool no_bucket;
do
{
debug ( FileSystemLayout ) Stderr.formatln("slot {:x10}", slot);
// Find first slot directory within range
hash_t found_slot;
auto no_slot = filesystem.findFirstSlotDirectory(base_dir, found_slot,
slot, max_slot);
if ( no_slot )
{
debug ( FileSystemLayout ) Stderr.formatln(" no slot dir found");
return true;
}
slot = found_slot;
debug ( FileSystemLayout ) Stderr.formatln(" found slot {:x10}", slot);
// Work out which buckets within the slot directory count as a
// match. Generally, all buckets in a slot are valid...
static immutable hash_t bucket_mask = (1 << SplitBits.bucket_bits) - 1;
hash_t min_bucket = hash_t.min; // 000
hash_t max_bucket = bucket_mask; // fff
// ...but if this is the first slot in the range, respect the min
// bucket specified...
if ( slot == min_slot )
{
min_bucket = min_bucket_slot & bucket_mask;
}
// ...and if this is the last slot in the range, respect the max
// bucket specified.
if ( slot == max_slot )
{
max_bucket = max_bucket_slot & bucket_mask;
}
// Find first bucket file in slot directory within range
char[SplitBits.slot_digits] slot_name_buf;
auto slot_name = Hash.intToHex(slot, slot_name_buf);
debug ( FileSystemLayout ) Stderr.formatln(" buckets {:x3}..{:x3}", min_bucket, max_bucket);
hash_t found_bucket;
no_bucket = filesystem.findFirstBucketFile(base_dir, slot_name, found_bucket,
min_bucket, max_bucket);
if ( !no_bucket )
{
debug ( FileSystemLayout ) Stderr.formatln(" found bucket {:x3}", found_bucket);
// Set output parameters
char[SplitBits.bucket_digits] bucket_name_buf;
auto bucket_name = Hash.intToHex(found_bucket, bucket_name_buf);
path.length = 0;
enableStomping(path);
sformat(path, "{}/{}/{}", base_dir, slot_name,
bucket_name);
found_bucket_slot = (slot << SplitBits.bucket_bits) +
found_bucket;
return false;
}
// Try again starting at the next slot
slot++;
}
while ( slot <= max_slot );
debug ( FileSystemLayout ) Stderr.formatln(" no bucket found");
return true;
}
/***************************************************************************
Filesystem scope class with methods for finding slot folders and bucket
files within specified ranges.
***************************************************************************/
private static scope class FileSystem : IFileSystem
{
/***********************************************************************
Scans the given base directory for the lowest matching slot folder
within the specified range. If a suitable match is found, its value
is returned via the ref min_slot argument.
Params:
base_dir = base directory containing slot folders
found_slot = receives value of matching slot on success
(hash_t.min otherwise) *
min_slot = value of minimum slot allowed *
max_slot = value of maximum slot allowed *
* The slot values are specified as hashes where the lowest
SplitBits.slot_bits contain the slot value.
Returns:
true if no slot folder exists in the base dir within the
specified range
***********************************************************************/
public bool findFirstSlotDirectory ( cstring base_dir, out hash_t found_slot,
hash_t min_slot, hash_t max_slot )
{
scope scan_path = new FilePath(base_dir);
hash_t first_slot;
auto no_slot = this.findLowestSubPath(scan_path, true, first_slot, min_slot);
if ( no_slot )
{
return true;
}
found_slot = first_slot;
return false;
}
/***********************************************************************
Scans the given slot directory (inside the base directory) for
bucket files starting at the specified minimum value. The existence
of every possible bucket file is checked until either one is
discovered or all have been checked and none has been found.
Note: this scanning algorithm is used, instead of an algorithm which
iterates over all extant files in the slot folder, in order to avoid
having to scan all (unordered) files every time the method is
called. As it is, usually bucket files with all values will exist
(in most slot folders), so it is much more efficient to simply check
for the existence of the next file.
Params:
base_dir = base directory containing slot folders
slot_dir = slot folder to scan
found_bucket = receives value of matching bucket on success
(hash_t.min otherwise) *
min_bucket = value of minimum bucket allowed *
max_bucket = value of maximum bucket allowed *
* The bucket values are specified as hashes where the lowest
SplitBits.bucket_bits contain the bucket value.
Returns:
true if no bucket file exists in the slot folder within the
specified range
***********************************************************************/
public bool findFirstBucketFile ( cstring base_dir, cstring slot_dir,
out hash_t found_bucket, hash_t min_bucket, hash_t max_bucket )
{
scope scan_path = new FilePath;
scan_path.folder = slot_dir;
scan_path.prepend(base_dir);
while ( min_bucket <= max_bucket )
{
char[SplitBits.bucket_digits] bucket_name_buf;
auto filename = Hash.intToHex(min_bucket, bucket_name_buf);
scan_path.file = assumeUnique(filename);
// Check whether bucket file exists and if it's not empty
// and that it contains enough data for a header to be read
stat_t file_stats;
auto ret_val = stat(scan_path.cString().ptr, &file_stats);
if ( ret_val == 0 && file_stats.st_size >= BucketFile.BucketHeaderSize)
{
found_bucket = min_bucket;
return false;
}
// Otherwise try the next bucket file.
min_bucket++;
}
return true;
}
/***********************************************************************
Iterates over all children (either child folders or child files) of
the given path in order to find the child with the lowest
hexadecimal filename value (i.e. the child's filename simply
converted to an integer - filenames containing non-hex characters
are ignored). Optionally a minimum integer value can be specified,
in order to filter out children whose filename is < the specified
minimum.
Params:
path = file path to search within
folders = flag indicating whether child folders (true) or child
files (false) should be scanned
lowest = receives the value of the lowest matching file / folder
(or hash_t.max if no match is found)
min = optional minimum value to scan for
Returns:
true if no matching folder/file exists
***********************************************************************/
private bool findLowestSubPath ( FilePath path, bool folders,
out hash_t lowest, hash_t min = hash_t.min )
{
bool found;
lowest = hash_t.max;
// Find file in directory with 'lowest' name
foreach ( child; path )
{
// Check that child is of the expected type.
if ( child.folder != folders )
{
continue;
}
// Get integer value of child's name (handling errors)
hash_t value;
if (!Integer.toUlong(child.name, value, 16))
{
log.warn("{}: {} found with invalid name: {}",
path.name, folders ? "Folder" : "File", child.name);
continue;
}
// Ignore child if value is less than the specified minimum.
if ( value < min )
{
continue;
}
// Update lowest value counter, if child's value is lower.
if ( !found || value < lowest )
{
found = true;
lowest = value;
}
}
return !found;
}
}
}
/*******************************************************************************
SlotBucket struct
Calculates and keeps slot and bucket from a key
*******************************************************************************/
public struct SlotBucket
{
/***************************************************************************
Value of the "slot" (channel directory sub-folder).
***************************************************************************/
public hash_t slot;
/***************************************************************************
Value of the "bucket" (data file). See FileSystemLayout.
***************************************************************************/
public hash_t bucket;
/***************************************************************************
Sets the slot and bucket value from the given key.
Params:
key = key to split into slot / bucket
Returns:
this instance
***************************************************************************/
public typeof (&this) fromKey ( hash_t key )
{
this.bucket = key >> FileSystemLayout.SplitBits.key_bits;
this.slot = bucket >> FileSystemLayout.SplitBits.bucket_bits;
return &this;
}
/***************************************************************************
Returns:
hash identifier for this instance, for use as a key in hash maps and
the like. As the bucket value is calculated by truncating the full
key (i.e. not by masking it), this value is a unique identifier for
the instance and can be returned directly.
Note that as this value is derived from a time value, not a real
pseudo-random number, it is not really a very good hash for use in a
hashmap. However, we know that the return value is only used by the
recent files cache (StorageEngine.Writers) which has a very small
number of maximum elements, meaning that the efficiency of the hash
determination is not important.
***************************************************************************/
public hash_t toHash ( )
{
return this.bucket;
}
/**************************************************************************
Returns first key that the bucket can contain.
Returns:
first key that the bucket can contain.
**************************************************************************/
public hash_t firstKey ()
{
return (this.slot <<
(FileSystemLayout.SplitBits.bucket_bits
+ FileSystemLayout.SplitBits.key_bits))
| (this.bucket << FileSystemLayout.SplitBits.key_bits);
}
}
version ( UnitTest )
{
/***************************************************************************
Dummy file system class. Implements the interface required by the
DLS storage engine, but instead of checking for the presence of
files and directories in a real file system, they are mimicked by an
internal map of slot folder numbers -> list of bucket file numbers.
***************************************************************************/
scope class DummyFileSystem : FileSystemLayout.IFileSystem
{
/***********************************************************************
Aliases for a set of buckets in a slot and a map of slots, indexed
by numerical identifier.
***********************************************************************/
alias ushort[] SlotBuckets;
alias SlotBuckets[hash_t] Slots;
/***********************************************************************
Id -> slot map.
***********************************************************************/
private Slots slots;
/***********************************************************************
Adds a slot to the internal map.
Params:
slot_num = numerical identifier of slot (asserted to be within
the range of possible slot numbers defined by
FileSystemLayout.SplitBits)
buckets = list of buckets within the slot (asserted to be within
the range of possible bucket numbers defined by
FileSystemLayout.SplitBits)
***********************************************************************/
public void addSlot ( hash_t slot_num, SlotBuckets buckets )
{
static immutable max_slot = (1 << FileSystemLayout.SplitBits.slot_digits) -1;
static immutable max_bucket = (1 << FileSystemLayout.SplitBits.bucket_digits) -1;
assert(slot_num <= max_slot);
foreach ( bucket; buckets )
{
assert(bucket <= max_bucket);
}
this.slots[slot_num] = buckets;
}
/***********************************************************************
Scans the given base directory for the lowest matching slot folder
within the specified range. If a suitable match is found, its value
is returned via the ref min_slot argument.
Params:
base_dir = base directory containing slot folders
found_slot = receives value of matching slot on success
(hash_t.min otherwise) *
min_slot = value of minimum slot allowed *
max_slot = value of maximum slot allowed *
* The slot values are specified as hashes where the lowest
SplitBits.slot_bits contain the slot value.
Returns:
true if no slot folder exists in the base dir within the
specified range
***********************************************************************/
public bool findFirstSlotDirectory ( cstring base_dir, out hash_t found_slot,
hash_t min_slot, hash_t max_slot )
{
auto slot_numbers = sort(this.slots.keys.dup);
foreach ( slot; slot_numbers )
{
if ( slot >= min_slot && slot <= max_slot )
{
found_slot = slot;
return false;
}
}
return true;
}
/***********************************************************************
Scans the given slot directory (inside the base directory) for
bucket files starting at the specified minimum value.
Params:
base_dir = base directory containing slot folders
slot_dir = slot folder to scan
found_bucket = receives value of matching bucket on success
(hash_t.min otherwise) *
min_bucket = value of minimum bucket allowed *
max_bucket = value of maximum bucket allowed *
* The bucket values are specified as hashes where the lowest
SplitBits.bucket_bits contain the bucket value.
Returns:
true if no bucket file exists in the slot folder within the
specified range
***********************************************************************/
public bool findFirstBucketFile ( cstring base_dir, cstring slot_dir,
out hash_t found_bucket, hash_t min_bucket, hash_t max_bucket )
{
hash_t slot_num;
if (!Integer.toUlong(slot_dir, slot_num))
{
.log.error("Invalid slot directory name: {}", slot_dir);
return true;
}
auto slot = slot_num in this.slots;
if ( !slot ) return true;
foreach ( bucket; *slot )
{
if ( bucket >= min_bucket && bucket <= max_bucket )
{
found_bucket = bucket;
return false;
}
}
return true;
}
}
}
unittest
{
/***************************************************************************
Calls FileSystemLayout.getFirstBucket_() with the specified parameters and
asserts that the results are as expected.
Params:
desc = identifier string for test, used for assert messages
fs = dummy file system instance to run tests on
start = start hash of search range
end = end hash of search range
expected_found = is the test expected to find a bucket?
expected_bucket_slot = the value of the slot/bucket which is
expected to be found (only checked if expected_found is true)
***************************************************************************/
void test ( cstring desc, DummyFileSystem fs, hash_t start, hash_t end,
bool expected_found, hash_t expected_bucket_slot = 0 )
in
{
assert(fs !is null);
assert(start <= end);
}
body
{
static istring base_dir = "base";
mstring path;
hash_t found_bucket_slot;
auto empty = FileSystemLayout.getFirstBucket_(fs, base_dir, path, found_bucket_slot,
start, end);
debug ( FileSystemLayout ) Stderr.formatln("found={}, path={}, bucket/slot={:x13}",
!empty, path, found_bucket_slot);
assert(empty != expected_found, desc ~ ": found mismatch");
if ( !empty ) with ( FileSystemLayout.SplitBits )
{
assert(path[0..base_dir.length] == base_dir, desc ~ ": base path wrong");
assert(path[base_dir.length] == '/', desc ~ ": first slash missing");
auto slot_start = base_dir.length + 1;
hash_t path_slot;
Integer.toUlong(path[slot_start..slot_start + slot_digits], path_slot);
assert(path_slot == found_bucket_slot >> bucket_bits, desc ~ ": path slot wrong");
assert(path[slot_start + slot_digits] == '/', desc ~ ": second slash missing");
static immutable hash_t bucket_mask = (1 << bucket_bits) - 1;
auto bucket_start = slot_start + slot_digits + 1;
hash_t path_bucket;
Integer.toUlong(path[bucket_start..bucket_start + bucket_digits],
path_bucket);
assert(path_bucket == (found_bucket_slot & bucket_mask), desc ~ ": path bucket wrong");
assert(found_bucket_slot == expected_bucket_slot, desc ~ ": found bucket/slot mismatch");
}
}
// -------------------------------------------------------------------------
// Single slot tests
// Single bucket, exact range
{
scope fs = new DummyFileSystem();
fs.addSlot(0x0000000001, [0x001]);
test("test 1", fs, 0x0000000001001, 0x0000000001001, true, 0x0000000001001);
}
// Single bucket, range start
{
scope fs = new DummyFileSystem();
fs.addSlot(0x0000000001, [0x001]);
test("test 2", fs, 0x0000000001001, 0x0000000001002, true, 0x0000000001001);
}
// Single bucket, range end
{
scope fs = new DummyFileSystem();
fs.addSlot(0x0000000001, [0x001]);
test("test 3", fs, 0x0000000001000, 0x0000000001001, true, 0x0000000001001);
}
// Single bucket, before range
{
scope fs = new DummyFileSystem();
fs.addSlot(0x0000000001, [0x001]);
test("test 4", fs, 0x0000000001002, 0x0000000001003, false);
}
// Single bucket, after range
{
scope fs = new DummyFileSystem();
fs.addSlot(0x0000000001, [0x002]);
test("test 5", fs, 0x0000000001000, 0x0000000001001, false);
}
// Multiple buckets, exact range
{
scope fs = new DummyFileSystem();
fs.addSlot(0x0000000001, [0x001, 0x002, 0x003]);
test("test 6", fs, 0x0000000001001, 0x0000000001003, true, 0x0000000001001);
}
// Multiple buckets, range start
{
scope fs = new DummyFileSystem();
fs.addSlot(0x0000000001, [0x001, 0x002, 0x003]);
test("test 7", fs, 0x0000000001001, 0x0000000001006, true, 0x0000000001001);
}
// Multiple buckets, range end
{
scope fs = new DummyFileSystem();
fs.addSlot(0x0000000001, [0x001, 0x002, 0x003]);
test("test 8", fs, 0x0000000001003, 0x0000000001006, true, 0x0000000001003);
}
// Multiple buckets, before range
{
scope fs = new DummyFileSystem();
fs.addSlot(0x0000000001, [0x001, 0x002, 0x003]);
test("test 9", fs, 0x0000000001004, 0x0000000001004, false);
}
// Multiple buckets, after range
{
scope fs = new DummyFileSystem();
fs.addSlot(0x0000000001, [0x001, 0x002, 0x003]);
test("test 10", fs, 0x0000000001000, 0x0000000001000, false);
}
// -------------------------------------------------------------------------
// Multiple slot tests
// Range spans both slots, found in first slot
{
scope fs = new DummyFileSystem();
fs.addSlot(0x0000000001, [0x001]);
fs.addSlot(0x0000000002, [0x001]);
test("test 11", fs, 0x0000000001000, 0x0000000002fff, true, 0x0000000001001);
}
// Range starts after buckets in first slot, found in second slot
{
scope fs = new DummyFileSystem();
fs.addSlot(0x0000000001, [0x001]);
fs.addSlot(0x0000000002, [0x001]);
test("test 12", fs, 0x0000000001002, 0x0000000002fff, true, 0x0000000002001);
}
// Range ends before buckets of first slot
{
scope fs = new DummyFileSystem();
fs.addSlot(0x0000000001, [0x001]);
fs.addSlot(0x0000000002, [0x001]);
test("test 13", fs, 0x0000000001000, 0x0000000001000, false);
}
// Range ends after buckets of second slot
{
scope fs = new DummyFileSystem();
fs.addSlot(0x0000000001, [0x001]);
fs.addSlot(0x0000000002, [0x001]);
test("test 14", fs, 0x0000000002002, 0x0000000002fff, false);
}
}
| D |
a tax imposed on ships that enter the US
| D |
module android.java.android.view.MenuInflater_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import1 = android.java.android.view.Menu_d_interface;
import import2 = android.java.java.lang.Class_d_interface;
import import0 = android.java.android.content.Context_d_interface;
final class MenuInflater : IJavaObject {
static immutable string[] _d_canCastTo = [
];
@Import this(import0.Context);
@Import void inflate(int, import1.Menu);
@Import import2.Class getClass();
@Import int hashCode();
@Import bool equals(IJavaObject);
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import void notify();
@Import void notifyAll();
@Import void wait(long);
@Import void wait(long, int);
@Import void wait();
mixin IJavaObjectImplementation!(false);
public static immutable string _javaParameterString = "Landroid/view/MenuInflater;";
}
| D |
/Users/axj1l59/rust-projects/minigrep/target/debug/minigrep-faf75ff47b26236f.dSYM: /Users/axj1l59/rust-projects/minigrep/src/lib.rs /Users/axj1l59/rust-projects/minigrep/src/main.rs
| D |
/Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/Fluent.build/Relations/Parent.swift.o : /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Database/Database.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Database/Driver.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Entity/Entity.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Memory/Memory+Filters.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Memory/Memory+Group.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Memory/Memory+Sort.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Memory/MemoryDriver.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Preparation/Database+Preparation.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Preparation/Migration.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Preparation/Preparation.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Preparation/PreparationError.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Action.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Comparison.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Filter.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Group.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Join.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Limit.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Query.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Scope.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Sort.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Relations/Children.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Relations/Parent.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Relations/RelationError.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Relations/Siblings.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Database+Schema.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Schema+Creator.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Schema+Field.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Schema+Modifier.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Schema.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/SQL+Query.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/SQL+Schema.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/SQL.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/SQLSerializer.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Utilities/Fluent+Node.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/Node.swiftmodule /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/PathIndexable.swiftmodule /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/Polymorphic.swiftmodule
/Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/Fluent.build/Parent~partial.swiftmodule : /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Database/Database.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Database/Driver.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Entity/Entity.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Memory/Memory+Filters.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Memory/Memory+Group.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Memory/Memory+Sort.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Memory/MemoryDriver.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Preparation/Database+Preparation.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Preparation/Migration.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Preparation/Preparation.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Preparation/PreparationError.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Action.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Comparison.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Filter.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Group.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Join.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Limit.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Query.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Scope.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Sort.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Relations/Children.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Relations/Parent.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Relations/RelationError.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Relations/Siblings.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Database+Schema.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Schema+Creator.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Schema+Field.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Schema+Modifier.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Schema.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/SQL+Query.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/SQL+Schema.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/SQL.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/SQLSerializer.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Utilities/Fluent+Node.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/Node.swiftmodule /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/PathIndexable.swiftmodule /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/Polymorphic.swiftmodule
/Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/Fluent.build/Parent~partial.swiftdoc : /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Database/Database.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Database/Driver.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Entity/Entity.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Memory/Memory+Filters.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Memory/Memory+Group.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Memory/Memory+Sort.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Memory/MemoryDriver.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Preparation/Database+Preparation.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Preparation/Migration.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Preparation/Preparation.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Preparation/PreparationError.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Action.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Comparison.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Filter.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Group.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Join.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Limit.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Query.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Scope.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Query/Sort.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Relations/Children.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Relations/Parent.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Relations/RelationError.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Relations/Siblings.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Database+Schema.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Schema+Creator.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Schema+Field.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Schema+Modifier.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Schema/Schema.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/SQL+Query.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/SQL+Schema.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/SQL.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/SQL/SQLSerializer.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Fluent-1.3.3/Sources/Fluent/Utilities/Fluent+Node.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/Node.swiftmodule /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/PathIndexable.swiftmodule /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/Polymorphic.swiftmodule
| D |
# FIXED
uC-LIB/lib_str.obj: ../uC-LIB/lib_str.c
uC-LIB/lib_str.obj: /Volumes/UDISK/ucos3_28069u/ucos3_28069u/uC-LIB/lib_str.h
uC-LIB/lib_str.obj: /Volumes/UDISK/ucos3_28069u/ucos3_28069u/uC-CPU/C28x/CCS/cpu.h
uC-LIB/lib_str.obj: /Volumes/UDISK/ucos3_28069u/ucos3_28069u/uC-CPU/cpu_def.h
uC-LIB/lib_str.obj: /Volumes/UDISK/ucos3_28069u/ucos3_28069u/APP/cpu_cfg.h
uC-LIB/lib_str.obj: /Volumes/UDISK/ucos3_28069u/ucos3_28069u/uC-LIB/lib_def.h
uC-LIB/lib_str.obj: /Volumes/UDISK/ucos3_28069u/ucos3_28069u/uC-LIB/lib_ascii.h
uC-LIB/lib_str.obj: /Volumes/UDISK/ucos3_28069u/ucos3_28069u/APP/lib_cfg.h
../uC-LIB/lib_str.c:
/Volumes/UDISK/ucos3_28069u/ucos3_28069u/uC-LIB/lib_str.h:
/Volumes/UDISK/ucos3_28069u/ucos3_28069u/uC-CPU/C28x/CCS/cpu.h:
/Volumes/UDISK/ucos3_28069u/ucos3_28069u/uC-CPU/cpu_def.h:
/Volumes/UDISK/ucos3_28069u/ucos3_28069u/APP/cpu_cfg.h:
/Volumes/UDISK/ucos3_28069u/ucos3_28069u/uC-LIB/lib_def.h:
/Volumes/UDISK/ucos3_28069u/ucos3_28069u/uC-LIB/lib_ascii.h:
/Volumes/UDISK/ucos3_28069u/ucos3_28069u/APP/lib_cfg.h:
| D |
/home/syed/Desktop/rust_web_scrap/target/debug/build/memoffset-54f6f0115b699216/build_script_build-54f6f0115b699216: /home/syed/.cargo/registry/src/github.com-1ecc6299db9ec823/memoffset-0.5.4/build.rs
/home/syed/Desktop/rust_web_scrap/target/debug/build/memoffset-54f6f0115b699216/build_script_build-54f6f0115b699216.d: /home/syed/.cargo/registry/src/github.com-1ecc6299db9ec823/memoffset-0.5.4/build.rs
/home/syed/.cargo/registry/src/github.com-1ecc6299db9ec823/memoffset-0.5.4/build.rs:
| D |
import std.stdio, std.algorithm, std.conv, std.array, std.string;
void main()
{
auto N = readln.chomp.to!long;
auto n = 0;
for (;;) {
++n;
if ((N * n % (3 * n - N)) == 0 && (N * n / (3 * n - N)) > 0) break;
}
writefln("%s %s %s", N, n, (N * n / (3 * n - N)));
} | D |
/Users/adam/Projects/itunes_rss/Build/Intermediates.noindex/iTunesRSSFeed.build/Debug-iphonesimulator/iTunesRSSFeed.build/Objects-normal/x86_64/AlbumViewModel.o : /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/iTunesRSSAPI.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Feed.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Genre.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Response.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/SceneDelegate.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/AppDelegate.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/ViewModels/FeedViewModel.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/ViewModels/AlbumViewModel.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Views/AlbumTableViewCell.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Album.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Extensions/UIImageViewExtension.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Extensions/UITableViewExtension.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Views/DetailViewController.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Views/MainViewController.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/NetworkingError.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/QueryResult.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/APIClient.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/adam/Projects/itunes_rss/Build/Intermediates.noindex/iTunesRSSFeed.build/Debug-iphonesimulator/iTunesRSSFeed.build/Objects-normal/x86_64/AlbumViewModel~partial.swiftmodule : /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/iTunesRSSAPI.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Feed.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Genre.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Response.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/SceneDelegate.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/AppDelegate.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/ViewModels/FeedViewModel.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/ViewModels/AlbumViewModel.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Views/AlbumTableViewCell.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Album.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Extensions/UIImageViewExtension.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Extensions/UITableViewExtension.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Views/DetailViewController.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Views/MainViewController.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/NetworkingError.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/QueryResult.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/APIClient.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/adam/Projects/itunes_rss/Build/Intermediates.noindex/iTunesRSSFeed.build/Debug-iphonesimulator/iTunesRSSFeed.build/Objects-normal/x86_64/AlbumViewModel~partial.swiftdoc : /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/iTunesRSSAPI.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Feed.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Genre.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Response.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/SceneDelegate.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/AppDelegate.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/ViewModels/FeedViewModel.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/ViewModels/AlbumViewModel.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Views/AlbumTableViewCell.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Album.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Extensions/UIImageViewExtension.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Extensions/UITableViewExtension.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Views/DetailViewController.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Views/MainViewController.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/NetworkingError.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/QueryResult.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/APIClient.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/adam/Projects/itunes_rss/Build/Intermediates.noindex/iTunesRSSFeed.build/Debug-iphonesimulator/iTunesRSSFeed.build/Objects-normal/x86_64/AlbumViewModel~partial.swiftsourceinfo : /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/iTunesRSSAPI.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Feed.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Genre.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Response.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/SceneDelegate.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/AppDelegate.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/ViewModels/FeedViewModel.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/ViewModels/AlbumViewModel.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Views/AlbumTableViewCell.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Models/Album.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Extensions/UIImageViewExtension.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Extensions/UITableViewExtension.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Views/DetailViewController.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Views/MainViewController.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/NetworkingError.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/QueryResult.swift /Users/adam/Projects/itunes_rss/iTunesRSSFeed/Networking/APIClient.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
/home/dart/DoThinking/RustMain/Advanced/day28_advanced_traits/open_htrait4_use_supertrait/target/rls/debug/deps/open_htrait4_use_supertrait-9283106f81a9b5b1.rmeta: src/main.rs
/home/dart/DoThinking/RustMain/Advanced/day28_advanced_traits/open_htrait4_use_supertrait/target/rls/debug/deps/open_htrait4_use_supertrait-9283106f81a9b5b1.d: src/main.rs
src/main.rs:
| D |
module quoit.record;
import std.array;
import std.format;
public import std.conv;
public import std.traits;
public import std.variant;
import d2sqlite3;
public import quoit.query;
public import quoit.helpers.attributes;
public import quoit.helpers.helpers;
public import quoit.quoit;
//TODO: Coerce into bool type.
/**
* Exception type produced by record operations.
**/
class RecordException : Exception {
/**
* Constructs a record exception with an error message.
**/
this(string message) {
super(message);
}
}
/**
* A container type for Record information.
**/
struct RecordData(T) {
/**
* The name of the corresponding table.
**/
string table;
/**
* The name of the primary id column.
**/
string idColumn;
/**
* The column info table, for this record type.
**/
ColumnBindings[string] columns;
/**
* Mysql database connection.
**/
Database dbConnection;
}
/**
* The record class type.
*
* Template argument ensures that static fields stay local
* to the template instance (and thus, to the Record itself).
**/
class Record(Type) {
private static {
/**
* A container for static Record information.
**/
RecordData!Type _recordData;
}
protected static {
/**
* Gets a column definition, by name.
**/
ColumnBindings getColumnBindings(string name) {
return _recordData.columns[name];
}
/**
* Adds a column definition to this record.
**/
void addColumnBindings(ColumnBindings ci) {
_recordData.columns[ci.name] = ci;
}
/**
* Gets the name of the Id column.
**/
string getIdColumn() {
return _recordData.idColumn;
}
/**
* Sets the name of the Id column.
**/
void setIdColumn(string column) {
_recordData.idColumn = column;
}
/**
* Gets the name of the table for this record.
**/
string getTableName() {
return _recordData.table;
}
/**
* Sets the name of the table for this record.
**/
void setTableName(string table) {
_recordData.table = table;
}
/**
* Gets the column list for this record.
**/
string[] getColumnNames() {
return _recordData.columns.keys;
}
/**
* Gets a list of column values, for this instance.
**/
Variant[] getColumnValues(T)(T instance) {
Variant[] values;
foreach(name, info; _recordData.columns)
values ~= info.get(instance);
return values;
}
/**
* Gets the database connection.
**/
Database getDBConnection() {
// Mysql-native provides this.
if(_recordData.dbConnection.handle !is null) {
return _recordData.dbConnection;
}
// No database connection set.
throw new RecordException("Record has no database connection.");
}
/**
* Sets the database connection.
**/
void setDBConnection(Database conn) {
_recordData.dbConnection = conn;
}
/**
* Executes a query that produces a result set.
**/
CachedResults executeQueryResult(QueryBuilder query) {
// Get a database connection.
auto conn = getDBConnection;
auto stmt = conn.prepare(query.build);
// Bind parameters and execute.
foreach(i, param; query.getParameters) {
stmt.bind((++i).to!int, param.to!string);
}
CachedResults result = stmt.execute().cached();
stmt.reset();
return result;
}
/**
* Executes a query that doesn't produce a result set.
**/
ulong executeQuery(QueryBuilder query) {
// Get a database connection.
auto conn = getDBConnection;
//Prepare the query.
auto stmt = conn.prepare(query.build);
// Bind parameters and execute.
foreach(i, param; query.getParameters) {
stmt.bind((++i).to!int, param.to!string);
}
stmt.execute();
stmt.reset();
return conn.totalChanges;
}
/**
* Gets the query for get() operations.
**/
QueryBuilder getQueryForGet(KT)(KT key) {
SelectBuilder builder = new SelectBuilder()
.select(getColumnNames).from(getTableName).limit(1);
return builder.where(new WhereBuilder().equals(getIdColumn, key));
}
/**
* Gets the query for find() operations.
**/
QueryBuilder getQueryForFind(KT)(KT[string] conditions, int limit) {
auto query = appender!string;
SelectBuilder builder = new SelectBuilder()
.select(getColumnNames).from(getTableName).limit(limit);
formattedWrite(query, "%-(`%s`=?%| AND %)", conditions.keys);
return builder.where(query.data, conditions.values);
}
/**
* Gets the query for create() operations.
**/
QueryBuilder getQueryForCreate(T)(T instance) {
InsertBuilder builder = new InsertBuilder()
.insert(getColumnNames).into(getTableName);
// Add column values to query.
foreach(string name; getColumnNames) {
auto info = getColumnBindings(name);
builder.value(info.get(instance));
}
return builder;
}
/**
* Gets the query for update() operations.
**/
QueryBuilder getQueryForSave(T)(
T instance, string[] columns = null...) {
UpdateBuilder builder = new UpdateBuilder()
.update(getTableName);
// Check for a columns list.
if(columns is null) {
// Include all columns.
columns = getColumnNames;
}
// Set column values in query.
foreach(string name; columns) {
auto info = getColumnBindings(name);
builder.set(info.name, info.get(instance));
}
// Update the record using the primary id.
Variant id = getColumnBindings(getIdColumn).get(instance);
return builder.where(new WhereBuilder().equals(getIdColumn, id));
}
/**
* Gets the query for remove() operations.
**/
QueryBuilder getQueryForRemove(T)(T instance) {
DeleteBuilder builder = new DeleteBuilder()
.from(getTableName);
// Delete the record using the primary id.
Variant id = getColumnBindings(getIdColumn).get(instance);
return builder.where(new WhereBuilder().equals(getIdColumn, id));
}
}
}
/**
* The ActiveRecord mixin.
**/
mixin template ActiveRecord() {
/**
* Alias to the local type.
**/
alias Type = Target!(__traits(parent, get));
mixin Helpers;
/**
* Static initializer for column info.
**/
static this() {
// Check if the class defined an override name.
setTableName(getTableDefinition!(Type));
// Search through class members.
foreach(member; __traits(derivedMembers, Type)) {
static if(__traits(compiles, __traits(getMember, Type, member))) {
alias Current = Target!(__traits(getMember, Type, member));
// Check if this is a column.
static if(isColumn!(Type, member)) {
// Ensure that this isn't a function.
static assert(!is(typeof(Current) == function));
// Find the column name.
string name = getColumnDefinition!(Type, member);
// Create a column info record.
auto info = new ColumnBindings();
info.field = member;
info.name = name;
// Create delegate get and set.
info.get = createGetDelegate!(Type, member)(info);
info.set = createSetDelegate!(Type, member)(info);
// Populate other fields.
foreach(annotation; __traits(getAttributes, Current)) {
// Check is @Id is present.
static if(is(annotation == Id)) {
// Check for duplicate Id.
if(getIdColumn !is null) {
throw new RecordException(Type.stringof ~
" already defined an Id column.");
}
// Save the Id column.
setIdColumn(info.name);
info.isId = true;
}
// Check if @Nullable is present.
static if(is(annotation == Nullable)) {
info.notNull = false;
}
// Check if @AutoIncrement is present.
static if(is(annotation == AutoIncrement)) {
// Check that this can be auto incremented.
static assert(isNumeric!(typeof(Current)));
info.autoIncrement = true;
}
// Check if @MaxLength(int) is present.
static if(is(typeof(annotation) == MaxLength)) {
info.maxLength = annotation.maxLength;
}
}
// Store the column definition.
addColumnBindings(info);
}
}
}
// Check is we have an Id.
if(getIdColumn is null) {
throw new RecordException(Type.stringof ~
" doesn't define an Id column.");
}
// Check if we have any columns.
if(getColumnNames.length < 1) {
throw new RecordException(Type.stringof ~
" defines no valid columns.");
}
}
/**
* Gets an object by its primary key.
**/
static Type get(KT)(KT key) {
// Get the query for the operation.
auto query = getQueryForGet(key);
// Execute the get() query.
auto result = executeQueryResult(query);
// Check that we got a result.
if(result.length < 1) {
throw new RecordException("No records found for " ~
getTableName ~ " at " ~ to!string(key));
}
auto row = result[0];
auto instance = new Type;
// Bind column values to fields.
foreach(idx, col; getColumnNames) {
//FIXME Fix instance where a column is omitted.
Variant value = row[col].as!string;
getColumnBindings(col).set(instance, value);
}
// Return the instance.
return instance;
}
/**
* Finds matching objects, by column values.
**/
static Type[] find(KT)(KT[string] conditions, int limit = -1) {
// Get the query for the operation.
auto query = getQueryForFind(conditions, limit);
// Execute the find() query.
auto result = executeQueryResult(query);
// Check that we got a result.
if(result.length < 1) return [];
Type[] array;
// Create the initial array of elements.
foreach(row; result) {
auto instance = new Type;
foreach(col; getColumnNames) {
//FIXME: Fix instance where a column is omitted.
Variant value = row[col].as!string;
getColumnBindings(col).set(instance, value);
}
// Append the object.
array ~= instance;
}
// Return the array.
return array;
}
/**
* Creates this object in the database, if it does not yet exist.
**/
void create() {
import std.array;
// Update auto increment columns.
auto info = getColumnBindings(getIdColumn);
if(info.autoIncrement) {
// Fetch the last insert id.
QueryBuilder query = SelectBuilder.lastInsertId.from(getTableName);
Variant id = executeQueryResult(query)[0][0].as!size_t + 1;
// Update the auto incremented column.
info.set(this, id);
}
// Get the query for the operation.
QueryBuilder query = getQueryForCreate(this);
// Execute the create() query.
immutable result = executeQuery(query);
// Check that something was created.
if(result < 1) {
throw new RecordException("No records were created for " ~
Type.stringof ~ " by create().");
}
}
/**
* Saves this object to the database, if it already exists.
* Optionally specifies a list of columns to be updated.
**/
void save(string[] names = null...) {
// Get the query for the operation.
auto query = getQueryForSave(this, names);
// Execute the save() query.
ulong result = executeQuery(query);
// Check that something was created.
if(result < 1) {
throw new RecordException("No records were updated for " ~
Type.stringof ~ " by save().");
}
}
/**
* Removes this object from the database, if it already exists.
**/
void remove() {
// Get the query for the operation.
auto query = getQueryForRemove(this);
// Execute the remove() query.
ulong result = executeQuery(query);
// Check that something was created.
if(result < 1) {
throw new RecordException("No records were removed for " ~
Type.stringof ~ " by remove().");
}
}
}
alias Target(alias T) = T;
| D |
/Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.build/Utilities.swift.o : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/PostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentPostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Redis.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.build/Utilities~partial.swiftmodule : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/PostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentPostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Redis.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.build/Utilities~partial.swiftdoc : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/PostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentPostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Redis.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.build/Utilities~partial.swiftsourceinfo : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/PostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentPostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Redis.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
| D |
module google.protobuf.empty;
import std.json : JSONValue;
import google.protobuf;
struct Empty
{
auto toProtobuf()
{
return cast(ubyte[]) null;
}
Empty fromProtobuf(R)(ref R inputRange)
{
import std.range : drop;
inputRange = inputRange.drop(inputRange.length);
return this;
}
JSONValue toJSONValue()()
{
return JSONValue(cast(JSONValue[string]) null);
}
Empty fromJSONValue()(JSONValue value)
{
import std.exception : enforce;
import std.json : JSON_TYPE;
import std.range : empty;
if (value.type == JSON_TYPE.NULL)
{
return this;
}
enforce!ProtobufException(value.type == JSON_TYPE.OBJECT && value.object.empty,
"Invalid google.protobuf.Empty JSON Encoding");
return this;
}
}
unittest
{
import std.range : empty;
assert(Empty().toProtobuf.empty);
ubyte[] foo = [1, 2, 3];
Empty().fromProtobuf(foo);
assert(foo.empty);
}
unittest
{
import std.json : JSON_TYPE;
import std.range : empty;
assert(Empty().toJSONValue.type == JSON_TYPE.OBJECT);
assert(Empty().toJSONValue.object.empty);
}
| D |
instance Mod_1147_GRD_Gardist_MT (Npc_Default)
{
//-------- primary data --------
name = NAME_Gardist;
npctype = NPCTYPE_mt_gardist;
guild = GIL_OUT;
level = 15;
voice = 7;
id = 1147;
//-------- abilities --------
B_SetAttributesToChapter (self, 4);
EquipItem (self, ItMw_1H_quantarie_Schwert_01);
//-------- visuals --------
// animations
Mdl_SetVisual (self,"HUMANS.MDS");
Mdl_ApplyOverlayMds (self,"Humans_Militia.mds");
// body mesh ,bdytex,skin,head mesh ,headtex,teethtex,ruestung
Mdl_SetVisualBody (self,"hum_body_Naked0", 0, 0,"Hum_Head_FatBald", 10, 0, GRD_ARMOR_M);
Mdl_SetModelFatness(self,0);
fight_tactic = FAI_HUMAN_STRONG;
//-------- Talente --------
B_SetFightSkills (self, 60);
B_CreateAmbientInv (self);
//-------------Daily Routine-------------
daily_routine = Rtn_start_1147;
};
FUNC VOID Rtn_start_1147 ()
{
TA_Stand_Guarding (18,00,19,00,"OCC_CELLAR_HALL");
TA_Stand_Guarding (19,00,18,00,"OCC_CELLAR_HALL");
}; | D |
/Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTPServer.build/HTTP2/HTTP2FrameWriter.swift.o : /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HPACK.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Frame.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP11/HTTP11Response.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Response.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPServerExConfig.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPContentCompression.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2FrameReader.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2FrameWriter.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPServer.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPMultiplexer.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2PrefaceValidator.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2SessionSettings.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Client.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP11/HTTP11Request.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Request.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPServerEx.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/XPC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/os.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftinterface /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/os.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../asn1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../tls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dtls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../e_os2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl23.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509v3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../md5.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pkcs7.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../sha.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../zlib.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/czlib.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../obj_mac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../hmac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ec.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rand.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pqueue.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../conf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslconf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../zconf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../lhash.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../stack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../safestack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../zutil.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../kssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/openssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bn.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bio.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../crypto.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../comp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../srtp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../evp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ossl_typ.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../buffer.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectCHTTPParser/include/http_parser.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../err.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../inftrees.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../symhacks.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../cms.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../objects.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslv.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509_vfy.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/dyld.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCRUD.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectMySQL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCURL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/StORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/MySQLStORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLogger.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTPServer.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/SwiftMoment.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectCHTTPParser/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTPServer.build/HTTP2/HTTP2FrameWriter~partial.swiftmodule : /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HPACK.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Frame.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP11/HTTP11Response.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Response.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPServerExConfig.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPContentCompression.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2FrameReader.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2FrameWriter.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPServer.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPMultiplexer.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2PrefaceValidator.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2SessionSettings.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Client.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP11/HTTP11Request.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Request.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPServerEx.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/XPC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/os.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftinterface /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/os.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../asn1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../tls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dtls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../e_os2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl23.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509v3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../md5.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pkcs7.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../sha.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../zlib.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/czlib.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../obj_mac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../hmac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ec.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rand.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pqueue.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../conf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslconf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../zconf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../lhash.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../stack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../safestack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../zutil.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../kssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/openssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bn.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bio.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../crypto.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../comp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../srtp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../evp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ossl_typ.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../buffer.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectCHTTPParser/include/http_parser.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../err.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../inftrees.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../symhacks.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../cms.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../objects.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslv.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509_vfy.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/dyld.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCRUD.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectMySQL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCURL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/StORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/MySQLStORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLogger.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTPServer.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/SwiftMoment.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectCHTTPParser/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTPServer.build/HTTP2/HTTP2FrameWriter~partial.swiftdoc : /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HPACK.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Frame.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP11/HTTP11Response.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Response.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPServerExConfig.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPContentCompression.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2FrameReader.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2FrameWriter.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPServer.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPMultiplexer.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2PrefaceValidator.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2SessionSettings.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Client.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP11/HTTP11Request.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Request.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPServerEx.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/XPC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/os.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftinterface /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/os.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../asn1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../tls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dtls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../e_os2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl23.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509v3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../md5.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pkcs7.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../sha.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../zlib.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/czlib.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../obj_mac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../hmac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ec.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rand.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pqueue.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../conf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslconf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../zconf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../lhash.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../stack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../safestack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../zutil.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../kssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/openssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bn.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bio.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../crypto.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../comp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../srtp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../evp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ossl_typ.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../buffer.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectCHTTPParser/include/http_parser.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../err.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../inftrees.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../symhacks.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../cms.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../objects.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslv.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509_vfy.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/dyld.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCRUD.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectMySQL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCURL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/StORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/MySQLStORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLogger.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTPServer.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/SwiftMoment.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectCHTTPParser/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTPServer.build/HTTP2/HTTP2FrameWriter~partial.swiftsourceinfo : /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HPACK.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Frame.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP11/HTTP11Response.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Response.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPServerExConfig.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPContentCompression.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2FrameReader.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2FrameWriter.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPServer.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPMultiplexer.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2PrefaceValidator.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2SessionSettings.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Client.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP11/HTTP11Request.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Request.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTPServerEx.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/XPC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/os.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftinterface /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/os.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../asn1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../tls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dtls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../e_os2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl23.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509v3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../md5.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pkcs7.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../sha.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../zlib.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/czlib.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../obj_mac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../hmac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ec.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rand.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pqueue.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../conf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslconf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../zconf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../lhash.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../stack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../safestack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../zutil.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../kssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/openssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bn.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bio.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../crypto.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../comp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../srtp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../evp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ossl_typ.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../buffer.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectCHTTPParser/include/http_parser.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../err.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/../inftrees.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../symhacks.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../cms.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../objects.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslv.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509_vfy.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/dyld.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCRUD.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectMySQL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCURL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/StORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/MySQLStORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLogger.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTPServer.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/SwiftMoment.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-CZlib-src/PerfectCZlib/include/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTPServer/Sources/PerfectCHTTPParser/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
/* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
module flow.engine.impl.bpmn.listener.TransactionDependentExecutionListenerExecutionScope;
import hunt.collection.Map;
import flow.bpmn.model.FlowElement;
/**
* @author Yvo Swillens
*/
class TransactionDependentExecutionListenerExecutionScope {
protected string processInstanceId;
protected string executionId;
protected FlowElement flowElement;
protected Map!(string, Object) executionVariables;
protected Map!(string, Object) customPropertiesMap;
this(string processInstanceId, string executionId,
FlowElement flowElement, Map!(string, Object) executionVariables,
Map!(string, Object) customPropertiesMap) {
this.processInstanceId = processInstanceId;
this.executionId = executionId;
this.flowElement = flowElement;
this.executionVariables = executionVariables;
this.customPropertiesMap = customPropertiesMap;
}
public string getProcessInstanceId() {
return processInstanceId;
}
public string getExecutionId() {
return executionId;
}
public FlowElement getFlowElement() {
return flowElement;
}
public Map!(string, Object) getExecutionVariables() {
return executionVariables;
}
public Map!(string, Object) getCustomPropertiesMap() {
return customPropertiesMap;
}
}
| D |
instance KDW_14010_Addon_Cronos_ADW(Npc_Default)
{
name[0] = "Cronos";
guild = GIL_KDW;
id = 14010;
voice = 4;
flags = NPC_FLAG_IMMORTAL;
npcType = npctype_main;
aivar[AIV_MagicUser] = MAGIC_ALWAYS;
aivar[AIV_IgnoresFakeGuild] = TRUE;
aivar[AIV_IgnoresArmor] = TRUE;
B_SetAttributesToChapter(self,5);
fight_tactic = FAI_HUMAN_STRONG;
EquipItem(self,ItMW_Addon_Stab05);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Thief",Face_P_NormalBart_Cronos,BodyTex_P,itar_kdw_h_wh);
Mdl_ApplyOverlayMds(self,"Humans_Mage.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,80);
daily_routine = Rtn_Start_14010;
};
func void Rtn_Start_14010()
{
TA_Study_WP(6,35,7,35,"ADW_ENTRANCE_PLATEAU_13A");
TA_Study_WP(7,35,8,35,"ADW_ENTRANCE_PLATEAU_04A");
TA_Study_WP(8,35,9,35,"ADW_ENTRANCE_PLATEAU_05A");
TA_Study_WP(9,35,10,10,"ADW_ENTRANCE_PLATEAU_13A");
TA_Study_WP(10,10,11,15,"ADW_ENTRANCE_PLATEAU_05A");
TA_Study_WP(11,15,12,35,"ADW_ENTRANCE_PLATEAU_04A");
TA_Study_WP(12,35,13,35,"ADW_ENTRANCE_PLATEAU_13A");
TA_Study_WP(13,35,14,35,"ADW_ENTRANCE_PLATEAU_04A");
TA_Study_WP(14,35,15,35,"ADW_ENTRANCE_PLATEAU_05A");
TA_Study_WP(15,35,16,10,"ADW_ENTRANCE_PLATEAU_13A");
TA_Study_WP(16,10,17,15,"ADW_ENTRANCE_PLATEAU_04A");
TA_Study_WP(17,15,18,35,"ADW_ENTRANCE_PLATEAU_05A");
TA_Study_WP(18,35,19,35,"ADW_ENTRANCE_PLATEAU_13A");
TA_Study_WP(19,35,20,35,"ADW_ENTRANCE_PLATEAU_05A");
TA_Study_WP(20,35,21,35,"ADW_ENTRANCE_PLATEAU_04A");
TA_Study_WP(21,35,22,0,"ADW_ENTRANCE_PLATEAU_13A");
TA_Sit_Chair(22,0,6,35,"ADW_ENTRANCE_BUILDING2_03");
};
| D |
void main() {
auto ip = readAs!(int[]), N = ip[0], M = ip[1];
auto cnt = new ulong[](N);
foreach(i; 0..M) {
auto ip2 = readAs!(int[]), a = ip2[0], b = ip2[1];
a--; b--;
cnt[a]++; cnt[b]++;
}
if(cnt.all!(v => v % 2 == 0)) writeln("YES");
else writeln("NO");
}
// ===================================
import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;
T readAs(T)() if (isBasicType!T) {
return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
return readln.split.to!T;
}
T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
auto res = new T[][](height, width);
foreach(i; 0..height) {
res[i] = readAs!(T[]);
}
return res;
}
T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
auto res = new T[][](height, width);
foreach(i; 0..height) {
auto s = rs;
foreach(j; 0..width) res[i][j] = s[j].to!T;
}
return res;
}
int ri() {
return readAs!int;
}
double rd() {
return readAs!double;
}
string rs() {
return readln.chomp;
} | D |
Long: http3
Tags: Versions
Protocols: HTTP
Added: 7.66.0
Mutexed: http1.1 http1.0 http2 http2-prior-knowledge
Requires: HTTP/3
Help: Use HTTP v3
See-also: http1.1 http2
---
WARNING: this option is experimental. Do not use in production.
Tells curl to use HTTP version 3 directly to the host and port number used in
the URL. A normal HTTP/3 transaction will be done to a host and then get
redirected via Alt-SVc, but this option allows a user to circumvent that when
you know that the target speaks HTTP/3 on the given host and port.
This option will make curl fail if a QUIC connection cannot be established, it
cannot fall back to a lower HTTP version on its own.
| D |
void test() {
Print("test successful!");
}
int main() {
test();
}
| D |
(postpositive) however
| D |
module deimos.cef1.proxy_handler;
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// #ifndef CEF_INCLUDE_CAPI_CEF_PROXY_HANDLER_CAPI_H_
// #pragma once
// #ifdef __cplusplus
extern(C) {
// #endif
import deimos.cef1.base;
///
// Implement this structure to handle proxy resolution events.
///
struct cef_proxy_handler_t {
///
// Base structure.
///
cef_base_t base;
///
// Called to retrieve proxy information for the specified |url|.
///
extern(System) void function(cef_proxy_handler_t* self, const(cef_string_t)* url, cef_proxy_info_t* proxy_info) get_proxy_for_url;
}
// #ifdef __cplusplus
}
// #endif
// #endif CEF_INCLUDE_CAPI_CEF_PROXY_HANDLER_CAPI_H_
| D |
/*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* gtkD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
/*
* Conversion parameters:
* inFile = GtkSourceLanguage.html
* outPack = gsv
* outFile = SourceLanguage
* strct = GtkSourceLanguage
* realStrct=
* ctorStrct=
* clss = SourceLanguage
* interf =
* class Code: No
* interface Code: No
* template for:
* extend =
* implements:
* prefixes:
* - gtk_source_iter_
* omit structs:
* omit prefixes:
* omit code:
* omit signals:
* imports:
* - gtkD.glib.Str
* structWrap:
* module aliases:
* local aliases:
* overrides:
*/
module gtkD.gsv.SourceLanguage;
public import gtkD.gsvc.gsvtypes;
private import gtkD.gsvc.gsv;
private import gtkD.glib.ConstructionException;
private import gtkD.glib.Str;
private import gtkD.gobject.ObjectG;
/**
* Description
* GtkSourceLanguage encapsulates syntax and highlighting styles for a
* particular language. Use GtkSourceLanguageManager to obtain a
* GtkSourceLanguage instance, and gtk_source_buffer_set_language()
* to apply it to a GtkSourceBuffer.
*/
public class SourceLanguage : ObjectG
{
/** the main Gtk struct */
protected GtkSourceLanguage* gtkSourceLanguage;
public GtkSourceLanguage* getSourceLanguageStruct()
{
return gtkSourceLanguage;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)gtkSourceLanguage;
}
/**
* Sets our main struct and passes it to the parent class
*/
public this (GtkSourceLanguage* gtkSourceLanguage)
{
if(gtkSourceLanguage is null)
{
this = null;
return;
}
//Check if there already is a D object for this gtk struct
void* ptr = getDObject(cast(GObject*)gtkSourceLanguage);
if( ptr !is null )
{
this = cast(SourceLanguage)ptr;
return;
}
super(cast(GObject*)gtkSourceLanguage);
this.gtkSourceLanguage = gtkSourceLanguage;
}
/**
*/
/**
* Returns the ID of the language. The ID is not locale-dependent.
* Returns: the ID of language.The returned string is owned by language and should not be freedor modified.
*/
public string gtkSourceLanguageGetId()
{
// const gchar * gtk_source_language_get_id (GtkSourceLanguage *language);
return Str.toString(gtk_source_language_get_id(gtkSourceLanguage));
}
/**
* Returns the localized name of the language.
* Returns: the name of language.The returned string is owned by language and should not be freedor modified.
*/
public string gtkSourceLanguageGetName()
{
// const gchar * gtk_source_language_get_name (GtkSourceLanguage *language);
return Str.toString(gtk_source_language_get_name(gtkSourceLanguage));
}
/**
* Returns the localized section of the language.
* Each language belong to a section (ex. HTML belogs to the
* Markup section).
* Returns: the section of language.The returned string is owned by language and should not be freedor modified.
*/
public string gtkSourceLanguageGetSection()
{
// const gchar * gtk_source_language_get_section (GtkSourceLanguage *language);
return Str.toString(gtk_source_language_get_section(gtkSourceLanguage));
}
/**
* Returns whether the language should be hidden from the user.
* Returns: TRUE if the language should be hidden, FALSE otherwise.
*/
public int gtkSourceLanguageGetHidden()
{
// gboolean gtk_source_language_get_hidden (GtkSourceLanguage *language);
return gtk_source_language_get_hidden(gtkSourceLanguage);
}
/**
* Params:
* name = metadata property name.
* Returns: value of property name stored in the metadata of languageor NULL if language doesn't contain that metadata property.The returned string is owned by language and should not be freedor modified.
*/
public string gtkSourceLanguageGetMetadata(string name)
{
// const gchar * gtk_source_language_get_metadata (GtkSourceLanguage *language, const gchar *name);
return Str.toString(gtk_source_language_get_metadata(gtkSourceLanguage, Str.toStringz(name)));
}
/**
* Returns the mime types associated to this language. This is just
* an utility wrapper around gtk_source_language_get_metadata() to
* retrieve the "mimetypes" metadata property and split it into an
* array.
* Returns: a newly-allocated NULL terminated array containingthe mime types or NULL if no mime types are found.The returned array must be freed with g_strfreev().
*/
public string[] gtkSourceLanguageGetMimeTypes()
{
// gchar ** gtk_source_language_get_mime_types (GtkSourceLanguage *language);
return Str.toStringArray(gtk_source_language_get_mime_types(gtkSourceLanguage));
}
/**
* Returns the globs associated to this language. This is just
* an utility wrapper around gtk_source_language_get_metadata() to
* retrieve the "globs" metadata property and split it into an array.
* Returns: a newly-allocated NULL terminated array containingthe globs or NULL if no globs are found.The returned array must be freed with g_strfreev().
*/
public string[] gtkSourceLanguageGetGlobs()
{
// gchar ** gtk_source_language_get_globs (GtkSourceLanguage *language);
return Str.toStringArray(gtk_source_language_get_globs(gtkSourceLanguage));
}
/**
* Returns the name of the style with ID style_id defined by this language.
* Params:
* styleId = a style ID
* Returns: the name of the style with ID style_id defined by this language orNULL if the style has no name or there is no style with ID style_id definedby this language. The returned string is owned by the language and mustnot be modified.
*/
public string gtkSourceLanguageGetStyleName(string styleId)
{
// const gchar * gtk_source_language_get_style_name (GtkSourceLanguage *language, const gchar *style_id);
return Str.toString(gtk_source_language_get_style_name(gtkSourceLanguage, Str.toStringz(styleId)));
}
/**
* Returns the ids of the styles defined by this language.
* Returns: a NULL terminated array containingids of the styles defined by this language or NULL if no style isdefined. The returned array must be freed with g_strfreev().
*/
public string[] gtkSourceLanguageGetStyleIds()
{
// gchar ** gtk_source_language_get_style_ids (GtkSourceLanguage *language);
return Str.toStringArray(gtk_source_language_get_style_ids(gtkSourceLanguage));
}
}
| D |
//T compiles:no
//T retval:0
//T has-passed:yes
// Tests missing default in non-final switches
int main() {
int x = 10;
switch(x) {
case 0:
return 1;
case 2:
return 2;
}
}
| D |
module a;
import myName = b;
| D |
// To compile:
// dfl charformat -gui
private import os.win.gui.all;
class MainForm: Form
{
RichTextBox rtb;
this()
{
text = "Пример с Форматированием Текста";
size = Size(600, 400);
windowState = FormWindowState.MAXIMIZED;
with(rtb = new RichTextBox)
{
parent = this;
font = new Font("Courier New", 10f); // Default font.
rtb.backColor = Color(0xFF, 0xFF, 0xFF);
rtb.foreColor = Color.fromRgb(0);
dock = DockStyle.FILL;
scrollBars = RichTextBoxScrollBars.VERTICAL;
gotFocus ~= &rtb_gotFocus;
}
load ~= &form_load;
}
private void form_load(Object sender, EventArgs ea)
{
// Stream in formatted text by setting the selection formatting and then
// setting the selected text.
// If you want to apply formatting to existing text you would have to
// select the text first using selectionStart and selectionLength.
with(rtb)
{
rtb.selectionColor = Color.fromRgb(0);
rtb.selectedText = "И тогда разработчики сказали, ";
rtb.selectionColor = Color(0xFF, 0, 0);
rtb.selectionFont = new Font("Arial", 12f);
rtb.selectedText = "\"DFL - не плох, не плох\"";
rtb.selectionFont = font; // Set the font back to the default rtb.font.
rtb.selectionColor = Color.fromRgb(0);
rtb.selectedText = " и продолжили ";
rtb.selectionFont = new Font("Courier New", 10f, FontStyle.ITALIC);
rtb.selectedText = "удивлять ";
rtb.selectionFont = new Font("Courier New", 10f, cast(FontStyle)(FontStyle.ITALIC | FontStyle.BOLD));
rtb.selectedText = "мир ";
rtb.selectionFont = font; // Set the font back to the default rtb.font.
rtb.selectedText = "приложениями, которые разработывали.";
rtb.selectionColor = Color.fromRgb(0);
rtb.selectedText = "\r\n\r\nH";
rtb.selectionSubscript = true;
assert(selectionSubscript);
rtb.selectedText = "2";
rtb.selectionSubscript = false;
assert(!selectionSubscript);
rtb.selectedText = "0";
rtb.selectedText = "\r\n\r\nx";
rtb.selectionSuperscript = true;
assert(selectionSuperscript);
rtb.selectedText = "3";
rtb.selectionSuperscript = false;
assert(!selectionSuperscript);
rtb.selectedText = " + 1";
}
}
private void rtb_gotFocus(Object sender, EventArgs ea)
{
// Prevent the text from initially being highlighted when the form opens.
rtb.selectionLength = 0;
// Unregister this delegate from being called on focus events in the future.
rtb.gotFocus.removeHandler(&rtb_gotFocus);
}
}
int main()
{
int result = 0;
try
{
Application.run(new MainForm);
}
catch(Object o)
{
msgBox(o.toString(), "Непоправимая Ошибка", MsgBoxButtons.OK, MsgBoxIcon.ERROR);
result = 1;
}
return result;
}
| D |
module hunt.http.codec.http.encode.ResetGenerator;
import hunt.http.codec.http.frame.Flags;
import hunt.http.codec.http.frame.Frame;
import hunt.http.codec.http.frame.FrameType;
import hunt.http.codec.http.frame.ResetFrame;
import hunt.http.codec.http.encode.FrameGenerator;
import hunt.http.codec.http.encode.HeaderGenerator;
import hunt.collection;
import hunt.Exceptions;
import std.conv;
/**
*/
class ResetGenerator :FrameGenerator {
this(HeaderGenerator headerGenerator) {
super(headerGenerator);
}
override
List!(ByteBuffer) generate(Frame frame) {
ResetFrame resetFrame = cast(ResetFrame) frame;
return Collections.singletonList(generateReset(resetFrame.getStreamId(), resetFrame.getError()));
}
ByteBuffer generateReset(int streamId, int error) {
if (streamId < 0)
throw new IllegalArgumentException("Invalid stream id: " ~ streamId.to!string);
ByteBuffer header = generateHeader(FrameType.RST_STREAM, 4, Flags.NONE, streamId);
header.put!int(error);
BufferUtils.flipToFlush(header, 0);
return header;
}
}
| D |
module pnet.clientsocket;
| D |
module entity_generated;
import std.container.array;
import components : PositionComponent;
import components : VelocityComponent;
import components : Color;
import components : FigureComponent;
import components : MoveNode;
import components : RenderNode;
struct PhysicsGroup {
Array!MoveNode moveNodes;
}
struct GapiGroup {
Array!Color colorComponents;
Array!FigureComponent figureComponents;
Array!RenderNode renderNodes;
}
mixin template EntityManagerMixin() {
import std.container.array;
import components : PositionComponent;
Array!PositionComponent positionComponents;
import components : VelocityComponent;
Array!VelocityComponent velocityComponents;
import components : Color;
GapiGroup gapi;
import components : FigureComponent;
import components : MoveNode;
PhysicsGroup physics;
import components : RenderNode;
}
mixin template EntityMixin() {
import std.container.array;
import components : PositionComponent;
import components : VelocityComponent;
import components : Color;
import components : FigureComponent;
import components : MoveNode;
import components : RenderNode;
Entity resolveNodes(T)(T component) {
static if (is(T == PositionComponent)) {
manager.positionComponents.insert(component);
components[typeid(component)] = manager.positionComponents.length - 1;
// Check node: MoveNode
{
PositionComponent* position;
VelocityComponent* velocity;
int componentsCount = 1;
if (typeid(VelocityComponent) in components) {
const index = components[typeid(VelocityComponent)];
velocity = &manager.velocityComponents[index];
++componentsCount;
}
if (componentsCount == 2) {
manager.physics.moveNodes.insert(MoveNode(position, velocity));
}
}
// Check node: RenderNode
{
PositionComponent* position;
FigureComponent* figure;
int componentsCount = 1;
if (typeid(FigureComponent) in components) {
const index = components[typeid(FigureComponent)];
figure = &manager.gapi.figureComponents[index];
++componentsCount;
}
if (componentsCount == 2) {
manager.gapi.renderNodes.insert(RenderNode(position, figure));
}
}
}
static if (is(T == VelocityComponent)) {
manager.velocityComponents.insert(component);
components[typeid(component)] = manager.velocityComponents.length - 1;
// Check node: MoveNode
{
PositionComponent* position;
VelocityComponent* velocity;
int componentsCount = 1;
if (typeid(PositionComponent) in components) {
const index = components[typeid(PositionComponent)];
position = &manager.positionComponents[index];
++componentsCount;
}
if (componentsCount == 2) {
manager.physics.moveNodes.insert(MoveNode(position, velocity));
}
}
}
static if (is(T == Color)) {
manager.gapi.colorComponents.insert(component);
components[typeid(component)] = manager.gapi.colorComponents.length - 1;
}
static if (is(T == FigureComponent)) {
manager.gapi.figureComponents.insert(component);
components[typeid(component)] = manager.gapi.figureComponents.length - 1;
// Check node: RenderNode
{
PositionComponent* position;
FigureComponent* figure;
int componentsCount = 1;
if (typeid(PositionComponent) in components) {
const index = components[typeid(PositionComponent)];
position = &manager.positionComponents[index];
++componentsCount;
}
if (componentsCount == 2) {
manager.gapi.renderNodes.insert(RenderNode(position, figure));
}
}
}
return this;
}
}
| D |
///
module serialport.port;
import std.algorithm;
import std.array;
import std.conv : to, text, octal;
import std.exception;
import std.experimental.logger;
import std.path;
import std.string;
import core.time;
import std.datetime;
import serialport.types;
import serialport.exception;
version (Posix) {} else version (Windows) {}
else static assert(0, "unsupported platform");
///
class SerialPort
{
protected:
///
string port;
///
version (Posix) int handle = -1;
///
version (Windows) HANDLE handle = null;
/// preform pause
void sleep(Duration dt)
{
if (sleepFunc !is null) sleepFunc(dt);
else
{
import core.thread;
if (Fiber.getThis is null)
Thread.sleep(dt);
else
{
auto tm = StopWatch(AutoStart.yes);
while (tm.peek.to!Duration < dt) Fiber.yield();
}
}
}
Duration ioPause()
{
// approx theoretical time for receive or send
// one byte (8 bit + 1 start bit + 1 stop bit)
return (cast(ulong)(10.0f / baudRate * 1e6)).usecs;
}
public:
///
static struct Config
{
///
uint baudRate=9600;
///
Parity parity=Parity.none;
///
DataBits dataBits=DataBits.data8;
///
StopBits stopBits=StopBits.one;
bool hardwareDisableFlowControl = true;
auto set(Parity v) { parity = v; return this; }
auto set(uint v) { baudRate = v; return this; }
auto set(DataBits v) { dataBits = v; return this; }
auto set(StopBits v) { stopBits = v; return this; }
}
/// extended delegate for perform sleep
void delegate(Duration dt) sleepFunc;
///
this(string port, Config conf=Config.init, void delegate(Duration) slp=null)
{
this.port = port;
this.sleepFunc = slp;
setup(conf);
}
///
this(string port, uint baudRate, void delegate(Duration) slp=null)
{ this(port, Config(baudRate), slp); }
///
this(string port, uint baudRate, Parity parity, void delegate(Duration) slp=null)
{ this(port, Config(baudRate, parity), slp); }
///
this(string port, uint baudRate, Parity parity,
DataBits dataBits,
StopBits stopBits, void delegate(Duration) slp=null)
{ this(port, Config(baudRate, parity, dataBits, stopBits), slp); }
~this() { close(); }
/// close handle
void close()
{
if (closed) return;
version (Windows)
{
CloseHandle(handle);
handle = null;
}
version (Posix)
{
posixClose(handle);
handle = -1;
}
}
///
void reopen(string port, Config cfg)
{
if (!closed) close();
this.port = port;
setup(cfg);
}
///
override string toString() { return port; }
///
SerialPort set(Parity p) { config = config.set(p); return this; }
///
SerialPort set(uint br) { config = config.set(br); return this; }
///
SerialPort set(DataBits db) { config = config.set(db); return this; }
///
SerialPort set(StopBits sb) { config = config.set(sb); return this; }
@property
{
///
bool closed() const
{
version (Posix) return handle == -1;
version (Windows) return handle is null;
}
///
Config config()
{
enforce(!closed, new PortClosedException(port));
Config ret;
version (Posix)
{
termios opt;
enforce(tcgetattr(handle, &opt) != -1,
new SerialPortException(format("Failed while call tcgetattr: %d", errno)));
ret.baudRate = getUintBaudRate();
if (opt.c_cflag.hasFlag(PARODD)) ret.parity = Parity.odd;
else if (!(opt.c_cflag & PARENB)) ret.parity = Parity.none;
else ret.parity = Parity.even;
if (opt.c_cflag.hasFlag(CS8)) ret.dataBits = DataBits.data8;
else if (opt.c_cflag.hasFlag(CS7)) ret.dataBits = DataBits.data7;
else if (opt.c_cflag.hasFlag(CS6)) ret.dataBits = DataBits.data6;
else ret.dataBits = DataBits.data5;
ret.stopBits = opt.c_cflag.hasFlag(CSTOPB) ? StopBits.two : StopBits.one;
}
version (Windows)
{
DCB cfg;
GetCommState(handle, &cfg);
ret.baudRate = cast(uint)cfg.BaudRate;
ret.parity = [NOPARITY: Parity.none, ODDPARITY: Parity.odd,
EVENPARITY: Parity.even][cfg.Parity];
ret.dataBits = [5: DataBits.data5, 6: DataBits.data6,
7: DataBits.data7, 8: DataBits.data8]
.get(cfg.ByteSize, DataBits.data8);
ret.stopBits = cfg.StopBits == ONESTOPBIT ? StopBits.one : StopBits.two;
}
return ret;
}
///
void config(Config c)
{
if (closed) throw new PortClosedException(port);
version (Posix)
{
setUintBaudRate(c.baudRate);
termios opt;
enforce(tcgetattr(handle, &opt) != -1,
new SerialPortException(format("Failed while call tcgetattr: %d", errno)));
final switch (c.parity)
{
case Parity.none:
opt.c_cflag &= ~PARENB;
break;
case Parity.odd:
opt.c_cflag |= (PARENB | PARODD);
break;
case Parity.even:
opt.c_cflag &= ~PARODD;
opt.c_cflag |= PARENB;
break;
}
final switch (c.stopBits)
{
case StopBits.one:
opt.c_cflag &= ~CSTOPB;
break;
case StopBits.onePointFive:
case StopBits.two:
opt.c_cflag |= CSTOPB;
break;
}
opt.c_cflag &= ~CSIZE;
switch (c.dataBits) {
case DataBits.data5: opt.c_cflag |= CS5; break;
case DataBits.data6: opt.c_cflag |= CS6; break;
case DataBits.data7: opt.c_cflag |= CS7; break;
case DataBits.data8: opt.c_cflag |= CS8; break;
default:
errorf("config dataBits is setted as %d, set default CS8",
c.dataBits);
opt.c_cflag |= CS8;
break;
}
enforce(tcsetattr(handle, TCSANOW, &opt) != -1,
new SerialPortException(format("Failed while call tcsetattr: %d", errno)));
auto test = config;
enforce(test.baudRate == c.baudRate,
new BaudRateUnsupportedException(c.baudRate));
enforce(test.parity == c.parity,
new ParityUnsupportedException(c.parity));
enforce(test.stopBits == c.stopBits,
new StopBitsUnsupportedException(c.stopBits));
enforce(test.dataBits == c.dataBits,
new DataBitsUnsupportedException(c.dataBits));
}
version (Windows)
{
DCB cfg;
GetCommState(handle, &cfg);
if (cfg.BaudRate != cast(DWORD)c.baudRate)
{
cfg.BaudRate = cast(DWORD)c.baudRate;
enforce(SetCommState(handle, &cfg),
new BaudRateUnsupportedException(c.baudRate));
}
auto tmpParity = [Parity.none: NOPARITY, Parity.odd: ODDPARITY,
Parity.even: EVENPARITY][c.parity];
if (cfg.Parity != tmpParity)
{
cfg.Parity = cast(ubyte)tmpParity;
enforce(SetCommState(handle, &cfg),
new ParityUnsupportedException(c.parity));
}
auto tmpStopBits = [StopBits.one: ONESTOPBIT,
StopBits.onePointFive: ONESTOPBIT,
StopBits.two: TWOSTOPBITS][c.stopBits];
if (cfg.StopBits != tmpStopBits)
{
cfg.StopBits = cast(ubyte)tmpStopBits;
enforce(SetCommState(handle, &cfg),
new StopBitsUnsupportedException(c.stopBits));
}
if (cfg.ByteSize != cast(typeof(cfg.ByteSize))c.dataBits)
{
cfg.ByteSize = cast(typeof(cfg.ByteSize))c.dataBits;
enforce(SetCommState(handle, &cfg),
new DataBitsUnsupportedException(c.dataBits));
}
}
}
///
Parity parity() { return config.parity; }
///
uint baudRate() { return config.baudRate; }
///
DataBits dataBits() { return config.dataBits; }
///
StopBits stopBits() { return config.stopBits; }
///
Parity parity(Parity v) { config = config.set(v); return v; }
///
uint baudRate(uint v) { config = config.set(v); return v; }
///
DataBits dataBits(DataBits v) { config = config.set(v); return v; }
///
StopBits stopBits(StopBits v) { config = config.set(v); return v; }
///
static string[] ports()
{
version (Posix)
{
bool onlyComPorts(string n)
{
static bool isInRange(T, U)(T v, U a, U b)
{ return a <= v && v <= b; }
version (linux) return n.startsWith("ttyUSB") ||
n.startsWith("ttyS");
version (darwin) return n.startsWith("cu");
version (FreeBSD) return n.startsWith("cuaa") ||
n.startsWith("cuad");
version (openbsd) return n.startsWith("tty");
version (solaris) return n.startsWith("tty") &&
isInRange(n[$-1],'a','z');
}
return dirEntries("/dev/", SpanMode.shallow)
.map!(a=>a.name.baseName)
.filter!onlyComPorts
.map!(a=>"/dev/" ~ a)
.array;
}
version (Windows)
{
import std.algorithm : map;
import std.array : array;
import std.windows.registry;
return Registry
.localMachine()
.getKey("HARDWARE")
.getKey("DEVICEMAP")
.getKey("SERIALCOMM")
.values
.map!(a => a.valueSZ)
.array;
}
}
}
///
void write(const(void[]) arr, Duration timeout=500.usecs)
{
if (closed) throw new PortClosedException(port);
size_t written = 0;
StopWatch full;
auto pause = ioPause();
full.start();
while (written < arr.length)
{
ptrdiff_t res;
auto ptr = arr.ptr + written;
auto len = arr.length - written;
version (Posix)
{
res = posixWrite(handle, ptr, len);
enforce(res >= 0, new WriteException(port, text("errno ", errno)));
}
version (Windows)
{
uint sres;
auto wfr = WriteFile(handle, ptr, cast(uint)len, &sres, null);
if (!wfr)
{
auto err = GetLastError();
if (err == ERROR_IO_PENDING) { /+ asynchronously +/ }
else throw new WriteException(port, text("error ", err));
}
res = sres;
}
written += res;
if (full.peek().to!Duration > timeout)
throw new TimeoutException(port);
sleep(pause);
}
}
///
void[] read(void[] arr, Duration timeout=1.seconds,
Duration frameGap=4.msecs)
{
if (closed) throw new PortClosedException(port);
ptrdiff_t readed = 0;
auto pause = ioPause();
StopWatch silence, full;
full.start();
while (true)
{
enforce(readed <= arr.length,
new SerialPortException("read more what can"));
size_t res;
auto ptr = arr.ptr + readed;
auto len = arr.length - readed;
version (Posix)
{
auto sres = posixRead(handle, ptr, len);
if (sres < 0 && errno == EAGAIN) // no bytes for read, it's ok
sres = 0;
else
enforce(sres >= 0,
new ReadException(port, text("errno ", errno)));
res = sres;
}
version (Windows)
{
uint sres;
auto rfr = ReadFile(handle, ptr, cast(uint)len, &sres, null);
if (!rfr)
{
auto err = GetLastError();
if (err == ERROR_IO_PENDING) { /+ asynchronously +/ }
else throw new ReadException(port, text("error ", err));
}
res = sres;
}
readed += res;
if (res == 0)
{
if (readed > 0 && silence.peek().to!Duration > frameGap)
return arr[0..readed];
if (!silence.running) silence.start();
}
else
{
silence.stop();
silence.reset();
}
if (readed == 0 && full.peek().to!Duration > timeout)
throw new TimeoutException(port);
sleep(pause);
}
}
protected:
version (Posix)
{
void setUintBaudRate(uint br)
{
version (usetermios2)
{
enum CBAUD = octal!10017;
enum BOTHER = octal!10000;
termios2 opt2;
enforce(ioctl(handle, TCGETS2, &opt2) != -1,
new SetupFailException(port, "can't get termios2 options"));
opt2.c_cflag &= ~CBAUD; //Remove current BAUD rate
opt2.c_cflag |= BOTHER; //Allow custom BAUD rate using int input
opt2.c_ispeed = br; //Set the input BAUD rate
opt2.c_ospeed = br; //Set the output BAUD rate
ioctl(handle, TCSETS2, &opt2);
}
else
{
enforce(br in unixBaudList,
new BaudRateUnsupportedException(br));
auto baud = unixBaudList[br];
termios opt;
enforce(tcgetattr(handle, &opt) != -1,
new SerialPortException(port, "can't get termios options"));
//cfsetispeed(&opt, B0);
cfsetospeed(&opt, baud);
enforce(tcsetattr(handle, TCSANOW, &opt) != -1,
new SerialPortException("Failed while call tcsetattr"));
}
}
uint getUintBaudRate()
{
version (usetermios2)
{
termios2 opt2;
enforce(ioctl(handle, TCGETS2, &opt2) != -1,
new SetupFailException(port, "can't get termios2 options"));
return opt2.c_ospeed;
}
else
{
termios opt;
enforce(tcgetattr(handle, &opt) != -1,
new SerialPortException(port, "can't get termios options"));
auto b = cfgetospeed(&opt);
if (b !in unixUintBaudList)
{
warningf("unknown baud speed setted: %s", b);
return 0;
}
return unixUintBaudList[b];
}
}
}
/// open handler, set new config
final void setup(Config conf)
{
enforce(port.length, new SetupFailException(port, "zero length name"));
version (Posix)
{
handle = open(port.toStringz(), O_RDWR | O_NOCTTY | O_NONBLOCK);
enforce(handle != -1,
new SetupFailException(port,
format("Can't open port (errno %d)", errno)));
termios opt;
enforce(tcgetattr(handle, &opt) != -1,
new SetupFailException(port, "can't get termios options"));
// make raw
opt.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP |
INLCR | IGNCR | ICRNL | IXON);
opt.c_oflag &= ~OPOST;
opt.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
opt.c_cflag &= ~(CSIZE | PARENB);
if (conf.hardwareDisableFlowControl)
opt.c_cflag &= ~CRTSCTS;
opt.c_cflag |= CS8;
enforce(tcsetattr(handle, TCSANOW, &opt) != -1,
new SetupFailException(format("Failed while" ~
" call tcsetattr (errno %d)", errno)));
}
else version (Windows)
{
auto fname = `\\.\` ~ port;
handle = CreateFileA(fname.toStringz,
GENERIC_READ | GENERIC_WRITE, 0, null,
OPEN_EXISTING, 0, null);
if (handle is INVALID_HANDLE_VALUE)
{
auto err = GetLastError();
throw new SetupFailException(port,
format("can't CreateFileA '%s' with error: %d", fname, err));
}
SetupComm(handle, 4096, 4096);
PurgeComm(handle, PURGE_TXABORT | PURGE_TXCLEAR |
PURGE_RXABORT | PURGE_RXCLEAR);
COMMTIMEOUTS tm;
tm.ReadIntervalTimeout = DWORD.max;
tm.ReadTotalTimeoutMultiplier = 0;
tm.ReadTotalTimeoutConstant = 0;
tm.WriteTotalTimeoutMultiplier = 0;
tm.WriteTotalTimeoutConstant = 0;
if (SetCommTimeouts(handle, &tm) == 0)
throw new SetupFailException(port,
format("can't SetCommTimeouts with error: %d", GetLastError()));
}
config = conf;
}
}
private bool hasFlag(A,B)(A a, B b) @property { return (a & b) == b; } | D |
class Point {
int x;
int y;
void Init(int x, int y)
{
this.x = x;
this.y = y;
}
void PrintSelf()
{
Print("[",x,", ",y,"]\n");
}
void PrintBoth(Point other)
{
PrintSelf();
other.PrintSelf();
Print(x, other.x);
}
bool equals(Point other) {
return (x == other.x && y == other.y);
}
}
int main() {
Point p;
Point q;
p = new Point;
p.Init(3, 5);
p.PrintSelf();
q = new Point;
q.Init(5, 6);
q.PrintSelf();
p.PrintBoth(q);
Print(p.equals(q));
Print(q.equals(q));
} | D |
module org.serviio.ui.resources.server.ServiceStatusServerResource;
import org.serviio.restlet.AbstractServerResource;
import org.serviio.ui.representation.ServiceStatusRepresentation;
import org.serviio.ui.resources.ServiceStatusResource;
public class ServiceStatusServerResource : AbstractServerResource
, ServiceStatusResource
{
public ServiceStatusRepresentation load()
{
return new ServiceStatusRepresentation();
}
}
/* Location: D:\Program Files\Serviio\lib\serviio.jar
* Qualified Name: org.serviio.ui.resources.server.ServiceStatusServerResource
* JD-Core Version: 0.6.2
*/ | D |
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Fluent.build/Query/QuerySupporting.swift.o : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/ID.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/Model+CRUD.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Utilities/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Service/MigrateCommand.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Service/RevertCommand.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/SoftDeletable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/MigrationConfig.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaSupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Join/JoinSupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/MigrationSupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Query/QuerySupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/MigrationLog.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/Model.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/AnyModel.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Relations/Children.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/Migration.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/AnyMigration.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Service/FluentProvider.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaBuilder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaUpdater.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Utilities/FluentError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaCreator.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Relations/Siblings.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/Migrations.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/AnyMigrations.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Relations/Parent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/ModelEvent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/Pivot.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Cache/CacheEntry.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Query/FluentProperty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIODarwin/include/c_nio_darwin.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Fluent.build/QuerySupporting~partial.swiftmodule : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/ID.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/Model+CRUD.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Utilities/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Service/MigrateCommand.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Service/RevertCommand.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/SoftDeletable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/MigrationConfig.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaSupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Join/JoinSupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/MigrationSupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Query/QuerySupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/MigrationLog.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/Model.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/AnyModel.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Relations/Children.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/Migration.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/AnyMigration.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Service/FluentProvider.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaBuilder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaUpdater.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Utilities/FluentError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaCreator.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Relations/Siblings.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/Migrations.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/AnyMigrations.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Relations/Parent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/ModelEvent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/Pivot.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Cache/CacheEntry.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Query/FluentProperty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIODarwin/include/c_nio_darwin.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Fluent.build/QuerySupporting~partial.swiftdoc : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/ID.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/Model+CRUD.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Utilities/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Service/MigrateCommand.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Service/RevertCommand.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/SoftDeletable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/MigrationConfig.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaSupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Join/JoinSupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/MigrationSupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Query/QuerySupporting.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/MigrationLog.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/Model.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/AnyModel.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Relations/Children.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/Migration.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/AnyMigration.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Service/FluentProvider.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaBuilder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaUpdater.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Utilities/FluentError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/SchemaCreator.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Relations/Siblings.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/Migrations.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Migration/AnyMigrations.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Relations/Parent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/ModelEvent.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Model/Pivot.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Cache/CacheEntry.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/fluent.git--7619811335752932298/Sources/Fluent/Query/FluentProperty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIODarwin/include/c_nio_darwin.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
module android.java.android.view.InputEvent_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import1 = android.java.java.lang.Class_d_interface;
import import2 = android.java.android.os.Parcel_d_interface;
import import0 = android.java.android.view.InputDevice_d_interface;
final class InputEvent : IJavaObject {
static immutable string[] _d_canCastTo = [
"android/os/Parcelable",
];
@Import int getDeviceId();
@Import import0.InputDevice getDevice();
@Import int getSource();
@Import bool isFromSource(int);
@Import long getEventTime();
@Import int describeContents();
@Import import1.Class getClass();
@Import int hashCode();
@Import bool equals(IJavaObject);
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import void notify();
@Import void notifyAll();
@Import void wait(long);
@Import void wait(long, int);
@Import void wait();
@Import void writeToParcel(import2.Parcel, int);
mixin IJavaObjectImplementation!(false);
public static immutable string _javaParameterString = "Landroid/view/InputEvent;";
}
| D |
module cmsed.user.models.user;
import cmsed.user.models.group;
import cmsed.user.models.policy;
import cmsed.base;
import dvorm;
import vbson = vibe.data.bson;
import std.string : split;
/**
* A user.
*/
@dbName("User")
@shouldNotGenerateJavascriptModel
class UserModel {
/**
* A unique identifer.
* Automatically generated.
*
* See_Also:
* UserIdModel
*/
@dbId
@dbName("")
UserIdModel key;
/**
* The name of the user.
* Example:
* NameModel name = new NameModel;
* name = "richard andrew cattermole";
* assert(name.first == "richard")
* assert(name.middle == "andrew")
* assert(name.last == "cattermole")
*
* name = "richard cattermole";
* assert(name.first == "richard")
* assert(name.last == "cattermole")
*/
NameModel name;
/**
* UTC0 time in unix form of when the user was born.
*/
ulong dateOfBirth;
/**
* UTC0 time in unix format of when the user joined.
*/
ulong createdOn;
/**
* Generats the key and sets when the user joined.
*/
void generateKey() {
key.name = vbson.BsonObjectID.generate().toString();
createdOn = utc0Time();
}
mixin OrmModel!UserModel;
/**
* Get all the groups the user is a member of.
*
* See_Also:
* GroupModel
*/
GroupModel[] getGroups() {
import cmsed.user.models.usergroup;
return UserGroupModel.query().user_name_eq(key.name).find_by_group();
}
/**
* Gets the policies applied to this user.
*
* Return:
* The policies applied to this user
*/
PolicyModel[] getPolicies() {
import cmsed.user.models.userpolicy;
return UserPolicyModel.query().user_name_eq(key.name).enabled_eq(true).find_by_policy();
}
}
/**
* Uniquely identifies a user.
* Designed to be embbeded. Not a model in its own right.
*
* See_Also:
* UserModel
*/
struct UserIdModel {
@dbId {
@dbName("id")
string name;
}
@dbIgnore
UserModel getUser() {
return UserModel.findOne(name);
}
}
/**
* A class that handles a name. Automatically seperates out first/middle/last.
*/
struct NameModel {
@dbId {
/**
* Persons first name.
* Note not optional.
*/
string first;
/**
* Persons middle name.
* Note only supports one. And is optional.
*/
string middle;
/**
* A persons last name.
* Note not optional.
*/
string last;
}
@dbIgnore
void opAssign(string s) {
string[] names = s.split(" ");
if (names.length >= 1)
first = names[0];
if (names.length == 2)
last = names[1];
if (names.length == 3) {
middle = names[1];
last = names[2];
}
}
} | D |
/// @file htslib/vcfutils.h
/// Allele-related utility functions.
/*
Copyright (C) 2012, 2013, 2015-2016 Genome Research Ltd.
Author: Petr Danecek <pd3@sanger.ac.uk>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. */
module htslib.vcfutils;
import htslib.vcf;
@system:
nothrow:
@nogc:
extern (C):
struct kbitset_t;
/**
* bcf_trim_alleles() - remove ALT alleles unused in genotype fields
* @header: for access to BCF_DT_ID dictionary
* @line: VCF line obtain from vcf_parse1
*
* Returns the number of removed alleles on success or negative
* on error:
* -1 .. some allele index is out of bounds
* -2 .. could not remove alleles
*/
int bcf_trim_alleles(const(bcf_hdr_t)* header, bcf1_t* line);
/**
* bcf_remove_alleles() - remove ALT alleles according to bitmask @mask
* @header: for access to BCF_DT_ID dictionary
* @line: VCF line obtained from vcf_parse1
* @mask: alleles to remove
*
* If you have more than 31 alleles, then the integer bit mask will
* overflow, so use bcf_remove_allele_set instead
* Returns 0 on success, <0 on error
*/
int bcf_remove_alleles(const(bcf_hdr_t)* header, bcf1_t* line, int mask);
/**
* bcf_remove_allele_set() - remove ALT alleles according to bitset @rm_set
* @header: for access to BCF_DT_ID dictionary
* @line: VCF line obtained from vcf_parse1
* @rm_set: pointer to kbitset_t object with bits set for allele
* indexes to remove
*
* Returns 0 on success or -1 on failure
*
* Number=A,R,G INFO and FORMAT fields will be updated accordingly.
*/
int bcf_remove_allele_set(
const(bcf_hdr_t)* header,
bcf1_t* line,
const(kbitset_t)* rm_set);
/**
* bcf_calc_ac() - calculate the number of REF and ALT alleles
* @header: for access to BCF_DT_ID dictionary
* @line: VCF line obtained from vcf_parse1
* @ac: array of length line->n_allele
* @which: determine if INFO/AN,AC and indv fields be used
*
* Returns 1 if the call succeeded, or 0 if the value could not
* be determined.
*
* The value of @which determines if existing INFO/AC,AN can be
* used (BCF_UN_INFO) and and if indv fields can be split (BCF_UN_FMT).
*/
int bcf_calc_ac(const(bcf_hdr_t)* header, bcf1_t* line, int* ac, int which);
/**
* bcf_gt_type() - determines type of the genotype
* @fmt_ptr: the GT format field as set for example by set_fmt_ptr
* @isample: sample index (starting from 0)
* @ial: index of the 1st non-reference allele (starting from 1)
* @jal: index of the 2nd non-reference allele (starting from 1)
*
* Returns the type of the genotype (one of GT_HOM_RR, GT_HET_RA,
* GT_HOM_AA, GT_HET_AA, GT_HAPL_R, GT_HAPL_A or GT_UNKN). If $ial
* is not NULL and the genotype has one or more non-reference
* alleles, $ial will be set. In case of GT_HET_AA, $ial is the
* position of the allele which appeared first in ALT. If $jal is
* not null and the genotype is GT_HET_AA, $jal will be set and is
* the position of the second allele in ALT.
*/
enum GT_HOM_RR = 0; // note: the actual value of GT_* matters, used in dosage r2 calculation
enum GT_HOM_AA = 1;
enum GT_HET_RA = 2;
enum GT_HET_AA = 3;
enum GT_HAPL_R = 4;
enum GT_HAPL_A = 5;
enum GT_UNKN = 6;
int bcf_gt_type(bcf_fmt_t* fmt_ptr, int isample, int* ial, int* jal);
pragma(inline, true)
int bcf_acgt2int(char c)
{
if ( cast(int)c>96 ) c -= 32;
if ( c=='A' ) return 0;
if ( c=='C' ) return 1;
if ( c=='G' ) return 2;
if ( c=='T' ) return 3;
return -1;
}
extern (D) auto bcf_int2acgt(T)(auto ref T i)
{
return "ACGT"[i];
}
/**
* bcf_ij2G() - common task: allele indexes to Number=G index (diploid)
* @i,j: allele indexes, 0-based, i<=j
*
* Returns index to the Number=G diploid array
*/
extern (D) auto bcf_ij2G(T0, T1)(auto ref T0 i, auto ref T1 j)
{
return j * (j + 1) / 2 + i;
}
| D |
/Users/surkin/dev/Editor/Editor/DerivedData/Editor/Build/Intermediates.noindex/Editor.build/Debug/XCodeEditor.build/Objects-normal/x86_64/SourceEditorExtension.o : /Users/surkin/dev/Editor/Editor/XCodeEditor/SourceEditorCommand.swift /Users/surkin/dev/Editor/Editor/XCodeEditor/SourceEditorExtension.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceEditorCommand.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceTextRange.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceEditorExtension.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceTextPosition.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceTextBuffer.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XcodeKitDefines.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XcodeKit.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Modules/module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/surkin/dev/Editor/Editor/DerivedData/Editor/Build/Intermediates.noindex/Editor.build/Debug/XCodeEditor.build/Objects-normal/x86_64/SourceEditorExtension~partial.swiftmodule : /Users/surkin/dev/Editor/Editor/XCodeEditor/SourceEditorCommand.swift /Users/surkin/dev/Editor/Editor/XCodeEditor/SourceEditorExtension.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceEditorCommand.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceTextRange.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceEditorExtension.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceTextPosition.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceTextBuffer.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XcodeKitDefines.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XcodeKit.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Modules/module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/surkin/dev/Editor/Editor/DerivedData/Editor/Build/Intermediates.noindex/Editor.build/Debug/XCodeEditor.build/Objects-normal/x86_64/SourceEditorExtension~partial.swiftdoc : /Users/surkin/dev/Editor/Editor/XCodeEditor/SourceEditorCommand.swift /Users/surkin/dev/Editor/Editor/XCodeEditor/SourceEditorExtension.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceEditorCommand.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceTextRange.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceEditorExtension.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceTextPosition.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XCSourceTextBuffer.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XcodeKitDefines.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Headers/XcodeKit.h /Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/XcodeKit.framework/Modules/module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
| D |
# FIXED
third_party/FreeRTOS/Source/timers.obj: C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/timers.c
third_party/FreeRTOS/Source/timers.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/stdlib.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/_ti_config.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/linkage.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/sys/cdefs.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/FreeRTOS.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/stddef.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/stdint.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/sys/stdint.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/sys/_types.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/machine/_types.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/machine/_stdint.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/sys/_stdint.h
third_party/FreeRTOS/Source/timers.obj: C:/Users/jains/workspace_v8/seqgen/FreeRTOSConfig.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/projdefs.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/portable.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/deprecated_definitions.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/portable/CCS/ARM_CM4F/portmacro.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/mpu_wrappers.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/task.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/list.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/queue.h
third_party/FreeRTOS/Source/timers.obj: C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/timers.h
C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/timers.c:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/stdlib.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/_ti_config.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/linkage.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/sys/cdefs.h:
C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/FreeRTOS.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/stddef.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/stdint.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/sys/stdint.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/sys/_types.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/machine/_types.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/machine/_stdint.h:
C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include/sys/_stdint.h:
C:/Users/jains/workspace_v8/seqgen/FreeRTOSConfig.h:
C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/projdefs.h:
C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/portable.h:
C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/deprecated_definitions.h:
C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/portable/CCS/ARM_CM4F/portmacro.h:
C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/mpu_wrappers.h:
C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/task.h:
C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/list.h:
C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/queue.h:
C:/ti/TivaWare_C_Series-2.1.4.178/third_party/FreeRTOS/Source/include/timers.h:
| D |
instance DIA_Grd_216_Exit(C_Info)
{
npc = GRD_216_Torwache;
nr = 999;
condition = DIA_Grd_216_Exit_Condition;
information = DIA_Grd_216_Exit_Info;
permanent = 1;
description = DIALOG_ENDE;
};
func int DIA_Grd_216_Exit_Condition()
{
return 1;
};
func void DIA_Grd_216_Exit_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Grd_216_First(C_Info)
{
npc = GRD_216_Torwache;
nr = 1;
condition = DIA_Grd_216_First_Condition;
information = DIA_Grd_216_First_Info;
permanent = 0;
important = 1;
};
func int DIA_Grd_216_First_Condition()
{
var C_Npc Dusty;
if(Npc_GetDistToWP(other,"OCR_NORTHGATE_ADVANCE") > 400)
{
Npc_SetRefuseTalk(self,30);
};
if(Npc_RefuseTalk(self) == FALSE)
{
Dusty = Hlp_GetNpc(VLK_524_Dusty);
if((Dusty.aivar[AIV_PARTYMEMBER] == FALSE) && (Kapitel < 2))
{
return 1;
};
};
};
func void DIA_Grd_216_First_Info()
{
AI_Output(self,other,"DIA_Grd_216_First_13_00"); //Hej, ty! Chyba cię tu wcześniej nie widziałem!
AI_Output(other,self,"DIA_Grd_216_First_15_01"); //Nic dziwnego. Dopiero co tutaj trafiłem.
AI_Output(self,other,"DIA_Grd_216_First_13_02"); //To lepiej uważaj! Poza murami jest bardzo niebezpiecznie. Tylko w obozie możesz spać spokojnie.
};
instance DIA_Grd_216_DustyZoll(C_Info)
{
npc = GRD_216_Torwache;
nr = 1;
condition = DIA_Grd_216_DustyZoll_Condition;
information = DIA_Grd_216_DustyZoll_Info;
permanent = 1;
important = 1;
};
func int DIA_Grd_216_DustyZoll_Condition()
{
var C_Npc Dusty;
Dusty = Hlp_GetNpc(VLK_524_Dusty);
if((Dusty.aivar[AIV_PARTYMEMBER] == TRUE) && (Npc_GetDistToNpc(hero,Dusty) < 2000))
{
return 1;
};
};
func void DIA_Grd_216_DustyZoll_Info()
{
AI_Output(self,other,"DIA_Grd_216_Dusty_Zoll_13_00"); //Stój! Dokąd zabierasz naszego drogiego przyjaciela?
Info_ClearChoices(DIA_Grd_216_DustyZoll);
Info_AddChoice(DIA_Grd_216_DustyZoll,"Nie twój interes!",DIA_Grd_216_DustyZoll_PissOff);
Info_AddChoice(DIA_Grd_216_DustyZoll,"Udajemy się do obozu Bractwa.",DIA_Grd_216_DustyZoll_ToPSI);
if(Npc_HasItems(other,ItMiNugget) >= 100)
{
Info_AddChoice(DIA_Grd_216_DustyZoll,"Idziemy się przespacerować. A oto 100 bryłek rudy.",DIA_Grd_216_DustyZoll_LittleWalk);
};
};
func void DIA_Grd_216_DustyZoll_PissOff()
{
var C_Npc Dusty;
AI_Output(other,self,"DIA_Grd_216_Dusty_Zoll_PissOff_15_00"); //Nie twój interes!
AI_Output(self,other,"DIA_Grd_216_Dusty_Zoll_PIssOff_13_00"); //Mam na ten temat nieco inne zdanie!
AI_StopProcessInfos(self);
Npc_SetTarget(self,other);
AI_StartState(self,ZS_Attack,1,"");
B_ExchangeRoutine(VLK_524_Dusty,"start");
Dusty = Hlp_GetNpc(VLK_524_Dusty);
Dusty.aivar[AIV_PARTYMEMBER] = FALSE;
Dusty.flags = 0;
};
func void DIA_Grd_216_DustyZoll_ToPSI()
{
var C_Npc Dusty;
AI_Output(other,self,"DIA_Grd_216_Dusty_Zoll_ToPsi_15_00"); //Udajemy się do obozu Bractwa.
AI_Output(self,other,"DIA_Grd_216_Dusty_Zoll_ToPsi_13_00"); //Gdzie nigdy nie dotrzecie...
AI_StopProcessInfos(self);
Npc_SetTarget(self,other);
AI_StartState(self,ZS_Attack,1,"");
B_ExchangeRoutine(VLK_524_Dusty,"start");
Dusty = Hlp_GetNpc(VLK_524_Dusty);
Dusty.aivar[AIV_PARTYMEMBER] = FALSE;
Dusty.flags = 0;
};
func void DIA_Grd_216_DustyZoll_LittleWalk()
{
var C_Npc Dusty;
AI_Output(other,self,"DIA_Grd_216_Dusty_Zoll_LittleWalk_15_00"); //Idziemy się przespacerować. A oto 100 bryłek rudy.
if(Npc_HasItems(hero,ItMiNugget) >= 100)
{
AI_Output(self,other,"DIA_Grd_216_Dusty_Zoll_LittleWalk_13_00"); //Nic nie widziałem.
B_GiveInvItems(hero,self,ItMiNugget,100);
DIA_Grd_216_DustyZoll.permanent = 0;
B_LogEntry(CH1_RecruitDusty,"Udało mi się przekupić strażników przy południowej bramie!");
B_GiveXP(XP_BribedDustyGuard);
AI_StopProcessInfos(self);
}
else
{
AI_Output(self,other,"DIA_Grd_216_Dusty_Zoll_LittleWalk_13_02"); //Myślisz, że jestem taki głupi? Tak łatwo ci nie pójdzie, mały!
AI_StopProcessInfos(self);
Npc_SetTarget(self,other);
AI_StartState(self,ZS_Attack,1,"");
B_ExchangeRoutine(VLK_524_Dusty,"start");
Dusty = Hlp_GetNpc(VLK_524_Dusty);
Dusty.aivar[AIV_PARTYMEMBER] = FALSE;
Dusty.flags = 0;
};
};
instance GRD_216_Torwache_SEETHORUS(C_Info)
{
npc = GRD_216_Torwache;
condition = GRD_216_Torwache_SEETHORUS_Condition;
information = GRD_216_Torwache_SEETHORUS_Info;
important = 1;
permanent = 0;
};
func int GRD_216_Torwache_SEETHORUS_Condition()
{
if(!Npc_KnowsInfo(hero,Grd_214_Torwache_SEETHORUS) && ((CorKalom_BringMCQBalls == LOG_SUCCESS) || (Npc_HasItems(hero,ItAt_Crawlerqueen) >= 3)) && !Npc_KnowsInfo(hero,GRD_200_Thorus_GARDIST) && (Npc_GetTrueGuild(hero) == GIL_STT))
{
return TRUE;
};
};
func void GRD_216_Torwache_SEETHORUS_Info()
{
AI_Output(self,other,"Grd_216_Torwache_SEETHORUS_Info_13_01"); //Cieszę się, że cię widzę. Thorus chce z tobą porozmawiać.
AI_Output(other,self,"Grd_216_Torwache_SEETHORUS_Info_15_02"); //A czego ode mnie chce?
AI_Output(self,other,"Grd_216_Torwache_SEETHORUS_Info_13_03"); //Porozmawiaj z nim, to się dowiesz.
};
| D |
func void B_RemoveWeapon(var C_Npc slf)
{
AI_RemoveWeapon(slf);
};
| D |
//----------------------------------
// (c) Reliable Software, 2008
//----------------------------------
module WebAtlas;
import xml;
import std.stdio;
import std.stream;
import std.path;
import std.string;
static import std.algorithm;
class WebSiteAtlas
{
public:
this (Node root)
{
foreach (child; root)
{
string relPath;
if (child.Name == "directory" && child.FindAttribute ("path", relPath))
{
ProcessFiles (child, tolower (relPath));
}
}
}
void ProcessFiles (Node root, string relPath)
{
assert (relPath == tolower (relPath));
foreach (child; root)
{
string curFilePath;
string type;
if (child.Name == "file")
{
if (child.FindAttribute ("path", curFilePath))
child.FindAttribute ("type", type);
else
throw new Exception ("file without path");
curFilePath = tolower (curFilePath);
}
else
throw new Exception ("non-file node");
assert (curFilePath.length != 0);
if (curFilePath in _targets)
{
_targets [curFilePath].Type = type;
}
else
{
_targets [curFilePath] = new TargetInfo (curFilePath, type);
}
switch (type)
{
case "html":
_htmlFiles ~= curFilePath;
break;
case "img":
_imgFiles ~= curFilePath;
break;
default:
throw new Exception ("Illegal file type");
}
// Look for grandchildren that are anchors
foreach (gChild; child)
{
if (gChild.Name == "a")
{
string href;
if (!gChild.FindAttribute ("href", href))
throw new Exception ("anchor without href");
href = NormalizeHref (href, relPath);
if (!(href in _targets))
_targets [href] = new TargetInfo (href, "");
_targets [href].AddLinkFrom (curFilePath);
}
}
// Look for grandchildren that are image links
foreach (gChild; child)
{
if (gChild.Name == "img")
{
string href;
if (!gChild.FindAttribute ("src", href))
throw new Exception ("image without source");
href = NormalizeHref (href, relPath);
if (!(href in _targets))
_targets [href] = new TargetInfo (href, "");
_targets [href].AddLinkFrom (curFilePath);
}
}
}
}
bool HasFile (string path, string type)
{
if (type.length == 0)
return false;
if (type != "html" && type != "img")
{
string msg = "Invalid file type: " ~ type ~ "; path: " ~ path;
throw new Exception (msg);
}
string [] fileList = (type == "html" ? _htmlFiles : _imgFiles);
return std.algorithm.find (fileList, path) != std.algorithm.end (fileList);
}
string [] LinksTo (string targetPath)
{
const TargetInfo * tgt = (targetPath in _targets);
if (tgt == null)
throw new Exception ("Target not found");
return tgt.LinksToMe;
}
string [] HtmlFiles () { return _htmlFiles; }
string [] ImgFiles () { return _imgFiles; }
TargetInfo [string] TargetInfoArr () { return _targets; }
private:
TargetInfo [string] _targets;
string [] _htmlFiles;
string [] _imgFiles;
}
Node MakeTree (string path)
{
// string s = `<root><child color="red">foo bar baz</child></root>`;
// MemoryStream input = new MemoryStream (s.dup);
File input = new File (path);
if (!input.isOpen)
{
writefln ("Cannot open file for reading: ", path);
}
Tree tree = new Tree;
TreeMaker treeMaker = new TreeMaker (tree);
Scanner scanner = new Scanner (input);
Parser parser = new Parser (scanner, treeMaker);
parser.Parse ();
return tree.Root ();
}
class TargetInfo
{
public:
this (string path, string type)
{
_path = path;
_type = type;
}
string Type ()
{
return _type;
}
string Type (string type)
{
_type = type;
return _type;
}
string Path ()
{
return _path;
}
string Path (string path)
{
_path = path;
return _path;
}
void AddLinkFrom (string src)
{
_linksToMe ~= src;
}
string [] LinksToMe () const { return _linksToMe; }
private:
string _path;
string _type;
string [] _linksToMe;
}
bool IsExternalTarget (string href)
{
if (href.length < 4)
return false;
string prefix = href [0..4];
assert (prefix == tolower (prefix));
return prefix == "http" || prefix == "mail" || prefix == "java";
}
string NormalizeHref (string href, string relPath)
{
href = tolower (href);
assert (relPath == tolower (relPath));
if (IsExternalTarget (href))
return href;
string result;
if (href.length >= 2 && href [0..2] == "..")
{
if (href.length == 2 || (href [2] != sep [0] && href [2] != altsep[0]))
{
writefln ("relPath=%s, href=%s", relPath, href);
throw new Exception ("invalid relative path");
}
int pos = rfind (relPath, sep);
if (pos == -1)
result = href [3..$];
else
result = relPath [0..pos + 1] ~ href [3..$];
}
else
{
result = relPath ~ sep ~ href;
}
int pos = rfind (result, '#');
if (pos != -1)
result = result [0..pos];
return replace (result, altsep, sep);
}
void DumpTree (Node node, int level=0)
{
void Indent (int level)
{
for (int i = 0; i < level * 4; ++i)
write (' ');
}
Indent (level);
writefln (node.Name);
foreach (a; node.Attributes)
{
Indent (level);
writefln (" %s=%s", a.Name, a.Value);
}
foreach (n; node.Children)
{
DumpTree (n, level + 1);
}
}
| D |
/*******************************************************************************
Node that draws a section of a texture
Authors: ArcLib team, see AUTHORS file
Maintainer: Christian Kamm (kamm incasoftware de)
License: zlib/libpng license: $(LICENSE)
Copyright: ArcLib team
Description:
Add the Frame nodes to the scenegraph and use
arc.scenegraph.drawable.drawScenegraph to get them drawn.
*******************************************************************************/
module arc.scenegraph.frame;
import
arc.types,
arc.texture,
arc.scenegraph.node,
arc.scenegraph.drawable,
arc.draw.image,
arc.math.rect,
arc.math.point,
arc.math.angle;
import derelict.opengl.gl;
/**
Frame is a drawable that displays a section of a texture on screen.
The midpoint value is relative to the top-left of the texture section
and does not neccessarily have to lie within it.
**/
class Frame : MultiParentNode, IDrawable
{
enum Midpoint
{
Center,
TopLeft
}
/// Construct with texture and midpoint specified by enum
this(Texture texture_, Midpoint midpoint_ = Midpoint.Center)
{
texture = texture_;
frame = Rect(Point(0,0), texture.getSize);
setMidpointByEnum(midpoint_);
}
/// Construct with texture and midpoint given explicitly
this(Texture texture_, Point midpoint_)
{
texture = texture_;
frame = Rect(Point(0,0), texture.getSize);
midpoint = midpoint_;
}
/**
Construct with texture, rectangle of the texture to be
displayed and midpoint by enum
**/
this(Texture texture_, Rect frame_, Midpoint midpoint_ = Midpoint.Center)
{
texture = texture_;
frame = frame_;
setMidpointByEnum(midpoint_);
}
/**
Construct with texture, rectangle of the texture to be
displayed and midpoint given explicitly
**/
this(Texture texture_, Rect frame_, Point midpoint_)
{
texture = texture_;
frame = frame_;
midpoint = midpoint_;
}
// just set midpoint
this(Midpoint midpoint_ = Midpoint.Center)
{
setMidpointByEnum(midpoint_);
}
/// return duplicate of frame
Frame dup()
{
Frame f = new Frame(texture, frame, midpoint);
foreach(i, elem; this.tupleof)
f.tupleof[i] = elem;
return f;
}
/// draw section of the texture
override void draw()
{
glPushMatrix();
glRotatef(radiansToDegrees(rotation), 0, 0, 1);
glScalef(scale.x, scale.y, 1);
glTranslatef(-midpoint.x, -midpoint.y, 0);
/// BUG: make sure drawImageSubsection doesn't change any GL state
drawImageSubsection(texture, frame.topLeft, frame.getBottomRight);
glPopMatrix();
}
/// frame frame
void setFrame(inout Rect frame_)
in
{
assert(
frame_.getLeft >= 0 &&
frame_.getTop >= 0 &&
frame_.getRight <= texture.getSize.w &&
frame_.getBottom <= texture.getSize.h,
"Frame in '" ~ texture.getFile ~ "' exceeds image dimensions.");
}
body
{
frame = frame_;
}
/// get frame for frame
Rect getFrame()
{
return frame;
}
/// scale frame
void setScale(Point s)
{
scale = s;
}
/// scale frame
void setScale(arcfl s)
{
scale.set(s, s);
}
package:
void setMidpointByEnum(Midpoint m)
{
switch(m)
{
case Midpoint.TopLeft:
{
midpoint = Point(0,0);
break;
}
case Midpoint.Center:
{
midpoint = Point(frame.size.w / 2, frame.size.h / 2);
break;
}
}
}
Texture texture;
Rect frame;
Point midpoint;
Point scale = {1f, 1f};
Radians rotation = cast(Radians)0;
}
| D |
peer3
/src/P2Pfile/Peer3/filefolder
3003
127.0.0.1
p3t1.txt
p3t10.txt
p3t2.txt
p3t3.txt
p3t4.txt
p3t5.txt
p3t6.txt
p3t7.txt
p3t8.txt
p3t9.txt
test1.txt
test2.jpg
test3.jpg
| D |
<?xml version="1.0" encoding="ASCII"?>
<di:SashWindowsMngr xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi">
<pageList>
<availablePage>
<emfPageIdentifier href="usageClassInsidePackage.notation#_l6th8I5SEeK7gaguBqBG7w"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="usageClassInsidePackage.notation#_l6th8I5SEeK7gaguBqBG7w"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
| D |
#!/usr/bin/env dub
/+
dub.sdl:
name "snippet119"
dependency "dwt" path="../../../../../../"
libs \
"atk-1.0" \
"cairo" \
"dl" \
"fontconfig" \
"gdk-x11-2.0" \
"gdk_pixbuf-2.0" \
"glib-2.0" \
"gmodule-2.0" \
"gnomeui-2" \
"gnomevfs-2" \
"gobject-2.0" \
"gthread-2.0" \
"gtk-x11-2.0" \
"pango-1.0" \
"pangocairo-1.0" \
"X11" \
"Xcomposite" \
"Xcursor" \
"Xdamage" \
"Xext" \
"Xfixes" \
"Xi" \
"Xinerama" \
"Xrandr" \
"Xrender" \
"Xtst" \
platform="linux"
+/
/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* D Port:
* Thomas Demmer <t_demmer AT web DOT de>
*******************************************************************************/
module org.eclipse.swt.snippets.Snippet119;
/*
* Cursor example snippet: create a color cursor from a source and a mask
*
* For a list of all SWT example snippets see
* http://www.eclipse.org/swt/snippets/
*
* @since 3.0
*/
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.PaletteData;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import java.lang.all;
auto srcData = [
cast(byte)0x11, cast(byte)0x11, cast(byte)0x11, cast(byte)0x00, cast(byte)0x00, cast(byte)0x11, cast(byte)0x11, cast(byte)0x11,
cast(byte)0x11, cast(byte)0x10, cast(byte)0x00, cast(byte)0x01, cast(byte)0x10, cast(byte)0x00, cast(byte)0x01, cast(byte)0x11,
cast(byte)0x11, cast(byte)0x00, cast(byte)0x22, cast(byte)0x01, cast(byte)0x10, cast(byte)0x33, cast(byte)0x00, cast(byte)0x11,
cast(byte)0x10, cast(byte)0x02, cast(byte)0x22, cast(byte)0x01, cast(byte)0x10, cast(byte)0x33, cast(byte)0x30, cast(byte)0x01,
cast(byte)0x10, cast(byte)0x22, cast(byte)0x22, cast(byte)0x01, cast(byte)0x10, cast(byte)0x33, cast(byte)0x33, cast(byte)0x01,
cast(byte)0x10, cast(byte)0x22, cast(byte)0x22, cast(byte)0x01, cast(byte)0x10, cast(byte)0x33, cast(byte)0x33, cast(byte)0x01,
cast(byte)0x00, cast(byte)0x00, cast(byte)0x00, cast(byte)0x00, cast(byte)0x00, cast(byte)0x00, cast(byte)0x00, cast(byte)0x00,
cast(byte)0x01, cast(byte)0x11, cast(byte)0x11, cast(byte)0x01, cast(byte)0x10, cast(byte)0x11, cast(byte)0x11, cast(byte)0x10,
cast(byte)0x01, cast(byte)0x11, cast(byte)0x11, cast(byte)0x01, cast(byte)0x10, cast(byte)0x11, cast(byte)0x11, cast(byte)0x10,
cast(byte)0x00, cast(byte)0x00, cast(byte)0x00, cast(byte)0x00, cast(byte)0x00, cast(byte)0x00, cast(byte)0x00, cast(byte)0x00,
cast(byte)0x10, cast(byte)0x44, cast(byte)0x44, cast(byte)0x01, cast(byte)0x10, cast(byte)0x55, cast(byte)0x55, cast(byte)0x01,
cast(byte)0x10, cast(byte)0x44, cast(byte)0x44, cast(byte)0x01, cast(byte)0x10, cast(byte)0x55, cast(byte)0x55, cast(byte)0x01,
cast(byte)0x10, cast(byte)0x04, cast(byte)0x44, cast(byte)0x01, cast(byte)0x10, cast(byte)0x55, cast(byte)0x50, cast(byte)0x01,
cast(byte)0x11, cast(byte)0x00, cast(byte)0x44, cast(byte)0x01, cast(byte)0x10, cast(byte)0x55, cast(byte)0x00, cast(byte)0x11,
cast(byte)0x11, cast(byte)0x10, cast(byte)0x00, cast(byte)0x01, cast(byte)0x10, cast(byte)0x00, cast(byte)0x01, cast(byte)0x11,
cast(byte)0x11, cast(byte)0x11, cast(byte)0x11, cast(byte)0x00, cast(byte)0x00, cast(byte)0x11, cast(byte)0x11, cast(byte)0x11,
];
auto mskData = [
cast(byte)0x03, cast(byte)0xc0,
cast(byte)0x1f, cast(byte)0xf8,
cast(byte)0x3f, cast(byte)0xfc,
cast(byte)0x7f, cast(byte)0xfe,
cast(byte)0x7f, cast(byte)0xfe,
cast(byte)0x7f, cast(byte)0xfe,
cast(byte)0xff, cast(byte)0xff,
cast(byte)0xfe, cast(byte)0x7f,
cast(byte)0xfe, cast(byte)0x7f,
cast(byte)0xff, cast(byte)0xff,
cast(byte)0x7f, cast(byte)0xfe,
cast(byte)0x7f, cast(byte)0xfe,
cast(byte)0x7f, cast(byte)0xfe,
cast(byte)0x3f, cast(byte)0xfc,
cast(byte)0x1f, cast(byte)0xf8,
cast(byte)0x03, cast(byte)0xc0
];
void main (String [] args) {
Display display = new Display();
Color white = display.getSystemColor (SWT.COLOR_WHITE);
Color black = display.getSystemColor (SWT.COLOR_BLACK);
Color yellow = display.getSystemColor (SWT.COLOR_YELLOW);
Color red = display.getSystemColor (SWT.COLOR_RED);
Color green = display.getSystemColor (SWT.COLOR_GREEN);
Color blue = display.getSystemColor (SWT.COLOR_BLUE);
//Create a source ImageData of depth 4
PaletteData palette = new PaletteData ([black.getRGB(), white.getRGB(), yellow.getRGB(),
red.getRGB(), blue.getRGB(), green.getRGB()]);
ImageData sourceData = new ImageData (16, 16, 4, palette, 1, srcData[]);
//Create a mask ImageData of depth 1 (monochrome)
palette = new PaletteData ([black.getRGB(), white.getRGB()]);
ImageData maskData = new ImageData (16, 16, 1, palette, 1, mskData[]);
//Set mask
sourceData.maskData = maskData.data;
sourceData.maskPad = maskData.scanlinePad;
//Create cursor
Cursor cursor = new Cursor(display, sourceData, 10, 10);
//Remove mask to draw them separately just to show what they look like
sourceData.maskData = null;
sourceData.maskPad = -1;
Shell shell = new Shell(display);
Image source = new Image (display,sourceData);
Image mask = new Image (display, maskData);
shell.addPaintListener(new class PaintListener{
public void paintControl(PaintEvent e) {
GC gc = e.gc;
int x = 10, y = 10;
String stringSource = "source: ";
String stringMask = "mask: ";
gc.drawString(stringSource, x, y);
gc.drawString(stringMask, x, y + 30);
x += Math.max(gc.stringExtent(stringSource).x, gc.stringExtent(stringMask).x);
gc.drawImage(source, x, y);
gc.drawImage(mask, x, y + 30);
}
});
shell.setSize(150, 150);
shell.open();
shell.setCursor(cursor);
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
cursor.dispose();
source.dispose();
mask.dispose();
display.dispose();
}
| D |
instance SLD_762_Soeldner(Npc_Default)
{
name[0] = NAME_Soeldner;
npcType = NpcType_MINE_Guard;
guild = GIL_SLD;
level = 18;
voice = 11;
id = 762;
attribute[ATR_STRENGTH] = 100;
attribute[ATR_DEXTERITY] = 80;
attribute[ATR_MANA_MAX] = 0;
attribute[ATR_MANA] = 0;
attribute[ATR_HITPOINTS_MAX] = 286;
attribute[ATR_HITPOINTS] = 286;
Mdl_SetVisual(self,"HUMANS.MDS");
Mdl_ApplyOverlayMds(self,"Humans_Militia.mds");
Mdl_SetVisualBody(self,"hum_body_Naked0",0,1,"Hum_Head_Pony",53,1,sld_armor_h);
B_Scale(self);
Mdl_SetModelFatness(self,0);
fight_tactic = FAI_HUMAN_Strong;
Npc_SetTalentSkill(self,NPC_TALENT_1H,1);
Npc_SetTalentSkill(self,NPC_TALENT_2H,1);
Npc_SetTalentSkill(self,NPC_TALENT_BOW,1);
EquipItem(self,ItMw_1H_Mace_War_03);
EquipItem(self,ItRw_Bow_Long_01);
CreateInvItems(self,ItAmArrow,20);
CreateInvItems(self,ItFoRice,7);
CreateInvItems(self,ItFoLoaf,5);
CreateInvItems(self,ItFoMutton,4);
CreateInvItems(self,ItMiNugget,18);
CreateInvItems(self,ItFoBooze,5);
CreateInvItems(self,ItLsTorch,5);
CreateInvItems(self,ItFo_Potion_Health_02,7);
CreateInvItem(self,ItMi_Stuff_Barbknife_01);
CreateInvItem(self,ItMi_Stuff_Amphore_01);
daily_routine = Rtn_FMCstart_762;
};
func void Rtn_FMCstart_762()
{
TA_GuardPassage(1,0,13,0,"FMC_PATH28");
TA_GuardPassage(13,0,1,0,"FMC_PATH28");
};
| D |
/Users/thendral/POC/vapor/Friends/.build/debug/Fluent.build/Schema/Database+Schema.swift.o : /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Database/Database.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Database/Driver.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Entity/Entity.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Memory/Memory+Filters.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Memory/Memory+Group.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Memory/Memory+Sort.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Memory/MemoryDriver.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Preparation/Database+Preparation.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Preparation/Migration.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Preparation/Preparation.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Preparation/PreparationError.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Action.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Comparison.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Filter.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Group.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Join.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Limit.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Query.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Scope.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Sort.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Relations/Children.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Relations/Parent.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Relations/RelationError.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Relations/Siblings.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Database+Schema.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Schema+Creator.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Schema+Field.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Schema+Modifier.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Schema.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/SQL+Query.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/SQL+Schema.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/SQL.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/SQLSerializer.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Utilities/Fluent+Node.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/Node.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/PathIndexable.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/Polymorphic.swiftmodule
/Users/thendral/POC/vapor/Friends/.build/debug/Fluent.build/Database+Schema~partial.swiftmodule : /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Database/Database.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Database/Driver.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Entity/Entity.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Memory/Memory+Filters.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Memory/Memory+Group.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Memory/Memory+Sort.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Memory/MemoryDriver.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Preparation/Database+Preparation.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Preparation/Migration.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Preparation/Preparation.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Preparation/PreparationError.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Action.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Comparison.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Filter.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Group.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Join.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Limit.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Query.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Scope.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Sort.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Relations/Children.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Relations/Parent.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Relations/RelationError.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Relations/Siblings.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Database+Schema.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Schema+Creator.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Schema+Field.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Schema+Modifier.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Schema.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/SQL+Query.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/SQL+Schema.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/SQL.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/SQLSerializer.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Utilities/Fluent+Node.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/Node.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/PathIndexable.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/Polymorphic.swiftmodule
/Users/thendral/POC/vapor/Friends/.build/debug/Fluent.build/Database+Schema~partial.swiftdoc : /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Database/Database.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Database/Driver.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Entity/Entity.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Memory/Memory+Filters.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Memory/Memory+Group.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Memory/Memory+Sort.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Memory/MemoryDriver.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Preparation/Database+Preparation.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Preparation/Migration.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Preparation/Preparation.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Preparation/PreparationError.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Action.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Comparison.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Filter.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Group.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Join.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Limit.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Query.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Scope.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Query/Sort.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Relations/Children.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Relations/Parent.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Relations/RelationError.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Relations/Siblings.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Database+Schema.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Schema+Creator.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Schema+Field.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Schema+Modifier.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Schema/Schema.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/SQL+Query.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/SQL+Schema.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/SQL.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/SQL/SQLSerializer.swift /Users/thendral/POC/vapor/Friends/Packages/Fluent-1.3.7/Sources/Fluent/Utilities/Fluent+Node.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/Node.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/PathIndexable.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/Polymorphic.swiftmodule
| D |
/Users/Lavanya/Desktop/AlbumsApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/Request.o : /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/MultipartFormData.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/MultipartUpload.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/AlamofireExtended.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/HTTPMethod.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Response.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/SessionDelegate.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Session.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Validation.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RequestTaskMap.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ParameterEncoder.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RedirectHandler.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/AFError.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Protector.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/EventMonitor.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RequestInterceptor.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Notifications.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/HTTPHeaders.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/AFResult.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Request.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/Lavanya/Desktop/AlbumsApp/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/dyld.modulemap /Users/Lavanya/Desktop/AlbumsApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/Lavanya/Desktop/AlbumsApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/Request~partial.swiftmodule : /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/MultipartFormData.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/MultipartUpload.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/AlamofireExtended.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/HTTPMethod.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Response.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/SessionDelegate.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Session.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Validation.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RequestTaskMap.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ParameterEncoder.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RedirectHandler.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/AFError.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Protector.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/EventMonitor.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RequestInterceptor.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Notifications.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/HTTPHeaders.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/AFResult.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Request.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/Lavanya/Desktop/AlbumsApp/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/dyld.modulemap /Users/Lavanya/Desktop/AlbumsApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/Lavanya/Desktop/AlbumsApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/Request~partial.swiftdoc : /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/MultipartFormData.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/MultipartUpload.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/AlamofireExtended.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/HTTPMethod.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Response.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/SessionDelegate.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Session.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Validation.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RequestTaskMap.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ParameterEncoder.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RedirectHandler.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/AFError.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Protector.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/EventMonitor.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RequestInterceptor.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Notifications.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/HTTPHeaders.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/AFResult.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Request.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/Lavanya/Desktop/AlbumsApp/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/dyld.modulemap /Users/Lavanya/Desktop/AlbumsApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/Lavanya/Desktop/AlbumsApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/Request~partial.swiftsourceinfo : /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/MultipartFormData.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/MultipartUpload.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/AlamofireExtended.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/HTTPMethod.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Alamofire.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Response.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/SessionDelegate.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Session.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Validation.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RequestTaskMap.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/ParameterEncoder.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RedirectHandler.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/AFError.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Protector.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/EventMonitor.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RequestInterceptor.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Notifications.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/HTTPHeaders.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/AFResult.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/Request.swift /Users/Lavanya/Desktop/AlbumsApp/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/Lavanya/Desktop/AlbumsApp/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/dyld.modulemap /Users/Lavanya/Desktop/AlbumsApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
void main() {
problem();
}
void problem() {
auto A = scan!int;
auto B = scan!int;
auto C = scan!int;
auto D = scan!int;
bool solve() {
while(true) {
C -= B;
if (C <= 0) return true;
A -= D;
if (A <= 0) return false;
}
}
writeln(solve() ? "Yes" : "No");
}
// ----------------------------------------------
import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons, std.numeric;
T[][] combinations(T)(T[] s, in int m) { if (!m) return [[]]; if (s.empty) return []; return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }
string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T scan(T)(){ return scan.to!T; }
T[] scan(T)(int n){ return n.iota.map!(i => scan!T()).array; }
void deb(T ...)(T t){ debug writeln(t); }
alias Point = Tuple!(long, "x", long, "y");
// -----------------------------------------------
| D |
module error;
enum SocketError : long
{
OK = 0x0000,
PORT_NOT_IN_RANGE = 0x0010,
INVALID_URL = 0x0100
} | D |
/*
* Credits: functions Trade_ChangeBuyMultiplier & Trade_ChangeSellMultiplier originally created by OrcWarriorPL
* https://forum.worldofplayers.de/forum/threads/879891-Skriptpaket-Ikarus-2/page12?p=14836995&viewfull=1#post14836995
*
* They were modified to change multipliers for both inventory containers in case of both buying / selling containers.
*
* TODO: still dirty - becuase of oCNpcInventory
*/
/*
* Internal variables
*/
var int TradeForceTransferAccept; //Variable indicating that player forced trading
func void Trade_ChangeBuyMultiplier (var int mul) {
var int ptrTrader;
ptrTrader = MEMINT_oCInformationManager_Address;
ptrTrader = MEM_ReadInt (ptrTrader + 24); //oCInformationManager.ocViewDialogTrade
ptrTrader = MEM_ReadInt (ptrTrader + 248); //oCInformationManager.ocViewDialogTrade.oCViewDialogStealContainer
MEM_WriteInt (ptrTrader + 268, mul); //oCInformationManager.ocViewDialogTrade.oCViewDialogStealContainer.multiplier
var int ptrTraderOffer;
ptrTraderOffer = MEMINT_oCInformationManager_Address;
ptrTraderOffer = MEM_ReadInt (ptrTraderOffer + 24); //oCInformationManager.ocViewDialogTrade
ptrTraderOffer = MEM_ReadInt (ptrTraderOffer + 252); //oCInformationManager.ocViewDialogTrade.oCViewDialogItemContainer
MEM_WriteInt (ptrTraderOffer + 268, mul); //oCInformationManager.ocViewDialogTrade.oCViewDialogItemContainer.multiplier
};
func void Trade_ChangeSellMultiplier (var int mul) {
var int ptrBuyerOffer;
ptrBuyerOffer = MEMINT_oCInformationManager_Address;
ptrBuyerOffer = MEM_ReadInt (ptrBuyerOffer + 24); //oCInformationManager.ocViewDialogTrade
ptrBuyerOffer = MEM_ReadInt (ptrBuyerOffer + 260); //oCInformationManager.ocViewDialogTrade.oCViewDialogItemContainer
MEM_WriteInt (ptrBuyerOffer + 268, mul); //oCInformationManager.ocViewDialogTrade.oCViewDialogItemContainer.multiplier
var int ptrBuyer;
ptrBuyer = MEMINT_oCInformationManager_Address;
ptrBuyer = MEM_ReadInt (ptrBuyer + 24); //oCInformationManager.ocViewDialogTrade
ptrBuyer = MEM_ReadInt (ptrBuyer + 264); //oCInformationManager.ocViewDialogTrade.oCViewDialogInventory
MEM_WriteInt (ptrBuyer + 268, mul); //oCInformationManager.ocViewDialogTrade.oCViewDialogInventory.multiplier
};
/*
* Function forces item transfer in trading
*/
func void oCViewDialogTrade_TransferAccept () {
//00729390 .text Debug data ?TransferAccept@oCViewDialogTrade@@IAIXXZ
const int oCViewDialogTrade__TransferAccept = 7508880;
const int call = 0;
if (CALL_Begin(call)) {
CALL__thiscall (_@ (MEM_InformationMan.DlgTrade), oCViewDialogTrade__TransferAccept);
call = CALL_End();
};
};
/*
* Sets containers value for both traders and buyers 'offers' to 0
* We have to reset value at the end of each trade ... not sure why
*/
func void Trade_ResetBuySellValue () {
var int ptr;
//Traders 'offer'
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
ptr = MEM_ReadInt (ptr + 252); //oCInformationManager.ocViewDialogTrade.oCViewDialogItemContainer
if (ptr) {
//Overwrite container value - write 0
MEM_WriteInt (ptr + 264, 0); //oCInformationManager.ocViewDialogTrade.oCViewDialogItemContainer.value
};
};
//Buyers 'offer'
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
ptr = MEM_ReadInt (ptr + 260); //oCInformationManager.ocViewDialogTrade.oCViewDialogItemContainer
if (ptr) {
//Overwrite container value - write 0
MEM_WriteInt (ptr + 264, 0); //oCInformationManager.ocViewDialogTrade.oCViewDialogItemContainer.value
};
};
};
func void _hook_oCViewDialogTrade_OnTransfer__EnhancedTrading () {
var int ptr;
var int activeContainerNo; activeContainerNo = -1;
var oCItemContainer container;
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
//Get activeContainerNo: 0 = trader, 1 = traders offer, 2 = buyers offer, 3 = buyer
activeContainerNo = MEM_ReadInt (ptr + 268);
};
//No need to adjust anything
if (activeContainerNo == -1) { return; };
//Trader
if (activeContainerNo == 0) {
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
ptr = MEM_ReadInt (ptr + 248); //oCInformationManager.ocViewDialogTrade.oCViewDialogStealContainer
if (ptr) {
ptr = MEM_ReadInt (ptr + 256);
container = _^ (ptr);
};
};
} else
//Traders offer
if (activeContainerNo == 1) {
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
ptr = MEM_ReadInt (ptr + 252); //oCInformationManager.ocViewDialogTrade.oCViewDialogItemContainer
if (ptr) {
ptr = MEM_ReadInt (ptr + 256);
container = _^ (ptr);
};
};
} else
//Buyers offer
if (activeContainerNo == 2) {
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
ptr = MEM_ReadInt (ptr + 260); //oCInformationManager.ocViewDialogTrade.oCViewDialogItemContainer
if (ptr) {
ptr = MEM_ReadInt (ptr + 256);
container = _^ (ptr);
};
};
} else
//Buyer
if (activeContainerNo == 3) {
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
ptr = MEM_ReadInt (ptr + 264); //oCInformationManager.ocViewDialogTrade.oCViewDialogInventory
if (ptr) {
ptr = MEM_ReadInt (ptr + 256);
container = _^ (ptr);
};
};
};
var oCNPC npc; npc = _^ (MEM_InformationMan.npc);
var int itemPtr; itemPtr = List_GetS (container.inventory2_oCItemContainer_contents, container.inventory2_oCItemContainer_selectedItem + 2);
if (itemPtr) {
var oCItem itm;
itm = _^ (itemPtr);
//--- Figure out if trader wants to buy an item
if (activeContainerNo == 3) //Player selling items
{
if (!NPC_WantsToBuyItems (npc, itemPtr)) {
//Trick von mud-freak! :)
const int contents = 0;
ECX = _@ (contents) - 4;
return;
};
};
//--- Adjust selling/buying multiplier value
var int multiplier;
//if item.value == 1 - set multiplier to 100 % (otherwise value of the item would be 0!)
if (itm.Value == 1) {
multiplier = FLOATONE;
} else {
if (activeContainerNo == 3) //Player selling items
|| (activeContainerNo == 2) //Player moving items back to his inventory
{
multiplier = NPC_GetSellMultiplierF (npc, itemPtr);
} else { //Player buying items / moving items back to traders inventory
multiplier = NPC_GetBuyMultiplierF (npc, itemPtr);
};
};
Trade_ChangeBuyMultiplier (multiplier);
Trade_ChangeSellMultiplier (multiplier);
};
};
func void _hook_oCViewDialogTrade_OnExit__EnhancedTrading () {
//Reset values
Trade_ResetBuySellValue ();
TradeForceTransferAccept = 0;
};
func void _hook_oCViewDialogTrade_HandleEvent__EnhancedTrading ()
{
var int key; key = MEM_ReadInt (ESP + 4);
//Check if trader / buyer have enough ore to sell / buy stuff
if (key != KEY_RETURN) {
return;
};
var int ptr;
var oCNpcInventory container_Trader;
var oCItemContainer container_Trader_Offer;
var oCItemContainer container_Buyer_Offer;
var oCNpcInventory container_Buyer;
//--- Get Item containers (oCItemContainer)
//Traders Inventory
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
ptr = MEM_ReadInt (ptr + 248); //oCViewDialogStealContainer
if (ptr) {
ptr = MEM_ReadInt (ptr + 256); //oCItemContainer
container_Trader = _^ (ptr);
};
};
//Traders 'offer'
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
ptr = MEM_ReadInt (ptr + 252); //oCViewDialogStealContainer
if (ptr) {
ptr = MEM_ReadInt (ptr + 256); //oCItemContainer
container_Trader_Offer = _^ (ptr);
};
};
//Buyers 'offer'
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
ptr = MEM_ReadInt (ptr + 260); //oCViewDialogItemContainer
if (ptr) {
ptr = MEM_ReadInt (ptr + 256); //oCItemContainer
container_Buyer_Offer = _^ (ptr);
};
};
//Buyers inventory
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
ptr = MEM_ReadInt (ptr + 264); //oCViewDialogItemInventory
if (ptr) {
ptr = MEM_ReadInt (ptr + 256); //oCItemContainer
container_Buyer = _^ (ptr);
};
};
//--- Get Offer Value + Ore amount for both Trader and Buyer
var string msg;
var int valueBuying;
var int valueSelling;
var int oreTrader;
var int oreBuyer;
var int delta;
var int cancel; cancel = FALSE;
//inventory2_oCItemContainer_textCategoryStatic contains Total Value of offers - we can exploit that
valueBuying = STR_ToInt (container_Trader_Offer.inventory2_oCItemContainer_textCategoryStatic);
valueSelling = STR_ToInt (container_Buyer_Offer.inventory2_oCItemContainer_textCategoryStatic);
var C_NPC Trader; Trader = _^ (container_Trader.inventory2_owner);
oreTrader = NPC_HasItems (Trader, ItMiNugget);
var C_NPC Buyer; Buyer = _^ (container_Buyer.inventory2_owner);
oreBuyer = NPC_HasItems (Buyer, ItMiNugget);
delta = valueBuying - valueSelling;
if (delta == 0) {
//Trade went smoothly :)
} else
//Buyer does not have enough ore!
if (delta > 0) {
if (delta > oreBuyer) {
PrintScreen (TEXT_TRADE_BUYER_NOTENOUGHORE, -1, POSY_TRADE_BUYER_NOTENOUGHORE, "font_old_20_white.tga", _TIME_MESSAGE_LOGENTRY);
};
} else
//Trader does not have enough ore!
{
//Abs (delta)
delta = 0 - delta;
if (delta > oreTrader) {
TradeForceTransferAccept += 1;
//First warning
if (TradeForceTransferAccept == 1) {
PrintScreen (TEXT_TRADE_TRADER_NOTENOUGHORE, -1, POSY_TRADE_TRADER_NOTENOUGHORE, "font_old_20_white.tga", _TIME_MESSAGE_LOGENTRY);
cancel = FALSE;
} else
//Second warning --> ignore enter
if (TradeForceTransferAccept == 2) {
PrintScreen (TEXT_TRADE_TRADER_NOTENOUGHORE_CONFIRM, -1, POSY_TRADE_TRADER_NOTENOUGHORE_CONFIRM, "font_old_20_white.tga", _TIME_MESSAGE_LOGENTRY);
cancel = TRUE;
} else
//If player confirmed trade anyway ... then don't ignore it
if (TradeForceTransferAccept == 3) {
cancel = FALSE;
TradeForceTransferAccept = 0;
};
};
};
if (cancel) {
MEM_WriteInt (ESP + 4, 0);
EDI = 0;
};
};
func void _hook_oCViewDialogTrade_OnAccept__EnhancedTrading ()
{
var int ptr;
var oCNpcInventory container_Trader;
var oCItemContainer container_Trader_Offer;
var oCItemContainer container_Buyer_Offer;
var oCNpcInventory container_Buyer;
//--- Get Item containers (oCItemContainer)
//Traders Inventory
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
ptr = MEM_ReadInt (ptr + 248); //oCViewDialogItemInventory
if (ptr) {
ptr = MEM_ReadInt (ptr + 256); //oCItemContainer
container_Trader = _^ (ptr);
};
};
//Traders 'offer'
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
ptr = MEM_ReadInt (ptr + 252); //oCViewDialogStealContainer
if (ptr) {
ptr = MEM_ReadInt (ptr + 256); //oCItemContainer
container_Trader_Offer = _^ (ptr);
};
};
//Buyers 'offer'
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
ptr = MEM_ReadInt (ptr + 260); //oCViewDialogItemContainer
if (ptr) {
ptr = MEM_ReadInt (ptr + 256); //oCItemContainer
container_Buyer_Offer = _^ (ptr);
};
};
//Buyers inventory
ptr = MEMINT_oCInformationManager_Address;
ptr = MEM_ReadInt (ptr + 24); //oCInformationManager.ocViewDialogTrade
if (ptr) {
ptr = MEM_ReadInt (ptr + 264); //oCViewDialogItemInventory
if (ptr) {
ptr = MEM_ReadInt (ptr + 256); //oCItemContainer
container_Buyer = _^ (ptr);
};
};
//--- Get Offer Value + Ore amount for both Trader and Buyer
var int valueBuying;
var int valueSelling;
var int oreTrader;
var int oreBuyer;
var int delta;
//inventory2_oCItemContainer_textCategoryStatic contains Total Value of offers - we can exploit that
valueBuying = STR_ToInt (container_Trader_Offer.inventory2_oCItemContainer_textCategoryStatic);
valueSelling = STR_ToInt (container_Buyer_Offer.inventory2_oCItemContainer_textCategoryStatic);
var C_NPC Trader; Trader = _^ (container_Trader.inventory2_owner);
oreTrader = NPC_HasItems (Trader, ItMiNugget);
var C_NPC Buyer; Buyer = _^ (container_Buyer.inventory2_owner);
oreBuyer = NPC_HasItems (Buyer, ItMiNugget);
delta = valueBuying - valueSelling;
var string msg;
if (delta == 0) {
//Trade went smoothly :)
} else
//Buyer has to supply ore !
if (delta > 0) {
if (delta > oreBuyer) {
} else {
//Accept Transfer anyway!
oCViewDialogTrade_TransferAccept ();
//'Move' ore from Buyer to Trader
NPC_RemoveInvItems (Buyer, ItMiNugget, delta);
CreateInvItems (Trader, ItMiNugget, delta);
PrintScreen (GetText_TradeGiveOre (delta), -1, _YPOS_MESSAGE_GIVEN, "font_old_10_white.tga", _TIME_MESSAGE_TAKEN);
};
} else
//Trader has to supply ore !
{
//Abs (delta)
delta = 0 - delta;
if (delta > oreTrader) {
if (oreTrader > 0) {
delta = oreTrader;
//'Move' ore from Trader to Buyer
NPC_RemoveInvItems (Trader, ItMiNugget, delta);
CreateInvItems (Buyer, ItMiNugget, delta);
PrintScreen (GetText_ReceiveGiveOre (delta), -1, _YPOS_MESSAGE_TAKEN, "font_old_10_white.tga", _TIME_MESSAGE_TAKEN);
};
} else {
//Accept Transfer anyway!
oCViewDialogTrade_TransferAccept ();
//'Move' ore from Trader to Buyer
NPC_RemoveInvItems (Trader, ItMiNugget, delta);
CreateInvItems (Buyer, ItMiNugget, delta);
PrintScreen (GetText_ReceiveGiveOre (delta), -1, _YPOS_MESSAGE_TAKEN, "font_old_10_white.tga", _TIME_MESSAGE_TAKEN);
};
};
};
func void G1_EnhancedTrading_Init(){
const int once = 0;
if (!once) {
//Hooked functions checks whether NPC wants to buy an item or not. Also it cahnges selling/buying multiplier values
HookEngine (oCViewDialogTrade__OnTransferLeft, 10, "_hook_oCViewDialogTrade_OnTransfer__EnhancedTrading");
HookEngine (oCViewDialogTrade__OnTransferRight, 10, "_hook_oCViewDialogTrade_OnTransfer__EnhancedTrading");
//Called when exiting trading
HookEngine (oCViewDialogTrade__OnExit, 5, "_hook_oCViewDialogTrade_OnExit__EnhancedTrading");
//Obsluha obchodovania - automaticke dorovnavanie rudy
HookEngine (oCViewDialogTrade__OnAccept, 6, "_hook_oCViewDialogTrade_OnAccept__EnhancedTrading");
//10
HookEngine (oCViewDialogTrade__HandleEvent, 7, "_hook_oCViewDialogTrade_HandleEvent__EnhancedTrading");
once = 1;
};
};
| D |
// Copyright 2013-2017, Adam D. Ruppe.
/++
This is version 2 of my http/1.1 client implementation.
It has no dependencies for basic operation, but does require OpenSSL
libraries (or compatible) to be support HTTPS. Compile with
`-version=with_openssl` to enable such support.
http2.d, despite its name, does NOT implement HTTP/2.0, but this
shouldn't matter for 99.9% of usage, since all servers will continue
to support HTTP/1.1 for a very long time.
+/
module arsd.http2;
version(without_openssl) {}
else {
version=use_openssl;
version=with_openssl;
}
/++
Demonstrates core functionality, using the [HttpClient],
[HttpRequest] (returned by [HttpClient.navigateTo|client.navigateTo]),
and [HttpResponse] (returned by [HttpRequest.waitForCompletion|request.waitForCompletion]).
+/
unittest {
import arsd.http2;
void main() {
auto client = new HttpClient();
auto request = client.navigateTo(Uri("http://dlang.org/"));
auto response = request.waitForCompletion();
string returnedHtml = response.contentText;
}
}
// FIXME: multipart encoded file uploads needs implementation
// future: do web client api stuff
debug import std.stdio;
import std.socket;
import core.time;
// FIXME: check Transfer-Encoding: gzip always
version(with_openssl) {
pragma(lib, "crypto");
pragma(lib, "ssl");
}
/+
HttpRequest httpRequest(string method, string url, ubyte[] content, string[string] content) {
return null;
}
+/
/**
auto request = get("http://arsdnet.net/");
request.send();
auto response = get("http://arsdnet.net/").waitForCompletion();
*/
HttpRequest get(string url) {
auto client = new HttpClient();
auto request = client.navigateTo(Uri(url));
return request;
}
/// gets the text off a url. basic operation only.
string getText(string url) {
auto request = get(url);
auto response = request.waitForCompletion();
return cast(string) response.content;
}
/+
ubyte[] getBinary(string url, string[string] cookies = null) {
auto hr = httpRequest("GET", url, null, cookies);
if(hr.code != 200)
throw new Exception(format("HTTP answered %d instead of 200 on %s", hr.code, url));
return hr.content;
}
/**
Gets a textual document, ignoring headers. Throws on non-text or error.
*/
string get(string url, string[string] cookies = null) {
auto hr = httpRequest("GET", url, null, cookies);
if(hr.code != 200)
throw new Exception(format("HTTP answered %d instead of 200 on %s", hr.code, url));
if(hr.contentType.indexOf("text/") == -1)
throw new Exception(hr.contentType ~ " is bad content for conversion to string");
return cast(string) hr.content;
}
static import std.uri;
string post(string url, string[string] args, string[string] cookies = null) {
string content;
foreach(name, arg; args) {
if(content.length)
content ~= "&";
content ~= std.uri.encode(name) ~ "=" ~ std.uri.encode(arg);
}
auto hr = httpRequest("POST", url, cast(ubyte[]) content, cookies, ["Content-Type: application/x-www-form-urlencoded"]);
if(hr.code != 200)
throw new Exception(format("HTTP answered %d instead of 200", hr.code));
if(hr.contentType.indexOf("text/") == -1)
throw new Exception(hr.contentType ~ " is bad content for conversion to string");
return cast(string) hr.content;
}
+/
///
struct HttpResponse {
int code; ///
string codeText; ///
string httpVersion; ///
string statusLine; ///
string contentType; /// The content type header
string[string] cookies; /// Names and values of cookies set in the response.
string[] headers; /// Array of all headers returned.
string[string] headersHash; ///
ubyte[] content; /// The raw content returned in the response body.
string contentText; /// [content], but casted to string (for convenience)
/++
returns `new Document(this.contentText)`. Requires [arsd.dom].
+/
auto contentDom()() {
import arsd.dom;
return new Document(this.contentText);
}
/++
returns `var.fromJson(this.contentText)`. Requires [arsd.jsvar].
+/
auto contentJson()() {
import arsd.jsvar;
return var.fromJson(this.contentText);
}
HttpRequestParameters requestParameters; ///
LinkHeader[] linksStored;
bool linksLazilyParsed;
/// Returns links header sorted by "rel" attribute.
/// It returns a new array on each call.
LinkHeader[string] linksHash() {
auto links = this.links();
LinkHeader[string] ret;
foreach(link; links)
ret[link.rel] = link;
return ret;
}
/// Returns the Link header, parsed.
LinkHeader[] links() {
if(linksLazilyParsed)
return linksStored;
linksLazilyParsed = true;
LinkHeader[] ret;
auto hdrPtr = "Link" in headersHash;
if(hdrPtr is null)
return ret;
auto header = *hdrPtr;
LinkHeader current;
while(header.length) {
char ch = header[0];
if(ch == '<') {
// read url
header = header[1 .. $];
size_t idx;
while(idx < header.length && header[idx] != '>')
idx++;
current.url = header[0 .. idx];
header = header[idx .. $];
} else if(ch == ';') {
// read attribute
header = header[1 .. $];
header = header.stripLeft;
size_t idx;
while(idx < header.length && header[idx] != '=')
idx++;
string name = header[0 .. idx];
header = header[idx + 1 .. $];
string value;
if(header.length && header[0] == '"') {
// quoted value
header = header[1 .. $];
idx = 0;
while(idx < header.length && header[idx] != '\"')
idx++;
value = header[0 .. idx];
header = header[idx .. $];
} else if(header.length) {
// unquoted value
idx = 0;
while(idx < header.length && header[idx] != ',' && header[idx] != ' ' && header[idx] != ';')
idx++;
value = header[0 .. idx];
header = header[idx .. $].stripLeft;
}
name = name.toLower;
if(name == "rel")
current.rel = value;
else
current.attributes[name] = value;
} else if(ch == ',') {
// start another
ret ~= current;
current = LinkHeader.init;
} else if(ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t') {
// ignore
}
header = header[1 .. $];
}
ret ~= current;
linksStored = ret;
return ret;
}
}
///
struct LinkHeader {
string url; ///
string rel; ///
string[string] attributes; /// like title, rev, media, whatever attributes
}
import std.string;
static import std.algorithm;
import std.conv;
import std.range;
// Copy pasta from cgi.d, then stripped down
///
struct Uri {
alias toString this; // blargh idk a url really is a string, but should it be implicit?
// scheme//userinfo@host:port/path?query#fragment
string scheme; /// e.g. "http" in "http://example.com/"
string userinfo; /// the username (and possibly a password) in the uri
string host; /// the domain name
int port; /// port number, if given. Will be zero if a port was not explicitly given
string path; /// e.g. "/folder/file.html" in "http://example.com/folder/file.html"
string query; /// the stuff after the ? in a uri
string fragment; /// the stuff after the # in a uri.
/// Breaks down a uri string to its components
this(string uri) {
reparse(uri);
}
private void reparse(string uri) {
import std.regex;
// from RFC 3986
// the ctRegex triples the compile time and makes ugly errors for no real benefit
// it was a nice experiment but just not worth it.
// enum ctr = ctRegex!r"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?";
auto ctr = regex(r"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?");
auto m = match(uri, ctr);
if(m) {
scheme = m.captures[2];
auto authority = m.captures[4];
auto idx = authority.indexOf("@");
if(idx != -1) {
userinfo = authority[0 .. idx];
authority = authority[idx + 1 .. $];
}
idx = authority.indexOf(":");
if(idx == -1) {
port = 0; // 0 means not specified; we should use the default for the scheme
host = authority;
} else {
host = authority[0 .. idx];
port = to!int(authority[idx + 1 .. $]);
}
path = m.captures[5];
query = m.captures[7];
fragment = m.captures[9];
}
// uriInvalidated = false;
}
private string rebuildUri() const {
string ret;
if(scheme.length)
ret ~= scheme ~ ":";
if(userinfo.length || host.length)
ret ~= "//";
if(userinfo.length)
ret ~= userinfo ~ "@";
if(host.length)
ret ~= host;
if(port)
ret ~= ":" ~ to!string(port);
ret ~= path;
if(query.length)
ret ~= "?" ~ query;
if(fragment.length)
ret ~= "#" ~ fragment;
// uri = ret;
// uriInvalidated = false;
return ret;
}
/// Converts the broken down parts back into a complete string
string toString() const {
// if(uriInvalidated)
return rebuildUri();
}
/// Returns a new absolute Uri given a base. It treats this one as
/// relative where possible, but absolute if not. (If protocol, domain, or
/// other info is not set, the new one inherits it from the base.)
///
/// Browsers use a function like this to figure out links in html.
Uri basedOn(in Uri baseUrl) const {
Uri n = this; // copies
// n.uriInvalidated = true; // make sure we regenerate...
// userinfo is not inherited... is this wrong?
// if anything is given in the existing url, we don't use the base anymore.
if(n.scheme.empty) {
n.scheme = baseUrl.scheme;
if(n.host.empty) {
n.host = baseUrl.host;
if(n.port == 0) {
n.port = baseUrl.port;
if(n.path.length > 0 && n.path[0] != '/') {
auto b = baseUrl.path[0 .. baseUrl.path.lastIndexOf("/") + 1];
if(b.length == 0)
b = "/";
n.path = b ~ n.path;
} else if(n.path.length == 0) {
n.path = baseUrl.path;
}
}
}
}
return n;
}
}
/*
void main(string args[]) {
write(post("http://arsdnet.net/bugs.php", ["test" : "hey", "again" : "what"]));
}
*/
///
struct BasicAuth {
string username; ///
string password; ///
}
/**
When you send something, it creates a request
and sends it asynchronously. The request object
auto request = new HttpRequest();
// set any properties here
// synchronous usage
auto reply = request.perform();
// async usage, type 1:
request.send();
request2.send();
// wait until the first one is done, with the second one still in-flight
auto response = request.waitForCompletion();
// async usage, type 2:
request.onDataReceived = (HttpRequest hr) {
if(hr.state == HttpRequest.State.complete) {
// use hr.responseData
}
};
request.send(); // send, using the callback
// before terminating, be sure you wait for your requests to finish!
request.waitForCompletion();
*/
class HttpRequest {
private static {
// we manage the actual connections. When a request is made on a particular
// host, we try to reuse connections. We may open more than one connection per
// host to do parallel requests.
//
// The key is the *domain name* and the port. Multiple domains on the same address will have separate connections.
Socket[][string] socketsPerHost;
void loseSocket(string host, ushort port, bool ssl, Socket s) {
import std.string;
auto key = format("http%s://%s:%s", ssl ? "s" : "", host, port);
if(auto list = key in socketsPerHost) {
for(int a = 0; a < (*list).length; a++) {
if((*list)[a] is s) {
for(int b = a; b < (*list).length - 1; b++)
(*list)[b] = (*list)[b+1];
(*list) = (*list)[0 .. $-1];
break;
}
}
}
}
Socket getOpenSocketOnHost(string host, ushort port, bool ssl) {
Socket openNewConnection() {
Socket socket;
if(ssl) {
version(with_openssl)
socket = new SslClientSocket(AddressFamily.INET, SocketType.STREAM);
else
throw new Exception("SSL not compiled in");
} else
socket = new Socket(AddressFamily.INET, SocketType.STREAM);
socket.connect(new InternetAddress(host, port));
debug(arsd_http2) writeln("opening to ", host, ":", port);
assert(socket.handle() !is socket_t.init);
return socket;
}
import std.string;
auto key = format("http%s://%s:%s", ssl ? "s" : "", host, port);
if(auto hostListing = key in socketsPerHost) {
// try to find an available socket that is already open
foreach(socket; *hostListing) {
if(socket !in activeRequestOnSocket) {
// let's see if it has closed since we last tried
// e.g. a server timeout or something. If so, we need
// to lose this one and immediately open a new one.
static SocketSet readSet = null;
if(readSet is null)
readSet = new SocketSet();
readSet.reset();
assert(socket.handle() !is socket_t.init, socket is null ? "null" : socket.toString());
readSet.add(socket);
auto got = Socket.select(readSet, null, null, 5.msecs /* timeout */);
if(got > 0) {
// we can read something off this... but there aren't
// any active requests. Assume it is EOF and open a new one
socket.close();
loseSocket(host, port, ssl, socket);
goto openNew;
}
return socket;
}
}
// if not too many already open, go ahead and do a new one
if((*hostListing).length < 6) {
auto socket = openNewConnection();
(*hostListing) ~= socket;
return socket;
} else
return null; // too many, you'll have to wait
}
openNew:
auto socket = openNewConnection();
socketsPerHost[key] ~= socket;
return socket;
}
// only one request can be active on a given socket (at least HTTP < 2.0) so this is that
HttpRequest[Socket] activeRequestOnSocket;
HttpRequest[] pending; // and these are the requests that are waiting
SocketSet readSet;
SocketSet writeSet;
void advanceConnections() {
if(readSet is null)
readSet = new SocketSet();
if(writeSet is null)
writeSet = new SocketSet();
ubyte[2048] buffer;
HttpRequest[16] removeFromPending;
size_t removeFromPendingCount = 0;
// are there pending requests? let's try to send them
foreach(idx, pc; pending) {
if(removeFromPendingCount == removeFromPending.length)
break;
if(pc.state == HttpRequest.State.aborted) {
removeFromPending[removeFromPendingCount++] = pc;
continue;
}
auto socket = getOpenSocketOnHost(pc.requestParameters.host, pc.requestParameters.port, pc.requestParameters.ssl);
if(socket !is null) {
activeRequestOnSocket[socket] = pc;
assert(pc.sendBuffer.length);
pc.state = State.sendingHeaders;
removeFromPending[removeFromPendingCount++] = pc;
}
}
import std.algorithm : remove;
foreach(rp; removeFromPending[0 .. removeFromPendingCount])
pending = pending.remove!((a) => a is rp)();
readSet.reset();
writeSet.reset();
// active requests need to be read or written to
foreach(sock, request; activeRequestOnSocket) {
// check the other sockets just for EOF, if they close, take them out of our list,
// we'll reopen if needed upon request.
readSet.add(sock);
if(request.state == State.sendingHeaders || request.state == State.sendingBody)
writeSet.add(sock);
}
tryAgain:
auto got = Socket.select(readSet, writeSet, null, 10.seconds /* timeout */);
if(got == 0) { /* timeout */
// timeout
} else if(got == -1) /* interrupted */
goto tryAgain;
else { /* ready */
Socket[16] inactive;
int inactiveCount = 0;
foreach(sock, request; activeRequestOnSocket) {
if(readSet.isSet(sock)) {
keep_going:
auto got = sock.receive(buffer);
debug(arsd_http2) writeln("====PACKET ",got,"=====",cast(string)buffer[0 .. got],"===/PACKET===");
if(got < 0) {
throw new Exception("receive error");
} else if(got == 0) {
// remote side disconnected
debug(arsd_http2) writeln("remote disconnect");
request.state = State.aborted;
inactive[inactiveCount++] = sock;
loseSocket(request.requestParameters.host, request.requestParameters.port, request.requestParameters.ssl, sock);
} else {
// data available
request.handleIncomingData(buffer[0 .. got]);
if(request.state == HttpRequest.State.complete) {
inactive[inactiveCount++] = sock;
// reuse the socket for another pending request, if we can
}
}
if(request.onDataReceived)
request.onDataReceived(request);
version(with_openssl)
if(auto s = cast(SslClientSocket) sock) {
// select doesn't handle the case with stuff
// left in the ssl buffer so i'm checking it separately
if(s.dataPending()) {
goto keep_going;
}
}
}
if(request.state == State.sendingHeaders || request.state == State.sendingBody)
if(writeSet.isSet(sock)) {
assert(request.sendBuffer.length);
auto sent = sock.send(request.sendBuffer);
if(sent <= 0)
throw new Exception("send error " ~ lastSocketError);
request.sendBuffer = request.sendBuffer[sent .. $];
request.state = State.waitingForResponse;
}
}
foreach(s; inactive[0 .. inactiveCount]) {
debug(arsd_http2) writeln("removing socket from active list");
activeRequestOnSocket.remove(s);
}
}
// we've completed a request, are there any more pending connection? if so, send them now
}
}
struct HeaderReadingState {
bool justSawLf;
bool justSawCr;
bool atStartOfLine = true;
bool readingLineContinuation;
}
HeaderReadingState headerReadingState;
struct BodyReadingState {
bool isGzipped;
bool isDeflated;
bool isChunked;
int chunkedState;
// used for the chunk size if it is chunked
int contentLengthRemaining;
}
BodyReadingState bodyReadingState;
bool closeSocketWhenComplete;
import std.zlib;
UnCompress uncompress;
const(ubyte)[] leftoverDataFromLastTime;
void handleIncomingData(scope const ubyte[] dataIn) {
debug(arsd_http2) writeln("handleIncomingData, state: ", state);
if(state == State.waitingForResponse) {
state = State.readingHeaders;
headerReadingState = HeaderReadingState.init;
bodyReadingState = BodyReadingState.init;
}
const(ubyte)[] data;
if(leftoverDataFromLastTime.length)
data = leftoverDataFromLastTime ~ dataIn[];
else
data = dataIn[];
if(state == State.readingHeaders) {
void parseLastHeader() {
assert(responseData.headers.length);
if(responseData.headers.length == 1) {
responseData.statusLine = responseData.headers[0];
import std.algorithm;
auto parts = responseData.statusLine.splitter(" ");
responseData.httpVersion = parts.front;
parts.popFront();
responseData.code = to!int(parts.front());
parts.popFront();
responseData.codeText = "";
while(!parts.empty) {
// FIXME: this sucks!
responseData.codeText ~= parts.front();
parts.popFront();
if(!parts.empty)
responseData.codeText ~= " ";
}
} else {
// parse the new header
auto header = responseData.headers[$-1];
auto colon = header.indexOf(":");
if(colon == -1)
return;
auto name = header[0 .. colon];
auto value = header[colon + 2 .. $]; // skipping the colon itself and the following space
switch(name) {
case "Connection":
case "connection":
if(value == "close")
closeSocketWhenComplete = true;
break;
case "Content-Type":
case "content-type":
responseData.contentType = value;
break;
case "Content-Length":
case "content-length":
bodyReadingState.contentLengthRemaining = to!int(value);
break;
case "Transfer-Encoding":
case "transfer-encoding":
// note that if it is gzipped, it zips first, then chunks the compressed stream.
// so we should always dechunk first, then feed into the decompressor
if(value.strip == "chunked")
bodyReadingState.isChunked = true;
else throw new Exception("Unknown Transfer-Encoding: " ~ value);
break;
case "Content-Encoding":
case "content-encoding":
if(value == "gzip") {
bodyReadingState.isGzipped = true;
uncompress = new UnCompress();
} else if(value == "deflate") {
bodyReadingState.isDeflated = true;
uncompress = new UnCompress();
} else throw new Exception("Unknown Content-Encoding: " ~ value);
break;
case "Set-Cookie":
case "set-cookie":
// FIXME handle
break;
default:
// ignore
}
responseData.headersHash[name] = value;
}
}
size_t position = 0;
for(position = 0; position < dataIn.length; position++) {
if(headerReadingState.readingLineContinuation) {
if(data[position] == ' ' || data[position] == '\t')
continue;
headerReadingState.readingLineContinuation = false;
}
if(headerReadingState.atStartOfLine) {
headerReadingState.atStartOfLine = false;
if(data[position] == '\r' || data[position] == '\n') {
// done with headers
if(data[position] == '\r' && (position + 1) < data.length && data[position + 1] == '\n')
position++;
state = State.readingBody;
position++; // skip the newline
break;
} else if(data[position] == ' ' || data[position] == '\t') {
// line continuation, ignore all whitespace and collapse it into a space
headerReadingState.readingLineContinuation = true;
responseData.headers[$-1] ~= ' ';
} else {
// new header
if(responseData.headers.length)
parseLastHeader();
responseData.headers ~= "";
}
}
if(data[position] == '\r') {
headerReadingState.justSawCr = true;
continue;
} else
headerReadingState.justSawCr = false;
if(data[position] == '\n') {
headerReadingState.justSawLf = true;
headerReadingState.atStartOfLine = true;
continue;
} else
headerReadingState.justSawLf = false;
responseData.headers[$-1] ~= data[position];
}
parseLastHeader();
data = data[position .. $];
}
if(state == State.readingBody) {
if(bodyReadingState.isChunked) {
// read the hex length, stopping at a \r\n, ignoring everything between the new line but after the first non-valid hex character
// read binary data of that length. it is our content
// repeat until a zero sized chunk
// then read footers as headers.
start_over:
for(int a = 0; a < data.length; a++) {
final switch(bodyReadingState.chunkedState) {
case 0: // reading hex
char c = data[a];
if((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) {
// just keep reading
} else {
int power = 1;
bodyReadingState.contentLengthRemaining = 0;
assert(a != 0, cast(string) data);
for(int b = a-1; b >= 0; b--) {
char cc = data[b];
if(cc >= 'a' && cc <= 'z')
cc -= 0x20;
int val = 0;
if(cc >= '0' && cc <= '9')
val = cc - '0';
else
val = cc - 'A' + 10;
assert(val >= 0 && val <= 15, to!string(val));
bodyReadingState.contentLengthRemaining += power * val;
power *= 16;
}
debug(arsd_http2) writeln("Chunk length: ", bodyReadingState.contentLengthRemaining);
bodyReadingState.chunkedState = 1;
data = data[a + 1 .. $];
goto start_over;
}
break;
case 1: // reading until end of line
char c = data[a];
if(c == '\n') {
if(bodyReadingState.contentLengthRemaining == 0)
bodyReadingState.chunkedState = 5;
else
bodyReadingState.chunkedState = 2;
}
data = data[a + 1 .. $];
goto start_over;
break;
case 2: // reading data
auto can = a + bodyReadingState.contentLengthRemaining;
if(can > data.length)
can = cast(int) data.length;
auto newData = data[a .. can];
data = data[can .. $];
//if(bodyReadingState.isGzipped || bodyReadingState.isDeflated)
// responseData.content ~= cast(ubyte[]) uncompress.uncompress(data[a .. can]);
//else
responseData.content ~= newData;
bodyReadingState.contentLengthRemaining -= newData.length;
debug(arsd_http2) writeln("clr: ", bodyReadingState.contentLengthRemaining, " " , a, " ", can);
assert(bodyReadingState.contentLengthRemaining >= 0);
if(bodyReadingState.contentLengthRemaining == 0) {
bodyReadingState.chunkedState = 3;
} else {
// will continue grabbing more
}
goto start_over;
case 3: // reading 13/10
assert(data[a] == 13);
bodyReadingState.chunkedState++;
data = data[a + 1 .. $];
goto start_over;
break;
case 4: // reading 10 at end of packet
assert(data[a] == 10);
data = data[a + 1 .. $];
bodyReadingState.chunkedState = 0;
goto start_over;
case 5: // reading footers
//goto done; // FIXME
state = State.complete;
bodyReadingState.chunkedState = 0;
while(data[a] != 10)
a++;
data = data[a + 1 .. $];
if(bodyReadingState.isGzipped || bodyReadingState.isDeflated) {
auto n = uncompress.uncompress(responseData.content);
n ~= uncompress.flush();
responseData.content = cast(ubyte[]) n;
}
// responseData.content ~= cast(ubyte[]) uncompress.flush();
responseData.contentText = cast(string) responseData.content;
goto done;
}
}
done:
// FIXME
//if(closeSocketWhenComplete)
//socket.close();
} else {
//if(bodyReadingState.isGzipped || bodyReadingState.isDeflated)
// responseData.content ~= cast(ubyte[]) uncompress.uncompress(data);
//else
responseData.content ~= data;
//assert(data.length <= bodyReadingState.contentLengthRemaining, format("%d <= %d\n%s", data.length, bodyReadingState.contentLengthRemaining, cast(string)data));
int use = cast(int) data.length;
if(use > bodyReadingState.contentLengthRemaining)
use = bodyReadingState.contentLengthRemaining;
bodyReadingState.contentLengthRemaining -= use;
data = data[use .. $];
if(bodyReadingState.contentLengthRemaining == 0) {
if(bodyReadingState.isGzipped || bodyReadingState.isDeflated) {
auto n = uncompress.uncompress(responseData.content);
n ~= uncompress.flush();
responseData.content = cast(ubyte[]) n;
//responseData.content ~= cast(ubyte[]) uncompress.flush();
}
state = State.complete;
responseData.contentText = cast(string) responseData.content;
// FIXME
//if(closeSocketWhenComplete)
//socket.close();
}
}
}
if(data.length)
leftoverDataFromLastTime = data.dup;
else
leftoverDataFromLastTime = null;
}
this() {
}
///
this(Uri where, HttpVerb method) {
auto parts = where;
requestParameters.method = method;
requestParameters.host = parts.host;
requestParameters.port = cast(ushort) parts.port;
requestParameters.ssl = parts.scheme == "https";
if(parts.port == 0)
requestParameters.port = requestParameters.ssl ? 443 : 80;
requestParameters.uri = parts.path.length ? parts.path : "/";
if(parts.query.length) {
requestParameters.uri ~= "?";
requestParameters.uri ~= parts.query;
}
}
~this() {
}
ubyte[] sendBuffer;
HttpResponse responseData;
HttpRequestParameters parameters;
private HttpClient parentClient;
size_t bodyBytesSent;
size_t bodyBytesReceived;
State state_;
State state() { return state_; }
State state(State s) {
assert(state_ != State.complete);
return state_ = s;
}
/// Called when data is received. Check the state to see what data is available.
void delegate(HttpRequest) onDataReceived;
enum State {
/// The request has not yet been sent
unsent,
/// The send() method has been called, but no data is
/// sent on the socket yet because the connection is busy.
pendingAvailableConnection,
/// The headers are being sent now
sendingHeaders,
/// The body is being sent now
sendingBody,
/// The request has been sent but we haven't received any response yet
waitingForResponse,
/// We have received some data and are currently receiving headers
readingHeaders,
/// All headers are available but we're still waiting on the body
readingBody,
/// The request is complete.
complete,
/// The request is aborted, either by the abort() method, or as a result of the server disconnecting
aborted
}
/// Sends now and waits for the request to finish, returning the response.
HttpResponse perform() {
send();
return waitForCompletion();
}
/// Sends the request asynchronously.
void send() {
if(state != State.unsent && state != State.aborted)
return; // already sent
string headers;
headers ~= to!string(requestParameters.method) ~ " "~requestParameters.uri;
if(requestParameters.useHttp11)
headers ~= " HTTP/1.1\r\n";
else
headers ~= " HTTP/1.0\r\n";
headers ~= "Host: "~requestParameters.host~"\r\n";
if(requestParameters.userAgent.length)
headers ~= "User-Agent: "~requestParameters.userAgent~"\r\n";
if(requestParameters.contentType.length)
headers ~= "Content-Type: "~requestParameters.contentType~"\r\n";
if(requestParameters.authorization.length)
headers ~= "Authorization: "~requestParameters.authorization~"\r\n";
if(requestParameters.bodyData.length)
headers ~= "Content-Length: "~to!string(requestParameters.bodyData.length)~"\r\n";
if(requestParameters.acceptGzip)
headers ~= "Accept-Encoding: gzip\r\n";
foreach(header; requestParameters.headers)
headers ~= header ~ "\r\n";
headers ~= "\r\n";
sendBuffer = cast(ubyte[]) headers ~ requestParameters.bodyData;
responseData = HttpResponse.init;
responseData.requestParameters = requestParameters;
bodyBytesSent = 0;
bodyBytesReceived = 0;
state = State.pendingAvailableConnection;
pending ~= this;
HttpRequest.advanceConnections();
}
/// Waits for the request to finish or timeout, whichever comes furst.
HttpResponse waitForCompletion() {
while(state != State.aborted && state != State.complete) {
if(state == State.unsent)
send();
HttpRequest.advanceConnections();
}
return responseData;
}
/// Aborts this request.
void abort() {
this.state = State.aborted;
// FIXME
}
HttpRequestParameters requestParameters; ///
}
///
struct HttpRequestParameters {
// Duration timeout;
// debugging
bool useHttp11 = true; ///
bool acceptGzip = true; ///
// the request itself
HttpVerb method; ///
string host; ///
ushort port; ///
string uri; ///
bool ssl; ///
string userAgent; ///
string authorization; ///
string[string] cookies; ///
string[] headers; /// do not duplicate host, content-length, content-type, or any others that have a specific property
string contentType; ///
ubyte[] bodyData; ///
}
interface IHttpClient {
}
///
enum HttpVerb {
///
GET,
///
HEAD,
///
POST,
///
PUT,
///
DELETE,
///
OPTIONS,
///
TRACE,
///
CONNECT,
///
PATCH,
///
MERGE
}
/**
Usage:
auto client = new HttpClient("localhost", 80);
// relative links work based on the current url
client.get("foo/bar");
client.get("baz"); // gets foo/baz
auto request = client.get("rofl");
auto response = request.waitForCompletion();
*/
/// HttpClient keeps cookies, location, and some other state to reuse connections, when possible, like a web browser.
class HttpClient {
/* Protocol restrictions, useful to disable when debugging servers */
bool useHttp11 = true; ///
bool acceptGzip = true; ///
/// Automatically follow a redirection?
bool followLocation = false; /// NOT IMPLEMENTED
///
@property Uri location() {
return currentUrl;
}
/// High level function that works similarly to entering a url
/// into a browser.
///
/// Follows locations, updates the current url.
HttpRequest navigateTo(Uri where, HttpVerb method = HttpVerb.GET) {
currentUrl = where.basedOn(currentUrl);
currentDomain = where.host;
auto request = new HttpRequest(currentUrl, method);
request.requestParameters.userAgent = userAgent;
request.requestParameters.authorization = authorization;
request.requestParameters.useHttp11 = this.useHttp11;
request.requestParameters.acceptGzip = this.acceptGzip;
return request;
}
private Uri currentUrl;
private string currentDomain;
this(ICache cache = null) {
}
// FIXME: add proxy
// FIXME: some kind of caching
///
void setCookie(string name, string value, string domain = null) {
if(domain == null)
domain = currentDomain;
cookies[domain][name] = value;
}
///
void clearCookies(string domain = null) {
if(domain is null)
cookies = null;
else
cookies[domain] = null;
}
// If you set these, they will be pre-filled on all requests made with this client
string userAgent = "D arsd.html2"; ///
string authorization; ///
/* inter-request state */
string[string][string] cookies;
}
interface ICache {
HttpResponse* getCachedResponse(HttpRequestParameters request);
}
// / Provides caching behavior similar to a real web browser
class HttpCache : ICache {
HttpResponse* getCachedResponse(HttpRequestParameters request) {
return null;
}
}
// / Gives simple maximum age caching, ignoring the actual http headers
class SimpleCache : ICache {
HttpResponse* getCachedResponse(HttpRequestParameters request) {
return null;
}
}
///
struct HttpCookie {
string name; ///
string value; ///
string domain; ///
string path; ///
//SysTime expirationDate; ///
bool secure; ///
bool httpOnly; ///
}
// FIXME: websocket
version(testing)
void main() {
import std.stdio;
auto client = new HttpClient();
auto request = client.navigateTo(Uri("http://localhost/chunked.php"));
request.send();
auto request2 = client.navigateTo(Uri("http://dlang.org/"));
request2.send();
{
auto response = request2.waitForCompletion();
//write(cast(string) response.content);
}
auto response = request.waitForCompletion();
write(cast(string) response.content);
writeln(HttpRequest.socketsPerHost);
}
// From sslsocket.d
version(use_openssl) {
alias SslClientSocket = OpenSslSocket;
extern(C) {
int SSL_library_init();
void OpenSSL_add_all_ciphers();
void OpenSSL_add_all_digests();
void SSL_load_error_strings();
struct SSL {}
struct SSL_CTX {}
struct SSL_METHOD {}
SSL_CTX* SSL_CTX_new(const SSL_METHOD* method);
SSL* SSL_new(SSL_CTX*);
int SSL_set_fd(SSL*, int);
int SSL_connect(SSL*);
int SSL_write(SSL*, const void*, int);
int SSL_read(SSL*, void*, int);
void SSL_free(SSL*);
void SSL_CTX_free(SSL_CTX*);
int SSL_pending(const SSL*);
void SSL_set_verify(SSL*, int, void*);
enum SSL_VERIFY_NONE = 0;
SSL_METHOD* SSLv3_client_method();
SSL_METHOD* TLS_client_method();
SSL_METHOD* SSLv23_client_method();
void ERR_print_errors_fp(FILE*);
}
import core.stdc.stdio;
shared static this() {
SSL_library_init();
OpenSSL_add_all_ciphers();
OpenSSL_add_all_digests();
SSL_load_error_strings();
}
pragma(lib, "crypto");
pragma(lib, "ssl");
class OpenSslSocket : Socket {
private SSL* ssl;
private SSL_CTX* ctx;
private void initSsl(bool verifyPeer) {
ctx = SSL_CTX_new(SSLv23_client_method());
assert(ctx !is null);
ssl = SSL_new(ctx);
if(!verifyPeer)
SSL_set_verify(ssl, SSL_VERIFY_NONE, null);
SSL_set_fd(ssl, this.handle);
}
bool dataPending() {
return SSL_pending(ssl) > 0;
}
@trusted
override void connect(Address to) {
super.connect(to);
if(SSL_connect(ssl) == -1) {
ERR_print_errors_fp(core.stdc.stdio.stderr);
int i;
printf("wtf\n");
scanf("%d\n", i);
throw new Exception("ssl connect");
}
}
@trusted
override ptrdiff_t send(const(void)[] buf, SocketFlags flags) {
//import std.stdio;writeln(cast(string) buf);
auto retval = SSL_write(ssl, buf.ptr, cast(uint) buf.length);
if(retval == -1) {
ERR_print_errors_fp(core.stdc.stdio.stderr);
int i;
printf("wtf\n");
scanf("%d\n", i);
throw new Exception("ssl send");
}
return retval;
}
override ptrdiff_t send(const(void)[] buf) {
return send(buf, SocketFlags.NONE);
}
@trusted
override ptrdiff_t receive(void[] buf, SocketFlags flags) {
auto retval = SSL_read(ssl, buf.ptr, cast(int)buf.length);
if(retval == -1) {
ERR_print_errors_fp(core.stdc.stdio.stderr);
int i;
printf("wtf\n");
scanf("%d\n", i);
throw new Exception("ssl send");
}
return retval;
}
override ptrdiff_t receive(void[] buf) {
return receive(buf, SocketFlags.NONE);
}
this(AddressFamily af, SocketType type = SocketType.STREAM, bool verifyPeer = true) {
super(af, type);
initSsl(verifyPeer);
}
this(socket_t sock, AddressFamily af) {
super(sock, af);
initSsl(true);
}
~this() {
SSL_free(ssl);
SSL_CTX_free(ctx);
}
}
}
/++
An experimental component for working with REST apis. Note that it
is a zero-argument template, so to create one, use `new HttpApiClient!()(args..)`
or you will get "HttpApiClient is used as a type" compile errors.
This will probably not work for you yet, and I might change it significantly.
Requires [arsd.jsvar].
Here's a snippet to create a pull request on GitHub to Phobos:
---
auto github = new HttpApiClient!()("https://api.github.com/", "your personal api token here");
// create the arguments object
// see: https://developer.github.com/v3/pulls/#create-a-pull-request
var args = var.emptyObject;
args.title = "My Pull Request";
args.head = "yourusername:" ~ branchName;
args.base = "master";
// note it is ["body"] instead of .body because `body` is a D keyword
args["body"] = "My cool PR is opened by the API!";
args.maintainer_can_modify = true;
// this translates to `repos/dlang/phobos/pulls` and sends a POST request,
// containing `args` as json, then immediately grabs the json result and extracts
// the value `html_url` from it. `prUrl` is typed `var`, from arsd.jsvar.
auto prUrl = github.rest.repos.dlang.phobos.pulls.POST(args).result.html_url;
writeln("Created: ", prUrl);
---
Why use this instead of just building the URL? Well, of course you can! This just makes
it a bit more convenient than string concatenation and manages a few headers for you.
Subtypes could potentially add static type checks too.
+/
class HttpApiClient() {
import arsd.jsvar;
HttpClient httpClient;
alias HttpApiClientType = typeof(this);
string urlBase;
string oauth2Token;
string submittedContentType;
/++
Params:
urlBase = The base url for the api. Tends to be something like `https://api.example.com/v2/` or similar.
oauth2Token = the authorization token for the service. You'll have to get it from somewhere else.
submittedContentType = the content-type of POST, PUT, etc. bodies.
+/
this(string urlBase, string oauth2Token, string submittedContentType = "application/json") {
httpClient = new HttpClient();
assert(urlBase[0] == 'h');
assert(urlBase[$-1] == '/');
this.urlBase = urlBase;
this.oauth2Token = oauth2Token;
this.submittedContentType = submittedContentType;
}
///
static struct HttpRequestWrapper {
HttpApiClientType apiClient; ///
HttpRequest request; ///
HttpResponse _response;
///
this(HttpApiClientType apiClient, HttpRequest request) {
this.apiClient = apiClient;
this.request = request;
}
/// Returns the full [HttpResponse] object so you can inspect the headers
@property HttpResponse response() {
if(_response is HttpResponse.init)
_response = request.waitForCompletion();
return _response;
}
/++
Returns the parsed JSON from the body of the response.
Throws on non-2xx responses.
+/
var result() {
return apiClient.throwOnError(response);
}
alias request this;
}
///
HttpRequestWrapper request(string uri, HttpVerb requestMethod = HttpVerb.GET, ubyte[] bodyBytes = null) {
if(uri[0] == '/')
uri = uri[1 .. $];
auto u = Uri(uri).basedOn(Uri(urlBase));
auto req = httpClient.navigateTo(u, requestMethod);
if(oauth2Token.length)
req.requestParameters.headers ~= "Authorization: Bearer " ~ oauth2Token;
req.requestParameters.contentType = submittedContentType;
req.requestParameters.bodyData = bodyBytes;
return HttpRequestWrapper(this, req);
}
///
var throwOnError(HttpResponse res) {
if(res.code < 200 || res.code >= 300)
throw new Exception(res.codeText);
var response = var.fromJson(res.contentText);
if(response.errors) {
throw new Exception(response.errors.toJson());
}
return response;
}
///
@property RestBuilder rest() {
return RestBuilder(this, null, null);
}
// hipchat.rest.room["Tech Team"].history
// gives: "/room/Tech%20Team/history"
//
// hipchat.rest.room["Tech Team"].history("page", "12)
///
static struct RestBuilder {
HttpApiClientType apiClient;
string[] pathParts;
string[2][] queryParts;
this(HttpApiClientType apiClient, string[] pathParts, string[2][] queryParts) {
this.apiClient = apiClient;
this.pathParts = pathParts;
this.queryParts = queryParts;
}
RestBuilder _SELF() {
return this;
}
/// The args are so you can call opCall on the returned
/// object, despite @property being broken af in D.
RestBuilder opDispatch(string str, T)(string n, T v) {
return RestBuilder(apiClient, pathParts ~ str, queryParts ~ [n, to!string(v)]);
}
///
RestBuilder opDispatch(string str)() {
return RestBuilder(apiClient, pathParts ~ str, queryParts);
}
///
RestBuilder opIndex(string str) {
return RestBuilder(apiClient, pathParts ~ str, queryParts);
}
///
RestBuilder opIndex(var str) {
return RestBuilder(apiClient, pathParts ~ str.get!string, queryParts);
}
///
RestBuilder opIndex(int i) {
return RestBuilder(apiClient, pathParts ~ to!string(i), queryParts);
}
///
RestBuilder opCall(T)(string name, T value) {
return RestBuilder(apiClient, pathParts, queryParts ~ [name, to!string(value)]);
}
///
string toUri() {
import std.uri;
string result;
foreach(idx, part; pathParts) {
if(idx)
result ~= "/";
result ~= encodeComponent(part);
}
result ~= "?";
foreach(idx, part; queryParts) {
if(idx)
result ~= "&";
result ~= encodeComponent(part[0]);
result ~= "=";
result ~= encodeComponent(part[1]);
}
return result;
}
///
final HttpRequestWrapper GET() { return _EXECUTE(HttpVerb.GET, this.toUri(), null); }
/// ditto
final HttpRequestWrapper DELETE() { return _EXECUTE(HttpVerb.DELETE, this.toUri(), null); }
// need to be able to send: JSON, urlencoded, multipart/form-data, and raw stuff.
/// ditto
final HttpRequestWrapper POST(T...)(T t) { return _EXECUTE(HttpVerb.POST, this.toUri(), toBytes(t)); }
/// ditto
final HttpRequestWrapper PATCH(T...)(T t) { return _EXECUTE(HttpVerb.PATCH, this.toUri(), toBytes(t)); }
/// ditto
final HttpRequestWrapper PUT(T...)(T t) { return _EXECUTE(HttpVerb.PUT, this.toUri(), toBytes(t)); }
private ubyte[] toBytes(T...)(T t) {
static if(T.length == 0)
return null;
else static if(T.length == 1 && is(T[0] == var))
return cast(ubyte[]) t[0].toJson(); // FIXME: cast
else
static assert(0); // FIXME
}
HttpRequestWrapper _EXECUTE(HttpVerb verb, string uri, ubyte[] bodyBytes) {
return apiClient.request(uri, verb, bodyBytes);
}
}
}
| D |
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: version
Short: V
Help: Show version number and quit
Category: important curl
Example: --version
Added: 4.0
See-also: help manual
Multi: custom
---
Displays information about curl and the libcurl version it uses.
The first line includes the full version of curl, libcurl and other 3rd party
libraries linked with the executable.
The second line (starts with "Protocols:") shows all protocols that libcurl
reports to support.
The third line (starts with "Features:") shows specific features libcurl
reports to offer. Available features include:
.RS
.IP "alt-svc"
Support for the Alt-Svc: header is provided.
.IP "AsynchDNS"
This curl uses asynchronous name resolves. Asynchronous name resolves can be
done using either the c-ares or the threaded resolver backends.
.IP "brotli"
Support for automatic brotli compression over HTTP(S).
.IP "CharConv"
curl was built with support for character set conversions (like EBCDIC)
.IP "Debug"
This curl uses a libcurl built with Debug. This enables more error-tracking
and memory debugging etc. For curl-developers only!
.IP "gsasl"
The built-in SASL authentication includes extensions to support SCRAM because
libcurl was built with libgsasl.
.IP "GSS-API"
GSS-API is supported.
.IP "HSTS"
HSTS support is present.
.IP "HTTP2"
HTTP/2 support has been built-in.
.IP "HTTP3"
HTTP/3 support has been built-in.
.IP "HTTPS-proxy"
This curl is built to support HTTPS proxy.
.IP "IDN"
This curl supports IDN - international domain names.
.IP "IPv6"
You can use IPv6 with this.
.IP "Kerberos"
Kerberos V5 authentication is supported.
.IP "Largefile"
This curl supports transfers of large files, files larger than 2GB.
.IP "libz"
Automatic decompression (via gzip, deflate) of compressed files over HTTP is
supported.
.IP "MultiSSL"
This curl supports multiple TLS backends.
.IP "NTLM"
NTLM authentication is supported.
.IP "NTLM_WB"
NTLM delegation to winbind helper is supported.
.IP "PSL"
PSL is short for Public Suffix List and means that this curl has been built
with knowledge about "public suffixes".
.IP "SPNEGO"
SPNEGO authentication is supported.
.IP "SSL"
SSL versions of various protocols are supported, such as HTTPS, FTPS, POP3S
and so on.
.IP "SSPI"
SSPI is supported.
.IP "TLS-SRP"
SRP (Secure Remote Password) authentication is supported for TLS.
.IP "TrackMemory"
Debug memory tracking is supported.
.IP "Unicode"
Unicode support on Windows.
.IP "UnixSockets"
Unix sockets support is provided.
.IP "zstd"
Automatic decompression (via zstd) of compressed files over HTTP is supported.
.RE
| D |
module minima.util;
T pmod(T)(T a, T m)
{
return (a % m + m) % m;
}
T pfmod(T)(T a, T m)
{
import std.math;
a = fmod(a, m);
if (a < 0)
return a + m;
return a;
}
deprecated string makeArray(int n, string dg)()
{
import std.array;
import std.conv;
string literal = "[";
static foreach (i; 0 .. n)
literal ~= dg.replace("$", to!string(i)) ~ ", ";
literal ~= "]";
return literal;
}
string makeArray(string dg, int n)
{
import std.array;
import std.conv;
string literal = "[";
foreach (i; 0 .. n)
literal ~= dg.replace("$", to!string(i)) ~ ", ";
literal ~= "]";
return literal;
}
| D |
/Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Core.build/DataCoders.swift.o : /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Base64URL.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/NestedData.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Thread+Async.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Deprecated.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Reflectable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/LosslessDataConvertible.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/File.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/MediaType.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/OptionalType.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Process+Execute.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/HeaderValue.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/DirectoryConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CaseInsensitiveString.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Future+Unwrap.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/FutureEncoder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CoreError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+Utilities.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/DataCoders.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Exports.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Hex.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/BasicKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Core.build/DataCoders~partial.swiftmodule : /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Base64URL.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/NestedData.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Thread+Async.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Deprecated.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Reflectable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/LosslessDataConvertible.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/File.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/MediaType.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/OptionalType.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Process+Execute.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/HeaderValue.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/DirectoryConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CaseInsensitiveString.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Future+Unwrap.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/FutureEncoder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CoreError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+Utilities.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/DataCoders.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Exports.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Hex.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/BasicKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Core.build/DataCoders~partial.swiftdoc : /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Base64URL.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/NestedData.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Thread+Async.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Deprecated.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Reflectable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/LosslessDataConvertible.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/File.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/MediaType.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/OptionalType.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Process+Execute.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/HeaderValue.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/DirectoryConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CaseInsensitiveString.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Future+Unwrap.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/FutureEncoder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CoreError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+Utilities.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/DataCoders.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Exports.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Hex.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/core.git-9210800844849382486/Sources/Core/BasicKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
| D |
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Designer of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef PROPERTYSHEET_H
#define PROPERTYSHEET_H
public import qt.QtDesigner.extension;
QT_BEGIN_NAMESPACE
class QVariant;
class QDesignerPropertySheetExtension
{
public:
/+virtual+/ ~QDesignerPropertySheetExtension() {}
/+virtual+/ int count() const = 0;
/+virtual+/ int indexOf(ref const(QString) name) const = 0;
/+virtual+/ QString propertyName(int index) const = 0;
/+virtual+/ QString propertyGroup(int index) const = 0;
/+virtual+/ void setPropertyGroup(int index, ref const(QString) group) = 0;
/+virtual+/ bool hasReset(int index) const = 0;
/+virtual+/ bool reset(int index) = 0;
/+virtual+/ bool isVisible(int index) const = 0;
/+virtual+/ void setVisible(int index, bool b) = 0;
/+virtual+/ bool isAttribute(int index) const = 0;
/+virtual+/ void setAttribute(int index, bool b) = 0;
/+virtual+/ QVariant property(int index) const = 0;
/+virtual+/ void setProperty(int index, ref const(QVariant) value) = 0;
/+virtual+/ bool isChanged(int index) const = 0;
/+virtual+/ void setChanged(int index, bool changed) = 0;
/+virtual+/ bool isEnabled(int index) const
// ### Qt6 remove body, provided in Qt5 for source compatibility to Qt4.
{ Q_UNUSED(index); return true; }
};
Q_DECLARE_EXTENSION_INTERFACE(QDesignerPropertySheetExtension,
"org.qt-project.Qt.Designer.PropertySheet")
QT_END_NAMESPACE
#endif // PROPERTYSHEET_H
| D |
module david;
public import david.timing; | D |
1 edwin_s_porter
6148 stuart_heisler
18439 tom_gries
12299 david_swift_ii
6157 s_sylvan_simon
15 dw_griffith
14352 arthur_hiller
12306 ken_annakin
6165 leslie_arliss
14359 ermanno_olmi
2075 leni_riefenstahl
2084 george_stevens
4139 john_huston
13845 john_ford_henry_hathaway
4144 orson_welles
2099 1028179-william_a_seiter
6198 jean_delannoy
8248 roy_del_ruth
10309 roger_corman
8263 brian_desmond_hurst
16457 jiri_menzel
3767 edward_buzzell
2126 sam_wood
6232 harve_foster
12380 john_llewellyn_moxey
8287 charles_lamont
100 charlie_chaplin
2149 1050292-david_butler
8294 robert_pirosh
12391 jeanluc_godard
16489 jun_fukuda
15893 claude_lelouch
16494 volker_schloendorff
10358 francis_d_lyon
119 yakov_protazanov
16505 kihachi_okamoto
10367 leslie_norman
2178 robert_n_bradbury
13675 _0668227
132 daniel_bressanutti
135 fritz_lang
16522 silvio_narizzano
16407 david_lane
12428 jamie_nolan
8334 _0823906
2192 gregory_la_cava
16529 king_hu
148 herbert_blache
16547 shohei_imamura
14500 anton_leader
166 robert_wiene
6315 alfred_e_green
6325 bj_alexander
8376 budd_boetticher
12473 karel_reisz
2234 robert_z_leonard
187 carl_boese
714 carl_theodor_dreyer
16590 eric_rohmer
4308 spencer_williams
14550 richard_lester
10460 robert_d_webb
13690 roman_polanski
223 fw_murnau
10469 gerd_oswald
14570 guy_hamilton
4335 sidney_lanfield
14581 sergio_leone
16638 stuart_rosenberg
2304 charlie_s_chaplin
14595 hiroshi_teshigahara
260 john_s_robertson
12550 lewis_gilbert
15148 sergei_parajanov
4366 arthur_lubin
274 dorothy_arzner
10538 valentine_davies
6443 sidney_gilliat
2351 william_wyler
312 benjamin_christensen
16700 john_allison
6461 akira_kurosawa
325 robert_flaherty
6475 george_seaton
16717 james_clavell
14676 william_asher
5518 vittorio_de_sica
10587 nunnally_johnson
348 fred_c_newmeyer
6495 mitchell_leisen
14690 don_weis
16744 michael_winner
361 buster-keaton-jr
16749 winston_hibler
10606 arnold_laven
10611 jack_pollexfen
6523 joseph_l_mankiewicz
6532 james_edward_grant
16777 _0111656
2442 william_cameron_menzies
12683 antonioni
8600 rene_clement
16793 arthur_h_nadel
6554 anthony_mann
4508 michael_powell
2463 louis_j_gasnier
13040 cy_endfield
14756 walter_grauman
8617 henry_levin
6576 elia_kazan
14769 ubaldo_ragona
14780 carl-lerner
455 alfred_hitchcock
10696 albert_lamorisse
16849 vilgot_sjoman
10318 virgil_w_vogel
12758 frank_tashlin
2519 1072502-marc_connelly
12767 1042605-richard_murphy
12773 mikio_naruse
14829 george_roy_hill
6640 douglas_sirk
6642 bill_roberts
15906 harald_reinl
16884 richard_rush
6910 harold_d_schuster
6647 henry_koster
512 sergei_eisenstein
4609 erle_c_kenton
6662 robert_rosen
14081 herschell_gordon_lewis
16916 david_swift
14869 james_neilson
6678 henry_hathaway
10777 sidney_lumet
542 rupert_julian
4639 _0478303
8738 richard_fleischer
2595 cecil_b_demille
12836 jerome_robbins
4654 1010653-david_miller
14897 jack_cardiff
563 clyde_bruckman
10335 roger_vadim
2622 _0176699
10817 terence_fisher
16962 theodore_j_flicker
4675 irving_rapper
8774 phil_karlson
583 bonnie_hill
16971 martin_scorsese
591 george_fitzmaurice
12882 curtis_harrington
782 georg_wilhelm_pabst
10838 george_abbott
602 albert_parker
12389 terence_young
2657 archie_mayo
17001 da_pennebaker
12906 daniel_petrie
12917 robert_rossen
10877 george_w_george
643 josef_von_sternberg
6792 don_hartman
655 walter_ruttmann
14994 mihalis_kakogiannis
12947 irwin_allen
6805 hc_potter
6811 irving_reis
17052 ken_russell
673 ja_howe
10914 val_guest
681 paul_leni
3527 dave_fleischer
8879 daniel_davis_edward_d_wood_jr
6832 carol_reed
690 walt_disney
15028 peter_glenville
8890 jack_arnold
4800 john_rawlins
705 1051480-david_sutherland
12999 gottfried_reinhardt
2762 enrique_tovar_avalos
6263 bob_cormack
4813 william_keighley
15064 kaneto_shindo
4825 billy_wilder
6874 abraham_polonsky
2779 lambert_hillyer
734 edward_m_sedgwick
10975 nathan_juran
17123 george_a_romero
2788 david_hand
7633 jacques_tati
13034 philip_dunne
749 _0064600
8944 richard_talmadge
10998 mikhail_kalatozov
8957 roy_rowland
11006 stanley_kramer
775 james_w_horne
4908 ray_enright
2826 william_dieterle
11021 boris_petroff
4878 john_farrow
3545 1042400-george_marshall
11035 robert_mulligan
796 dziga_verto
800 luis_bunuel
17189 don-hawks
806 robert_florey
11047 bert_i_gordon
17194 lindsay_anderson
9004 1028855-david_butler
15154 russ_meyer
17201 franklin_j_schaffner
2866 jean_renoir
4915 frank_tuttle
821 lewis_milestone
13116 pier_paolo_pasolini
17216 ted_post
9028 george_sidney
9356 david_macdonald
6986 hamilton_luske
17233 john_boorman
9045 eugene_lourie
860 roland_west
2910 sidney_franklin
6288 hal_walker
11106 andrzej_wajda
13156 george_pal
7013 anatole_litvak
15208 wojciech_has
2926 julien_duvivier
9085 samuel_fuller
13189 don_chaffey
9095 arthur_hilton
17291 sergio_corbucci
16877 edward_montagne
918 victor_heerman
15258 sidney_j_furie
13213 sam_peckinpah
7071 joseph_losey
5025 roy_william_neill
9124 charles_frend
13811 chris_marker
951 edmund_goulding
3000 king_vidor
5050 lewis_seiler
13244 pietro_germi
11199 masaki_kobayashi
5067 luchino_visconti
3022 henry_king
979 jean_cocteau
13268 allen_baron
5079 emeric_pressburger
991 james_whale
9187 charles_marquis_warren
13290 andrei_tarkovsky
7147 charles_walters
11251 james_a_contner
15361 elliot_silverstein
11270 196111261
8705 daniel_mann
7184 jules_dassin
15381 daniel_haller
17440 ken_hughes
16219 sydney_pollack
17585 michael_oherlihy
5160 john_m_stahl
17458 gilberto_de_anda
17464 michael_reeves
5187 henrigeorges_clouzot
9285 1094889-richard_brooks
15442 elio-petri
1109 norman_z_mcleod
5206 herman_shumlin
3940 edward-cline
15451 elmar-klos
1893 770890969
1121 rene_clair
11365 morton_dacosta
5224 jacques_tourneur
5235 fred_m_wilcox
1140 william_wellman
9334 inoshiro-honda
11383 mario_monicelli
15485 guy_green
9343 mario_bava
5248 delmer_daves
3208 anthony_asquith
7308 kenji_mizoguchi
1169 frank_capra
17557 werner_herzog
11415 albert_band
7321 max-ophuls
11418 quentin_lawrence
15516 james_b_harris
3231 dmitri_vasilyev
1187 mervyn_leroy
15525 clive_donner
17576 hubert_cornfield
9392 robert_aldrich
11441 lesley_selander
3250 1043170-george_b_seitz
14634 john_rich
13509 herk_harvey
1229 frank_borzage
11472 ronald_neame
17499 barry_shear
7381 stanley_donen
13526 agnes_varda
7390 james_algar_and_clyde_geronimi
17637 bob_rafelson
11497 melville_shavelson
9451 _0290371
3312 _0138893
11507 martin_ritt
1270 ernst_lubitsch
13545 joseph_green
5372 mark_robson
17705 charles_jarrott
929 clarence_brown
13573 ralph_nelson
15625 george_pollock
7436 anthony_pelissier
13583 basil_dearden
3344 norman_taurog
11537 ralph_thomas
7453 robert_hamer
1321 norman_mcleod
2951 marcel_carne
1331 victor_halperin
3389 richard_thorpe
9534 lewis_allen
11585 j_lee_thompson
15682 stephen_c_apostolof
13639 abe_levitow
11594 arthur_penn
5455 thorold_dickinson
1377 irving_pichel
14094 henri_verneuil
16955 irvin_kershner
15717 1001975-richard_brooks
9579 hiroshi_inagaki
5489 otto_preminger
11639 364630944
9594 byron_haskin
15739 bill_melendez
5502 norman_ferguson
7552 allan_dwan
1413 charles-brabin
5511 edward_dmytryk
17801 robert_butler
11659 louis_malle
3470 frank_popper
15767 fred_coe
1434 frank_lloyd
11677 renny_bartlett
9631 satyajit_ray
7586 robert_wise
5545 leslie_goodwins
3499 1041609-michael_gordon
5551 reginald_le_borg
1463 frank_r_strayer
5560 edgarulmer
16211 george_axelrod
7612 nicholas_ray
1474 robert_f_hill
9671 joshua_logan
5577 edward_ludwig
17866 milton_moses_ginsberg
5582 lew_landers
15824 seijun_suzuki
9681 norman_foster
17874 bruce_kessler
7638 yasujiro_ozu
1495 thornton_freeland
5028 robert_siodmak
15837 gillo_pontecorvo
16144 john_guillermin
7650 victor_saville
9701 clyde_geronimi
17900 peter_r_hunt
5619 alf-sjoberg
1528 lloyd_bacon
15875 mike_nichols
13835 gordon_douglas
17935 lee_h_katzin
9749 stanley_kubrick
16896 bud_yorkin
18192 james_b_clark
1570 wesley_ruggles
11813 francois_truffaut
15918 bruce_brown
1585 michael_curtiz
7730 kurt_neumann
17971 haskell_wexler
13879 frank_perry
7736 andrew_marton
11833 william_castle
11836 jack_clayton
1598 rouben_mamoulian
5698 charles_vidor
3655 a_edward_sutherland
9803 edward_wood
1613 jean_vigo
15288 claudia_carey
18012 william_a_graham
5729 gunther_von_fritsch
1634 george_cukor
15974 burt_kennedy
5393 vincente_minnelli
5737 jean_negulesco
11891 edward_bernds
3702 alfred_l_werker
18025 kevin_reynolds
15993 vincent_mceveety
13946 rudolph_mate
3708 garson_kanin
13956 _0119819
3719 vincent_sherman
1672 ernest_b_schoedsack
13977 wolfgang_reitherman
18074 karen_everett
7838 joseph_h_lewis
13993 francisco-perez-dolz
1706 alexander_korda
13597 norman_panama
11955 ib_melchior
9911 john_sturges
11963 grigori_chukhraj_and_valentin_yezhov
5820 abbasmustan
3778 ben_sharpsteen
15307 kevin_brownlow
9924 kaj_munk
18038 claude_chabrol
18118 leonard_kastle
16073 1041809-james_hill
1422 leo_mccarey
9946 melvin_frank
1756 mark_sandrich
18141 jesus_franco
11998 john_boulting
5859 erie_c_kenton
18154 arthur_allan_seidelman
13609 freddie_francis
15833 leslie_h_martinson
1789 john_cromwell
5886 david_lean
7937 federico_fellini
1798 charley_rogers
3848 james_algar
12046 tom_graeff
3856 christy_cabanne
5914 george_sidney_ii
1826 stuart_marshall
12070 marcel_camus
17032 frederick_wiseman
16186 _0417691
7995 wilfred_jackson
18236 jack_couffer
10050 richard_brooks_i
1860 1059518-alexander_hall
15815 marco_bellocchio
18401 _0649096
16202 alan_rafkin
14156 howard_e_baker
1870 howard_hawks
10065 ladislaus_vajda
5971 roberto_rossellini
14169 john_schlesinger
12123 paul_wendkos
8036 christian_nyby
5989 joseph_kane
18278 larry_peerce
8054 _0401680
6007 robert_bresson
12153 david_decoteau
3962 victor_schertzinger
10108 edvin_laine
12160 alain_resnais
10115 1063458-michael_anderson
6020 deryn_warren
16261 norman_tokar
14219 peter_yates
3981 jean_yarbrough
12180 robert_frank
10142 don_siegel
6047 walter_lang
14240 norman_jewison
12197 kon_ichikawa
8102 _0005789
14251 francis_ford_coppola
6063 albert_lewin
13299 john_frankenheimer
18361 barbet_schroeder
8130 charles_crichton
14283 george_englund
14291 cliff_owen
4058 ford_beebe
18395 bernard_l_kowalski
16348 _0319241
8161 alexander_mackendrick
12260 tony_richardson
4070 joe_may
18419 michael_ritchie
16378 jack_smight
4091 preston_sturges
12285 george_franju
8533 roy_ward_baker
| D |
/++
This module is part of d2sqlite3.
Authors:
Nicolas Sicard (biozic) and other contributors at $(LINK https://github.com/biozic/d2sqlite3)
Copyright:
Copyright 2011-17 Nicolas Sicard.
License:
$(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
+/
module d2sqlite3.database;
import d2sqlite3.statement;
import d2sqlite3.results;
import d2sqlite3.sqlite3;
import d2sqlite3.internal.memory;
import d2sqlite3.internal.util;
import std.conv : to;
import std.exception : enforce;
import std.string : format, toStringz;
import std.typecons : Nullable;
/// SQLite type codes
enum SqliteType
{
INTEGER = SQLITE_INTEGER, ///
FLOAT = SQLITE_FLOAT, ///
TEXT = SQLITE3_TEXT, ///
BLOB = SQLITE_BLOB, ///
NULL = SQLITE_NULL ///
}
/++
A caracteristic of user-defined functions or aggregates.
+/
enum Deterministic
{
/++
The returned value is the same if the function is called with the same parameters.
+/
yes = 0x800,
/++
The returned value can vary even if the function is called with the same parameters.
+/
no = 0
}
/++
An database connection.
This struct is a reference-counted wrapper around a `sqlite3*` pointer.
+/
struct Database
{
import std.traits : isFunctionPointer, isDelegate;
import std.typecons : RefCounted, RefCountedAutoInitialize;
private:
struct Payload
{
sqlite3* handle;
void* updateHook;
void* commitHook;
void* rollbackHook;
void* progressHandler;
void* traceCallback;
void* profileCallback;
this(sqlite3* handle) nothrow
{
this.handle = handle;
}
~this()
{
close();
}
void close()
{
if (!handle)
return;
sqlite3_progress_handler(handle, 0, null, null);
auto result = sqlite3_close(handle);
// Check that destructor was not call by the GC
// See https://p0nce.github.io/d-idioms/#GC-proof-resource-class
import core.exception : InvalidMemoryOperationError;
try
{
enforce(result == SQLITE_OK, new SqliteException(errmsg(handle), result));
}
catch (InvalidMemoryOperationError e)
{
import core.stdc.stdio : fprintf, stderr;
fprintf(stderr, "Error: release of Database resource incorrectly"
~ " depends on destructors called by the GC.\n");
assert(false); // crash
}
handle = null;
ptrFree(updateHook);
ptrFree(commitHook);
ptrFree(rollbackHook);
ptrFree(progressHandler);
ptrFree(traceCallback);
ptrFree(profileCallback);
}
}
RefCounted!(Payload, RefCountedAutoInitialize.no) p;
void check(int result)
{
enforce(result == SQLITE_OK, new SqliteException(errmsg(p.handle), result));
}
public:
/++
Opens a database connection.
Params:
path = The path to the database file. In recent versions of SQLite, the path can be
an URI with options.
flags = Options flags.
See_Also: $(LINK http://www.sqlite.org/c3ref/open.html) to know how to use the flags
parameter or to use path as a file URI if the current configuration allows it.
+/
this(string path, int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)
{
sqlite3* hdl;
auto result = sqlite3_open_v2(path.toStringz, &hdl, flags, null);
enforce(result == SQLITE_OK, new SqliteException(hdl ? errmsg(hdl) : "Error opening the database", result));
p = Payload(hdl);
}
/++
Explicitly closes the database connection.
After a call to `close()`, using the database connection or one of its prepared statement
is an error. The `Database` object is destroyed and cannot be used any more.
+/
void close()
{
p.close();
destroy(p);
}
/++
Gets the SQLite internal _handle of the database connection.
+/
sqlite3* handle() @property nothrow
{
return p.handle;
}
/++
Gets the path associated with an attached database.
Params:
database = The name of an attached database.
Returns: The absolute path of the attached database.
If there is no attached database, or if database is a temporary or
in-memory database, then null is returned.
+/
string attachedFilePath(string database = "main")
{
assert(p.handle);
return sqlite3_db_filename(p.handle, database.toStringz).to!string;
}
/++
Gets the read-only status of an attached database.
Params:
database = The name of an attached database.
+/
bool isReadOnly(string database = "main")
{
immutable ret = sqlite3_db_readonly(p.handle, database.toStringz);
enforce(ret >= 0, new SqliteException("Database not found: %s".format(database)));
return ret == 1;
}
/++
Gets metadata for a specific table column of an attached database.
Params:
table = The name of the table.
column = The name of the column.
database = The name of a database attached. If null, then all attached databases
are searched for the table using the same algorithm used by the database engine
to resolve unqualified table references.
+/
ColumnMetadata tableColumnMetadata(string table, string column, string database = "main")
{
ColumnMetadata data;
char* pzDataType, pzCollSeq;
int notNull, primaryKey, autoIncrement;
check(sqlite3_table_column_metadata(p.handle, database.toStringz, table.toStringz,
column.toStringz, &pzDataType, &pzCollSeq, ¬Null, &primaryKey, &autoIncrement));
data.declaredTypeName = pzDataType.to!string;
data.collationSequenceName = pzCollSeq.to!string;
data.isNotNull = cast(bool) notNull;
data.isPrimaryKey = cast(bool) primaryKey;
data.isAutoIncrement = cast(bool) autoIncrement;
return data;
}
/++
Executes a single SQL statement and returns the results directly.
It's the equivalent of `prepare(sql).execute()`.
Or when used with args the equivalent of:
---
auto stm = prepare(sql);
stm.bindAll(args);
stm.execute();
---
The results become undefined when the Database goes out of scope and is destroyed.
Params:
sql = The code of the SQL statement.
args = Optional arguments to bind to the SQL statement.
+/
ResultRange execute(Args...)(string sql, Args args)
{
auto stm = prepare(sql);
static if (Args.length) stm.bindAll(args);
return stm.execute();
}
///
unittest
{
auto db = Database(":memory:");
db.execute("CREATE TABLE test (val INTEGER)");
db.execute("INSERT INTO test (val) VALUES (:v)", 1);
assert(db.execute("SELECT val FROM test WHERE val=:v", 1).oneValue!int == 1);
}
/++
Runs an SQL script that can contain multiple statements.
Params:
script = The code of the SQL script.
dg = A delegate to call for each statement to handle the results. The passed
ResultRange will be empty if a statement doesn't return rows. If the delegate
return false, the execution is aborted.
+/
void run(string script, bool delegate(ResultRange) dg = null)
{
foreach (sql; script.byStatement)
{
auto stmt = prepare(sql);
auto results = stmt.execute();
if (dg && !dg(results))
return;
}
}
///
unittest
{
auto db = Database(":memory:");
db.run(`CREATE TABLE test1 (val INTEGER);
CREATE TABLE test2 (val FLOAT);
DROP TABLE test1;
DROP TABLE test2;`);
}
/++
Prepares (compiles) a single SQL statement and returngs it, so that it can be bound to
values before execution.
The statement becomes invalid if the Database goes out of scope and is destroyed.
+/
Statement prepare(string sql)
{
return Statement(this, sql);
}
/// Convenience functions equivalent to an SQL statement.
void begin() { execute("BEGIN"); }
/// Ditto
void commit() { execute("COMMIT"); }
/// Ditto
void rollback() { execute("ROLLBACK"); }
/++
Returns the rowid of the last INSERT statement.
+/
long lastInsertRowid()
{
assert(p.handle);
return sqlite3_last_insert_rowid(p.handle);
}
/++
Gets the number of database rows that were changed, inserted or deleted by the most
recently executed SQL statement.
+/
int changes() @property nothrow
{
assert(p.handle);
return sqlite3_changes(p.handle);
}
/++
Gets the number of database rows that were changed, inserted or deleted since the
database was opened.
+/
int totalChanges() @property nothrow
{
assert(p.handle);
return sqlite3_total_changes(p.handle);
}
/++
Gets the SQLite error code of the last operation.
+/
int errorCode() @property nothrow
{
return p.handle ? sqlite3_errcode(p.handle) : 0;
}
/++
Interrupts any pending database operations.
It's safe to call this function from anouther thread.
See_also: $(LINK http://www.sqlite.org/c3ref/interrupt.html).
+/
void interrupt()
{
assert(p.handle);
sqlite3_interrupt(p.handle);
}
/++
Sets a connection configuration option.
See_Also: $(LINK http://www.sqlite.org/c3ref/db_config.html).
+/
void config(Args...)(int code, Args args)
{
auto result = sqlite3_db_config(p.handle, code, args);
enforce(result == SQLITE_OK, new SqliteException("Database configuration: error %s".format(result)));
}
version (SQLITE_OMIT_LOAD_EXTENSION) {}
else
{
/++
Enables or disables loading extensions.
+/
void enableLoadExtensions(bool enable = true)
{
enforce(sqlite3_enable_load_extension(p.handle, enable) == SQLITE_OK,
new SqliteException("Could not enable loading extensions."));
}
/++
Loads an extension.
Params:
path = The path of the extension file.
entryPoint = The name of the entry point function. If null is passed, SQLite
uses the name of the extension file as the entry point.
+/
void loadExtension(string path, string entryPoint = null)
{
immutable ret = sqlite3_load_extension(p.handle, path.toStringz, entryPoint.toStringz, null);
enforce(ret == SQLITE_OK, new SqliteException(
"Could not load extension: %s:%s".format(entryPoint, path)));
}
}
/++
Creates and registers a new function in the database.
If a function with the same name and the same arguments already exists, it is replaced
by the new one.
The memory associated with the function will be released when the database connection
is closed.
Params:
name = The name that the function will have in the database.
fun = a delegate or function that implements the function. $(D_PARAM fun)
must satisfy the following criteria:
$(UL
$(LI It must not be variadic.)
$(LI Its arguments must all have a type that is compatible with SQLite types:
it must be a boolean or numeric type, a string, an array, `null`,
or a `Nullable!T` where T is any of the previous types.)
$(LI Its return value must also be of a compatible type.)
)
or
$(UL
$(LI It must be a normal or type-safe variadic function where the arguments
are of type `ColumnData`. In other terms, the signature of the function must be:
`function(ColumnData[] args)` or `function(ColumnData[] args...)`)
$(LI Its return value must be a boolean or numeric type, a string, an array, `null`,
or a `Nullable!T` where T is any of the previous types.)
)
Pass a `null` function pointer to delete the function from the database connection.
det = Tells SQLite whether the result of the function is deterministic, i.e. if the
result is the same when called with the same parameters. Recent versions of SQLite
perform optimizations based on this. Set to `Deterministic.no` otherwise.
See_Also: $(LINK http://www.sqlite.org/c3ref/create_function.html).
+/
void createFunction(T)(string name, T fun, Deterministic det = Deterministic.yes)
if (isFunctionPointer!T || isDelegate!T)
{
import std.meta : AliasSeq, staticMap, EraseAll;
import std.traits : variadicFunctionStyle, Variadic, ParameterTypeTuple,
ParameterDefaultValueTuple, ReturnType, Unqual;
static assert(variadicFunctionStyle!(fun) == Variadic.no
|| is(ParameterTypeTuple!fun == AliasSeq!(ColumnData[])),
"only type-safe variadic functions with ColumnData arguments are supported");
static if (is(ParameterTypeTuple!fun == AliasSeq!(ColumnData[])))
{
extern(C) static nothrow
void x_func(sqlite3_context* context, int argc, sqlite3_value** argv)
{
string name;
try
{
import std.array : appender;
auto args = appender!(ColumnData[]);
for (int i = 0; i < argc; ++i)
{
auto value = argv[i];
immutable type = sqlite3_value_type(value);
final switch (type)
{
case SqliteType.INTEGER:
args.put(ColumnData(getValue!long(value)));
break;
case SqliteType.FLOAT:
args.put(ColumnData(getValue!double(value)));
break;
case SqliteType.TEXT:
args.put(ColumnData(getValue!string(value)));
break;
case SqliteType.BLOB:
args.put(ColumnData(getValue!(ubyte[])(value)));
break;
case SqliteType.NULL:
args.put(ColumnData(null));
break;
}
}
auto ptr = sqlite3_user_data(context);
auto wrappedDelegate = delegateUnwrap!T(ptr);
auto dlg = wrappedDelegate.dlg;
name = wrappedDelegate.name;
setResult(context, dlg(args.data));
}
catch (Exception e)
{
sqlite3_result_error(context, "error in function %s(): %s"
.nothrowFormat(name, e.msg).toStringz, -1);
}
}
}
else
{
static assert(!is(ReturnType!fun == void), "function must not return void");
alias PT = staticMap!(Unqual, ParameterTypeTuple!fun);
alias PD = ParameterDefaultValueTuple!fun;
extern (C) static nothrow
void x_func(sqlite3_context* context, int argc, sqlite3_value** argv)
{
string name;
try
{
// Get the deledate and its name
auto ptr = sqlite3_user_data(context);
auto wrappedDelegate = delegateUnwrap!T(ptr);
auto dlg = wrappedDelegate.dlg;
name = wrappedDelegate.name;
enum maxArgc = PT.length;
enum minArgc = PT.length - EraseAll!(void, PD).length;
if (argc > maxArgc)
{
auto txt = ("too many arguments in function %s(), expecting at most %s"
).format(name, maxArgc);
sqlite3_result_error(context, txt.toStringz, -1);
}
else if (argc < minArgc)
{
auto txt = ("too few arguments in function %s(), expecting at least %s"
).format(name, minArgc);
sqlite3_result_error(context, txt.toStringz, -1);
}
else
{
PT args;
foreach (i, type; PT)
{
if (i < argc)
args[i] = getValue!type(argv[i]);
else
static if (is(typeof(PD[i])))
args[i] = PD[i];
}
setResult(context, dlg(args));
}
}
catch (Exception e)
{
sqlite3_result_error(context, "error in function %s(): %s"
.nothrowFormat(name, e.msg).toStringz, -1);
}
}
}
assert(name.length, "function has an empty name");
if (!fun)
createFunction(name, null);
assert(p.handle);
check(sqlite3_create_function_v2(p.handle, name.toStringz, -1,
SQLITE_UTF8 | det, delegateWrap(fun, name), &x_func, null, null, &ptrFree));
}
///
unittest
{
string star(int count, string starSymbol = "*")
{
import std.range : repeat;
import std.array : join;
return starSymbol.repeat(count).join;
}
auto db = Database(":memory:");
db.createFunction("star", &star);
assert(db.execute("SELECT star(5)").oneValue!string == "*****");
assert(db.execute("SELECT star(3, '♥')").oneValue!string == "♥♥♥");
}
///
unittest
{
// The implementation of the new function
string myList(ColumnData[] args)
{
import std.array : appender;
import std.string : format, join;
auto app = appender!(string[]);
foreach (arg; args)
{
if (arg.type == SqliteType.TEXT)
app.put(`"%s"`.format(arg));
else
app.put("%s".format(arg));
}
return app.data.join(", ");
}
auto db = Database(":memory:");
db.createFunction("my_list", &myList);
auto list = db.execute("SELECT my_list(42, 3.14, 'text', NULL)").oneValue!string;
assert(list == `42, 3.14, "text", null`);
}
/// Ditto
void createFunction(T)(string name, T fun = null)
if (is(T == typeof(null)))
{
assert(name.length, "function has an empty name");
assert(p.handle);
check(sqlite3_create_function_v2(p.handle, name.toStringz, -1, SQLITE_UTF8,
null, fun, null, null, null));
}
/++
Creates and registers a new aggregate function in the database.
Params:
name = The name that the aggregate function will have in the database.
agg = The struct of type T implementing the aggregate. T must implement
at least these two methods: `accumulate()` and `result()`.
Each parameter and the returned type of `accumulate()` and `result()` must be
a boolean or numeric type, a string, an array, `null`, or a `Nullable!T`
where T is any of the previous types. These methods cannot be variadic.
det = Tells SQLite whether the result of the function is deterministic, i.e. if the
result is the same when called with the same parameters. Recent versions of SQLite
perform optimizations based on this. Set to `Deterministic.no` otherwise.
See_Also: $(LINK http://www.sqlite.org/c3ref/create_function.html).
+/
void createAggregate(T)(string name, T agg, Deterministic det = Deterministic.yes)
{
import std.meta : staticMap;
import std.traits : isAggregateType, ReturnType, variadicFunctionStyle, Variadic,
Unqual, ParameterTypeTuple;
import core.stdc.stdlib : malloc;
static assert(isAggregateType!T,
T.stringof ~ " should be an aggregate type");
static assert(is(typeof(T.accumulate) == function),
T.stringof ~ " should have a method named accumulate");
static assert(is(typeof(T.result) == function),
T.stringof ~ " should have a method named result");
static assert(is(typeof({
alias RT = ReturnType!(T.result);
setResult!RT(null, RT.init);
})), T.stringof ~ ".result should return an SQLite-compatible type");
static assert(variadicFunctionStyle!(T.accumulate) == Variadic.no,
"variadic functions are not supported");
static assert(variadicFunctionStyle!(T.result) == Variadic.no,
"variadic functions are not supported");
alias PT = staticMap!(Unqual, ParameterTypeTuple!(T.accumulate));
alias RT = ReturnType!(T.result);
static struct Context
{
T aggregate;
string functionName;
}
extern(C) static nothrow
void x_step(sqlite3_context* context, int /* argc */, sqlite3_value** argv)
{
auto ctx = cast(Context*) sqlite3_user_data(context);
if (!ctx)
{
sqlite3_result_error_nomem(context);
return;
}
PT args;
try
{
foreach (i, type; PT)
args[i] = getValue!type(argv[i]);
ctx.aggregate.accumulate(args);
}
catch (Exception e)
{
sqlite3_result_error(context, "error in aggregate function %s(): %s"
.nothrowFormat(ctx.functionName, e.msg).toStringz, -1);
}
}
extern(C) static nothrow
void x_final(sqlite3_context* context)
{
auto ctx = cast(Context*) sqlite3_user_data(context);
if (!ctx)
{
sqlite3_result_error_nomem(context);
return;
}
try
{
setResult(context, ctx.aggregate.result());
}
catch (Exception e)
{
sqlite3_result_error(context, "error in aggregate function %s(): %s"
.nothrowFormat(ctx.functionName, e.msg).toStringz, -1);
}
}
static if (is(T == class) || is(T == Interface))
assert(agg, "Attempt to create an aggregate function from a null reference");
auto ctx = cast(Context*) malloc(Context.sizeof);
ctx.aggregate = agg;
ctx.functionName = name;
assert(p.handle);
check(sqlite3_create_function_v2(p.handle, name.toStringz, PT.length, SQLITE_UTF8 | det,
cast(void*) ctx, null, &x_step, &x_final, &ptrFree));
}
///
unittest // Aggregate creation
{
import std.array : Appender, join;
// The implementation of the aggregate function
struct Joiner
{
private
{
Appender!(string[]) stringList;
string separator;
}
this(string separator)
{
this.separator = separator;
}
void accumulate(string word)
{
stringList.put(word);
}
string result()
{
return stringList.data.join(separator);
}
}
auto db = Database(":memory:");
db.run("CREATE TABLE test (word TEXT);
INSERT INTO test VALUES ('My');
INSERT INTO test VALUES ('cat');
INSERT INTO test VALUES ('is');
INSERT INTO test VALUES ('black');");
db.createAggregate("dash_join", Joiner("-"));
auto text = db.execute("SELECT dash_join(word) FROM test").oneValue!string;
assert(text == "My-cat-is-black");
}
/++
Creates and registers a collation function in the database.
Params:
name = The name that the function will have in the database.
fun = a delegate or function that implements the collation. The function $(D_PARAM fun)
must be `nothrow`` and satisfy these criteria:
$(UL
$(LI Takes two string arguments (s1 and s2). These two strings are slices of C-style strings
that SQLite manages internally, so there is no guarantee that they are still valid
when the function returns.)
$(LI Returns an integer (ret).)
$(LI If s1 is less than s2, ret < 0.)
$(LI If s1 is equal to s2, ret == 0.)
$(LI If s1 is greater than s2, ret > 0.)
$(LI If s1 is equal to s2, then s2 is equal to s1.)
$(LI If s1 is equal to s2 and s2 is equal to s3, then s1 is equal to s3.)
$(LI If s1 is less than s2, then s2 is greater than s1.)
$(LI If s1 is less than s2 and s2 is less than s3, then s1 is less than s3.)
)
See_Also: $(LINK http://www.sqlite.org/lang_aggfunc.html)
+/
void createCollation(T)(string name, T fun)
if (isFunctionPointer!T || isDelegate!T)
{
import std.traits : isImplicitlyConvertible, functionAttributes, FunctionAttribute,
ParameterTypeTuple, isSomeString, ReturnType;
static assert(isImplicitlyConvertible!(typeof(fun("a", "b")), int),
"the collation function has a wrong signature");
static assert(functionAttributes!(T) & FunctionAttribute.nothrow_,
"only nothrow functions are allowed as collations");
alias PT = ParameterTypeTuple!fun;
static assert(isSomeString!(PT[0]),
"the first argument of function " ~ name ~ " should be a string");
static assert(isSomeString!(PT[1]),
"the second argument of function " ~ name ~ " should be a string");
static assert(isImplicitlyConvertible!(ReturnType!fun, int),
"function " ~ name ~ " should return a value convertible to an int");
extern (C) static nothrow
int x_compare(void* ptr, int n1, const(void)* str1, int n2, const(void)* str2)
{
static string slice(const(void)* str, int n) nothrow
{
// The string data is owned by SQLite, so it should be safe
// to take a slice of it.
return str ? (cast(immutable) (cast(const(char)*) str)[0 .. n]) : null;
}
return delegateUnwrap!T(ptr).dlg(slice(str1, n1), slice(str2, n2));
}
assert(p.handle);
auto dgw = delegateWrap(fun, name);
auto result = sqlite3_create_collation_v2(p.handle, name.toStringz, SQLITE_UTF8,
delegateWrap(fun, name), &x_compare, &ptrFree);
if (result != SQLITE_OK)
{
ptrFree(dgw);
throw new SqliteException(errmsg(p.handle), result);
}
}
///
unittest // Collation creation
{
// The implementation of the collation
int my_collation(string s1, string s2) nothrow
{
import std.uni : icmp;
import std.exception : assumeWontThrow;
return assumeWontThrow(icmp(s1, s2));
}
auto db = Database(":memory:");
db.createCollation("my_coll", &my_collation);
db.run("CREATE TABLE test (word TEXT);
INSERT INTO test (word) VALUES ('straße');
INSERT INTO test (word) VALUES ('strasses');");
auto word = db.execute("SELECT word FROM test ORDER BY word COLLATE my_coll")
.oneValue!string;
assert(word == "straße");
}
/++
Registers a delegate of type `UpdateHookDelegate` as the database's update hook.
Any previously set hook is released. Pass `null` to disable the callback.
See_Also: $(LINK http://www.sqlite.org/c3ref/commit_hook.html).
+/
void setUpdateHook(UpdateHookDelegate updateHook)
{
extern(C) static nothrow
void callback(void* ptr, int type, const(char)* dbName, const(char)* tableName, long rowid)
{
WrappedDelegate!UpdateHookDelegate* dg;
dg = delegateUnwrap!UpdateHookDelegate(ptr);
dg.dlg(type, dbName.to!string, tableName.to!string, rowid);
}
ptrFree(p.updateHook);
p.updateHook = delegateWrap(updateHook);
sqlite3_update_hook(p.handle, &callback, p.updateHook);
}
/++
Registers a delegate of type `CommitHookDelegate` as the database's commit hook.
Any previously set hook is released.
Params:
commitHook = A delegate that should return a non-zero value
if the operation must be rolled back, or 0 if it can commit.
Pass `null` to disable the callback.
See_Also: $(LINK http://www.sqlite.org/c3ref/commit_hook.html).
+/
void setCommitHook(CommitHookDelegate commitHook)
{
extern(C) static nothrow
int callback(void* ptr)
{
auto dlg = delegateUnwrap!CommitHookDelegate(ptr).dlg;
return dlg();
}
ptrFree(p.commitHook);
p.commitHook = delegateWrap(commitHook);
sqlite3_commit_hook(p.handle, &callback, p.commitHook);
}
/++
Registers a delegate of type `RoolbackHookDelegate` as the database's rollback hook.
Any previously set hook is released.
Pass `null` to disable the callback.
See_Also: $(LINK http://www.sqlite.org/c3ref/commit_hook.html).
+/
void setRollbackHook(RoolbackHookDelegate rollbackHook)
{
extern(C) static nothrow
void callback(void* ptr)
{
auto dlg = delegateUnwrap!RoolbackHookDelegate(ptr).dlg;
dlg();
}
ptrFree(p.rollbackHook);
p.rollbackHook = delegateWrap(rollbackHook);
sqlite3_rollback_hook(p.handle, &callback, p.rollbackHook);
}
/++
Registers a delegate of type `ProgressHandlerDelegate` as the progress handler.
Any previously set handler is released.
Pass `null` to disable the callback.
Params:
pace = The approximate number of virtual machine instructions that are
evaluated between successive invocations of the handler.
progressHandler = A delegate that should return 0 if the operation can continue
or another value if it must be aborted.
See_Also: $(LINK http://www.sqlite.org/c3ref/progress_handler.html).
+/
void setProgressHandler(int pace, ProgressHandlerDelegate progressHandler)
{
extern(C) static nothrow
int callback(void* ptr)
{
auto dlg = delegateUnwrap!ProgressHandlerDelegate(ptr).dlg;
return dlg();
}
ptrFree(p.progressHandler);
p.progressHandler = delegateWrap(progressHandler);
sqlite3_progress_handler(p.handle, pace, &callback, p.progressHandler);
}
/++
Registers a delegate of type `TraceCallbackDelegate` as the trace callback.
Any previously set trace callback is released.
Pass `null` to disable the callback.
The string parameter that is passed to the callback is the SQL text of the statement being
executed.
See_Also: $(LINK http://www.sqlite.org/c3ref/profile.html).
+/
void setTraceCallback(TraceCallbackDelegate traceCallback)
{
extern(C) static nothrow
void callback(void* ptr, const(char)* str)
{
auto dlg = delegateUnwrap!TraceCallbackDelegate(ptr).dlg;
dlg(str.to!string);
}
ptrFree(p.traceCallback);
p.traceCallback = delegateWrap(traceCallback);
sqlite3_trace(p.handle, &callback, p.traceCallback);
}
/++
Registers a delegate of type `ProfileCallbackDelegate` as the profile callback.
Any previously set profile callback is released.
Pass `null` to disable the callback.
The string parameter that is passed to the callback is the SQL text of the statement being
executed. The time unit is defined in SQLite's documentation as nanoseconds (subject to change,
as the functionality is experimental).
See_Also: $(LINK http://www.sqlite.org/c3ref/profile.html).
+/
void setProfileCallback(ProfileCallbackDelegate profileCallback)
{
extern(C) static nothrow
void callback(void* ptr, const(char)* str, sqlite3_uint64 time)
{
auto dlg = delegateUnwrap!ProfileCallbackDelegate(ptr).dlg;
dlg(str.to!string, time);
}
ptrFree(p.profileCallback);
p.profileCallback = delegateWrap(profileCallback);
sqlite3_profile(p.handle, &callback, p.profileCallback);
}
}
/// Delegate types
alias UpdateHookDelegate = void delegate(int type, string dbName, string tableName, long rowid) nothrow;
/// ditto
alias CommitHookDelegate = int delegate() nothrow;
/// ditto
alias RoolbackHookDelegate = void delegate() nothrow;
/// ditto
alias ProgressHandlerDelegate = int delegate() nothrow;
/// ditto
alias TraceCallbackDelegate = void delegate(string sql) nothrow;
/// ditto
alias ProfileCallbackDelegate = void delegate(string sql, ulong time) nothrow;
/++
Exception thrown when SQLite functions return an error.
+/
class SqliteException : Exception
{
/++
The _code of the error that raised the exception, or 0 if this _code is not known.
+/
int code;
/++
The SQL code that raised the exception, if applicable.
+/
string sql;
private this(string msg, string sql, int code,
string file = __FILE__, size_t line = __LINE__, Throwable next = null)
{
this.sql = sql;
this.code = code;
super(msg, file, line, next);
}
this(string msg, int code, string sql = null,
string file = __FILE__, size_t line = __LINE__, Throwable next = null)
{
this("error %d: %s".format(code, msg), sql, code, file, line, next);
}
this(string msg, string sql = null,
string file = __FILE__, size_t line = __LINE__, Throwable next = null)
{
this(msg, sql, 0, file, line, next);
}
}
| D |
/*
Copyright (c) 2014 Timur Gafarov
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
module exdep;
import std.stdio;
import std.digest.crc;
import std.format;
import std.array;
import std.string;
import std.file;
import std.path;
import std.process;
import cmdopt;
string home(string path, CmdOptions opt)
{
string homeDir;
version(Posix)
homeDir = environment.get("HOME");
version(Windows)
homeDir = environment.get("APPDATA").replace("\\", "/");
if (opt.local)
homeDir = ".";
return homeDir ~ "/" ~ path;
}
class Exdep
{
string descriptor;
string id;
string vcs;
string hostname;
string path;
string subdir = "";
string location;
string srcDir;
bool useHTTPS = false;
this(string desc, bool https, CmdOptions cmd)
{
descriptor = desc;
useHTTPS = https;
id = crc32Of(descriptor).crcHexString;
string name;
try
{
formattedRead(descriptor, "%s:%s:%s", &name, &path, &subdir);
}
catch(Exception) {}
finally {}
// TODO: check the result
immutable auto pos = indexOf(name, "@");
if (pos >= 0)
formattedRead(name, "%s@%s", &vcs, &hostname);
else
vcs = name;
if (vcs != "local")
// TODO: use config to override this
location = home(format(".cook/remote/%s", id), cmd);
else
location = path;
if (subdir.length)
srcDir = location ~ "/" ~ subdir;
else
srcDir = location;
}
void print()
{
writefln("id: %s", id);
writefln("VCS: %s", vcs);
writefln("Host: %s", hostname);
writefln("Path: %s", path);
}
void fetch(CmdOptions ops)
{
if (vcs != "local")
{
if (exists() && isDir(location))
{
if (ops.rebuild)
{
writefln("Fetching %s (%s from %s)...", id, path, hostname);
pull();
}
}
else
{
writefln("Fetching %s (%s from %s)...", id, path, hostname);
clone();
}
}
}
bool exists()
{
return (std.file.exists(location));
}
void clone()
{
if (vcs == "git")
{
string command;
if (useHTTPS)
command = format("git clone https://%s/%s.git %s", hostname, path, location);
else
command = format("git clone git@%s:%s.git %s", hostname, path, location);
writeln(command);
executeShell(command);
}
}
void pull()
{
if (vcs == "git")
{
string command = format("cd %s && git pull", location);
writeln(command);
executeShell(command);
}
}
}
| D |
/**
* Windows API header module
*
* Translated from MinGW Windows headers
*
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(DRUNTIMESRC src/core/sys/windows/_subauth.d)
*/
module core.sys.windows.subauth;
version (Windows):
@system:
private import core.sys.windows.ntdef, core.sys.windows.windef;
/+
alias LONG NTSTATUS;
alias NTSTATUS* PNTSTATUS;
+/
enum : ULONG {
MSV1_0_PASSTHRU = 1,
MSV1_0_GUEST_LOGON = 2
}
// USER_ALL_INFORMATION.WhichFields (Undocumented)
enum ULONG
MSV1_0_VALIDATION_LOGOFF_TIME = 1,
MSV1_0_VALIDATION_KICKOFF_TIME = 2,
MSV1_0_VALIDATION_LOGON_SERVER = 4,
MSV1_0_VALIDATION_LOGON_DOMAIN = 8,
MSV1_0_VALIDATION_SESSION_KEY = 16,
MSV1_0_VALIDATION_USER_FLAGS = 32,
MSV1_0_VALIDATION_USER_ID = 64;
// ?ActionsPerformed? (Undocumented)
enum MSV1_0_SUBAUTH_ACCOUNT_DISABLED = 1;
enum MSV1_0_SUBAUTH_PASSWORD = 2;
enum MSV1_0_SUBAUTH_WORKSTATIONS = 4;
enum MSV1_0_SUBAUTH_LOGON_HOURS = 8;
enum MSV1_0_SUBAUTH_ACCOUNT_EXPIRY = 16;
enum MSV1_0_SUBAUTH_PASSWORD_EXPIRY = 32;
enum MSV1_0_SUBAUTH_ACCOUNT_TYPE = 64;
enum MSV1_0_SUBAUTH_LOCKOUT = 128;
enum NEXT_FREE_ACCOUNT_CONTROL_BIT = 131072;
enum SAM_DAYS_PER_WEEK = 7;
enum SAM_HOURS_PER_WEEK = 168;
enum SAM_MINUTES_PER_WEEK = 10080;
enum : NTSTATUS {
STATUS_SUCCESS = 0,
STATUS_INVALID_INFO_CLASS = 0xC0000003,
STATUS_NO_SUCH_USER = 0xC0000064,
STATUS_WRONG_PASSWORD = 0xC000006A,
STATUS_PASSWORD_RESTRICTION = 0xC000006C,
STATUS_LOGON_FAILURE = 0xC000006D,
STATUS_ACCOUNT_RESTRICTION = 0xC000006E,
STATUS_INVALID_LOGON_HOURS = 0xC000006F,
STATUS_INVALID_WORKSTATION = 0xC0000070,
STATUS_PASSWORD_EXPIRED = 0xC0000071,
STATUS_ACCOUNT_DISABLED = 0xC0000072,
STATUS_INSUFFICIENT_RESOURCES = 0xC000009A,
STATUS_ACCOUNT_EXPIRED = 0xC0000193,
STATUS_PASSWORD_MUST_CHANGE = 0xC0000224,
STATUS_ACCOUNT_LOCKED_OUT = 0xC0000234
}
// Note: undocumented in MSDN
// USER_ALL_INFORMATION.UserAccountControl
enum ULONG
USER_ACCOUNT_DISABLED = 1,
USER_HOME_DIRECTORY_REQUIRED = 2,
USER_PASSWORD_NOT_REQUIRED = 4,
USER_TEMP_DUPLICATE_ACCOUNT = 8,
USER_NORMAL_ACCOUNT = 16,
USER_MNS_LOGON_ACCOUNT = 32,
USER_INTERDOMAIN_TRUST_ACCOUNT = 64,
USER_WORKSTATION_TRUST_ACCOUNT = 128,
USER_SERVER_TRUST_ACCOUNT = 256,
USER_DONT_EXPIRE_PASSWORD = 512,
USER_ACCOUNT_AUTO_LOCKED = 1024,
USER_ENCRYPTED_TEXT_PASSWORD_ALLOWED = 2048,
USER_SMARTCARD_REQUIRED = 4096,
USER_TRUSTED_FOR_DELEGATION = 8192,
USER_NOT_DELEGATED = 16384,
USER_USE_DES_KEY_ONLY = 32768,
USER_DONT_REQUIRE_PREAUTH = 65536,
USER_MACHINE_ACCOUNT_MASK = 448,
USER_ACCOUNT_TYPE_MASK = 472,
USER_ALL_PARAMETERS = 2097152;
/+
struct UNICODE_STRING {
USHORT Length;
USHORT MaximumLength;
PWSTR Buffer;
}
alias UNICODE_STRING* PUNICODE_STRING;
struct STRING {
USHORT Length;
USHORT MaximumLength;
PCHAR Buffer;
}
alias STRING* PSTRING;
+/
mixin DECLARE_HANDLE!("SAM_HANDLE");
alias SAM_HANDLE* PSAM_HANDLE;
struct OLD_LARGE_INTEGER {
ULONG LowPart;
LONG HighPart;
}
alias OLD_LARGE_INTEGER* POLD_LARGE_INTEGER;
enum NETLOGON_LOGON_INFO_CLASS {
NetlogonInteractiveInformation = 1,
NetlogonNetworkInformation,
NetlogonServiceInformation,
NetlogonGenericInformation,
NetlogonInteractiveTransitiveInformation,
NetlogonNetworkTransitiveInformation,
NetlogonServiceTransitiveInformation
}
enum CYPHER_BLOCK_LENGTH = 8;
enum USER_SESSION_KEY_LENGTH = CYPHER_BLOCK_LENGTH * 2;
enum CLEAR_BLOCK_LENGTH = 8;
struct CYPHER_BLOCK {
CHAR[CYPHER_BLOCK_LENGTH] data = 0;
}
alias CYPHER_BLOCK* PCYPHER_BLOCK;
struct CLEAR_BLOCK {
CHAR[CLEAR_BLOCK_LENGTH] data = 0;
}
alias CLEAR_BLOCK* PCLEAR_BLOCK;
struct LM_OWF_PASSWORD {
CYPHER_BLOCK[2] data;
}
alias LM_OWF_PASSWORD* PLM_OWF_PASSWORD;
struct USER_SESSION_KEY {
CYPHER_BLOCK[2] data;
}
alias USER_SESSION_KEY* PUSER_SESSION_KEY;
alias CLEAR_BLOCK LM_CHALLENGE;
alias LM_CHALLENGE* PLM_CHALLENGE;
alias LM_OWF_PASSWORD NT_OWF_PASSWORD;
alias NT_OWF_PASSWORD* PNT_OWF_PASSWORD;
alias LM_CHALLENGE NT_CHALLENGE;
alias NT_CHALLENGE* PNT_CHALLENGE;
struct LOGON_HOURS {
USHORT UnitsPerWeek;
PUCHAR LogonHours;
}
alias LOGON_HOURS* PLOGON_HOURS;
struct SR_SECURITY_DESCRIPTOR {
ULONG Length;
PUCHAR SecurityDescriptor;
}
alias SR_SECURITY_DESCRIPTOR* PSR_SECURITY_DESCRIPTOR;
align(4):
struct USER_ALL_INFORMATION {
LARGE_INTEGER LastLogon;
LARGE_INTEGER LastLogoff;
LARGE_INTEGER PasswordLastSet;
LARGE_INTEGER AccountExpires;
LARGE_INTEGER PasswordCanChange;
LARGE_INTEGER PasswordMustChange;
UNICODE_STRING UserName;
UNICODE_STRING FullName;
UNICODE_STRING HomeDirectory;
UNICODE_STRING HomeDirectoryDrive;
UNICODE_STRING ScriptPath;
UNICODE_STRING ProfilePath;
UNICODE_STRING AdminComment;
UNICODE_STRING WorkStations;
UNICODE_STRING UserComment;
UNICODE_STRING Parameters;
UNICODE_STRING LmPassword;
UNICODE_STRING NtPassword;
UNICODE_STRING PrivateData;
SR_SECURITY_DESCRIPTOR SecurityDescriptor;
ULONG UserId;
ULONG PrimaryGroupId;
ULONG UserAccountControl;
ULONG WhichFields;
LOGON_HOURS LogonHours;
USHORT BadPasswordCount;
USHORT LogonCount;
USHORT CountryCode;
USHORT CodePage;
BOOLEAN LmPasswordPresent;
BOOLEAN NtPasswordPresent;
BOOLEAN PasswordExpired;
BOOLEAN PrivateDataSensitive;
}
alias USER_ALL_INFORMATION* PUSER_ALL_INFORMATION;
align:
struct MSV1_0_VALIDATION_INFO {
LARGE_INTEGER LogoffTime;
LARGE_INTEGER KickoffTime;
UNICODE_STRING LogonServer;
UNICODE_STRING LogonDomainName;
USER_SESSION_KEY SessionKey;
BOOLEAN Authoritative;
ULONG UserFlags;
ULONG WhichFields;
ULONG UserId;
}
alias MSV1_0_VALIDATION_INFO* PMSV1_0_VALIDATION_INFO;
struct NETLOGON_LOGON_IDENTITY_INFO {
UNICODE_STRING LogonDomainName;
ULONG ParameterControl;
OLD_LARGE_INTEGER LogonId;
UNICODE_STRING UserName;
UNICODE_STRING Workstation;
}
alias NETLOGON_LOGON_IDENTITY_INFO* PNETLOGON_LOGON_IDENTITY_INFO;
struct NETLOGON_INTERACTIVE_INFO {
NETLOGON_LOGON_IDENTITY_INFO Identity;
LM_OWF_PASSWORD LmOwfPassword;
NT_OWF_PASSWORD NtOwfPassword;
}
alias NETLOGON_INTERACTIVE_INFO* PNETLOGON_INTERACTIVE_INFO;
struct NETLOGON_GENERIC_INFO {
NETLOGON_LOGON_IDENTITY_INFO Identity;
UNICODE_STRING PackageName;
ULONG DataLength;
PUCHAR LogonData;
}
alias NETLOGON_GENERIC_INFO* PNETLOGON_GENERIC_INFO;
struct NETLOGON_NETWORK_INFO {
NETLOGON_LOGON_IDENTITY_INFO Identity;
LM_CHALLENGE LmChallenge;
STRING NtChallengeResponse;
STRING LmChallengeResponse;
}
alias NETLOGON_NETWORK_INFO* PNETLOGON_NETWORK_INFO;
struct NETLOGON_SERVICE_INFO {
NETLOGON_LOGON_IDENTITY_INFO Identity;
LM_OWF_PASSWORD LmOwfPassword;
NT_OWF_PASSWORD NtOwfPassword;
}
alias NETLOGON_SERVICE_INFO* PNETLOGON_SERVICE_INFO;
extern (Windows) {
NTSTATUS Msv1_0SubAuthenticationRoutine(NETLOGON_LOGON_INFO_CLASS,PVOID,
ULONG,PUSER_ALL_INFORMATION,PULONG,PULONG,
PBOOLEAN,PLARGE_INTEGER,PLARGE_INTEGER);
NTSTATUS Msv1_0SubAuthenticationFilter(NETLOGON_LOGON_INFO_CLASS,PVOID,
ULONG,PUSER_ALL_INFORMATION,PULONG,PULONG,
PBOOLEAN,PLARGE_INTEGER,PLARGE_INTEGER);
NTSTATUS Msv1_0SubAuthenticationRoutineGeneric(PVOID,ULONG,PULONG,PVOID*);
NTSTATUS Msv1_0SubAuthenticationRoutineEx(NETLOGON_LOGON_INFO_CLASS,PVOID,
ULONG,PUSER_ALL_INFORMATION,SAM_HANDLE,
PMSV1_0_VALIDATION_INFO,PULONG);
}
| D |
/home/owen/github/cryptopals/cryptopals/tools/dictionary_trie/target/debug/deps/dictionary_trie-e8ef0aff38ee4b17.rmeta: src/lib.rs
/home/owen/github/cryptopals/cryptopals/tools/dictionary_trie/target/debug/deps/libdictionary_trie-e8ef0aff38ee4b17.rlib: src/lib.rs
/home/owen/github/cryptopals/cryptopals/tools/dictionary_trie/target/debug/deps/dictionary_trie-e8ef0aff38ee4b17.d: src/lib.rs
src/lib.rs:
| D |
/**
* Test scanone routines: simplest case
*/
module test.scanone.test_scanone_simple;
import std.stdio;
import std.conv;
import std.string;
import std.path;
import std.algorithm;
import std.math;
import std.container;
import std.conv;
import std.typecons;
import qtl.plugins.qtab.read_qtab;
import qtl.core.primitives;
import qtl.core.chromosome;
import qtl.core.phenotype;
import qtl.core.marker;
import qtl.core.genotype;
import qtl.core.phenotype;
import qtl.core.map.map;
import qtl.core.map.make_map;
import qtl.core.map.genetic_map_functions;
import qtl.core.hmm.cross;
import qtl.core.hmm.calcgenoprob;
import qtl.core.scanone.scanone_hk;
import qtl.core.scanone.util;
unittest {
writeln("Unit test " ~ __FILE__);
writeln(" --Loading data");
// form file names
alias std.path.buildPath buildPath;
auto dir = to!string(dirName(__FILE__) ~ dirSeparator ~
buildPath("..","..","..","..","test","data", "input", "listeria_qtab"));
string[] files = ["listeria_founder.qtab", "listeria_symbol.qtab",
"listeria_genotype.qtab", "listeria_phenotype.qtab",
"listeria_marker_map.qtab"];
foreach(ref file; files)
file = dir ~ dirSeparator ~ file;
// load all qtab files
auto all_data = load_qtab(files);
auto founder_info = all_data[1];
auto markers = all_data[2];
auto pheno = all_data[4];
auto genotype_matrix = all_data[7];
auto cross_class = form_cross(founder_info["Cross"]);
// omit individuals with missing phenotype
auto ind_to_omit = individuals_missing_a_phenotype(pheno);
auto n_to_omit = count(ind_to_omit, true);
writeln(" --Omitting ", n_to_omit, " individuals with missing phenotype");
genotype_matrix = omit_ind_from_genotypes(genotype_matrix, ind_to_omit);
pheno = omit_ind_from_phenotypes(pheno, ind_to_omit);
// split markers into chromsomes; sort chromosomes
auto markers_by_chr = sort_chromosomes_by_marker_id(get_markers_by_chromosome(markers));
// drop X chromosome
markers_by_chr = markers_by_chr[0..($-1)];
// add pseudomarkers at 1.0 cM spacing
auto pmar_by_chr = add_stepped_markers(markers_by_chr, 1.0);
// inter-marker recombination fractions
auto rec_frac = recombination_fractions(pmar_by_chr, GeneticMapFunc.Haldane);
// empty covariate matrices
auto addcovar = new double[][](0, 0);
auto intcovar = new double[][](0, 0);
auto weights = new double[](0);
// null model
auto rss0 = scanone_hk_null(pheno, addcovar, weights);
// to store LOD curves and peaks for all chromosomes
double[][] lod;
Tuple!(double, Marker)[][] peaks;
// calc genoprob for each chromosome, then scanone
foreach(i, chr; pmar_by_chr) {
auto genoprobs = calc_geno_prob(cross_class, genotype_matrix, chr[1], rec_frac[i][0], 0.002);
auto rss = scanone_hk(genoprobs, pheno, addcovar, intcovar, weights);
auto lod_this_chr = rss_to_lod(rss, rss0, pheno.length);
lod ~= lod_this_chr;
auto peak_this_chr = get_peak_scanone(lod_this_chr, chr[1]);
peaks ~= peak_this_chr;
}
// print peaks
double threshold = 2;
writeln(" --Peaks with LOD > ", threshold, ":");
foreach(i, peak; peaks) {
foreach(j; 0..peak.length) {
if(peak[j][0] > threshold)
writefln(" ----Chr %-2s : peak %d for phenotype %d: max lod = %7.2f at pos = %7.2f", peak[j][1].chromosome.name, i, j,
peak[j][0], peak[j][1].get_position);
}
}
writeln(peaks[0][0]);
assert(to!int(peaks[0][0][0]) == 2,to!string(to!int(peaks[0][0][0])));
writeln(peaks[4][0]);
assert(to!int(peaks[4][0][0]) == 6,to!string(to!int(peaks[4][0][0])));
writeln(peaks[14][0]);
assert(to!int(peaks[14][0][0]) == 3,to!string(to!int(peaks[14][0][0])));
}
| D |
/**
* Compiler implementation of the
* $(LINK2 https://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 2009-2023 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
* License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/backend/mscoffobj.d, backend/mscoffobj.d)
*/
module dmd.backend.mscoffobj;
version (MARS)
version = COMPILE;
version (SCPP)
version = COMPILE;
version (COMPILE)
{
import core.stdc.ctype;
import core.stdc.stdio;
import core.stdc.stdint;
import core.stdc.stdlib;
import core.stdc.string;
import core.stdc.time;
import dmd.backend.barray;
import dmd.backend.cc;
import dmd.backend.cdef;
import dmd.backend.code;
import dmd.backend.code_x86;
import dmd.backend.cv8;
import dmd.backend.dlist;
import dmd.backend.dvec;
import dmd.backend.el;
import dmd.backend.md5;
import dmd.backend.mem;
import dmd.backend.global;
import dmd.backend.obj;
import dmd.backend.ty;
import dmd.backend.type;
import dmd.backend.mscoff;
import dmd.common.outbuffer;
extern (C++):
nothrow:
@safe:
alias _compare_fp_t = extern(C) nothrow int function(const void*, const void*);
extern(C) void qsort(void* base, size_t nmemb, size_t size, _compare_fp_t compar);
extern (C) char* strupr(char*);
private extern (D) __gshared OutBuffer *fobjbuf;
enum DEST_LEN = (IDMAX + IDOHD + 1);
/******************************************
*/
// The object file is built ib several separate pieces
__gshared private
{
// String Table - String table for all other names
OutBuffer *string_table;
// Section Headers
public OutBuffer *ScnhdrBuf; // Buffer to build section table in
// The -1 is because it is 1 based indexing
@trusted
IMAGE_SECTION_HEADER* ScnhdrTab() { return cast(IMAGE_SECTION_HEADER *)ScnhdrBuf.buf - 1; }
int scnhdr_cnt; // Number of sections in table
enum SCNHDR_TAB_INITSIZE = 16; // Initial number of sections in buffer
enum SCNHDR_TAB_INC = 4; // Number of sections to increment buffer by
enum SYM_TAB_INIT = 100; // Initial number of symbol entries in buffer
enum SYM_TAB_INC = 50; // Number of symbols to increment buffer by
// The symbol table
OutBuffer *symbuf;
OutBuffer *syment_buf; // array of struct syment
segidx_t segidx_drectve = UNKNOWN; // contents of ".drectve" section
segidx_t segidx_debugS = UNKNOWN;
segidx_t segidx_xdata = UNKNOWN;
segidx_t segidx_pdata = UNKNOWN;
extern (D) int jumpTableSeg; // segment index for __jump_table
extern (D) OutBuffer *indirectsymbuf2; // indirect symbol table of Symbol*'s
extern (D) int pointersSeg; // segment index for __pointers
OutBuffer *ptrref_buf; // buffer for pointer references
int floatused;
/* If an MsCoffObj_external_def() happens, set this to the string index,
* to be added last to the symbol table.
* Obviously, there can be only one.
*/
extern (D) IDXSTR extdef;
// Each compiler segment is a section
// Predefined compiler segments CODE,DATA,CDATA,UDATA map to indexes
// into SegData[]
// New compiler segments are added to end.
/******************************
* Returns !=0 if this segment is a code segment.
*/
@trusted
int mscoff_seg_data_isCode(const ref seg_data sd)
{
return (ScnhdrTab[sd.SDshtidx].Characteristics & IMAGE_SCN_CNT_CODE) != 0;
}
public:
// already in cgobj.c (should be part of objmod?):
// seg_data **SegData;
extern Rarray!(seg_data*) SegData;
private extern (D) segidx_t seg_tlsseg = UNKNOWN;
private extern (D) segidx_t seg_tlsseg_bss = UNKNOWN;
}
/*******************************************************
* Because the mscoff relocations cannot be computed until after
* all the segments are written out, and we need more information
* than the mscoff relocations provide, make our own relocation
* type. Later, translate to mscoff relocation structure.
*/
enum
{
RELaddr = 0, // straight address
RELrel = 1, // relative to location to be fixed up
RELseg = 2, // 2 byte section
RELaddr32 = 3, // 4 byte offset
}
struct Relocation
{ // Relocations are attached to the struct seg_data they refer to
targ_size_t offset; // location in segment to be fixed up
Symbol *funcsym; // function in which offset lies, if any
Symbol *targsym; // if !=null, then location is to be fixed up
// to address of this symbol
uint targseg; // if !=0, then location is to be fixed up
// to address of start of this segment
ubyte rtype; // RELxxxx
short val; // 0, -1, -2, -3, -4, -5
}
/*******************************
* Output a string into a string table
* Input:
* strtab = string table for entry
* str = string to add
*
* Returns offset into the specified string table.
*/
IDXSTR MsCoffObj_addstr(OutBuffer *strtab, const(char)* str) @system
{
//printf("MsCoffObj_addstr(strtab = %p str = '%s')\n",strtab,str);
IDXSTR idx = cast(IDXSTR)strtab.length(); // remember starting offset
strtab.writeStringz(str);
//printf("\tidx %d, new size %d\n",idx,strtab.length());
return idx;
}
/**************************
* Output read only data and generate a symbol for it.
*
*/
Symbol * MsCoffObj_sym_cdata(tym_t ty,char *p,int len)
{
//printf("MsCoffObj_sym_cdata(ty = %x, p = %x, len = %d, Offset(CDATA) = %x)\n", ty, p, len, Offset(CDATA));
alignOffset(CDATA, tysize(ty));
Symbol *s = symboldata(Offset(CDATA), ty);
s.Sseg = CDATA;
MsCoffObj_pubdef(CDATA, s, Offset(CDATA));
MsCoffObj_bytes(CDATA, Offset(CDATA), len, p);
s.Sfl = FLdata; //FLextern;
return s;
}
/**************************
* Ouput read only data for data
*
*/
@trusted
int MsCoffObj_data_readonly(char *p, int len, segidx_t *pseg)
{
int oldoff;
version (SCPP)
{
oldoff = Offset(DATA);
SegData[DATA].SDbuf.reserve(len);
SegData[DATA].SDbuf.writen(p,len);
Offset(DATA) += len;
*pseg = DATA;
}
else
{
oldoff = cast(int)Offset(CDATA);
SegData[CDATA].SDbuf.reserve(len);
SegData[CDATA].SDbuf.writen(p,len);
Offset(CDATA) += len;
*pseg = CDATA;
}
return oldoff;
}
@trusted
int MsCoffObj_data_readonly(char *p, int len)
{
segidx_t pseg;
return MsCoffObj_data_readonly(p, len, &pseg);
}
/*****************************
* Get segment for readonly string literals.
* The linker will pool strings in this section.
* Params:
* sz = number of bytes per character (1, 2, or 4)
* Returns:
* segment index
*/
int MsCoffObj_string_literal_segment(uint sz)
{
assert(0);
}
/******************************
* Start a .obj file.
* Called before any other obj_xxx routines.
* One source file can generate multiple .obj files.
*/
@trusted
Obj MsCoffObj_init(OutBuffer *objbuf, const(char)* filename, const(char)* csegname)
{
//printf("MsCoffObj_init()\n");
Obj obj = cast(Obj)mem_calloc(__traits(classInstanceSize, Obj));
cseg = CODE;
fobjbuf = objbuf;
assert(objbuf.length() == 0);
floatused = 0;
segidx_drectve = UNKNOWN;
seg_tlsseg = UNKNOWN;
seg_tlsseg_bss = UNKNOWN;
segidx_pdata = UNKNOWN;
segidx_xdata = UNKNOWN;
segidx_debugS = UNKNOWN;
// Initialize buffers
if (!string_table)
{
string_table = cast(OutBuffer*) calloc(1, OutBuffer.sizeof);
if (!string_table)
err_nomem();
string_table.reserve(2048);
}
string_table.reset();
string_table.write32(4); // first 4 bytes are length of string table
if (symbuf)
{
Symbol **p = cast(Symbol **)symbuf.buf;
const size_t n = symbuf.length() / (Symbol *).sizeof;
for (size_t i = 0; i < n; ++i)
symbol_reset(p[i]);
symbuf.reset();
}
else
{
symbuf = cast(OutBuffer*) calloc(1, OutBuffer.sizeof);
if (!symbuf)
err_nomem();
symbuf.reserve((Symbol *).sizeof * SYM_TAB_INIT);
}
if (!syment_buf)
{
syment_buf = cast(OutBuffer*) calloc(1, OutBuffer.sizeof);
if (!syment_buf)
err_nomem();
syment_buf.reserve(SymbolTable32.sizeof * SYM_TAB_INIT);
}
syment_buf.reset();
extdef = 0;
pointersSeg = 0;
// Initialize segments for CODE, DATA, UDATA and CDATA
if (!ScnhdrBuf)
{
ScnhdrBuf = cast(OutBuffer*) calloc(1, OutBuffer.sizeof);
if (!ScnhdrBuf)
err_nomem();
ScnhdrBuf.reserve(SCNHDR_TAB_INITSIZE * (IMAGE_SECTION_HEADER).sizeof);
}
ScnhdrBuf.reset();
scnhdr_cnt = 0;
/* Define sections. Although the order should not matter, we duplicate
* the same order VC puts out just to avoid trouble.
*/
int alignText = I64 ? IMAGE_SCN_ALIGN_16BYTES : IMAGE_SCN_ALIGN_8BYTES;
int alignData = IMAGE_SCN_ALIGN_16BYTES;
MsCoffObj_addScnhdr(".data$B", IMAGE_SCN_CNT_INITIALIZED_DATA |
alignData |
IMAGE_SCN_MEM_READ |
IMAGE_SCN_MEM_WRITE); // DATA
MsCoffObj_addScnhdr(".text", IMAGE_SCN_CNT_CODE |
alignText |
IMAGE_SCN_MEM_EXECUTE |
IMAGE_SCN_MEM_READ); // CODE
MsCoffObj_addScnhdr(".bss$B", IMAGE_SCN_CNT_UNINITIALIZED_DATA |
alignData |
IMAGE_SCN_MEM_READ |
IMAGE_SCN_MEM_WRITE); // UDATA
MsCoffObj_addScnhdr(".rdata", IMAGE_SCN_CNT_INITIALIZED_DATA |
alignData |
IMAGE_SCN_MEM_READ); // CONST
SegData.reset();
SegData.push();
enum
{
SHI_DATA = 1,
SHI_TEXT = 2,
SHI_UDATA = 3,
SHI_CDATA = 4,
}
MsCoffObj_getsegment2(SHI_TEXT);
assert(SegData[CODE].SDseg == CODE);
MsCoffObj_getsegment2(SHI_DATA);
assert(SegData[DATA].SDseg == DATA);
MsCoffObj_getsegment2(SHI_CDATA);
assert(SegData[CDATA].SDseg == CDATA);
MsCoffObj_getsegment2(SHI_UDATA);
assert(SegData[UDATA].SDseg == UDATA);
if (config.fulltypes)
cv8_initfile(filename);
assert(objbuf.length() == 0);
return obj;
}
/**************************
* Start a module within a .obj file.
* There can be multiple modules within a single .obj file.
*
* Input:
* filename: Name of source file
* csegname: User specified default code segment name
*/
@trusted
void MsCoffObj_initfile(const(char)* filename, const(char)* csegname, const(char)* modname)
{
//dbg_printf("MsCoffObj_initfile(filename = %s, modname = %s)\n",filename,modname);
version (SCPP)
{
static if (TARGET_LINUX)
{
if (csegname && *csegname && strcmp(csegname,".text"))
{ // Define new section and make it the default for cseg segment
// NOTE: cseg is initialized to CODE
IDXSEC newsecidx;
Elf32_Shdr *newtextsec;
IDXSYM newsymidx;
assert(!I64); // fix later
SegData[cseg].SDshtidx = newsecidx =
elf_newsection(csegname,0,SHT_PROGDEF,SHF_ALLOC|SHF_EXECINSTR);
newtextsec = &ScnhdrTab[newsecidx];
newtextsec.sh_addralign = 4;
SegData[cseg].SDsymidx =
elf_addsym(0, 0, 0, STT_SECTION, STB_LOCAL, newsecidx);
}
}
}
if (config.fulltypes)
cv8_initmodule(filename, modname);
}
/************************************
* Patch pseg/offset by adding in the vmaddr difference from
* pseg/offset to start of seg.
*/
@trusted
private extern (D)
int32_t *MsCoffObj_patchAddr(int seg, targ_size_t offset)
{
return cast(int32_t *)(fobjbuf.buf + ScnhdrTab[SegData[seg].SDshtidx].PointerToRawData + offset);
}
@trusted
private extern (D)
int32_t *MsCoffObj_patchAddr64(int seg, targ_size_t offset)
{
return cast(int32_t *)(fobjbuf.buf + ScnhdrTab[SegData[seg].SDshtidx].PointerToRawData + offset);
}
private extern (D)
static if (0)
{
@trusted
void patch(seg_data *pseg, targ_size_t offset, int seg, targ_size_t value)
{
//printf("patch(offset = x%04x, seg = %d, value = x%llx)\n", cast(uint)offset, seg, value);
if (I64)
{
int32_t *p = cast(int32_t *)(fobjbuf.buf + ScnhdrTab[pseg.SDshtidx].PointerToRawData + offset);
static if (0)
printf("\taddr1 = x%llx\n\taddr2 = x%llx\n\t*p = x%llx\n\tdelta = x%llx\n",
ScnhdrTab[pseg.SDshtidx].VirtualAddress,
ScnhdrTab[SegData[seg].SDshtidx].VirtualAddress,
*p,
ScnhdrTab[SegData[seg].SDshtidx].VirtualAddress -
(ScnhdrTab[pseg.SDshtidx].VirtualAddress + offset));
*p += ScnhdrTab[SegData[seg].SDshtidx].VirtualAddress -
(ScnhdrTab[pseg.SDshtidx].VirtualAddress - value);
}
else
{
int32_t *p = cast(int32_t *)(fobjbuf.buf + ScnhdrTab[pseg.SDshtidx].PointerToRawData + offset);
static if (0)
printf("\taddr1 = x%x\n\taddr2 = x%x\n\t*p = x%x\n\tdelta = x%x\n",
ScnhdrTab[pseg.SDshtidx].VirtualAddress,
ScnhdrTab[SegData[seg].SDshtidx].VirtualAddress,
*p,
ScnhdrTab[SegData[seg].SDshtidx].VirtualAddress -
(ScnhdrTab[pseg.SDshtidx].VirtualAddress + offset));
*p += ScnhdrTab[SegData[seg].SDshtidx].VirtualAddress -
(ScnhdrTab[pseg.SDshtidx].VirtualAddress - value);
}
}
}
/*********************************
* Build syment[], the array of symbols.
* Store them in syment_buf.
*/
@trusted
private void syment_set_name(SymbolTable32 *sym, const(char)* name)
{
size_t len = strlen(name);
if (len > 8)
{ // Use offset into string table
IDXSTR idx = MsCoffObj_addstr(string_table, name);
sym.Zeros = 0;
sym.Offset = idx;
}
else
{ memcpy(sym.Name.ptr, name, len);
if (len < 8)
memset(sym.Name.ptr + len, 0, 8 - len);
}
}
@trusted
void write_sym(SymbolTable32* sym, bool bigobj)
{
assert((*sym).sizeof == 20);
if (bigobj)
{
syment_buf.write(sym[0 .. 1]);
}
else
{
// the only difference between SymbolTable32 and SymbolTable
// is that field SectionNumber is long instead of short
uint scoff = cast(uint)(cast(char*)&sym.SectionNumber - cast(char*)sym);
syment_buf.write(sym, scoff + 2);
syment_buf.write(cast(char*)sym + scoff + 4, cast(uint)((*sym).sizeof - scoff - 4));
}
}
@trusted
void build_syment_table(bool bigobj)
{
/* The @comp.id symbol appears to be the version of VC that generated the .obj file.
* Anything we put in there would have no relevance, so we'll not put out this symbol.
*/
uint symsize = bigobj ? SymbolTable32.sizeof : SymbolTable.sizeof;
/* Now goes one symbol per section.
*/
for (segidx_t seg = 1; seg < SegData.length; seg++)
{
seg_data *pseg = SegData[seg];
IMAGE_SECTION_HEADER *psechdr = &ScnhdrTab[pseg.SDshtidx]; // corresponding section
SymbolTable32 sym;
memcpy(sym.Name.ptr, psechdr.Name.ptr, 8);
sym.Value = 0;
sym.SectionNumber = pseg.SDshtidx;
sym.Type = 0;
sym.StorageClass = IMAGE_SYM_CLASS_STATIC;
sym.NumberOfAuxSymbols = 1;
write_sym(&sym, bigobj);
auxent aux = void;
memset(&aux, 0, (aux).sizeof);
// s_size is not set yet
//aux.x_section.length = psechdr.s_size;
if (pseg.SDbuf && pseg.SDbuf.length())
aux.x_section.length = cast(uint)pseg.SDbuf.length();
else
aux.x_section.length = cast(uint)pseg.SDoffset;
if (pseg.SDrel)
aux.x_section.NumberOfRelocations = cast(ushort)(pseg.SDrel.length() / (Relocation).sizeof);
if (psechdr.Characteristics & IMAGE_SCN_LNK_COMDAT)
{
aux.x_section.Selection = cast(ubyte)IMAGE_COMDAT_SELECT_ANY;
if (pseg.SDassocseg)
{ aux.x_section.Selection = cast(ubyte)IMAGE_COMDAT_SELECT_ASSOCIATIVE;
aux.x_section.NumberHighPart = cast(ushort)(pseg.SDassocseg >> 16);
aux.x_section.NumberLowPart = cast(ushort)(pseg.SDassocseg & 0x0000FFFF);
}
}
memset(&aux.x_section.Zeros, 0, 2);
syment_buf.write(&aux, symsize);
assert((aux).sizeof == 20);
}
/* Add symbols from symbuf[]
*/
int n = cast(int)SegData.length;
size_t dim = symbuf.length() / (Symbol *).sizeof;
for (size_t i = 0; i < dim; i++)
{ Symbol *s = (cast(Symbol **)symbuf.buf)[i];
s.Sxtrnnum = cast(uint)(syment_buf.length() / symsize);
n++;
SymbolTable32 sym;
char[DEST_LEN+1] dest = void;
char *destr = obj_mangle2(s, dest.ptr);
syment_set_name(&sym, destr);
sym.Value = 0;
switch (s.Sclass)
{
case SC.extern_:
sym.SectionNumber = IMAGE_SYM_UNDEFINED;
break;
default:
sym.SectionNumber = SegData[s.Sseg].SDshtidx;
break;
}
sym.Type = tyfunc(s.Stype.Tty) ? 0x20 : 0;
switch (s.Sclass)
{
case SC.static_:
if (s.Sflags & SFLhidden)
goto default;
goto case;
case SC.locstat:
sym.StorageClass = IMAGE_SYM_CLASS_STATIC;
sym.Value = cast(uint)s.Soffset;
break;
default:
sym.StorageClass = IMAGE_SYM_CLASS_EXTERNAL;
if (sym.SectionNumber != IMAGE_SYM_UNDEFINED)
sym.Value = cast(uint)s.Soffset;
break;
}
sym.NumberOfAuxSymbols = 0;
write_sym(&sym, bigobj);
}
}
/***************************
* Fixup and terminate object file.
*/
@trusted
void MsCoffObj_termfile()
{
//dbg_printf("MsCoffObj_termfile\n");
if (configv.addlinenumbers)
{
cv8_termmodule();
}
}
/*********************************
* Terminate package.
*/
@trusted
void MsCoffObj_term(const(char)* objfilename)
{
//printf("MsCoffObj_term()\n");
assert(fobjbuf.length() == 0);
version (SCPP)
{
if (!errcnt)
{
objflush_pointerRefs();
outfixlist(); // backpatches
}
}
else
{
objflush_pointerRefs();
outfixlist(); // backpatches
}
if (configv.addlinenumbers)
{
cv8_termfile(objfilename);
}
version (SCPP)
{
if (errcnt)
return;
}
// To allow tooling support for most output files
// switch to new object file format (similar to C++ with /bigobj)
// only when exceeding the limit for 16-bit section count according to
// https://msdn.microsoft.com/en-us/library/8578y171%28v=vs.71%29.aspx
bool bigobj = scnhdr_cnt > 65_279;
build_syment_table(bigobj);
/* Write out the object file in the following order:
* Header
* Section Headers
* Symbol table
* String table
* Section data
*/
uint foffset;
// Write out the bytes for the header
BIGOBJ_HEADER header = void;
IMAGE_FILE_HEADER header_old = void;
time_t f_timedat = 0;
time(&f_timedat);
uint symtable_offset;
if (bigobj)
{
header.Sig1 = IMAGE_FILE_MACHINE_UNKNOWN;
header.Sig2 = 0xFFFF;
header.Version = 2;
header.Machine = I64 ? IMAGE_FILE_MACHINE_AMD64 : IMAGE_FILE_MACHINE_I386;
header.NumberOfSections = scnhdr_cnt;
header.TimeDateStamp = cast(uint)f_timedat;
static immutable ubyte[16] uuid =
[ '\xc7', '\xa1', '\xba', '\xd1', '\xee', '\xba', '\xa9', '\x4b',
'\xaf', '\x20', '\xfa', '\xf6', '\x6a', '\xa4', '\xdc', '\xb8' ];
memcpy(header.UUID.ptr, uuid.ptr, 16);
memset(header.unused.ptr, 0, (header.unused).sizeof);
foffset = (header).sizeof; // start after header
foffset += ScnhdrBuf.length(); // section headers
header.PointerToSymbolTable = foffset; // offset to symbol table
symtable_offset = foffset;
header.NumberOfSymbols = cast(uint)(syment_buf.length() / (SymbolTable32).sizeof);
foffset += header.NumberOfSymbols * (SymbolTable32).sizeof; // symbol table
}
else
{
header_old.Machine = I64 ? IMAGE_FILE_MACHINE_AMD64 : IMAGE_FILE_MACHINE_I386;
header_old.NumberOfSections = cast(ushort)scnhdr_cnt;
header_old.TimeDateStamp = cast(uint)f_timedat;
header_old.SizeOfOptionalHeader = 0;
header_old.Characteristics = 0;
foffset = (header_old).sizeof; // start after header
foffset += ScnhdrBuf.length(); // section headers
header_old.PointerToSymbolTable = foffset; // offset to symbol table
symtable_offset = foffset;
header_old.NumberOfSymbols = cast(uint)(syment_buf.length() / (SymbolTable).sizeof);
foffset += header_old.NumberOfSymbols * (SymbolTable).sizeof; // symbol table
}
uint string_table_offset = foffset;
foffset += string_table.length(); // string table
// Compute file offsets of all the section data
for (segidx_t seg = 1; seg < SegData.length; seg++)
{
seg_data *pseg = SegData[seg];
IMAGE_SECTION_HEADER *psechdr = &ScnhdrTab[pseg.SDshtidx]; // corresponding section
int align_ = pseg.SDalignment;
if (align_ > 1)
foffset = (foffset + align_ - 1) & ~(align_ - 1);
if (pseg.SDbuf && pseg.SDbuf.length())
{
psechdr.PointerToRawData = foffset;
//printf("seg = %2d SDshtidx = %2d psechdr = %p s_scnptr = x%x\n", seg, pseg.SDshtidx, psechdr, cast(uint)psechdr.s_scnptr);
psechdr.SizeOfRawData = cast(uint)pseg.SDbuf.length();
foffset += psechdr.SizeOfRawData;
}
else
psechdr.SizeOfRawData = cast(uint)pseg.SDoffset;
}
// Compute file offsets of the relocation data
for (segidx_t seg = 1; seg < SegData.length; seg++)
{
seg_data *pseg = SegData[seg];
IMAGE_SECTION_HEADER *psechdr = &ScnhdrTab[pseg.SDshtidx]; // corresponding section
if (pseg.SDrel)
{
foffset = (foffset + 3) & ~3;
assert(psechdr.PointerToRelocations == 0);
auto nreloc = pseg.SDrel.length() / Relocation.sizeof;
if (nreloc > 0xffff)
{
// https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#coff-relocations-object-only
psechdr.Characteristics |= IMAGE_SCN_LNK_NRELOC_OVFL;
psechdr.PointerToRelocations = foffset;
psechdr.NumberOfRelocations = 0xffff;
foffset += reloc.sizeof;
}
else if (nreloc)
{
psechdr.PointerToRelocations = foffset;
//printf("seg = %d SDshtidx = %d psechdr = %p s_relptr = x%x\n", seg, pseg.SDshtidx, psechdr, cast(uint)psechdr.s_relptr);
psechdr.NumberOfRelocations = cast(ushort)nreloc;
}
foffset += nreloc * reloc.sizeof;
}
}
assert(fobjbuf.length() == 0);
// Write the header
if (bigobj)
{
fobjbuf.write((&header)[0 .. 1]);
foffset = (header).sizeof;
}
else
{
fobjbuf.write((&header_old)[0 .. 1]);
foffset = (header_old).sizeof;
}
// Write the section headers
fobjbuf.write((*ScnhdrBuf)[]);
foffset += ScnhdrBuf.length();
// Write the symbol table
assert(foffset == symtable_offset);
fobjbuf.write((*syment_buf)[]);
foffset += syment_buf.length();
// Write the string table
assert(foffset == string_table_offset);
*cast(uint *)(string_table.buf) = cast(uint)string_table.length();
fobjbuf.write((*string_table)[]);
foffset += string_table.length();
// Write the section data
for (segidx_t seg = 1; seg < SegData.length; seg++)
{
seg_data *pseg = SegData[seg];
IMAGE_SECTION_HEADER *psechdr = &ScnhdrTab[pseg.SDshtidx]; // corresponding section
foffset = elf_align(pseg.SDalignment, foffset);
if (pseg.SDbuf && pseg.SDbuf.length())
{
//printf("seg = %2d SDshtidx = %2d psechdr = %p s_scnptr = x%x, foffset = x%x\n", seg, pseg.SDshtidx, psechdr, cast(uint)psechdr.s_scnptr, cast(uint)foffset);
assert(pseg.SDbuf.length() == psechdr.SizeOfRawData);
assert(foffset == psechdr.PointerToRawData);
fobjbuf.write((*pseg.SDbuf)[]);
foffset += pseg.SDbuf.length();
}
}
// Compute the relocations, write them out
assert((reloc).sizeof == 10);
for (segidx_t seg = 1; seg < SegData.length; seg++)
{
seg_data *pseg = SegData[seg];
IMAGE_SECTION_HEADER *psechdr = &ScnhdrTab[pseg.SDshtidx]; // corresponding section
if (pseg.SDrel)
{
Relocation *r = cast(Relocation *)pseg.SDrel.buf;
size_t sz = pseg.SDrel.length();
bool pdata = (strcmp(cast(const(char)* )psechdr.Name, ".pdata") == 0);
Relocation *rend = cast(Relocation *)(pseg.SDrel.buf + sz);
foffset = elf_align(4, foffset);
debug
if (sz && foffset != psechdr.PointerToRelocations)
printf("seg = %d SDshtidx = %d psechdr = %p s_relptr = x%x, foffset = x%x\n", seg, pseg.SDshtidx, psechdr, cast(uint)psechdr.PointerToRelocations, cast(uint)foffset);
assert(sz == 0 || foffset == psechdr.PointerToRelocations);
if (psechdr.Characteristics & IMAGE_SCN_LNK_NRELOC_OVFL)
{
auto rel = reloc(cast(uint)(sz / Relocation.sizeof) + 1);
fobjbuf.write((&rel)[0 .. 1]);
foffset += rel.sizeof;
}
for (; r != rend; r++)
{ reloc rel;
rel.r_vaddr = 0;
rel.r_symndx = 0;
rel.r_type = 0;
Symbol *s = r.targsym;
const(char)* rs = r.rtype == RELaddr ? "addr" : "rel";
//printf("%d:x%04lx : tseg %d tsym %s REL%s\n", seg, cast(int)r.offset, r.targseg, s ? s.Sident.ptr : "0", rs);
if (s)
{
//printf("Relocation\n");
//symbol_print(s);
if (pseg.isCode())
{
if (I64)
{
rel.r_type = (r.rtype == RELrel)
? IMAGE_REL_AMD64_REL32
: IMAGE_REL_AMD64_REL32;
if (s.Stype.Tty & mTYthread)
rel.r_type = IMAGE_REL_AMD64_SECREL;
if (r.val == -1)
rel.r_type = IMAGE_REL_AMD64_REL32_1;
else if (r.val == -2)
rel.r_type = IMAGE_REL_AMD64_REL32_2;
else if (r.val == -3)
rel.r_type = IMAGE_REL_AMD64_REL32_3;
else if (r.val == -4)
rel.r_type = IMAGE_REL_AMD64_REL32_4;
else if (r.val == -5)
rel.r_type = IMAGE_REL_AMD64_REL32_5;
/+if (s.Sclass == SCextern ||
s.Sclass == SCcomdef ||
s.Sclass == SCcomdat ||
s.Sclass == SCglobal)
{
rel.r_vaddr = cast(uint)r.offset;
rel.r_symndx = s.Sxtrnnum;
}
else+/
{
rel.r_vaddr = cast(uint)r.offset;
rel.r_symndx = s.Sxtrnnum;
}
}
else if (I32)
{
rel.r_type = (r.rtype == RELrel)
? IMAGE_REL_I386_REL32
: IMAGE_REL_I386_DIR32;
if (s.Stype.Tty & mTYthread)
rel.r_type = IMAGE_REL_I386_SECREL;
/+if (s.Sclass == SCextern ||
s.Sclass == SCcomdef ||
s.Sclass == SCcomdat ||
s.Sclass == SCglobal)
{
rel.r_vaddr = cast(uint)r.offset;
rel.r_symndx = s.Sxtrnnum;
}
else+/
{
rel.r_vaddr = cast(uint)r.offset;
rel.r_symndx = s.Sxtrnnum;
}
}
else
assert(false); // not implemented for I16
}
else
{
if (I64)
{
if (pdata)
rel.r_type = IMAGE_REL_AMD64_ADDR32NB;
else
rel.r_type = IMAGE_REL_AMD64_ADDR64;
if (r.rtype == RELseg)
rel.r_type = IMAGE_REL_AMD64_SECTION;
else if (r.rtype == RELaddr32)
rel.r_type = IMAGE_REL_AMD64_SECREL;
}
else if (I32)
{
if (pdata)
rel.r_type = IMAGE_REL_I386_DIR32NB;
else
rel.r_type = IMAGE_REL_I386_DIR32;
if (r.rtype == RELseg)
rel.r_type = IMAGE_REL_I386_SECTION;
else if (r.rtype == RELaddr32)
rel.r_type = IMAGE_REL_I386_SECREL;
}
else
assert(false); // not implemented for I16
rel.r_vaddr = cast(uint)r.offset;
rel.r_symndx = s.Sxtrnnum;
}
}
else if (r.rtype == RELaddr && pseg.isCode())
{
int32_t *p = null;
p = MsCoffObj_patchAddr(seg, r.offset);
rel.r_vaddr = cast(uint)r.offset;
rel.r_symndx = s ? s.Sxtrnnum : 0;
if (I64)
{
rel.r_type = IMAGE_REL_AMD64_REL32;
//srel.r_value = ScnhdrTab[SegData[r.targseg].SDshtidx].s_vaddr + *p;
//printf("SECTDIFF: x%llx + x%llx = x%x\n", ScnhdrTab[SegData[r.targseg].SDshtidx].s_vaddr, *p, srel.r_value);
}
else
{
rel.r_type = IMAGE_REL_I386_SECREL;
//srel.r_value = ScnhdrTab[SegData[r.targseg].SDshtidx].s_vaddr + *p;
//printf("SECTDIFF: x%x + x%x = x%x\n", ScnhdrTab[SegData[r.targseg].SDshtidx].s_vaddr, *p, srel.r_value);
}
}
else
{
assert(0);
}
/* Some programs do generate a lot of symbols.
* Note that MS-Link can get pretty slow with large numbers of symbols.
*/
//assert(rel.r_symndx <= 20000);
assert(rel.r_type <= 0x14);
fobjbuf.write((&rel)[0 .. 1]);
foffset += (rel).sizeof;
}
}
}
}
/*****************************
* Line number support.
*/
/***************************
* Record file and line number at segment and offset.
* Params:
* srcpos = source file position
* seg = segment it corresponds to
* offset = offset within seg
*/
@trusted
void MsCoffObj_linnum(Srcpos srcpos, int seg, targ_size_t offset)
{
version (MARS)
{
if (srcpos.Slinnum == 0 || !srcpos.Sfilename)
return;
}
else
{
if (srcpos.Slinnum == 0 || !srcpos.srcpos_name())
return;
}
cv8_linnum(srcpos, cast(uint)offset);
}
/*******************************
* Set start address
*/
void MsCoffObj_startaddress(Symbol *s)
{
//dbg_printf("MsCoffObj_startaddress(Symbol *%s)\n",s.Sident.ptr);
//obj.startaddress = s;
}
/*******************************
* Output library name.
*/
@trusted
bool MsCoffObj_includelib(const(char)* name)
{
int seg = MsCoffObj_seg_drectve();
//dbg_printf("MsCoffObj_includelib(name *%s)\n",name);
SegData[seg].SDbuf.write(" /DEFAULTLIB:\"".ptr, 14);
SegData[seg].SDbuf.write(name, cast(uint)strlen(name));
SegData[seg].SDbuf.writeByte('"');
return true;
}
/*******************************
* Output linker directive name.
*/
@trusted
bool MsCoffObj_linkerdirective(const(char)* directive)
{
int seg = MsCoffObj_seg_drectve();
//dbg_printf("MsCoffObj::linkerdirective(directive *%s)\n",directive);
SegData[seg].SDbuf.writeByte(' ');
SegData[seg].SDbuf.write(directive, cast(uint)strlen(directive));
return true;
}
/**********************************
* Do we allow zero sized objects?
*/
bool MsCoffObj_allowZeroSize()
{
return true;
}
/**************************
* Embed string in executable.
*/
void MsCoffObj_exestr(const(char)* p)
{
//dbg_printf("MsCoffObj_exestr(char *%s)\n",p);
}
/**************************
* Embed string in obj.
*/
void MsCoffObj_user(const(char)* p)
{
//dbg_printf("MsCoffObj_user(char *%s)\n",p);
}
/*******************************
* Output a weak extern record.
*/
void MsCoffObj_wkext(Symbol *s1,Symbol *s2)
{
//dbg_printf("MsCoffObj_wkext(Symbol *%s,Symbol *s2)\n",s1.Sident.ptr,s2.Sident.ptr);
}
/*******************************
* Output file name record.
*
* Currently assumes that obj_filename will not be called
* twice for the same file.
*/
void MsCoffObj_filename(const(char)* modname)
{
//dbg_printf("MsCoffObj_filename(char *%s)\n",modname);
// Not supported by mscoff
}
/*******************************
* Embed compiler version in .obj file.
*/
void MsCoffObj_compiler()
{
//dbg_printf("MsCoffObj_compiler\n");
}
/**************************************
* Symbol is the function that calls the static constructors.
* Put a pointer to it into a special segment that the startup code
* looks at.
* Input:
* s static constructor function
* dtor !=0 if leave space for static destructor
* seg 1: user
* 2: lib
* 3: compiler
*/
void MsCoffObj_staticctor(Symbol *s,int dtor,int none)
{
MsCoffObj_setModuleCtorDtor(s, true);
}
/**************************************
* Symbol is the function that calls the static destructors.
* Put a pointer to it into a special segment that the exit code
* looks at.
* Input:
* s static destructor function
*/
void MsCoffObj_staticdtor(Symbol *s)
{
MsCoffObj_setModuleCtorDtor(s, false);
}
/***************************************
* Stuff pointer to function in its own segment.
* Used for static ctor and dtor lists.
*/
@trusted
void MsCoffObj_setModuleCtorDtor(Symbol *sfunc, bool isCtor)
{
// Also see https://blogs.msdn.microsoft.com/vcblog/2006/10/20/crt-initialization/
// and https://www.codeguru.com/cplusplus/running-code-before-and-after-main/
const int align_ = I64 ? IMAGE_SCN_ALIGN_8BYTES : IMAGE_SCN_ALIGN_4BYTES;
const int attr = IMAGE_SCN_CNT_INITIALIZED_DATA | align_ | IMAGE_SCN_MEM_READ;
const int seg = MsCoffObj_getsegment(isCtor ? ".CRT$XCU" : ".CRT$XPU", attr);
const int relflags = I64 ? CFoff | CFoffset64 : CFoff;
const int sz = MsCoffObj_reftoident(seg, SegData[seg].SDoffset, sfunc, 0, relflags);
SegData[seg].SDoffset += sz;
}
/***************************************
* Stuff the following data (instance of struct FuncTable) in a separate segment:
* pointer to function
* pointer to ehsym
* length of function
*/
@trusted
void MsCoffObj_ehtables(Symbol *sfunc,uint size,Symbol *ehsym)
{
//printf("MsCoffObj_ehtables(func = %s, handler table = %s) \n",sfunc.Sident.ptr, ehsym.Sident.ptr);
/* BUG: this should go into a COMDAT if sfunc is in a COMDAT
* otherwise the duplicates aren't removed.
*/
int align_ = I64 ? IMAGE_SCN_ALIGN_8BYTES : IMAGE_SCN_ALIGN_4BYTES; // align to _tysize[TYnptr]
// The size is (FuncTable).sizeof in deh2.d
const int seg =
MsCoffObj_getsegment("._deh$B", IMAGE_SCN_CNT_INITIALIZED_DATA |
align_ |
IMAGE_SCN_MEM_READ);
OutBuffer *buf = SegData[seg].SDbuf;
if (I64)
{ MsCoffObj_reftoident(seg, buf.length(), sfunc, 0, CFoff | CFoffset64);
MsCoffObj_reftoident(seg, buf.length(), ehsym, 0, CFoff | CFoffset64);
buf.write64(sfunc.Ssize);
}
else
{ MsCoffObj_reftoident(seg, buf.length(), sfunc, 0, CFoff);
MsCoffObj_reftoident(seg, buf.length(), ehsym, 0, CFoff);
buf.write32(cast(uint)sfunc.Ssize);
}
}
/*********************************************
* Put out symbols that define the beginning/end of the .deh_eh section.
* This gets called if this is the module with "extern (D) main()" in it.
*/
@trusted
private void emitSectionBrace(const(char)* segname, const(char)* symname, int attr, bool coffZeroBytes)
{
char[16] name = void;
strcat(strcpy(name.ptr, segname), "$A");
const int seg_bg = MsCoffObj_getsegment(name.ptr, attr);
strcat(strcpy(name.ptr, segname), "$C");
const int seg_en = MsCoffObj_getsegment(name.ptr, attr);
/* Create symbol sym_beg that sits just before the .seg$B section
*/
strcat(strcpy(name.ptr, symname), "_beg");
Symbol *beg = symbol_name(name[0 .. strlen(name.ptr)], SC.global, tspvoid);
beg.Sseg = seg_bg;
beg.Soffset = 0;
symbuf.write((&beg)[0 .. 1]);
if (coffZeroBytes) // unnecessary, but required by current runtime
MsCoffObj_bytes(seg_bg, 0, I64 ? 8 : 4, null);
/* Create symbol sym_end that sits just after the .seg$B section
*/
strcat(strcpy(name.ptr, symname), "_end");
Symbol *end = symbol_name(name[0 .. strlen(name.ptr)], SC.global, tspvoid);
end.Sseg = seg_en;
end.Soffset = 0;
symbuf.write((&end)[0 .. 1]);
if (coffZeroBytes) // unnecessary, but required by current runtime
MsCoffObj_bytes(seg_en, 0, I64 ? 8 : 4, null);
}
void MsCoffObj_ehsections()
{
//printf("MsCoffObj_ehsections()\n");
int align_ = I64 ? IMAGE_SCN_ALIGN_8BYTES : IMAGE_SCN_ALIGN_4BYTES;
int attr = IMAGE_SCN_CNT_INITIALIZED_DATA | align_ | IMAGE_SCN_MEM_READ;
emitSectionBrace("._deh", "_deh", attr, true);
emitSectionBrace(".minfo", "_minfo", attr, true);
attr = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_ALIGN_4BYTES | IMAGE_SCN_MEM_READ;
emitSectionBrace(".dp", "_DP", attr, false); // references to pointers in .data and .bss
emitSectionBrace(".tp", "_TP", attr, false); // references to pointers in .tls
attr = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_ALIGN_16BYTES | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE;
emitSectionBrace(".data", "_data", attr, false);
attr = IMAGE_SCN_CNT_UNINITIALIZED_DATA | IMAGE_SCN_ALIGN_16BYTES | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE;
emitSectionBrace(".bss", "_bss", attr, false);
/*************************************************************************/
static if (0)
{
{
/* TLS sections
*/
int align_ = I64 ? IMAGE_SCN_ALIGN_16BYTES : IMAGE_SCN_ALIGN_4BYTES;
int segbg =
MsCoffObj_getsegment(".tls$AAA", IMAGE_SCN_CNT_INITIALIZED_DATA |
align_ |
IMAGE_SCN_MEM_READ |
IMAGE_SCN_MEM_WRITE);
int segen =
MsCoffObj_getsegment(".tls$AAC", IMAGE_SCN_CNT_INITIALIZED_DATA |
align_ |
IMAGE_SCN_MEM_READ |
IMAGE_SCN_MEM_WRITE);
/* Create symbol _minfo_beg that sits just before the .tls$AAB section
*/
Symbol *minfo_beg = symbol_name("_tlsstart", SC.global, tspvoid);
minfo_beg.Sseg = segbg;
minfo_beg.Soffset = 0;
symbuf.write((&minfo_beg)[0 .. 1]);
MsCoffObj_bytes(segbg, 0, I64 ? 8 : 4, null);
/* Create symbol _minfo_end that sits just after the .tls$AAB section
*/
Symbol *minfo_end = symbol_name("_tlsend", SC.global, tspvoid);
minfo_end.Sseg = segen;
minfo_end.Soffset = 0;
symbuf.write((&minfo_end)[0 .. 1]);
MsCoffObj_bytes(segen, 0, I64 ? 8 : 4, null);
}
}
}
/*********************************
* Setup for Symbol s to go into a COMDAT segment.
* Output (if s is a function):
* cseg segment index of new current code segment
* Offset(cseg) starting offset in cseg
* Returns:
* "segment index" of COMDAT
*/
int MsCoffObj_comdatsize(Symbol *s, targ_size_t symsize)
{
return MsCoffObj_comdat(s);
}
@trusted
int MsCoffObj_comdat(Symbol *s)
{
uint align_;
//printf("MsCoffObj_comdat(Symbol* %s)\n",s.Sident.ptr);
//symbol_print(s);
//symbol_debug(s);
if (tyfunc(s.ty()))
{
align_ = I64 ? 16 : 4;
s.Sseg = MsCoffObj_getsegment(".text", IMAGE_SCN_CNT_CODE |
IMAGE_SCN_LNK_COMDAT |
(I64 ? IMAGE_SCN_ALIGN_16BYTES : IMAGE_SCN_ALIGN_4BYTES) |
IMAGE_SCN_MEM_EXECUTE |
IMAGE_SCN_MEM_READ);
}
else if ((s.ty() & mTYLINK) == mTYthread)
{
s.Sfl = FLtlsdata;
align_ = 16;
s.Sseg = MsCoffObj_getsegment(".tls$AAB", IMAGE_SCN_CNT_INITIALIZED_DATA |
IMAGE_SCN_LNK_COMDAT |
IMAGE_SCN_ALIGN_16BYTES |
IMAGE_SCN_MEM_READ |
IMAGE_SCN_MEM_WRITE);
MsCoffObj_data_start(s, align_, s.Sseg);
}
else
{
s.Sfl = FLdata;
align_ = 16;
s.Sseg = MsCoffObj_getsegment(".data$B", IMAGE_SCN_CNT_INITIALIZED_DATA |
IMAGE_SCN_LNK_COMDAT |
IMAGE_SCN_ALIGN_16BYTES |
IMAGE_SCN_MEM_READ |
IMAGE_SCN_MEM_WRITE);
}
// find or create new segment
if (s.Salignment > align_)
{ SegData[s.Sseg].SDalignment = s.Salignment;
assert(s.Salignment >= -1);
}
s.Soffset = SegData[s.Sseg].SDoffset;
if (s.Sfl == FLdata || s.Sfl == FLtlsdata)
{ // Code symbols are 'published' by MsCoffObj_func_start()
MsCoffObj_pubdef(s.Sseg,s,s.Soffset);
searchfixlist(s); // backpatch any refs to this symbol
}
return s.Sseg;
}
@trusted
int MsCoffObj_readonly_comdat(Symbol *s)
{
//printf("MsCoffObj_readonly_comdat(Symbol* %s)\n",s.Sident.ptr);
//symbol_print(s);
symbol_debug(s);
s.Sfl = FLdata;
s.Sseg = MsCoffObj_getsegment(".rdata", IMAGE_SCN_CNT_INITIALIZED_DATA |
IMAGE_SCN_LNK_COMDAT |
IMAGE_SCN_ALIGN_16BYTES |
IMAGE_SCN_MEM_READ);
SegData[s.Sseg].SDalignment = s.Salignment;
assert(s.Salignment >= -1);
s.Soffset = SegData[s.Sseg].SDoffset;
if (s.Sfl == FLdata || s.Sfl == FLtlsdata)
{ // Code symbols are 'published' by MsCoffObj_func_start()
MsCoffObj_pubdef(s.Sseg,s,s.Soffset);
searchfixlist(s); // backpatch any refs to this symbol
}
return s.Sseg;
}
/***********************************
* Returns:
* jump table segment for function s
*/
@trusted
int MsCoffObj_jmpTableSegment(Symbol *s)
{
return (config.flags & CFGromable) ? cseg : DATA;
}
/**********************************
* Get segment, which may already exist.
* Input:
* flags2 put out some data for this, so the linker will keep things in order
* Returns:
* segment index of found or newly created segment
*/
@trusted
segidx_t MsCoffObj_getsegment(const(char)* sectname, uint flags)
{
//printf("getsegment(%s)\n", sectname);
assert(strlen(sectname) <= 8); // so it won't go into string_table
if (!(flags & IMAGE_SCN_LNK_COMDAT))
{
for (segidx_t seg = 1; seg < SegData.length; seg++)
{ seg_data *pseg = SegData[seg];
if (!(ScnhdrTab[pseg.SDshtidx].Characteristics & IMAGE_SCN_LNK_COMDAT) &&
strncmp(cast(const(char)* )ScnhdrTab[pseg.SDshtidx].Name, sectname, 8) == 0)
{
//printf("\t%s\n", sectname);
return seg; // return existing segment
}
}
}
segidx_t seg = MsCoffObj_getsegment2(MsCoffObj_addScnhdr(sectname, flags));
//printf("\tSegData.length = %d\n", SegData.length);
//printf("\tseg = %d, %d, %s\n", seg, SegData[seg].SDshtidx, ScnhdrTab[SegData[seg].SDshtidx].s_name);
return seg;
}
/******************************************
* Create a new segment corresponding to an existing scnhdr index shtidx
*/
@trusted
segidx_t MsCoffObj_getsegment2(IDXSEC shtidx)
{
const segidx_t seg = cast(segidx_t)SegData.length;
seg_data** ppseg = SegData.push();
seg_data* pseg = *ppseg;
if (pseg)
{
OutBuffer *b1 = pseg.SDbuf;
OutBuffer *b2 = pseg.SDrel;
memset(pseg, 0, (seg_data).sizeof);
if (b1)
b1.reset();
else
{
b1 = cast(OutBuffer*) calloc(1, OutBuffer.sizeof);
if (!b1)
err_nomem();
b1.reserve(4096);
}
if (b2)
b2.reset();
pseg.SDbuf = b1;
pseg.SDrel = b2;
}
else
{
pseg = cast(seg_data *)mem_calloc((seg_data).sizeof);
SegData[seg] = pseg;
if (!(ScnhdrTab[shtidx].Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA))
{
pseg.SDbuf = cast(OutBuffer*) calloc(1, OutBuffer.sizeof);
if (!pseg.SDbuf)
err_nomem();
pseg.SDbuf.reserve(4096);
}
}
//dbg_printf("\tNew segment - %d size %d\n", seg,SegData[seg].SDbuf);
pseg.SDseg = seg;
pseg.SDoffset = 0;
pseg.SDshtidx = shtidx;
pseg.SDaranges_offset = 0;
pseg.SDlinnum_data.reset();
//printf("SegData.length = %d\n", SegData.length);
return seg;
}
/********************************************
* Add new scnhdr.
* Returns:
* scnhdr number for added scnhdr
*/
@trusted
IDXSEC MsCoffObj_addScnhdr(const(char)* scnhdr_name, uint flags)
{
IMAGE_SECTION_HEADER sec;
memset(&sec, 0, (sec).sizeof);
size_t len = strlen(scnhdr_name);
if (len > 8)
{ // Use /nnnn form
IDXSTR idx = MsCoffObj_addstr(string_table, scnhdr_name);
sprintf(cast(char *)sec.Name, "/%d", idx);
}
else
memcpy(sec.Name.ptr, scnhdr_name, len);
sec.Characteristics = flags;
ScnhdrBuf.write(cast(void *)&sec, (sec).sizeof);
return ++scnhdr_cnt;
}
/********************************
* Define a new code segment.
* Input:
* name name of segment, if null then revert to default
* suffix 0 use name as is
* 1 append "_TEXT" to name
* Output:
* cseg segment index of new current code segment
* Offset(cseg) starting offset in cseg
* Returns:
* segment index of newly created code segment
*/
int MsCoffObj_codeseg(const char *name,int suffix)
{
//dbg_printf("MsCoffObj_codeseg(%s,%x)\n",name,suffix);
return 0;
}
/*********************************
* Define segments for Thread Local Storage.
* Output:
* seg_tlsseg set to segment number for TLS segment.
* Returns:
* segment for TLS segment
*/
@trusted
seg_data *MsCoffObj_tlsseg()
{
//printf("MsCoffObj_tlsseg\n");
if (seg_tlsseg == UNKNOWN)
{
seg_tlsseg = MsCoffObj_getsegment(".tls$AAB", IMAGE_SCN_CNT_INITIALIZED_DATA |
IMAGE_SCN_ALIGN_16BYTES |
IMAGE_SCN_MEM_READ |
IMAGE_SCN_MEM_WRITE);
}
return SegData[seg_tlsseg];
}
/*********************************
* Define segments for Thread Local Storage.
* Output:
* seg_tlsseg_bss set to segment number for TLS segment.
* Returns:
* segment for TLS segment
*/
seg_data *MsCoffObj_tlsseg_bss()
{
/* No thread local bss for MS-COFF
*/
return MsCoffObj_tlsseg();
}
seg_data *MsCoffObj_tlsseg_data()
{
// specific for Mach-O
assert(0);
}
/*************************************
* Return segment indices for .pdata and .xdata sections
*/
@trusted
segidx_t MsCoffObj_seg_pdata()
{
if (segidx_pdata == UNKNOWN)
{
segidx_pdata = MsCoffObj_getsegment(".pdata", IMAGE_SCN_CNT_INITIALIZED_DATA |
IMAGE_SCN_ALIGN_4BYTES |
IMAGE_SCN_MEM_READ);
}
return segidx_pdata;
}
@trusted
segidx_t MsCoffObj_seg_xdata()
{
if (segidx_xdata == UNKNOWN)
{
segidx_xdata = MsCoffObj_getsegment(".xdata", IMAGE_SCN_CNT_INITIALIZED_DATA |
IMAGE_SCN_ALIGN_4BYTES |
IMAGE_SCN_MEM_READ);
}
return segidx_xdata;
}
@trusted
segidx_t MsCoffObj_seg_pdata_comdat(Symbol *sfunc)
{
segidx_t seg = MsCoffObj_getsegment(".pdata", IMAGE_SCN_CNT_INITIALIZED_DATA |
IMAGE_SCN_ALIGN_4BYTES |
IMAGE_SCN_MEM_READ |
IMAGE_SCN_LNK_COMDAT);
SegData[seg].SDassocseg = sfunc.Sseg;
return seg;
}
@trusted
segidx_t MsCoffObj_seg_xdata_comdat(Symbol *sfunc)
{
segidx_t seg = MsCoffObj_getsegment(".xdata", IMAGE_SCN_CNT_INITIALIZED_DATA |
IMAGE_SCN_ALIGN_4BYTES |
IMAGE_SCN_MEM_READ |
IMAGE_SCN_LNK_COMDAT);
SegData[seg].SDassocseg = sfunc.Sseg;
return seg;
}
@trusted
segidx_t MsCoffObj_seg_debugS()
{
if (segidx_debugS == UNKNOWN)
{
segidx_debugS = MsCoffObj_getsegment(".debug$S", IMAGE_SCN_CNT_INITIALIZED_DATA |
IMAGE_SCN_ALIGN_1BYTES |
IMAGE_SCN_MEM_READ |
IMAGE_SCN_MEM_DISCARDABLE);
}
return segidx_debugS;
}
@trusted
segidx_t MsCoffObj_seg_debugS_comdat(Symbol *sfunc)
{
//printf("associated with seg %d\n", sfunc.Sseg);
segidx_t seg = MsCoffObj_getsegment(".debug$S", IMAGE_SCN_CNT_INITIALIZED_DATA |
IMAGE_SCN_ALIGN_1BYTES |
IMAGE_SCN_MEM_READ |
IMAGE_SCN_LNK_COMDAT |
IMAGE_SCN_MEM_DISCARDABLE);
SegData[seg].SDassocseg = sfunc.Sseg;
return seg;
}
segidx_t MsCoffObj_seg_debugT()
{
segidx_t seg = MsCoffObj_getsegment(".debug$T", IMAGE_SCN_CNT_INITIALIZED_DATA |
IMAGE_SCN_ALIGN_1BYTES |
IMAGE_SCN_MEM_READ |
IMAGE_SCN_MEM_DISCARDABLE);
return seg;
}
@trusted
segidx_t MsCoffObj_seg_drectve()
{
if (segidx_drectve == UNKNOWN)
{
segidx_drectve = MsCoffObj_getsegment(".drectve", IMAGE_SCN_LNK_INFO |
IMAGE_SCN_ALIGN_1BYTES |
IMAGE_SCN_LNK_REMOVE); // linker commands
}
return segidx_drectve;
}
/*******************************
* Output an alias definition record.
*/
void MsCoffObj_alias(const(char)* n1,const(char)* n2)
{
//printf("MsCoffObj_alias(%s,%s)\n",n1,n2);
assert(0);
static if (0) // NOT_DONE
{
uint len;
char *buffer;
buffer = cast(char *) alloca(strlen(n1) + strlen(n2) + 2 * ONS_OHD);
len = obj_namestring(buffer,n1);
len += obj_namestring(buffer + len,n2);
objrecord(ALIAS,buffer,len);
}
}
@trusted
private extern (D) char* unsstr(uint value)
{
__gshared char[64] buffer;
sprintf (buffer.ptr, "%d", value);
return buffer.ptr;
}
/*******************************
* Mangle a name.
* Returns:
* mangled name
*/
@trusted
private extern (D)
char *obj_mangle2(Symbol *s,char *dest)
{
size_t len;
const(char)* name;
//printf("MsCoffObj_mangle(s = %p, '%s'), mangle = x%x\n",s,s.Sident.ptr,type_mangle(s.Stype));
symbol_debug(s);
assert(dest);
version (SCPP)
name = CPP ? cpp_mangle(s) : &s.Sident[0];
else version (MARS)
// C++ name mangling is handled by front end
name = &s.Sident[0];
else
name = &s.Sident[0];
len = strlen(name); // # of bytes in name
//dbg_printf("len %d\n",len);
switch (type_mangle(s.Stype))
{
case mTYman_pas: // if upper case
case mTYman_for:
if (len >= DEST_LEN)
dest = cast(char *)mem_malloc(len + 1);
memcpy(dest,name,len + 1); // copy in name and ending 0
strupr(dest); // to upper case
break;
case mTYman_std:
if (!(config.flags4 & CFG4oldstdmangle) &&
config.exe == EX_WIN32 && tyfunc(s.ty()) &&
!variadic(s.Stype))
{
char *pstr = unsstr(type_paramsize(s.Stype));
size_t pstrlen = strlen(pstr);
size_t prelen = I32 ? 1 : 0;
size_t destlen = prelen + len + 1 + pstrlen + 1;
if (destlen > DEST_LEN)
dest = cast(char *)mem_malloc(destlen);
dest[0] = '_';
memcpy(dest + prelen,name,len);
dest[prelen + len] = '@';
memcpy(dest + prelen + 1 + len, pstr, pstrlen + 1);
break;
}
goto case;
case mTYman_cpp:
case mTYman_sys:
case_mTYman_c64:
case 0:
if (len >= DEST_LEN)
dest = cast(char *)mem_malloc(len + 1);
memcpy(dest,name,len+1);// copy in name and trailing 0
break;
case mTYman_c:
case mTYman_d:
if(I64)
goto case_mTYman_c64;
// Prepend _ to identifier
if (len >= DEST_LEN - 1)
dest = cast(char *)mem_malloc(1 + len + 1);
dest[0] = '_';
memcpy(dest + 1,name,len+1);// copy in name and trailing 0
break;
default:
debug
{
printf("mangling %x\n",type_mangle(s.Stype));
symbol_print(s);
}
printf("%d\n", type_mangle(s.Stype));
assert(0);
}
//dbg_printf("\t %s\n",dest);
return dest;
}
/*******************************
* Export a function name.
*/
@trusted
void MsCoffObj_export_symbol(Symbol *s,uint argsize)
{
char[DEST_LEN+1] dest = void;
char *destr = obj_mangle2(s, dest.ptr);
int seg = MsCoffObj_seg_drectve();
//printf("MsCoffObj_export_symbol(%s,%d)\n",s.Sident.ptr,argsize);
SegData[seg].SDbuf.write(" /EXPORT:".ptr, 9);
SegData[seg].SDbuf.write(dest.ptr, cast(uint)strlen(dest.ptr));
}
/*******************************
* Update data information about symbol
* align for output and assign segment
* if not already specified.
*
* Input:
* sdata data symbol
* datasize output size
* seg default seg if not known
* Returns:
* actual seg
*/
@trusted
segidx_t MsCoffObj_data_start(Symbol *sdata, targ_size_t datasize, segidx_t seg)
{
targ_size_t alignbytes;
//printf("MsCoffObj_data_start(%s,size %d,seg %d)\n",sdata.Sident.ptr,cast(int)datasize,seg);
//symbol_print(sdata);
assert(sdata.Sseg);
if (sdata.Sseg == UNKNOWN) // if we don't know then there
sdata.Sseg = seg; // wasn't any segment override
else
seg = sdata.Sseg;
targ_size_t offset = Offset(seg);
if (sdata.Salignment > 0)
{ if (SegData[seg].SDalignment < sdata.Salignment)
SegData[seg].SDalignment = sdata.Salignment;
alignbytes = ((offset + sdata.Salignment - 1) & ~(sdata.Salignment - 1)) - offset;
}
else
alignbytes = _align(datasize, offset) - offset;
if (alignbytes)
MsCoffObj_lidata(seg, offset, alignbytes);
sdata.Soffset = offset + alignbytes;
return seg;
}
/*******************************
* Update function info before codgen
*
* If code for this function is in a different segment
* than the current default in cseg, switch cseg to new segment.
*/
@trusted
void MsCoffObj_func_start(Symbol *sfunc)
{
//printf("MsCoffObj_func_start(%s)\n",sfunc.Sident.ptr);
symbol_debug(sfunc);
assert(sfunc.Sseg);
if (sfunc.Sseg == UNKNOWN)
sfunc.Sseg = CODE;
//printf("sfunc.Sseg %d CODE %d cseg %d Coffset x%x\n",sfunc.Sseg,CODE,cseg,Offset(cseg));
cseg = sfunc.Sseg;
assert(cseg == CODE || cseg > UDATA);
MsCoffObj_pubdef(cseg, sfunc, Offset(cseg));
sfunc.Soffset = Offset(cseg);
if (config.fulltypes)
cv8_func_start(sfunc);
}
/*******************************
* Update function info after codgen
*/
@trusted
void MsCoffObj_func_term(Symbol *sfunc)
{
//dbg_printf("MsCoffObj_func_term(%s) offset %x, Coffset %x symidx %d\n",
// sfunc.Sident.ptr, sfunc.Soffset,Offset(cseg),sfunc.Sxtrnnum);
if (config.fulltypes)
cv8_func_term(sfunc);
}
/********************************
* Output a public definition.
* Params:
* seg = segment index that symbol is defined in
* s = symbol
* offset = offset of name within segment
*/
@trusted
void MsCoffObj_pubdef(segidx_t seg, Symbol *s, targ_size_t offset)
{
//printf("MsCoffObj_pubdef(%d:x%x s=%p, %s)\n", seg, cast(int)offset, s, s.Sident.ptr);
//symbol_print(s);
symbol_debug(s);
s.Soffset = offset;
s.Sseg = seg;
switch (s.Sclass)
{
case SC.global:
case SC.inline:
symbuf.write((&s)[0 .. 1]);
break;
case SC.comdat:
case SC.comdef:
symbuf.write((&s)[0 .. 1]);
break;
default:
symbuf.write((&s)[0 .. 1]);
break;
}
//printf("%p\n", *cast(void**)symbuf.buf);
s.Sxtrnnum = 1;
}
void MsCoffObj_pubdefsize(int seg, Symbol *s, targ_size_t offset, targ_size_t symsize)
{
MsCoffObj_pubdef(seg, s, offset);
}
/*******************************
* Output an external symbol for name.
* Input:
* name Name to do EXTDEF on
* (Not to be mangled)
* Returns:
* Symbol table index of the definition
* NOTE: Numbers will not be linear.
*/
@trusted
int MsCoffObj_external_def(const(char)* name)
{
//printf("MsCoffObj_external_def('%s')\n",name);
assert(name);
Symbol *s = symbol_name(name[0 .. strlen(name)], SC.extern_, tspvoid);
symbuf.write((&s)[0 .. 1]);
return 0;
}
/*******************************
* Output an external for existing symbol.
* Input:
* s Symbol to do EXTDEF on
* (Name is to be mangled)
* Returns:
* Symbol table index of the definition
* NOTE: Numbers will not be linear.
*/
@trusted
int MsCoffObj_external(Symbol *s)
{
//printf("MsCoffObj_external('%s') %x\n",s.Sident.ptr,s.Svalue);
symbol_debug(s);
symbuf.write((&s)[0 .. 1]);
s.Sxtrnnum = 1;
return 1;
}
/*******************************
* Output a common block definition.
* Params:
* s = Symbol for common block
* size = size in bytes of each elem
* count = number of elems
* Returns:
* Symbol table index for symbol
*/
@trusted
int MsCoffObj_common_block(Symbol *s,targ_size_t size,targ_size_t count)
{
//printf("MsCoffObj_common_block('%s', size=%d, count=%d)\n",s.Sident.ptr,size,count);
symbol_debug(s);
// can't have code or thread local comdef's
assert(!(s.ty() & mTYthread));
s.Sfl = FLudata;
uint align_ = 16;
s.Sseg = MsCoffObj_getsegment(".bss$B", IMAGE_SCN_CNT_UNINITIALIZED_DATA |
IMAGE_SCN_LNK_COMDAT |
IMAGE_SCN_ALIGN_16BYTES |
IMAGE_SCN_MEM_READ |
IMAGE_SCN_MEM_WRITE);
if (s.Salignment > align_)
{
SegData[s.Sseg].SDalignment = s.Salignment;
assert(s.Salignment >= -1);
}
s.Soffset = SegData[s.Sseg].SDoffset;
SegData[s.Sseg].SDsym = s;
SegData[s.Sseg].SDoffset += count * size;
MsCoffObj_pubdef(s.Sseg, s, s.Soffset);
searchfixlist(s); // backpatch any refs to this symbol
return 1; // should return void
}
int MsCoffObj_common_block(Symbol *s, int flag, targ_size_t size, targ_size_t count)
{
return MsCoffObj_common_block(s, size, count);
}
/***************************************
* Append an iterated data block of 0s.
* (uninitialized data only)
*/
void MsCoffObj_write_zeros(seg_data *pseg, targ_size_t count)
{
MsCoffObj_lidata(pseg.SDseg, pseg.SDoffset, count);
}
/***************************************
* Output an iterated data block of 0s.
*
* For boundary alignment and initialization
*/
@trusted
void MsCoffObj_lidata(segidx_t seg,targ_size_t offset,targ_size_t count)
{
//printf("MsCoffObj_lidata(%d,%x,%d)\n",seg,offset,count);
size_t idx = SegData[seg].SDshtidx;
if ((ScnhdrTab[idx].Characteristics) & IMAGE_SCN_CNT_UNINITIALIZED_DATA)
{ // Use SDoffset to record size of bss section
SegData[seg].SDoffset += count;
}
else
{
MsCoffObj_bytes(seg, offset, cast(uint)count, null);
}
}
/***********************************
* Append byte to segment.
*/
void MsCoffObj_write_byte(seg_data *pseg, uint byte_)
{
MsCoffObj_byte(pseg.SDseg, pseg.SDoffset, byte_);
}
/************************************
* Output byte_ to object file.
*/
@trusted
void MsCoffObj_byte(segidx_t seg,targ_size_t offset,uint byte_)
{
OutBuffer *buf = SegData[seg].SDbuf;
int save = cast(int)buf.length();
//dbg_printf("MsCoffObj_byte(seg=%d, offset=x%lx, byte=x%x)\n",seg,offset,byte_);
buf.setsize(cast(uint)offset);
buf.writeByte(byte_);
if (save > offset+1)
buf.setsize(save);
else
SegData[seg].SDoffset = offset+1;
//dbg_printf("\tsize now %d\n",buf.length());
}
/***********************************
* Append bytes to segment.
*/
void MsCoffObj_write_bytes(seg_data *pseg, uint nbytes, void *p)
{
MsCoffObj_bytes(pseg.SDseg, pseg.SDoffset, nbytes, p);
}
/************************************
* Output bytes to object file.
* Returns:
* nbytes
*/
@trusted
uint MsCoffObj_bytes(segidx_t seg, targ_size_t offset, uint nbytes, void *p)
{
static if (0)
{
if (!(seg >= 0 && seg < SegData.length))
{ printf("MsCoffObj_bytes: seg = %d, SegData.length = %d\n", seg, SegData.length);
*cast(char*)0=0;
}
}
assert(seg >= 0 && seg < SegData.length);
OutBuffer *buf = SegData[seg].SDbuf;
if (buf == null)
{
//printf("MsCoffObj_bytes(seg=%d, offset=x%llx, nbytes=%d, p=x%x)\n", seg, offset, nbytes, p);
//raise(SIGSEGV);
assert(buf != null);
}
int save = cast(int)buf.length();
//dbg_printf("MsCoffObj_bytes(seg=%d, offset=x%lx, nbytes=%d, p=x%x)\n",
//seg,offset,nbytes,p);
buf.position(cast(size_t)offset, nbytes);
if (p)
buf.write(p, nbytes);
else // Zero out the bytes
buf.writezeros(nbytes);
if (save > offset+nbytes)
buf.setsize(save);
else
SegData[seg].SDoffset = offset+nbytes;
return nbytes;
}
/*********************************************
* Add a relocation entry for seg/offset.
*/
@trusted
void MsCoffObj_addrel(segidx_t seg, targ_size_t offset, Symbol *targsym,
uint targseg, int rtype, int val)
{
//printf("addrel()\n");
if (!targsym)
{ // Generate one
targsym = symbol_generate(SC.static_, tstypes[TYint]);
targsym.Sseg = targseg;
targsym.Soffset = val;
symbuf.write((&targsym)[0 .. 1]);
}
Relocation rel = void;
rel.offset = offset;
rel.targsym = targsym;
rel.targseg = targseg;
rel.rtype = cast(ubyte)rtype;
rel.funcsym = funcsym_p;
rel.val = cast(short)val;
seg_data *pseg = SegData[seg];
if (!pseg.SDrel)
{
pseg.SDrel = cast(OutBuffer*) calloc(1, OutBuffer.sizeof);
if (!pseg.SDrel)
err_nomem();
}
pseg.SDrel.write((&rel)[0 .. 1]);
}
/****************************************
* Sort the relocation entry buffer.
*/
extern (C) {
@trusted
private int mscoff_rel_fp(scope const(void*) e1, scope const(void*) e2)
{ Relocation *r1 = cast(Relocation *)e1;
Relocation *r2 = cast(Relocation *)e2;
return cast(int)(r1.offset - r2.offset);
}
}
/*******************************
* Refer to address that is in the data segment.
* Input:
* seg:offset = the address being fixed up
* val = displacement from start of target segment
* targetdatum = target segment number (DATA, CDATA or UDATA, etc.)
* flags = CFoff, CFseg
* Example:
* int *abc = &def[3];
* to allocate storage:
* MsCoffObj_reftodatseg(DATA,offset,3 * (int *).sizeof,UDATA);
*/
@trusted
void MsCoffObj_reftodatseg(segidx_t seg,targ_size_t offset,targ_size_t val,
uint targetdatum,int flags)
{
OutBuffer *buf = SegData[seg].SDbuf;
int save = cast(int)buf.length();
buf.setsize(cast(uint)offset);
static if (0)
{
printf("MsCoffObj_reftodatseg(seg:offset=%d:x%llx, val=x%llx, targetdatum %x, flags %x )\n",
seg,offset,val,targetdatum,flags);
}
assert(seg != 0);
if (SegData[seg].isCode() && SegData[targetdatum].isCode())
{
assert(0);
}
MsCoffObj_addrel(seg, offset, null, targetdatum, RELaddr, 0);
if (I64)
{
if (flags & CFoffset64)
{
buf.write64(val);
if (save > offset + 8)
buf.setsize(save);
return;
}
}
buf.write32(cast(int)val);
if (save > offset + 4)
buf.setsize(save);
}
/*******************************
* Refer to address that is in the current function code (funcsym_p).
* Only offsets are output, regardless of the memory model.
* Used to put values in switch address tables.
* Input:
* seg = where the address is going (CODE or DATA)
* offset = offset within seg
* val = displacement from start of this module
*/
@trusted
void MsCoffObj_reftocodeseg(segidx_t seg,targ_size_t offset,targ_size_t val)
{
//printf("MsCoffObj_reftocodeseg(seg=%d, offset=x%lx, val=x%lx )\n",seg,cast(uint)offset,cast(uint)val);
assert(seg > 0);
OutBuffer *buf = SegData[seg].SDbuf;
int save = cast(int)buf.length();
buf.setsize(cast(uint)offset);
val -= funcsym_p.Soffset;
if (I32)
MsCoffObj_addrel(seg, offset, funcsym_p, 0, RELaddr, 0);
// MsCoffObj_addrel(seg, offset, funcsym_p, 0, RELaddr);
// if (I64)
// buf.write64(val);
// else
buf.write32(cast(int)val);
if (save > offset + 4)
buf.setsize(save);
}
/*******************************
* Refer to an identifier.
* Params:
* seg = where the address is going (CODE or DATA)
* offset = offset within seg
* s = Symbol table entry for identifier
* val = displacement from identifier
* flags = CFselfrel: self-relative
* CFseg: get segment
* CFoff: get offset
* CFpc32: [RIP] addressing, val is 0, -1, -2 or -4
* CFoffset64: 8 byte offset for 64 bit builds
* Returns:
* number of bytes in reference (4 or 8)
*/
@trusted
int MsCoffObj_reftoident(segidx_t seg, targ_size_t offset, Symbol *s, targ_size_t val,
int flags)
{
int refsize = (flags & CFoffset64) ? 8 : 4;
if (flags & CFseg)
refsize += 2;
static if (0)
{
printf("\nMsCoffObj_reftoident('%s' seg %d, offset x%llx, val x%llx, flags x%x)\n",
s.Sident.ptr,seg,cast(ulong)offset,cast(ulong)val,flags);
//printf("refsize = %d\n", refsize);
//dbg_printf("Sseg = %d, Sxtrnnum = %d\n",s.Sseg,s.Sxtrnnum);
//symbol_print(s);
}
assert(seg > 0);
if (s.Sclass != SC.locstat && !s.Sxtrnnum)
{ // It may get defined later as public or local, so defer
size_t numbyteswritten = addtofixlist(s, offset, seg, val, flags);
assert(numbyteswritten == refsize);
}
else
{
if (I64 || I32)
{
//if (s.Sclass != SCcomdat)
//val += s.Soffset;
int v = 0;
if (flags & CFpc32)
{
v = -((flags & CFREL) >> 24);
assert(v >= -5 && v <= 0);
}
if (flags & CFselfrel)
{
MsCoffObj_addrel(seg, offset, s, 0, RELrel, v);
}
else if ((flags & (CFseg | CFoff)) == (CFseg | CFoff))
{
MsCoffObj_addrel(seg, offset, s, 0, RELaddr32, v);
MsCoffObj_addrel(seg, offset + 4, s, 0, RELseg, v);
refsize = 6; // 4 bytes for offset, 2 for section
}
else
{
MsCoffObj_addrel(seg, offset, s, 0, RELaddr, v);
}
}
else
{
if (SegData[seg].isCode() && flags & CFselfrel)
{
seg_data *pseg = SegData[jumpTableSeg];
val -= offset + 4;
MsCoffObj_addrel(seg, offset, null, jumpTableSeg, RELrel, 0);
}
else if (SegData[seg].isCode() &&
((s.Sclass != SC.extern_ && SegData[s.Sseg].isCode()) || s.Sclass == SC.locstat ||
s.Sclass == SC.static_))
{
val += s.Soffset;
MsCoffObj_addrel(seg, offset, null, s.Sseg, RELaddr, 0);
}
else if (SegData[seg].isCode() && !tyfunc(s.ty()))
{
seg_data *pseg = SegData[pointersSeg];
if (!indirectsymbuf2)
{
indirectsymbuf2 = cast(OutBuffer*) calloc(1, OutBuffer.sizeof);
if (!indirectsymbuf2)
err_nomem();
}
else
{ // Look through indirectsym to see if it is already there
int n = cast(int)(indirectsymbuf2.length() / (Symbol *).sizeof);
Symbol **psym = cast(Symbol **)indirectsymbuf2.buf;
for (int i = 0; i < n; i++)
{ // Linear search, pretty pathetic
if (s == psym[i])
{ val = i * 4;
goto L2;
}
}
}
val = pseg.SDbuf.length();
pseg.SDbuf.writezeros(_tysize[TYnptr]);
// Add symbol s to indirectsymbuf2
indirectsymbuf2.write((&s)[0 .. 1]);
L2:
//printf("MsCoffObj_reftoident: seg = %d, offset = x%x, s = %s, val = x%x, pointersSeg = %d\n", seg, offset, s.Sident.ptr, val, pointersSeg);
MsCoffObj_addrel(seg, offset, null, pointersSeg, RELaddr, 0);
}
else
{ //val -= s.Soffset;
// MsCoffObj_addrel(seg, offset, s, 0, RELaddr, 0);
}
}
OutBuffer *buf = SegData[seg].SDbuf;
int save = cast(int)buf.length();
buf.setsize(cast(uint)offset);
//printf("offset = x%llx, val = x%llx\n", offset, val);
if (refsize == 8)
buf.write64(val);
else if (refsize == 4)
buf.write32(cast(int)val);
else if (refsize == 6)
{
buf.write32(cast(int)val);
buf.write16(0);
}
else
assert(0);
if (save > offset + refsize)
buf.setsize(save);
}
return refsize;
}
/*****************************************
* Generate far16 thunk.
* Input:
* s Symbol to generate a thunk for
*/
void MsCoffObj_far16thunk(Symbol *s)
{
//dbg_printf("MsCoffObj_far16thunk('%s')\n", s.Sident.ptr);
assert(0);
}
/**************************************
* Mark object file as using floating point.
*/
@trusted
void MsCoffObj_fltused()
{
//dbg_printf("MsCoffObj_fltused()\n");
/* Otherwise, we'll get the dreaded
* "runtime error R6002 - floating point support not loaded"
*/
if (!floatused)
{
MsCoffObj_external_def("_fltused");
floatused = 1;
}
}
@trusted
int elf_align(int size, int foffset)
{
if (size <= 1)
return foffset;
int offset = (foffset + size - 1) & ~(size - 1);
//printf("offset = x%lx, foffset = x%lx, size = x%lx\n", offset, foffset, cast(int)size);
if (offset > foffset)
fobjbuf.writezeros(offset - foffset);
return offset;
}
/***************************************
* Stuff pointer to ModuleInfo in its own segment.
* Input:
* scc symbol for ModuleInfo
*/
version (MARS)
{
@trusted
void MsCoffObj_moduleinfo(Symbol *scc)
{
int align_ = I64 ? IMAGE_SCN_ALIGN_8BYTES : IMAGE_SCN_ALIGN_4BYTES;
/* Module info sections
*/
const int seg =
MsCoffObj_getsegment(".minfo$B", IMAGE_SCN_CNT_INITIALIZED_DATA |
align_ |
IMAGE_SCN_MEM_READ);
//printf("MsCoffObj_moduleinfo(%s) seg = %d:x%x\n", scc.Sident.ptr, seg, Offset(seg));
int flags = CFoff;
if (I64)
flags |= CFoffset64;
SegData[seg].SDoffset += MsCoffObj_reftoident(seg, Offset(seg), scc, 0, flags);
}
}
/**********************************
* Reset code seg to existing seg.
* Used after a COMDAT for a function is done.
*/
@trusted
void MsCoffObj_setcodeseg(int seg)
{
assert(0 < seg && seg < SegData.length);
cseg = seg;
}
Symbol *MsCoffObj_tlv_bootstrap()
{
// specific for Mach-O
assert(0);
}
/*****************************************
* write a reference to a mutable pointer into the object file
* Params:
* s = symbol that contains the pointer
* soff = offset of the pointer inside the Symbol's memory
*/
@trusted
void MsCoffObj_write_pointerRef(Symbol* s, uint soff)
{
if (!ptrref_buf)
{
ptrref_buf = cast(OutBuffer*) calloc(1, OutBuffer.sizeof);
if (!ptrref_buf)
err_nomem();
}
// defer writing pointer references until the symbols are written out
ptrref_buf.write((&s)[0 .. 1]);
ptrref_buf.write32(soff);
}
/*****************************************
* flush a single pointer reference saved by write_pointerRef
* to the object file
* Params:
* s = symbol that contains the pointer
* soff = offset of the pointer inside the Symbol's memory
*/
@trusted
extern (D) private void objflush_pointerRef(Symbol* s, uint soff)
{
bool isTls = (s.Sfl == FLtlsdata);
const(char)* segname = isTls ? ".tp$B" : ".dp$B";
int attr = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_ALIGN_4BYTES | IMAGE_SCN_MEM_READ;
int seg = MsCoffObj_getsegment(segname, attr);
targ_size_t offset = SegData[seg].SDoffset;
MsCoffObj_addrel(seg, offset, s, cast(uint)offset, RELaddr32, 0);
OutBuffer* buf = SegData[seg].SDbuf;
buf.setsize(cast(uint)offset);
buf.write32(soff);
SegData[seg].SDoffset = buf.length();
}
/*****************************************
* flush all pointer references saved by write_pointerRef
* to the object file
*/
@trusted
extern (D) private void objflush_pointerRefs()
{
if (!ptrref_buf)
return;
ubyte *p = ptrref_buf.buf;
ubyte *end = ptrref_buf.buf + ptrref_buf.length();
while (p < end)
{
Symbol* s = *cast(Symbol**)p;
p += s.sizeof;
uint soff = *cast(uint*)p;
p += soff.sizeof;
objflush_pointerRef(s, soff);
}
ptrref_buf.reset();
}
}
| D |
/home/jawaher/example-helloworld/src/program-rust/target/release/build/bv-5853bf9e319aa78e/build_script_build-5853bf9e319aa78e: /home/jawaher/.cargo/registry/src/github.com-1ecc6299db9ec823/bv-0.11.1/build.rs
/home/jawaher/example-helloworld/src/program-rust/target/release/build/bv-5853bf9e319aa78e/build_script_build-5853bf9e319aa78e.d: /home/jawaher/.cargo/registry/src/github.com-1ecc6299db9ec823/bv-0.11.1/build.rs
/home/jawaher/.cargo/registry/src/github.com-1ecc6299db9ec823/bv-0.11.1/build.rs:
| D |
func void zs_iepfeiffer()
{
PrintDebugNpc(PD_TA_FRAME,"ZS_IEPFEIFFER");
AI_SetWalkMode(self,NPC_WALK);
AI_GotoWP(self,self.wp);
AI_AlignToWP(self);
};
func int ZS_IEPFEIFFER_Loop()
{
PrintDebugNpc(PD_TA_LOOP,"ZS_IEPFEIFFER_Loop");
if(InExtremoPlaying)
{
AI_UseMob(self,"MPIPE",1);
AI_UseMob(self,"MPIPE",1);
AI_UseMob(self,"MPIPE",2);
AI_UseMob(self,"MPIPE",1);
AI_UseMob(self,"MPIPE",2);
AI_UseMob(self,"MPIPE",3);
AI_UseMob(self,"MPIPE",4);
AI_UseMob(self,"MPIPE",3);
AI_UseMob(self,"MPIPE",4);
AI_UseMob(self,"MPIPE",3);
AI_UseMob(self,"MPIPE",4);
AI_UseMob(self,"MPIPE",3);
AI_UseMob(self,"MPIPE",4);
AI_UseMob(self,"MPIPE",3);
AI_UseMob(self,"MPIPE",4);
AI_UseMob(self,"MPIPE",5);
AI_UseMob(self,"MPIPE",4);
AI_UseMob(self,"MPIPE",5);
AI_UseMob(self,"MPIPE",4);
AI_UseMob(self,"MPIPE",3);
AI_UseMob(self,"MPIPE",4);
AI_UseMob(self,"MPIPE",3);
AI_UseMob(self,"MPIPE",4);
AI_UseMob(self,"MPIPE",3);
AI_UseMob(self,"MPIPE",4);
AI_UseMob(self,"MPIPE",3);
AI_UseMob(self,"MPIPE",4);
AI_UseMob(self,"MPIPE",6);
AI_UseMob(self,"MPIPE",5);
AI_UseMob(self,"MPIPE",6);
AI_UseMob(self,"MPIPE",7);
AI_UseMob(self,"MPIPE",6);
AI_UseMob(self,"MPIPE",7);
AI_UseMob(self,"MPIPE",2);
AI_UseMob(self,"MPIPE",3);
AI_UseMob(self,"MPIPE",2);
AI_UseMob(self,"MPIPE",3);
AI_UseMob(self,"MPIPE",2);
AI_UseMob(self,"MPIPE",3);
AI_UseMob(self,"MPIPE",-1);
};
return LOOP_CONTINUE;
};
func void ZS_IEPFEIFFER_End()
{
AI_UseMob(self,"MPIPE",-1);
PrintDebugNpc(PD_TA_FRAME,"ZS_IEPFEIFFER_End");
};
| D |
// Written in the D programming language.
module zbasud;
import std.algorithm: startsWith, map, filter;
import std.array: join, replace;
import std.datetime: SysTime;
import std.exception: enforce;
import std.file: chdir, read, write, readText, exists, timeLastModified;
import std.getopt: getopt;
import std.path: dirSeparator, extension, stripExtension, setExtension;
import std.process: environment, system;
import std.stdio: writeln;
import std.typecons: Tuple, tuple;
import ctpg;
import msgpack: pack, unpack;
enum projectFileName = ".vimprojects";
enum dataFileName = ".zbasud.msgpack";
struct Parsers
{
mixin(generateParsers(q{
@default_skip(defaultSkip)
Data root = project* $ >> makeAA >> Data;
Project project = projectName !"=" projectPath !"{\n" imports libs sourceFile* !"}" >> Project;
string projectName = (^"=" any)+ >> join;
string projectPath = (^"{" any)+ >> join;
@default_skip(^"\n" defaultSkip)
string[] imports = !"#imports" _import*<","> !("\n"+);
string _import = (^"," ^"\n" any)+ >> join;
string[] libs = !"#libs" lib*<","> !("\n"+);
string lib = (^"," ^"\n" any)+ >> join;
SourceFile sourceFile = (^"}" ^"\n" any)+ >> join >> SourceFile;
}));
unittest
{
{
auto r = parse!sourceFile("src/zbasud.d\n");
assert(r.match);
assert(r.value.path == "src/zbasud.d");
}
{
auto r = parse!imports("#imports src, ctpg/src,msgpack-d/src\n");
assert(r.match);
assert(r.value == ["src", "ctpg/src", "msgpack-d/src"]);
}
{
auto r = parse!libs("#libs ctpg/ctpg.lib, msgpack-d/msgpack.lib\n");
assert(r.match);
assert(r.value == ["ctpg/ctpg.lib", "msgpack-d/msgpack.lib"]);
}
{
auto r = parse!project(
`zbasud=~/zbasud {
#imports src,ctpg/src,msgpack-d/src
#libs ctpg/ctpg.lib,msgpack-d/msgpack.lib
src/zbasud.d
}`
);
assert(r.match);
assert(r.value.name == "zbasud");
assert(r.value.path == "~/zbasud");
assert(r.value.imports == ["src", "ctpg/src", "msgpack-d/src"]);
assert(r.value.libs == ["ctpg/ctpg.lib", "msgpack-d/msgpack.lib"]);
assert(r.value.files[0].path == "src/zbasud.d");
}
{
auto r = parse!root(`
ctpg=~/ctpg {
#imports src
#libs
src/ctpg.d
}
ciprad=~/ciprad {
#imports src
#libs
src/ciprad.d
}
zbasud=~/zbasud {
#imports src, ctpg/src, msgpack-d/src
#libs ctpg/ctpg.lib, msgpack-d/msgpack.lib
src/zbasud.d
}
`);
assert(r.match);
assert(r.value.projects.length == 3);
assert(r.value.projects["ctpg"].path == "~/ctpg");
assert(r.value.projects["ctpg"].imports == ["src"]);
assert(r.value.projects["ctpg"].libs.length == 0);
assert(r.value.projects["ctpg"].files.length == 1);
assert(r.value.projects["ctpg"].files[0].path == "src/ctpg.d");
assert(r.value.projects["ciprad"].path == "~/ciprad");
assert(r.value.projects["ciprad"].imports == ["src"]);
assert(r.value.projects["ciprad"].libs.length == 0);
assert(r.value.projects["ciprad"].files.length == 1);
assert(r.value.projects["ciprad"].files[0].path == "src/ciprad.d");
assert(r.value.projects["zbasud"].path == "~/zbasud");
assert(r.value.projects["zbasud"].imports == ["src", "ctpg/src", "msgpack-d/src"]);
assert(r.value.projects["zbasud"].libs == ["ctpg/ctpg.lib", "msgpack-d/msgpack.lib"]);
assert(r.value.projects["zbasud"].files.length == 1);
assert(r.value.projects["zbasud"].files[0].path == "src/zbasud.d");
}
}
}
struct Data
{
Project[string] projects;
long modified;
}
struct Project
{
string name;
string path;
string[] imports;
string[] libs;
SourceFile[] files;
}
struct SourceFile
{
string path;
string objPath;
long modified;
}
Project[string] makeAA(Project[] projects)
{
typeof(return) aa;
foreach(project; projects){
aa[project.name] = project;
}
return aa;
}
void main(string[] args)
{
auto release = false, run = false, all = false;
getopt(args, "release", &release, "run", &run, "all", &all);
enforce(args.length >= 2, "too few arguments");
immutable target = args[1];
version(Windows){
immutable prefix = environment["USERPROFILE"], objExt = "obj";
}else version(Posix){
immutable prefix = environment["HOME"], objExt = "o";
}else{
static assert(false);
}
immutable projectFile = prefix ~ dirSeparator ~ projectFileName;
immutable dataFile = prefix ~ dirSeparator ~ dataFileName;
projectFile.exists().enforce(projectFile ~ " not found");
auto data = Data.init;
if(dataFile.exists()){
unpack(cast(ubyte[])dataFile.read(), data);
"DataFileLoadedFromFile".writeln();
}
immutable modified = projectFile.timeLastModified().stdTime;
auto recreated = false;
if(modified > data.modified){
recreated = true;
"DataFileRecreated".writeln();
auto result = projectFile.readText().parse!(Parsers.root)();
data = result.value;
data.modified = modified;
foreach(ref project; data.projects.byValue()){
if(project.path.startsWith('~'))
{
project.path = prefix ~ project.path[1..$];
}
foreach(ref file; project.files)
{
file.modified = (project.path ~ dirSeparator ~ file.path).timeLastModified().stdTime;
if(file.path.extension() == ".d")
{
file.objPath = "obj" ~ dirSeparator ~ file.path.stripExtension().setExtension(objExt);
}
}
}
dataFile.write(pack(data));
}
auto project = data.projects[target];
chdir(project.path);
runCommands(project, all, release, recreated);
}
void runCommands(Project project, in bool isAll, in bool isRelease, in bool isForce)
{
immutable imports = project.imports.map!q{"-I" ~ a}().join(" ");
immutable libs = project.libs.join(" ");
version(Windows)
{
immutable name = project.name.replace('/', '\\');
}
else
{
immutable name = project.name;
}
if(isRelease)
{
system(getReleaseCommand(name, project.files, imports, libs));
}
else
{
if(isAll)
{
system(getDebugAllCommand(name, project.files, imports, libs));
}
else
{
foreach(file; project.files)
{
if(file.path.extension() == ".d" && (isForce || !file.objPath.exists() || file.modified < file.path.timeLastModified().stdTime))
{
system(getDebugCompileCommand(file.path, imports));
}
}
system(getDebugCommand(name, project.files, libs));
}
}
}
string getDebugAllCommand(in string name, SourceFile[] files, string imports, string libs)
{
return "dmd -debug -g -unittest -of" ~ name ~ " " ~ imports ~ " " ~ libs ~ " " ~ files.filter!(file => file.path.extension() == ".d")().map!(file => file.path)().join(" ");
}
string getDebugCompileCommand(in string path, in string imports)
{
return "dmd -c -debug -g -unittest -op -odobj " ~ imports ~ " " ~ path;
}
unittest
{
assert(getDebugCompileCommand("src/hoge.d", "-Isrc -Ifuga/src") == "dmd -c -debug -g -unittest -op -odobj -Isrc -Ifuga/src src/hoge.d");
assert(getDebugCompileCommand("src/foo.d", "-Isrc -Ibar/src") == "dmd -c -debug -g -unittest -op -odobj -Isrc -Ibar/src src/foo.d");
}
string getDebugCommand(string name, SourceFile[] files, string libs)
{
return "dmd -of" ~ name ~ " " ~ libs ~ " " ~ files.filter!(file => file.path.extension() == ".d")().map!(file => file.objPath)().join(" ");
}
string getReleaseCommand(in string name, SourceFile[] files, in string imports, in string libs)
{
return "dmd -O -release -inline -of" ~ name ~ " " ~ imports ~ " " ~ libs ~ " " ~ files.filter!(file => file.path.extension() == ".d")().map!(file => file.path)().join(" ");
}
unittest
{
assert(getReleaseCommand("hoge", [SourceFile("src/hoge.d")], "-Isrc", "a.lib") == "dmd -O -release -inline -ofhoge -Isrc a.lib src/hoge.d");
}
| D |
INSTANCE Info_Mod_Vincent_Hi (C_INFO)
{
npc = Mod_7379_OUT_Vincent_REL;
nr = 1;
condition = Info_Mod_Vincent_Hi_Condition;
information = Info_Mod_Vincent_Hi_Info;
permanent = 0;
important = 0;
description = "Wer bist du?";
};
FUNC INT Info_Mod_Vincent_Hi_Condition()
{
return 1;
};
FUNC VOID Info_Mod_Vincent_Hi_Info()
{
B_Say (hero, self, "$WHOAREYOU");
AI_Output(self, hero, "Info_Mod_Vincent_Hi_13_01"); //Hehe, ich bin Vincent, Jäger von Beruf.
if (Mod_Schwierigkeit != 4)
{
AI_Output(self, hero, "Info_Mod_Vincent_Hi_13_02"); //Wenn du willst, kannst du von mir lernen, geschickter den Bogen zu führen.
Log_CreateTopic (TOPIC_MOD_LEHRER_RELENDEL, LOG_NOTE);
B_LogEntry (TOPIC_MOD_LEHRER_RELENDEL, "Der Jäger Vincent kann mir beim Umgang mit dem Bogen helfen.");
};
};
INSTANCE Info_Mod_Vincent_Landvermessung (C_INFO)
{
npc = Mod_7379_OUT_Vincent_REL;
nr = 1;
condition = Info_Mod_Vincent_Landvermessung_Condition;
information = Info_Mod_Vincent_Landvermessung_Info;
permanent = 0;
important = 0;
description = "Anselm schickt mich.";
};
FUNC INT Info_Mod_Vincent_Landvermessung_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Vincent_Hi))
&& (Npc_KnowsInfo(hero, Info_Mod_Anselm_Landvermessung))
{
return 1;
};
};
FUNC VOID Info_Mod_Vincent_Landvermessung_Info()
{
AI_Output(hero, self, "Info_Mod_Vincent_Landvermessung_15_00"); //Anselm schickt mich. Ich soll für ihn in Erfahrung bringen, was für eine Fläche Khoratas Umland hat.
AI_Output(self, hero, "Info_Mod_Vincent_Landvermessung_13_01"); //(leise) Hihihihihi ...
AI_Output(hero, self, "Info_Mod_Vincent_Landvermessung_15_02"); //Was ist?
AI_Output(self, hero, "Info_Mod_Vincent_Landvermessung_13_03"); //(lauter) Hahahaha ...
AI_Output(hero, self, "Info_Mod_Vincent_Landvermessung_15_04"); //WAS IST???
AI_Output(self, hero, "Info_Mod_Vincent_Landvermessung_13_05"); //Nichts, nein, gar nichts ... hohoho ... (unterdrückt mühsam einen Lachanfall) Du kannst ... hehe ... sag ihm, Khoratas Umland hat eine Fläche von fünf Quadratmeilen. (Pause, dann prustet er los)
AI_Output(hero, self, "Info_Mod_Vincent_Landvermessung_15_06"); //Na schön.
B_LogEntry (TOPIC_MOD_KHORATA_LANDVERMESSUNG, "Fünf Quadratmeilen. Wie lustig.");
};
INSTANCE Info_Mod_Vincent_Schweine (C_INFO)
{
npc = Mod_7379_OUT_Vincent_REL;
nr = 1;
condition = Info_Mod_Vincent_Schweine_Condition;
information = Info_Mod_Vincent_Schweine_Info;
permanent = 0;
important = 0;
description = "Ich habe gehört, du arbeitest nicht mehr richtig.";
};
FUNC INT Info_Mod_Vincent_Schweine_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Henrik_Hi))
&& (Mod_Henrik_Schweine == 1)
{
return 1;
};
};
FUNC VOID Info_Mod_Vincent_Schweine_Info()
{
AI_Output(hero, self, "Info_Mod_Vincent_Schweine_15_00"); //Ich habe gehört, du arbeitest nicht mehr richtig.
AI_Output(self, hero, "Info_Mod_Vincent_Schweine_13_01"); //Kann sein. Egal! Hihihi.
AI_Output(hero, self, "Info_Mod_Vincent_Schweine_15_02"); //Irgendjemand muss aber deine Arbeit übernehmen.
AI_Output(self, hero, "Info_Mod_Vincent_Schweine_13_03"); //Ja, wirklich? (Pause) Ich hab' 'ne tolle Idee: Du übernimmst das!
AI_Output(self, hero, "Info_Mod_Vincent_Schweine_13_04"); //Hier!
B_GiveInvItems (self, hero, ItRw_Bow_L_03, 1);
AI_Output(self, hero, "Info_Mod_Vincent_Schweine_13_05"); //Und hier!
B_GiveInvItems (self, hero, ItRw_Arrow, 30);
AI_Output(self, hero, "Info_Mod_Vincent_Schweine_13_06"); //Und keine Widerrede! Lass mich in Ruhe! (kichert)
};
INSTANCE Info_Mod_Vincent_Freudenspender (C_INFO)
{
npc = Mod_7379_OUT_Vincent_REL;
nr = 1;
condition = Info_Mod_Vincent_Freudenspender_Condition;
information = Info_Mod_Vincent_Freudenspender_Info;
permanent = 0;
important = 0;
description = "Du brauchst doch sicher noch Freudenspender-Nachschub.";
};
FUNC INT Info_Mod_Vincent_Freudenspender_Condition()
{
if (Npc_HasItems(hero, ItMi_Freudenspender) >= 1)
&& (Mod_Freudenspender < 5)
&& (Npc_KnowsInfo(hero, Info_Mod_Sabine_Hi))
{
return TRUE;
};
};
FUNC VOID Info_Mod_Vincent_Freudenspender_Info()
{
AI_Output(hero, self, "Info_Mod_Vincent_Freudenspender_15_00"); //Du brauchst doch sicher noch Freudenspender-Nachschub.
AI_Output(self, hero, "Info_Mod_Vincent_Freudenspender_13_01"); //Richtig - Haha! Dann muss ich ja heute gar nicht mehr in die Stadt.
B_GiveInvItems (hero, self, ItMi_Freudenspender, 1);
B_GiveInvItems (self, hero, ItMi_Gold, 10);
Mod_Freudenspender += 1;
};
INSTANCE Info_Mod_Vincent_Lernen_Bogen (C_INFO)
{
npc = Mod_7379_OUT_Vincent_REL;
nr = 1;
condition = Info_Mod_Vincent_Lernen_Bogen_Condition;
information = Info_Mod_Vincent_Lernen_Bogen_Info;
permanent = 1;
important = 0;
description = "Lehre mich, geschickter im Umgang mit dem Bogen zu werden.";
};
FUNC INT Info_Mod_Vincent_Lernen_Bogen_Condition()
{
if (Npc_KnowsInfo(hero, Info_Mod_Vincent_Hi))
&& (hero.hitchance[NPC_TALENT_BOW] < 100)
&& (Mod_Schwierigkeit != 4)
{
return 1;
};
};
FUNC VOID Info_Mod_Vincent_Lernen_Bogen_Info()
{
AI_Output(hero, self, "Info_Mod_Vincent_Lernen_Bogen_15_00"); //Lehre mich, geschickter im Umgang mit dem Bogen zu werden.
Info_ClearChoices (Info_Mod_Vincent_Lernen_Bogen);
Info_AddChoice (Info_Mod_Vincent_Lernen_Bogen, "Zurück.", Info_Mod_Vincent_Lernen_Bogen_BACK);
Info_AddChoice (Info_Mod_Vincent_Lernen_Bogen, B_BuildLearnString(PRINT_LearnBow5, B_GetLearnCostTalent_New(hero, NPC_TALENT_BOW)), Info_Mod_Vincent_Lernen_Bogen_5);
Info_AddChoice (Info_Mod_Vincent_Lernen_Bogen, B_BuildLearnString(PRINT_LearnBow1, B_GetLearnCostTalent(hero, NPC_TALENT_BOW, 1)), Info_Mod_Vincent_Lernen_Bogen_1);
};
FUNC VOID Info_Mod_Vincent_Lernen_Bogen_BACK()
{
Info_ClearChoices (Info_Mod_Vincent_Lernen_Bogen);
};
FUNC VOID Info_Mod_Vincent_Lernen_Bogen_5()
{
B_TeachFightTalentPercent_New (self, hero, NPC_TALENT_BOW, 5, 100);
Info_ClearChoices (Info_Mod_Vincent_Lernen_Bogen);
Info_AddChoice (Info_Mod_Vincent_Lernen_Bogen, "Zurück.", Info_Mod_Vincent_Lernen_Bogen_BACK);
Info_AddChoice (Info_Mod_Vincent_Lernen_Bogen, B_BuildLearnString(PRINT_LearnBow5, B_GetLearnCostTalent_New(hero, NPC_TALENT_BOW)), Info_Mod_Vincent_Lernen_Bogen_5);
Info_AddChoice (Info_Mod_Vincent_Lernen_Bogen, B_BuildLearnString(PRINT_LearnBow1, B_GetLearnCostTalent(hero, NPC_TALENT_BOW, 1)), Info_Mod_Vincent_Lernen_Bogen_1);
};
FUNC VOID Info_Mod_Vincent_Lernen_Bogen_1()
{
B_TeachFightTalentPercent (self, hero, NPC_TALENT_BOW, 1, 100);
Info_ClearChoices (Info_Mod_Vincent_Lernen_Bogen);
Info_AddChoice (Info_Mod_Vincent_Lernen_Bogen, "Zurück.", Info_Mod_Vincent_Lernen_Bogen_BACK);
Info_AddChoice (Info_Mod_Vincent_Lernen_Bogen, B_BuildLearnString(PRINT_LearnBow5, B_GetLearnCostTalent_New(hero, NPC_TALENT_BOW)), Info_Mod_Vincent_Lernen_Bogen_5);
Info_AddChoice (Info_Mod_Vincent_Lernen_Bogen, B_BuildLearnString(PRINT_LearnBow1, B_GetLearnCostTalent(hero, NPC_TALENT_BOW, 1)), Info_Mod_Vincent_Lernen_Bogen_1);
};
INSTANCE Info_Mod_Vincent_Pickpocket (C_INFO)
{
npc = Mod_7379_OUT_Vincent_REL;
nr = 1;
condition = Info_Mod_Vincent_Pickpocket_Condition;
information = Info_Mod_Vincent_Pickpocket_Info;
permanent = 1;
important = 0;
description = Pickpocket_60;
};
FUNC INT Info_Mod_Vincent_Pickpocket_Condition()
{
C_Beklauen (58, ItRw_Arrow, 35);
};
FUNC VOID Info_Mod_Vincent_Pickpocket_Info()
{
Info_ClearChoices (Info_Mod_Vincent_Pickpocket);
Info_AddChoice (Info_Mod_Vincent_Pickpocket, DIALOG_BACK, Info_Mod_Vincent_Pickpocket_BACK);
Info_AddChoice (Info_Mod_Vincent_Pickpocket, DIALOG_PICKPOCKET, Info_Mod_Vincent_Pickpocket_DoIt);
};
FUNC VOID Info_Mod_Vincent_Pickpocket_BACK()
{
Info_ClearChoices (Info_Mod_Vincent_Pickpocket);
};
FUNC VOID Info_Mod_Vincent_Pickpocket_DoIt()
{
if (B_Beklauen() == TRUE)
{
Info_ClearChoices (Info_Mod_Vincent_Pickpocket);
}
else
{
Info_ClearChoices (Info_Mod_Vincent_Pickpocket);
Info_AddChoice (Info_Mod_Vincent_Pickpocket, DIALOG_PP_BESCHIMPFEN, Info_Mod_Vincent_Pickpocket_Beschimpfen);
Info_AddChoice (Info_Mod_Vincent_Pickpocket, DIALOG_PP_BESTECHUNG, Info_Mod_Vincent_Pickpocket_Bestechung);
Info_AddChoice (Info_Mod_Vincent_Pickpocket, DIALOG_PP_HERAUSREDEN, Info_Mod_Vincent_Pickpocket_Herausreden);
};
};
FUNC VOID Info_Mod_Vincent_Pickpocket_Beschimpfen()
{
B_Say (hero, self, "$PICKPOCKET_BESCHIMPFEN");
B_Say (self, hero, "$DIRTYTHIEF");
Info_ClearChoices (Info_Mod_Vincent_Pickpocket);
AI_StopProcessInfos (self);
B_Attack (self, hero, AR_Theft, 1);
};
FUNC VOID Info_Mod_Vincent_Pickpocket_Bestechung()
{
B_Say (hero, self, "$PICKPOCKET_BESTECHUNG");
var int rnd; rnd = r_max(99);
if (rnd < 25)
|| ((rnd >= 25) && (rnd < 50) && (Npc_HasItems(hero, ItMi_Gold) < 50))
|| ((rnd >= 50) && (rnd < 75) && (Npc_HasItems(hero, ItMi_Gold) < 100))
|| ((rnd >= 75) && (rnd < 100) && (Npc_HasItems(hero, ItMi_Gold) < 200))
{
B_Say (self, hero, "$DIRTYTHIEF");
Info_ClearChoices (Info_Mod_Vincent_Pickpocket);
AI_StopProcessInfos (self);
B_Attack (self, hero, AR_Theft, 1);
}
else
{
if (rnd >= 75)
{
B_GiveInvItems (hero, self, ItMi_Gold, 200);
}
else if (rnd >= 50)
{
B_GiveInvItems (hero, self, ItMi_Gold, 100);
}
else if (rnd >= 25)
{
B_GiveInvItems (hero, self, ItMi_Gold, 50);
};
B_Say (self, hero, "$PICKPOCKET_BESTECHUNG_01");
Info_ClearChoices (Info_Mod_Vincent_Pickpocket);
AI_StopProcessInfos (self);
};
};
FUNC VOID Info_Mod_Vincent_Pickpocket_Herausreden()
{
B_Say (hero, self, "$PICKPOCKET_HERAUSREDEN");
if (r_max(99) < Mod_Verhandlungsgeschick)
{
B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_01");
Info_ClearChoices (Info_Mod_Vincent_Pickpocket);
}
else
{
B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_02");
};
};
INSTANCE Info_Mod_Vincent_EXIT (C_INFO)
{
npc = Mod_7379_OUT_Vincent_REL;
nr = 1;
condition = Info_Mod_Vincent_EXIT_Condition;
information = Info_Mod_Vincent_EXIT_Info;
permanent = 1;
important = 0;
description = DIALOG_ENDE;
};
FUNC INT Info_Mod_Vincent_EXIT_Condition()
{
return 1;
};
FUNC VOID Info_Mod_Vincent_EXIT_Info()
{
AI_StopProcessInfos (self);
}; | D |
module hardware.devices;
import std.conv;
import std.stdio : File;
import std.datetime;
import hardware.hardware;
import saillog, fifo, gpscoord;
import filter;
import config;
public import hardware.hwelement;
enum DeviceID : ubyte{//List all devices
Invalid=0,
Sail=1,
Helm=2,
Gps=3,
Roll=4,
WindDir=5,
Compass=6,
Battery=7,
TurnSpeed=8
}
enum DeviceSens : DeviceID{//List all sensors
Gps=DeviceID.Gps,
Roll=DeviceID.Roll,
WindDir=DeviceID.WindDir,
Compass=DeviceID.Compass,
Battery=DeviceID.Battery,
TurnSpeed=DeviceID.TurnSpeed
}
enum DeviceAct : DeviceID{//List all actuators
Sail=DeviceID.Sail,
Helm=DeviceID.Helm
}
/**
Handles the sail tension
*/
class Sail : HWAct!ubyte {
this(){
m_id = DeviceID.Sail;
m_min = ubyte.min;
m_max = ubyte.max;
m_init = 50;
m_lastvalue=m_init;
}
invariant(){
assert(m_min<=m_lastvalue && m_lastvalue<=m_max, "Value is out of bound");
}
protected:
override ulong[2] FormatValue(in ubyte value){
return [cast(ulong)(value), 0];
}
}
/**
Handles the helm orientation
*/
class Helm : HWAct!float {
this(){
m_id = DeviceID.Helm;
m_min = -45;
m_max = 45;
m_init = 0;
m_lastvalue=m_init;
}
invariant(){
assert(m_min<=m_lastvalue && m_lastvalue<=m_max, "Value is out of bound");
}
protected:
override ulong[2] FormatValue(in float value){
return [cast(ulong)((value+45.0)*(ulong.max/90.0)), 0];
}
}
//==============================================================================
/**
Gets the GPS Position
*/
class Gps : HWSens!GpsCoord {
this(){
super(5);
m_id = DeviceID.Gps;
m_min.latitude = -90;
m_max.latitude = 90;
m_min.longitude = -180;
m_max.longitude = 180;
m_init.latitude = 0;
m_init.longitude = 0;
m_lastvalue=m_init;
try{
m_logfile.open(Config.Get!string("Global", "GPSLogFile"), "a");
}catch(Exception e){
SailLog.Critical("Unable to log GPS data: ",e);
}
}
invariant(){
assert(m_min.latitude<=m_lastvalue.latitude && m_lastvalue.latitude<=m_max.latitude, "Value is out of bound");
assert(m_min.longitude<=m_lastvalue.longitude && m_lastvalue.longitude<=m_max.longitude, "Value is out of bound");
}
override{
void ParseValue(ulong[2] data)
out{
assert(m_min.latitude<=m_values.front.value.latitude && m_values.front.value.latitude<=m_max.latitude, "Value is out of bound");
assert(m_min.longitude<=m_values.front.value.longitude && m_values.front.value.longitude<=m_max.longitude, "Value is out of bound");
}body{
GpsCoord coord = GpsCoord(
GpsCoord.toRad(((m_max.latitude-m_min.latitude)*data[0]/ulong.max)+m_min.latitude),
GpsCoord.toRad(((m_max.longitude-m_min.longitude)*data[1]/ulong.max)+m_min.longitude)
);
SailLog.Warning("Received ",typeof(this).stringof,"=", coord);
synchronized(this.classinfo){
m_values.Append(TimestampedValue!GpsCoord(
Clock.currAppTick(),
coord
));
}
if(m_logfile.isOpen()){
m_logfile.writeln(Clock.currTime.toSimpleString() ,"\t",coord);
}
import decisioncenter;
if(!m_bFirstReceived){
DecisionCenter.Get.StartWithGPS(coord);
m_bFirstReceived = true;
}
}
void ExecFilter(){
m_lastvalue = Filter.TimedAvgOnDuration!GpsCoord(m_values, TickDuration.from!"seconds"(2));
}
void CheckIsOutOfService(){
//May be wise to check if values are coherent
}
bool isValueInBounds(GpsCoord value) const{
if( m_min.latitude<=value.latitude && value.latitude<=m_max.latitude
&& m_min.longitude<=value.longitude && value.longitude<=m_max.longitude)
return true;
return false;
}
}
private:
File m_logfile;
bool m_bFirstReceived = false;
}
/**
Gets the roll
*/
class Roll : HWSens!float {
this(){
super(75);
m_id = DeviceID.Roll;
m_min = -180.0;
m_max = 180.0;
m_init = 0.0;
m_lastvalue=m_init;
}
invariant(){
assert(m_min<=m_lastvalue && m_lastvalue<=m_max, "Value is out of bound");
}
override{
void ParseValue(ulong[2] data)
out{
assert(m_min<=m_values.front.value && m_values.front.value<=m_max, "Value is out of bound");
}body{
auto value = to!float((m_max-m_min)*data[0]/ulong.max)+m_min;
synchronized(this.classinfo){
m_values.Append(TimestampedValue!float(
Clock.currAppTick(),
value
));
}
SailLog.Warning("Received ",typeof(this).stringof,"=", value);
}
void ExecFilter(){
m_lastvalue = Filter.TimedAvgOnDuration!float(m_values, TickDuration.from!"seconds"(7));
if(m_lastvalue>180.0)
m_lastvalue-=360.0;
}
void CheckIsOutOfService(){
//May be wise to check if values are coherent
}
}
}
/**
Gets the wind direction
*/
class WindDir : HWSens!float {
this(){
super(40);
m_id = DeviceID.WindDir;
m_min = -180;
m_max = 180;
m_init = 0;
m_lastvalue=m_init;
}
invariant(){
assert(m_min<=m_lastvalue && m_lastvalue<=m_max, "Value is out of bound");
}
override{
void ParseValue(ulong[2] data)
out{
assert(m_min<=m_values.front.value && m_values.front.value<=m_max, "Value is out of bound");
}body{
float value = to!float((m_max-m_min)*data[0]/ulong.max)+m_min;
if(value>180)
value = 360.0-value;
SailLog.Warning("Received ",typeof(this).stringof,"=", value);
synchronized(this.classinfo){
m_values.Append(TimestampedValue!float(
Clock.currAppTick(),
value
));
}
}
void ExecFilter(){
m_lastvalue = Filter.TimedAvgOnDurationAngle!float(m_values, TickDuration.from!"seconds"(3));
if(m_lastvalue>180.0)
m_lastvalue-=360.0;
}
void CheckIsOutOfService(){
//May be wise to check if values are coherent
}
}
float CalcAbsoluteWind(){
float fCompass = Hardware.Get!Compass(DeviceID.Compass).value;
float fValue = m_lastvalue+fCompass;
if(fValue>360)
fValue-=360;
else if(fValue<0)
fValue+=360;
return fValue;
}
}
/**
Gets the heading
*/
class Compass : HWSens!float {
this(){
super(1);
m_id = DeviceID.Compass;
m_min = 0;
m_max = 360;
m_init = 0;
m_lastvalue=m_init;
}
invariant(){
assert(m_min<=m_lastvalue && m_lastvalue<=m_max, "Value is out of bound");
}
override{
void ParseValue(ulong[2] data)
out{
assert(m_min<=m_values.front.value && m_values.front.value<=m_max, "Value is out of bound");
}body{
auto value = to!float((m_max-m_min)*data[0]/ulong.max)+m_min;
synchronized(this.classinfo){
m_values.Append(TimestampedValue!float(
Clock.currAppTick(),
value
));
}
SailLog.Warning("Received ",typeof(this).stringof,"=", value);
}
void ExecFilter(){
m_lastvalue = Filter.Raw!float(m_values);//Filter.TimedAvgOnDurationAngle!float(m_values, TickDuration.from!"seconds"(3));
if(m_lastvalue<0.0)
m_lastvalue+=360.0;
}
void CheckIsOutOfService(){
//May be wise to check if values are coherent
}
}
}
/**
Gets the battery voltage
*/
class Battery : HWSens!float {
this(){
super(10);
m_id = DeviceID.Battery;
m_min = 0;
m_max = 10;
m_init = 0;
m_lastvalue=m_init;
}
invariant(){
assert(m_min<=m_lastvalue && m_lastvalue<=m_max, "Value is out of bound");
}
override{
void ParseValue(ulong[2] data)
out{
assert(m_min<=m_values.front.value && m_values.front.value<=m_max, "Value is out of bound");
}body{
float value = to!float((m_max-m_min)*data[0]/ulong.max)+m_min;
synchronized(this.classinfo){
m_values.Append(TimestampedValue!float(
Clock.currAppTick(),
value
));
}
SailLog.Warning("Received ",typeof(this).stringof,"=", value);
//Battery voltage check
if(value <= Config.Get!float("Battery", "CriticalVoltage")){
SailLog.Critical("Battery voltage is FAR TOO LOW, you should rest : ",value,"v");
}
else if(value <= Config.Get!float("Battery", "LowVoltage")){
SailLog.Warning("Battery voltage is low : ",value,"v");
}
}
void ExecFilter(){
m_lastvalue = Filter.Raw!float(m_values);
}
void CheckIsOutOfService(){
//May be wise to check if values are coherent
}
}
}
/**
Gets the heading
*/
class TurnSpeed : HWSens!float {
this(){
super(1);
m_id = DeviceID.TurnSpeed;
m_min = -360;
m_max = 360;
m_init = 0;
m_lastvalue=m_init;
}
invariant(){
assert(m_min<=m_lastvalue && m_lastvalue<=m_max, "Value is out of bound");
}
override{
void ParseValue(ulong[2] data)
out{
assert(m_min<=m_values.front.value && m_values.front.value<=m_max, "Value is out of bound");
}body{
auto value = to!float((m_max-m_min)*data[0]/ulong.max)+m_min;
synchronized(this.classinfo){
m_values.Append(TimestampedValue!float(
Clock.currAppTick(),
value
));
}
SailLog.Warning("Received ",typeof(this).stringof,"=", value);
}
void ExecFilter(){
m_lastvalue = Filter.Raw!float(m_values);
}
void CheckIsOutOfService(){
//May be wise to check if values are coherent
}
}
} | D |
/**
* Copyright: Copyright Jason White, 2014-2016
* License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Jason White
*/
module io.file.pipe;
import io.file.stream;
struct Pipe(F = File)
if (is(F == struct))
{
F readEnd; // Read end
F writeEnd; // Write end
}
/**
* Creates an unnamed, unidirectional pipe that can be written to on one end and
* read from on the other.
*/
Pipe!F pipe(F = File)()
if (is(F == struct))
{
version (Posix)
{
import core.sys.posix.unistd : pipe;
int[2] fd = void;
sysEnforce(pipe(fd) != -1);
return Pipe!F(F(fd[0]), F(fd[1]));
}
else version(Windows)
{
import core.sys.windows.windows : CreatePipe;
F.Handle readEnd = void, writeEnd = void;
sysEnforce(CreatePipe(&readEnd, &writeEnd, null, 0));
return Pipe!F(F(readEnd), F(writeEnd));
}
else
{
static assert(false, "Unsupported platform.");
}
}
///
unittest
{
auto p = pipe!UnbufferedFile();
// Write to one end of the pipe...
immutable message = "Indubitably.";
p.writeEnd.write(message);
// ...and read from it on the other.
char[message.length] buf;
assert(buf[0 .. p.readEnd.read(buf)] == message);
}
| D |
module mod0;
int mod0Var;
class Mod0Class {
static int foo;
class Mod0Class_Inner {
static int foo;
}
}
void mod0Func(int a) {
} | D |
/+ dub.sdl:
name "tests"
dependency "vibe-core" path=".."
+/
module tests;
import core.time, vibe.core.core, vibe.core.process;
void main()
{
version (Windows) {
import vibe.core.log : logInfo;
logInfo("Skipping pipe test on Windows");
} else {
auto p = pipe();
runTask(()
{
sleepUninterruptible(10.msecs);
exitEventLoop();
});
runEventLoop();
}
}
| D |
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/Async+NIO.swift.o : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Async+NIO.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Variadic.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Void.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/FutureType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Collection+Future.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+DoCatch.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Global.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Transform.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Flatten.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Map.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Worker.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/QueueHandler.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/AsyncError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/Async+NIO~partial.swiftmodule : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Async+NIO.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Variadic.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Void.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/FutureType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Collection+Future.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+DoCatch.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Global.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Transform.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Flatten.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Map.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Worker.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/QueueHandler.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/AsyncError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/Async+NIO~partial.swiftdoc : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Async+NIO.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Variadic.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Void.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/FutureType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Collection+Future.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+DoCatch.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Global.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Transform.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Flatten.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Map.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Worker.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/QueueHandler.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/AsyncError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/Async+NIO~partial.swiftsourceinfo : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Async+NIO.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Variadic.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Void.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/FutureType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Collection+Future.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+DoCatch.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Global.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Transform.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Flatten.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Future+Map.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Worker.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/QueueHandler.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/AsyncError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Async/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
| D |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.