code
stringlengths 3
10M
| language
stringclasses 31
values |
|---|---|
/users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Build/Intermediates/SwiftIO.build/Debug-iphoneos/SwiftIO_iOS.build/Objects-normal/arm64/NullStream.o : /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/NullStream.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Datagram+Streams.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/FileStream.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BasicTypes+BinaryInputStreamable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/sockaddr_storage+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Inet.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Utilities.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/inet+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BinaryStreamable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Socket.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BinaryOutputStreams.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/NetworkEndian.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/TCPServer.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/UDPChannel.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Address.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BinaryDecodable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/TCPListener.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Datagram.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Resolver.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/RandomAccess.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Address+Interfaces.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/SocketOptions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BasicTypes+BinaryOutputStreamable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BinaryInputStreams.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Connectable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/AddressScanner.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/MemoryStream.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Logging.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/TCPChannel.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/TLV.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /users/tommy-b-10/Desktop/SidePilotApp/Modules/module.map /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/SwiftIOSupport.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/SwiftIO.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Build/Intermediates/SwiftIO.build/Debug-iphoneos/SwiftIO_iOS.build/unextended-module.modulemap /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/Darwin.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/ObjectiveC.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/SwiftOnoneSupport.swiftmodule /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Carthage/Build/iOS/SwiftUtilities.framework/Modules/SwiftUtilities.swiftmodule/arm64.swiftmodule /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Carthage/Build/iOS/SwiftUtilities.framework/Headers/SwiftUtilities-Swift.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Carthage/Build/iOS/SwiftUtilities.framework/Headers/SwiftUtilities.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Carthage/Build/iOS/SwiftUtilities.framework/Modules/module.modulemap
/users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Build/Intermediates/SwiftIO.build/Debug-iphoneos/SwiftIO_iOS.build/Objects-normal/arm64/NullStream~partial.swiftmodule : /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/NullStream.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Datagram+Streams.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/FileStream.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BasicTypes+BinaryInputStreamable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/sockaddr_storage+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Inet.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Utilities.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/inet+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BinaryStreamable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Socket.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BinaryOutputStreams.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/NetworkEndian.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/TCPServer.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/UDPChannel.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Address.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BinaryDecodable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/TCPListener.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Datagram.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Resolver.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/RandomAccess.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Address+Interfaces.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/SocketOptions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BasicTypes+BinaryOutputStreamable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BinaryInputStreams.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Connectable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/AddressScanner.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/MemoryStream.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Logging.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/TCPChannel.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/TLV.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /users/tommy-b-10/Desktop/SidePilotApp/Modules/module.map /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/SwiftIOSupport.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/SwiftIO.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Build/Intermediates/SwiftIO.build/Debug-iphoneos/SwiftIO_iOS.build/unextended-module.modulemap /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/Darwin.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/ObjectiveC.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/SwiftOnoneSupport.swiftmodule /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Carthage/Build/iOS/SwiftUtilities.framework/Modules/SwiftUtilities.swiftmodule/arm64.swiftmodule /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Carthage/Build/iOS/SwiftUtilities.framework/Headers/SwiftUtilities-Swift.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Carthage/Build/iOS/SwiftUtilities.framework/Headers/SwiftUtilities.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Carthage/Build/iOS/SwiftUtilities.framework/Modules/module.modulemap
/users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Build/Intermediates/SwiftIO.build/Debug-iphoneos/SwiftIO_iOS.build/Objects-normal/arm64/NullStream~partial.swiftdoc : /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/NullStream.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Datagram+Streams.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/FileStream.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BasicTypes+BinaryInputStreamable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/sockaddr_storage+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Inet.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Utilities.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/inet+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BinaryStreamable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Socket.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BinaryOutputStreams.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/NetworkEndian.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/TCPServer.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/UDPChannel.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Address.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BinaryDecodable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/TCPListener.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Datagram.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Resolver.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/RandomAccess.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Address+Interfaces.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/SocketOptions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BasicTypes+BinaryOutputStreamable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/BinaryInputStreams.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Connectable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/AddressScanner.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/MemoryStream.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/Logging.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/TCPChannel.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/TLV.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /users/tommy-b-10/Desktop/SidePilotApp/Modules/module.map /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/SwiftIOSupport.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Sources/SwiftIO.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Build/Intermediates/SwiftIO.build/Debug-iphoneos/SwiftIO_iOS.build/unextended-module.modulemap /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/Darwin.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/ObjectiveC.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/SwiftOnoneSupport.swiftmodule /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Carthage/Build/iOS/SwiftUtilities.framework/Modules/SwiftUtilities.swiftmodule/arm64.swiftmodule /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Carthage/Build/iOS/SwiftUtilities.framework/Headers/SwiftUtilities-Swift.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Carthage/Build/iOS/SwiftUtilities.framework/Headers/SwiftUtilities.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftIO/Carthage/Build/iOS/SwiftUtilities.framework/Modules/module.modulemap
|
D
|
// URL: https://atcoder.jp/contests/typical90/tasks/typical90_aa
import std.algorithm, std.array, std.bitmanip, std.container, std.conv, std.format,
std.functional, std.math, std.range, std.traits, std.typecons, std.stdio, std.string;
version(unittest) {} else
void main()
{
int N; io.getV(N);
bool[string] h;
foreach (i; 0..N) {
string Si; io.getV(Si);
if (Si !in h) io.put(i+1);
h[Si] = true;
}
}
auto io = IO!()();
import lib.io;
|
D
|
/Users/aligame/work/rust_repository/rutils/target/debug/deps/libclap-6733586c6827f407.rlib: /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/lib.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/macros.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/mod.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/settings.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/parser.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/meta.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/help.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/validator.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/usage.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/mod.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/macros.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/any_arg.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_matches.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_matcher.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/subcommand.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/mod.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/flag.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/positional.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/option.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/base.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/valued.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/switched.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/matched_arg.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/group.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/settings.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/usage_parser.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/fmt.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/suggestions.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/errors.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/osstringext.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/strext.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/mod.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/macros.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/bash.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/fish.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/zsh.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/powershell.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/elvish.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/shell.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/map.rs
/Users/aligame/work/rust_repository/rutils/target/debug/deps/clap-6733586c6827f407.d: /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/lib.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/macros.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/mod.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/settings.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/parser.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/meta.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/help.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/validator.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/usage.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/mod.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/macros.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/any_arg.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_matches.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_matcher.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/subcommand.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/mod.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/flag.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/positional.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/option.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/base.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/valued.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/switched.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/matched_arg.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/group.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/settings.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/usage_parser.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/fmt.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/suggestions.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/errors.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/osstringext.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/strext.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/mod.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/macros.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/bash.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/fish.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/zsh.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/powershell.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/elvish.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/shell.rs /Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/map.rs
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/lib.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/macros.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/mod.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/settings.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/parser.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/meta.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/help.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/validator.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/app/usage.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/mod.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/macros.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/any_arg.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_matches.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_matcher.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/subcommand.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/mod.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/flag.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/positional.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/option.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/base.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/valued.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/arg_builder/switched.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/matched_arg.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/group.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/args/settings.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/usage_parser.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/fmt.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/suggestions.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/errors.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/osstringext.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/strext.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/mod.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/macros.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/bash.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/fish.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/zsh.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/powershell.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/elvish.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/completions/shell.rs:
/Users/aligame/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/clap-2.32.0/src/map.rs:
|
D
|
/*************************************************************************
** Swampshark Prototype **
*************************************************************************/
PROTOTYPE Mst_Default_Swampshark(C_Npc)
{
name = "Wąż błotny";
guild = GIL_SWAMPSHARK;
level = 35;
//---------------------------------------------------------------
attribute [ATR_STRENGTH] = 170;
attribute [ATR_DEXTERITY] = 170;
attribute [ATR_HITPOINTS_MAX] = 500;
attribute [ATR_HITPOINTS] = 500;
attribute [ATR_MANA_MAX] = 0;
attribute [ATR_MANA] = 0;
//---------------------------------------------------------------
protection [PROT_BLUNT] = 180;
protection [PROT_EDGE] = 180;
protection [PROT_POINT] = 90;
protection [PROT_FIRE] = 50;
protection [PROT_FLY] = 9999;
protection [PROT_MAGIC] = 40;
//---------------------------------------------------------------
damagetype = DAM_EDGE;
// damage [DAM_INDEX_BLUNT] = 0;
// damage [DAM_INDEX_EDGE] = 0;
// damage [DAM_INDEX_POINT] = 0;
// damage [DAM_INDEX_FIRE] = 0;
// damage [DAM_INDEX_FLY] = 0;
// damage [DAM_INDEX_MAGIC] = 0;
//---------------------------------------------------------------
fight_tactic = FAI_SWAMPSHARK;
//---------------------------------------------------------------
senses = SENSE_HEAR | SENSE_SEE | SENSE_SMELL;
senses_range = 3000;
Npc_SetAivar(self,AIV_MM_Behaviour, HUNTER);
Npc_SetAivar(self,AIV_MM_PercRange, 1500);
Npc_SetAivar(self,AIV_MM_DrohRange, 1300);
Npc_SetAivar(self,AIV_MM_AttackRange, 1000);
Npc_SetAivar(self,AIV_MM_DrohTime, 5);
Npc_SetAivar(self,AIV_MM_FollowTime, 10);
Npc_SetAivar(self,AIV_MM_FollowInWater, TRUE);
Npc_SetAivar(self,AIV_MM_SPECREACTTODAMAGE, TRUE);
//-------------------------------------------------------------
start_aistate = ZS_MM_AllScheduler;
Npc_SetAivar(self,AIV_MM_RoamStart, OnlyRoutine);
};
//-------------------------------------------------------------
func void Set_Swampshark_Visuals()
{
Mdl_SetVisual (self, "Swampshark.mds");
// Body-Mesh Body-Tex Skin-Color Head-MMS Head-Tex Teeth-Tex ARMOR
Mdl_SetVisualBody (self, "Swa_Body", DEFAULT, DEFAULT, "", DEFAULT, DEFAULT, -1);
};
/*************************************************************************
** Swampshark **
*************************************************************************/
INSTANCE Swampshark (Mst_Default_Swampshark)
{
Set_Swampshark_Visuals();
Npc_SetToFistMode(self);
Npc_SetAivar(self,AIV_MM_DAYTORESPAWN, 6);
Npc_SetAivar(self,AIV_MM_MAXLEVEL, 70);
Npc_SetAivar(self,AIV_MM_REAL_ID, ID_SWAMPSHARK);
B_SetMonsterLevel();
};
/*************************************************************************
** hurt Swampshark: Mission: Sit_1_PSI_GorNaRan_KillSwampshark **
*************************************************************************/
INSTANCE HurtSwampshark(Mst_Default_Swampshark)
{
name = "Ranny wąż błotny";
attribute [ATR_HITPOINTS] = 20;
Set_Swampshark_Visuals();
Npc_SetToFistMode(self);
Npc_SetAivar(self,AIV_MM_DAYTORESPAWN, 999);
Npc_SetAivar(self,AIV_MM_MAXLEVEL, 70);
B_SetMonsterLevel();
};
|
D
|
Project_Source/renesas/src/compiler/ccrl/cstart.obj Project_Source/renesas/src/compiler/ccrl/cstart.d: C:/BLE_Renesas/Project_Source/renesas/src/compiler/ccrl/cstart.asm
|
D
|
/Users/Matt/iOS/RoadInfo/DerivedData/RoadInfo/Build/Intermediates/RoadInfo.build/Release-iphoneos/RoadInfo.build/Objects-normal/arm64/ChristchurchXML.o : /Users/Matt/iOS/RoadInfo/RoadInfo/ChristchurchEvent.swift /Users/Matt/iOS/RoadInfo/RoadInfo/EventViewController.swift /Users/Matt/iOS/RoadInfo/RoadInfo/XMLParser.swift /Users/Matt/iOS/RoadInfo/RoadInfo/MapController.swift /Users/Matt/iOS/RoadInfo/RoadInfo/Complex.swift /Users/Matt/iOS/RoadInfo/RoadInfo/NZMGConverter.swift /Users/Matt/iOS/RoadInfo/RoadInfo/Location.swift /Users/Matt/iOS/RoadInfo/RoadInfo/ChristchurchXML.swift /Users/Matt/iOS/RoadInfo/RoadInfo/RoadEvent.swift /Users/Matt/iOS/RoadInfo/RoadInfo/Annotation.swift /Users/Matt/iOS/RoadInfo/RoadInfo/AppDelegate.swift /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/Foundation.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/Dispatch.swiftmodule /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/CoreGraphics.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/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreLocation.swiftmodule
/Users/Matt/iOS/RoadInfo/DerivedData/RoadInfo/Build/Intermediates/RoadInfo.build/Release-iphoneos/RoadInfo.build/Objects-normal/arm64/ChristchurchXML~partial.swiftmodule : /Users/Matt/iOS/RoadInfo/RoadInfo/ChristchurchEvent.swift /Users/Matt/iOS/RoadInfo/RoadInfo/EventViewController.swift /Users/Matt/iOS/RoadInfo/RoadInfo/XMLParser.swift /Users/Matt/iOS/RoadInfo/RoadInfo/MapController.swift /Users/Matt/iOS/RoadInfo/RoadInfo/Complex.swift /Users/Matt/iOS/RoadInfo/RoadInfo/NZMGConverter.swift /Users/Matt/iOS/RoadInfo/RoadInfo/Location.swift /Users/Matt/iOS/RoadInfo/RoadInfo/ChristchurchXML.swift /Users/Matt/iOS/RoadInfo/RoadInfo/RoadEvent.swift /Users/Matt/iOS/RoadInfo/RoadInfo/Annotation.swift /Users/Matt/iOS/RoadInfo/RoadInfo/AppDelegate.swift /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/Foundation.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/Dispatch.swiftmodule /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/CoreGraphics.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/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreLocation.swiftmodule
/Users/Matt/iOS/RoadInfo/DerivedData/RoadInfo/Build/Intermediates/RoadInfo.build/Release-iphoneos/RoadInfo.build/Objects-normal/arm64/ChristchurchXML~partial.swiftdoc : /Users/Matt/iOS/RoadInfo/RoadInfo/ChristchurchEvent.swift /Users/Matt/iOS/RoadInfo/RoadInfo/EventViewController.swift /Users/Matt/iOS/RoadInfo/RoadInfo/XMLParser.swift /Users/Matt/iOS/RoadInfo/RoadInfo/MapController.swift /Users/Matt/iOS/RoadInfo/RoadInfo/Complex.swift /Users/Matt/iOS/RoadInfo/RoadInfo/NZMGConverter.swift /Users/Matt/iOS/RoadInfo/RoadInfo/Location.swift /Users/Matt/iOS/RoadInfo/RoadInfo/ChristchurchXML.swift /Users/Matt/iOS/RoadInfo/RoadInfo/RoadEvent.swift /Users/Matt/iOS/RoadInfo/RoadInfo/Annotation.swift /Users/Matt/iOS/RoadInfo/RoadInfo/AppDelegate.swift /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/Foundation.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/Dispatch.swiftmodule /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/CoreGraphics.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/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreLocation.swiftmodule
|
D
|
module reggae.dub.info;
import reggae.build;
import reggae.rules;
import reggae.types;
import reggae.sorting;
import reggae.options: Options;
import reggae.path: buildPath;
import std.algorithm: map, filter, find, splitter;
import std.array: array, join;
import std.range: chain;
enum TargetType {
autodetect,
none,
executable,
library,
sourceLibrary,
dynamicLibrary,
staticLibrary,
object,
}
struct DubPackage {
string name;
string path; /// path to the dub package
string mainSourceFile;
string targetFileName;
string[] dflags;
string[] lflags;
string[] importPaths;
string[] stringImportPaths;
string[] files;
TargetType targetType;
string[] versions;
string[] dependencies;
string[] libs;
string[] preBuildCommands;
string[] postBuildCommands;
string targetPath;
string toString() @safe pure const {
import std.string: join;
import std.conv: to;
import std.traits: Unqual;
auto ret = `DubPackage(`;
string[] lines;
foreach(ref elt; this.tupleof) {
static if(is(Unqual!(typeof(elt)) == TargetType))
lines ~= `TargetType.` ~ elt.to!string;
else static if(is(Unqual!(typeof(elt)) == string))
lines ~= "`" ~ elt.to!string ~ "`";
else
lines ~= elt.to!string;
}
ret ~= lines.join(`, `);
ret ~= `)`;
return ret;
}
DubPackage dup() @safe pure nothrow const {
DubPackage ret;
foreach(i, member; this.tupleof) {
static if(__traits(compiles, member.dup))
ret.tupleof[i] = member.dup;
else
ret.tupleof[i] = member;
}
return ret;
}
}
bool isStaticLibrary(in string fileName) @safe pure nothrow {
import std.path: extension;
version(Windows)
return fileName.extension == ".lib";
else
return fileName.extension == ".a";
}
bool isObjectFile(in string fileName) @safe pure nothrow {
import reggae.rules.common: objExt;
import std.path: extension;
return fileName.extension == objExt;
}
string inDubPackagePath(in string packagePath, in string filePath) @safe pure nothrow {
import std.algorithm: startsWith;
return filePath.startsWith("$project")
? buildPath(filePath)
: buildPath(packagePath, filePath);
}
struct DubObjsDir {
string globalDir;
string targetDir;
}
struct DubInfo {
import reggae.rules.dub: CompilationMode;
DubPackage[] packages;
DubInfo dup() @safe pure nothrow const {
import std.algorithm: map;
import std.array: array;
return DubInfo(packages.map!(a => a.dup).array);
}
Target[] toTargets(in string[] compilerFlags = [],
in CompilationMode compilationMode = CompilationMode.options,
in DubObjsDir dubObjsDir = DubObjsDir(),
in size_t startingIndex = 0)
@safe const
{
Target[] targets;
foreach(i; startingIndex .. packages.length) {
targets ~= packageIndexToTargets(i, compilerFlags, compilationMode, dubObjsDir);
}
return targets ~ allObjectFileSources ~ allStaticLibrarySources;
}
// dubPackage[i] -> Target[]
private Target[] packageIndexToTargets(
in size_t dubPackageIndex,
in string[] compilerFlags = [],
in CompilationMode compilationMode = CompilationMode.options,
in DubObjsDir dubObjsDir = DubObjsDir())
@safe const
{
import reggae.path: deabsolutePath;
import reggae.config: options;
import std.range: chain, only;
import std.algorithm: filter;
import std.array: array, replace;
import std.functional: not;
import std.path: baseName, dirSeparator;
import std.string: stripRight;
const dubPackage = packages[dubPackageIndex];
const importPaths = allImportPaths();
const stringImportPaths = dubPackage.allOf!(a => a.packagePaths(a.stringImportPaths))(packages);
const isMainPackage = dubPackageIndex == 0;
//the path must be explicit for the other packages, implicit for the "main"
//package
const projDir = isMainPackage ? "" : dubPackage.path;
const sharedFlag = targetType == TargetType.dynamicLibrary ? ["-fPIC"] : [];
// -unittest should only apply to the main package
const(string)[] deUnitTest(in string[] flags) {
return isMainPackage
? flags
: flags.filter!(f => f != "-unittest" && f != "-main").array;
}
const flags = chain(dubPackage.dflags,
dubPackage.versions.map!(a => "-version=" ~ a),
options.dflags.splitter, // TODO: doesn't support quoted args with spaces
sharedFlag,
deUnitTest(compilerFlags))
.array;
const files = dubPackage.files
.filter!(not!isStaticLibrary)
.filter!(not!isObjectFile)
.map!(a => buildPath(dubPackage.path, a))
.array;
auto compileFunc() {
final switch(compilationMode) with(CompilationMode) {
case all: return &dlangObjectFilesTogether;
case module_: return &dlangObjectFilesPerModule;
case package_: return &dlangObjectFilesPerPackage;
case options: return &dlangObjectFiles;
}
}
auto targetsFunc() {
import reggae.rules.d: dlangStaticLibraryTogether;
import reggae.config: options;
const isStaticLibDep =
dubPackage.targetType == TargetType.staticLibrary &&
dubPackageIndex != 0 &&
!options.dubDepObjsInsteadOfStaticLib;
return isStaticLibDep
? &dlangStaticLibraryTogether
: compileFunc;
}
auto packageTargets = targetsFunc()(files, flags, importPaths, stringImportPaths, [], projDir);
// go through dub dependencies and adjust object file output paths
if(!isMainPackage) {
// optionally put the object files in dubObjsDir
if(dubObjsDir.globalDir != "") {
foreach(ref target; packageTargets) {
target.rawOutputs[0] = buildPath(dubObjsDir.globalDir,
options.projectPath.deabsolutePath,
dubObjsDir.targetDir,
target.rawOutputs[0]);
}
} else {
const dubPkgRoot = buildPath(dubPackage.path).deabsolutePath.stripRight(dirSeparator);
const shortenedRoot = buildPath("__dub__", baseName(dubPackage.path));
foreach(ref target; packageTargets)
target.rawOutputs[0] = buildPath(target.rawOutputs[0]).replace(dubPkgRoot, shortenedRoot);
}
}
return packageTargets;
}
Target[] packageNameToTargets(
in string name,
in string[] compilerFlags = [],
in CompilationMode compilationMode = CompilationMode.options,
in DubObjsDir dubObjsDir = DubObjsDir())
@safe const
{
foreach(const index, const dubPackage; packages) {
if(dubPackage.name == name)
return packageIndexToTargets(index, compilerFlags, compilationMode, dubObjsDir);
}
throw new Exception("Couldn't find package '" ~ name ~ "'");
}
TargetName targetName() @safe const pure nothrow {
const fileName = packages[0].targetFileName;
return .targetName(targetType, fileName);
}
string targetPath(in Options options) @safe const pure {
import std.path: relativePath;
return options.workingDir == options.projectPath
? packages[0].targetPath.relativePath(options.projectPath)
: "";
}
TargetType targetType() @safe const pure nothrow {
return packages[0].targetType;
}
string[] mainLinkerFlags() @safe pure nothrow const {
import std.array: join;
const pack = packages[0];
return (pack.targetType == TargetType.library || pack.targetType == TargetType.staticLibrary)
? ["-shared"]
: [];
}
// template due to purity - in the 2nd build with the payload this is pure,
// but in the 1st build to generate the reggae executable it's not.
// See reggae.config.
string[] linkerFlags()() const {
import reggae.config: options;
const allLibs = packages[0].libs;
static string libFlag(in string lib) {
version(Posix)
return "-L-l" ~ lib;
else
return lib ~ ".lib";
}
return
packages[0].libs.map!libFlag.array ~
packages[0].lflags.dup
;
}
string[] allImportPaths() @safe nothrow const {
import reggae.config: options;
import std.algorithm: sorted = sort, uniq;
import std.array: array;
string[] paths;
auto rng = packages.map!(a => a.packagePaths(a.importPaths));
foreach(p; rng) paths ~= p;
auto allPaths = paths ~ options.projectPath;
return allPaths.sorted.uniq.array;
}
// must be at the very end
private Target[] allStaticLibrarySources() @trusted /*join*/ nothrow const pure {
import std.algorithm: filter, map;
import std.array: array, join;
return packages
.map!(a => cast(string[]) a.files.filter!isStaticLibrary.array)
.join
.map!(a => Target(a))
.array;
}
private Target[] allObjectFileSources() @trusted nothrow const pure {
import std.algorithm.iteration: filter, map, uniq;
import std.algorithm.sorting: sort;
import std.array: array, join;
string[] objectFiles =
packages
.map!(a => cast(string[]) a
.files
.filter!isObjectFile
.map!(b => inDubPackagePath(a.path, b))
.array
)
.join
.array;
sort(objectFiles);
return objectFiles
.uniq
.map!(a => Target(a))
.array;
}
// all postBuildCommands in one shell command. Empty if there are none
string postBuildCommands() @safe pure nothrow const {
import std.string: join;
return packages[0].postBuildCommands.join(" && ");
}
}
private auto packagePaths(in DubPackage dubPackage, in string[] paths) @trusted nothrow {
return paths.map!(a => buildPath(dubPackage.path, a)).array;
}
//@trusted because of map.array
private string[] allOf(alias F)(in DubPackage pack, in DubPackage[] packages) @trusted nothrow {
import std.range: chain, only;
import std.array: array, front, empty;
string[] result;
foreach(dependency; chain(only(pack.name), pack.dependencies)) {
auto depPack = packages.find!(a => a.name == dependency);
if(!depPack.empty) {
result ~= F(depPack.front).array;
}
}
return result;
}
TargetName targetName(in TargetType targetType, in string fileName) @safe pure nothrow {
import reggae.rules.common: exeExt;
switch(targetType) with(TargetType) {
default:
return TargetName(fileName);
case executable:
return TargetName(fileName ~ exeExt);
case library:
version(Posix)
return TargetName("lib" ~ fileName ~ ".a");
else
return TargetName(fileName ~ ".lib");
case dynamicLibrary:
version(Posix)
return TargetName("lib" ~ fileName ~ ".so");
else
return TargetName(fileName ~ ".dll");
}
}
|
D
|
/Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.build/Worker.swift.o : /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Async+NIO.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Variadic.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Deprecated.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Void.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/FutureType.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Collection+Future.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+DoCatch.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Global.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Transform.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Flatten.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Map.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Worker.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/QueueHandler.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/AsyncError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Exports.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/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.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/Darwin.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.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/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.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
/Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.build/Worker~partial.swiftmodule : /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Async+NIO.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Variadic.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Deprecated.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Void.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/FutureType.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Collection+Future.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+DoCatch.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Global.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Transform.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Flatten.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Map.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Worker.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/QueueHandler.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/AsyncError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Exports.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/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.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/Darwin.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.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/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.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
/Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.build/Worker~partial.swiftdoc : /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Async+NIO.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Variadic.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Deprecated.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Void.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/FutureType.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Collection+Future.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+DoCatch.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Global.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Transform.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Flatten.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Future+Map.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Worker.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/QueueHandler.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/AsyncError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/core.git-9210800844849382486/Sources/Async/Exports.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/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.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/Darwin.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.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/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.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
|
D
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtDeclarative module 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 QDECLARATIVECONTEXT_H
#define QDECLARATIVECONTEXT_H
public import qt.QtDeclarative.qtdeclarativeglobal;
public import qt.QtCore.qurl;
public import qt.QtCore.qobject;
public import qt.QtScript.qscriptvalue;
public import qt.QtCore.qmetatype;
public import qt.QtCore.qvariant;
QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QString;
class QDeclarativeEngine;
class QDeclarativeRefCount;
class QDeclarativeContextPrivate;
class QDeclarativeCompositeTypeData;
class QDeclarativeContextData;
class Q_DECLARATIVE_EXPORT QDeclarativeContext : public QObject
{
mixin Q_OBJECT;
mixin Q_DECLARE_PRIVATE;
public:
QDeclarativeContext(QDeclarativeEngine *parent, QObject *objParent=0);
QDeclarativeContext(QDeclarativeContext *parent, QObject *objParent=0);
/+virtual+/ ~QDeclarativeContext();
bool isValid() const;
QDeclarativeEngine *engine() const;
QDeclarativeContext *parentContext() const;
QObject *contextObject() const;
void setContextObject(QObject *);
QVariant contextProperty(ref const(QString) ) const;
void setContextProperty(ref const(QString) , QObject *);
void setContextProperty(ref const(QString) , ref const(QVariant) );
QUrl resolvedUrl(ref const(QUrl) );
void setBaseUrl(ref const(QUrl) );
QUrl baseUrl() const;
private:
friend class QDeclarativeVME;
friend class QDeclarativeEngine;
friend class QDeclarativeEnginePrivate;
friend class QDeclarativeExpression;
friend class QDeclarativeExpressionPrivate;
friend class QDeclarativeContextScriptClass;
friend class QDeclarativeObjectScriptClass;
friend class QDeclarativeComponent;
friend class QDeclarativeComponentPrivate;
friend class QDeclarativeScriptPrivate;
friend class QDeclarativeBoundSignalProxy;
friend class QDeclarativeContextData;
QDeclarativeContext(QDeclarativeContextData *);
QDeclarativeContext(QDeclarativeEngine *, bool);
mixin Q_DISABLE_COPY;
};
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QList<QObject*>)
#endif // QDECLARATIVECONTEXT_H
|
D
|
module UnrealScript.Engine.SeqAct_Teleport;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.Engine.Actor;
import UnrealScript.Engine.Volume;
import UnrealScript.Engine.SequenceAction;
extern(C++) interface SeqAct_Teleport : SequenceAction
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class Engine.SeqAct_Teleport")); }
private static __gshared SeqAct_Teleport mDefaultProperties;
@property final static SeqAct_Teleport DefaultProperties() { mixin(MGDPC("SeqAct_Teleport", "SeqAct_Teleport Engine.Default__SeqAct_Teleport")); }
static struct Functions
{
private static __gshared
{
ScriptFunction mShouldTeleport;
ScriptFunction mGetObjClassVersion;
}
public @property static final
{
ScriptFunction ShouldTeleport() { mixin(MGF("mShouldTeleport", "Function Engine.SeqAct_Teleport.ShouldTeleport")); }
ScriptFunction GetObjClassVersion() { mixin(MGF("mGetObjClassVersion", "Function Engine.SeqAct_Teleport.GetObjClassVersion")); }
}
}
@property final
{
auto ref
{
ScriptArray!(Volume) TeleportVolumes() { mixin(MGPC("ScriptArray!(Volume)", 240)); }
float TeleportDistance() { mixin(MGPC("float", 236)); }
}
bool bCheckOverlap() { mixin(MGBPC(232, 0x2)); }
bool bCheckOverlap(bool val) { mixin(MSBPC(232, 0x2)); }
bool bUpdateRotation() { mixin(MGBPC(232, 0x1)); }
bool bUpdateRotation(bool val) { mixin(MSBPC(232, 0x1)); }
}
final:
bool ShouldTeleport(Actor TestActor, Vector TeleportLocation)
{
ubyte params[20];
params[] = 0;
*cast(Actor*)params.ptr = TestActor;
*cast(Vector*)¶ms[4] = TeleportLocation;
(cast(ScriptObject)this).ProcessEvent(Functions.ShouldTeleport, params.ptr, cast(void*)0);
return *cast(bool*)¶ms[16];
}
static int GetObjClassVersion()
{
ubyte params[4];
params[] = 0;
StaticClass.ProcessEvent(Functions.GetObjClassVersion, params.ptr, cast(void*)0);
return *cast(int*)params.ptr;
}
}
|
D
|
/*#D*/
// Copyright © 2012-2017, Bernard Helyer.
// Copyright © 2012-2017, Jakob Bornecrantz.
// See copyright notice in src/volt/license.d (BOOST ver. 1.0).
/*!
* Module containing the @ref ImportResolver class.
*
* @ingroup passPost
*/
module volt.postparse.importresolver;
import watt.text.format : format;
import ir = volta.ir;
import volt.ir.util;
import volt.errors;
import volt.interfaces;
import volt.visitor.visitor;
import volt.visitor.scopemanager;
import volt.semantic.lookup : getModuleFromScope;
import gatherer = volt.postparse.gatherer;
/*!
* Resolves imports on a single module.
*
* @ingroup passes passLang passPost
*/
class ImportResolver : ScopeManager, Pass
{
private:
LanguagePass lp;
ir.Module mModule;
public:
this(LanguagePass lp)
{
this.lp = lp;
}
/*
*
* Pass functions.
*
*/
override void transform(ir.Module m)
{
assert(mModule is null);
mModule = m;
accept(m, this);
mModule = null;
}
override void close()
{
}
/*
*
* Visitor and our functions.
*
*/
override Status enter(ir.Import i)
{
if (current !is mModule.myScope) {
throw makeNonTopLevelImport(/*#ref*/i.loc);
}
if (i.isStatic && i.access != ir.Access.Private) {
throw makeExpected(/*#ref*/i.loc,
format("static import '%s' to be private", i.names[0]));
}
foreach (name; i.names) {
auto mod = lp.getModule(name);
if (mod is null) {
throw makeCannotImport(i, name.toString());
}
if (mod.isAnonymous) {
throw makeCannotImportAnonymous(i, name.toString());
}
i.targetModules ~= mod;
}
if (i.aliases.length > 0) {
// import a : b, c OR import a = b : c, d;
handleAliases(i);
} else if (i.bind !is null) {
// import a = b;
handleRebind(i);
} else {
// static import a; OR import a;
handleRegularAndStatic(i);
}
return ContinueParent;
}
/*!
* Takes a import that maps the module to a symbol in the current scope.
*
* import a = b;
*/
void handleRebind(ir.Import i)
{
// TODO We should not use mod.myScope here,
// but intead link directly to the module.
ir.Scope[] scopes;
foreach (mod; i.targetModules) {
gatherer.addScope(mod);
assert(mod.myScope !is null);
scopes ~= mod.myScope;
}
auto store = current.getStore(i.bind.value);
if (store !is null) {
if (store.fromImplicitContextChain) {
current.remove(i.bind.value);
} else {
throw makeRedefines(/*#ref*/i.loc, /*#ref*/store.node.loc, i.bind.value);
}
}
if (scopes.length == 1) {
ir.Status status;
store = current.addScope(i, scopes[0], i.bind.value, /*#out*/status);
if (status != ir.Status.Success) {
throw panic(/*#ref*/i.loc, "scope redefinition");
}
} else {
ir.Status status;
store = current.addMultiScope(i, scopes, i.bind.value, /*#out*/status);
if (status != ir.Status.Success) {
throw panic(/*#ref*/i.loc, "multi scope redefinition");
}
}
store.importBindAccess = i.access;
}
/*!
* Handles a import with symbol aliases.
*
* import a : b, c;
* import a = b : c, d;
*/
void handleAliases(ir.Import i)
{
panicAssert(i, i.targetModules.length == 1);
panicAssert(i, i.names.length == i.targetModules.length);
auto mod = i.targetModules[0];
auto bindScope = current;
if (i.bind !is null) {
bindScope = buildOrReturnScope(bindScope, i.bind, i.bind.value, false/*is low prio?*/);
} else {
assert(current is mModule.myScope);
}
auto parentMod = getModuleFromScope(/*#ref*/i.loc, current);
foreach (ii, _alias; i.aliases) {
ir.Alias a;
if (_alias[1] is null) {
a = buildAlias(/*#ref*/_alias[0].loc, _alias[0].value, _alias[0].value);
} else {
a = buildAliasSmart(/*#ref*/_alias[0].loc, _alias[0].value, _alias[1]);
}
// `private import a : func` should conflict with a public function of name 'func' in the importing module.
auto ret = parentMod.myScope.getStore(a.name);//lookupInGivenScopeOnly(lp, parentMod.myScope, i.loc, a.name);
if (ret !is null && ret.functions.length > 0) {
foreach (func; ret.functions) {
if (func.access != i.access) {
throw makeOverloadedFunctionsAccessMismatch(i.access, a, func);
}
}
}
// Setup where we should look.
a.lookScope = null;
a.lookModule = mod;
ir.Status status;
a.store = bindScope.addAlias(a, a.name, /*#out*/status);
if (status != ir.Status.Success) {
throw panic(/*#ref*/a.loc, "bind scope redefines symbol");
}
a.store.importBindAccess = i.access;
}
}
/*!
* Most common imports.
*
* import a;
* static import a;
*/
void handleRegularAndStatic(ir.Import i)
{
panicAssert(i, i.targetModules.length == 1);
auto mod = i.targetModules[0];
// TODO We should not use mod.myScope here,
// but intead link directly to the module.
gatherer.addScope(mod);
assert(mod.myScope !is null);
// Where we add the module binding.
ir.Scope parent = mModule.myScope;
// Build the chain of scopes for the import.
// import 'foo.bar.pkg'.mod;
foreach (ident; i.names[0].identifiers[0 .. $-1]) {
parent = buildOrReturnScope(parent, ident, ident.value, !i.isStatic/*is low prio?*/);
}
// Build the final level.
// import foo.bar.pkg.'mod';
auto store = parent.getStore(i.names[0].identifiers[$-1].value);
if (store !is null) {
if (i.isStatic && store.myScope !is mod.myScope) {
throw makeExpected(/*#ref*/i.loc, "unique module");
}
} else {
ir.Status status;
parent.addScope(i, mod.myScope, i.names[0].identifiers[$-1].value, /*#out*/status);
if (status != ir.Status.Success) {
throw panic(/*#ref*/i.loc, "regular scope import redefinition");
}
}
// Add the module to the list of imported modules.
if (!i.isStatic) {
mModule.myScope.importedModules ~= mod;
mModule.myScope.importedAccess ~= i.access;
}
}
/*!
* Used for adding in scopes from static imports
*
* If scope of `name` exists in `parent`, that will be used.
* Otherwise one will be created, see the `lowPriority` parameter
* for behaviour when a non-scope store of `name` already exists
* in `parent`.
*
* @Param parent The scope to build in.
* @Param node The node that introduces the new scope.
* @Param name The name of the scope to add.
* @Param lowPriority If `true`, the scope will not overwrite a non symbol
* scope that already exists. If `false`, such a scope existing will be an error.
*/
ir.Scope buildOrReturnScope(ir.Scope parent, ir.Node node, string name, bool lowPriority)
{
auto store = parent.getStore(name);
if (store !is null && (store.myScope !is null || !lowPriority)) {
// TODO Better error checking here,
// we could be adding to aggregates here.
if (store.myScope is null) {
throw makeExpected(/*#ref*/node.loc, "scope");
}
return store.myScope;
} else {
auto s = new ir.Scope(parent, node, name, parent.nestedDepth);
if (store is null || !lowPriority) {
ir.Status status;
store = parent.addScope(node, s, name, /*#out*/status);
if (status != ir.Status.Success) {
throw panic(/*#ref*/node.loc, "return scope redefinition");
}
store.fromImplicitContextChain = lowPriority;
}
parent = s;
}
return parent;
}
}
|
D
|
func void ZS_Teaching()
{
PrintDebugNpc(PD_TA_FRAME,"ZS_Teaching");
B_SetPerception(self);
AI_SetWalkMode(self,NPC_WALK);
if(!Npc_IsOnFP(self,"TEACHING"))
{
AI_GotoWP(self,self.wp);
};
};
func void ZS_Teaching_Loop()
{
var int guardreaktion;
PrintDebugNpc(PD_TA_LOOP,"ZS_Teaching_Loop");
B_GotoFP(self,"TEACHING");
guardreaktion = Hlp_Random(1000);
if(guardreaktion >= 900)
{
AI_PlayAni(self,"T_DIALOGGESTURE_11");
}
else if(guardreaktion >= 800)
{
AI_PlayAni(self,"T_DIALOGGESTURE_15");
}
else if(guardreaktion >= 700)
{
AI_PlayAni(self,"T_DIALOGGESTURE_16");
}
else if(guardreaktion >= 600)
{
AI_PlayAni(self,"T_DIALOGGESTURE_18");
}
else if(guardreaktion >= 500)
{
AI_PlayAni(self,"T_DIALOGGESTURE_21");
}
else if(guardreaktion >= 400)
{
AI_PlayAni(self,"T_DIALOGGESTURE_20");
};
AI_Wait(self,1);
};
func void ZS_Teaching_End()
{
PrintDebugNpc(PD_TA_FRAME,"ZS_Teaching_End");
};
|
D
|
/Users/salsabilaazaria/Desktop/urskinappProject/Build/Intermediates.noindex/urskinappProject.build/Debug-iphonesimulator/urskinappProject.build/Objects-normal/x86_64/signup.o : /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/profilepage/profilepage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/journalpage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/chatpage/chatpage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/productpage/productpage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/profilepage/CellCollectionSkincare.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/SceneDelegate.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/AppDelegate.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/CollectionViewDetailJournal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/TableCellJournal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/journal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/addjournal/addjournal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/addjournal/journaldetail.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/signup.swift /Users/salsabilaazaria/Desktop/urskinappProject/Build/Intermediates.noindex/urskinappProject.build/Debug-iphonesimulator/urskinappProject.build/DerivedSources/CoreMLGenerated/DecisionTreeClassifier/DecisionTreeClassifier.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/ViewController.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/resultpage/ResultViewController.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/chatpage/CollectionCellChat.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/productpage/TableCellProduct.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/productpage/product.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/resultpage/ResultUIView.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/CoreMIDI.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreML.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.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/AVFoundation.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/CoreAudio.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.7.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreML.framework/Headers/CoreML.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.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.7.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/salsabilaazaria/Desktop/urskinappProject/Build/Intermediates.noindex/urskinappProject.build/Debug-iphonesimulator/urskinappProject.build/Objects-normal/x86_64/signup~partial.swiftmodule : /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/profilepage/profilepage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/journalpage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/chatpage/chatpage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/productpage/productpage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/profilepage/CellCollectionSkincare.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/SceneDelegate.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/AppDelegate.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/CollectionViewDetailJournal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/TableCellJournal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/journal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/addjournal/addjournal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/addjournal/journaldetail.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/signup.swift /Users/salsabilaazaria/Desktop/urskinappProject/Build/Intermediates.noindex/urskinappProject.build/Debug-iphonesimulator/urskinappProject.build/DerivedSources/CoreMLGenerated/DecisionTreeClassifier/DecisionTreeClassifier.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/ViewController.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/resultpage/ResultViewController.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/chatpage/CollectionCellChat.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/productpage/TableCellProduct.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/productpage/product.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/resultpage/ResultUIView.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/CoreMIDI.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreML.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.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/AVFoundation.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/CoreAudio.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.7.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreML.framework/Headers/CoreML.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.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.7.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/salsabilaazaria/Desktop/urskinappProject/Build/Intermediates.noindex/urskinappProject.build/Debug-iphonesimulator/urskinappProject.build/Objects-normal/x86_64/signup~partial.swiftdoc : /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/profilepage/profilepage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/journalpage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/chatpage/chatpage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/productpage/productpage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/profilepage/CellCollectionSkincare.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/SceneDelegate.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/AppDelegate.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/CollectionViewDetailJournal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/TableCellJournal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/journal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/addjournal/addjournal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/addjournal/journaldetail.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/signup.swift /Users/salsabilaazaria/Desktop/urskinappProject/Build/Intermediates.noindex/urskinappProject.build/Debug-iphonesimulator/urskinappProject.build/DerivedSources/CoreMLGenerated/DecisionTreeClassifier/DecisionTreeClassifier.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/ViewController.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/resultpage/ResultViewController.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/chatpage/CollectionCellChat.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/productpage/TableCellProduct.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/productpage/product.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/resultpage/ResultUIView.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/CoreMIDI.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreML.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.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/AVFoundation.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/CoreAudio.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.7.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreML.framework/Headers/CoreML.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.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.7.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/salsabilaazaria/Desktop/urskinappProject/Build/Intermediates.noindex/urskinappProject.build/Debug-iphonesimulator/urskinappProject.build/Objects-normal/x86_64/signup~partial.swiftsourceinfo : /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/profilepage/profilepage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/journalpage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/chatpage/chatpage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/productpage/productpage.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/profilepage/CellCollectionSkincare.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/SceneDelegate.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/AppDelegate.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/CollectionViewDetailJournal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/TableCellJournal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/journalpage/journal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/addjournal/addjournal.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/addjournal/journaldetail.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/signup.swift /Users/salsabilaazaria/Desktop/urskinappProject/Build/Intermediates.noindex/urskinappProject.build/Debug-iphonesimulator/urskinappProject.build/DerivedSources/CoreMLGenerated/DecisionTreeClassifier/DecisionTreeClassifier.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/ViewController.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/resultpage/ResultViewController.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/chatpage/CollectionCellChat.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/productpage/TableCellProduct.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/productpage/product.swift /Users/salsabilaazaria/Desktop/urskinappProject/urskinappProject/resultpage/ResultUIView.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/CoreMIDI.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreML.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.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/AVFoundation.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/CoreAudio.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.7.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreML.framework/Headers/CoreML.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.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.7.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/++
This is an html DOM implementation, started with cloning
what the browser offers in Javascript, but going well beyond
it in convenience.
If you can do it in Javascript, you can probably do it with
this module, and much more.
---
import arsd.dom;
void main() {
auto document = new Document("<html><p>paragraph</p></html>");
writeln(document.querySelector("p"));
document.root.innerHTML = "<p>hey</p>";
writeln(document);
}
---
BTW: this file optionally depends on `arsd.characterencodings`, to
help it correctly read files from the internet. You should be able to
get characterencodings.d from the same place you got this file.
If you want it to stand alone, just always use the `Document.parseUtf8`
function or the constructor that takes a string.
+/
module arsd.dom;
// FIXME: support the css standard namespace thing in the selectors too
version(with_arsd_jsvar)
import arsd.jsvar;
else {
enum Scriptable;
}
// this is only meant to be used at compile time, as a filter for opDispatch
// lists the attributes we want to allow without the use of .attr
bool isConvenientAttribute(string name) {
static immutable list = [
"name", "id", "href", "value",
"checked", "selected", "type",
"src", "content", "pattern",
"placeholder", "required", "alt",
"rel",
"method", "action", "enctype"
];
foreach(l; list)
if(name == l) return true;
return false;
}
// FIXME: something like <ol>spam <ol> with no closing </ol> should read the second tag as the closer in garbage mode
// FIXME: failing to close a paragraph sometimes messes things up too
// FIXME: it would be kinda cool to have some support for internal DTDs
// and maybe XPath as well, to some extent
/*
we could do
meh this sux
auto xpath = XPath(element);
// get the first p
xpath.p[0].a["href"]
*/
/// The main document interface, including a html parser.
class Document : FileResource {
///.
this(string data, bool caseSensitive = false, bool strict = false) {
parseUtf8(data, caseSensitive, strict);
}
/**
Creates an empty document. It has *nothing* in it at all.
*/
this() {
}
/// This is just something I'm toying with. Right now, you use opIndex to put in css selectors.
/// It returns a struct that forwards calls to all elements it holds, and returns itself so you
/// can chain it.
///
/// Example: document["p"].innerText("hello").addClass("modified");
///
/// Equivalent to: foreach(e; document.getElementsBySelector("p")) { e.innerText("hello"); e.addClas("modified"); }
///
/// Note: always use function calls (not property syntax) and don't use toString in there for best results.
///
/// You can also do things like: document["p"]["b"] though tbh I'm not sure why since the selector string can do all that anyway. Maybe
/// you could put in some kind of custom filter function tho.
ElementCollection opIndex(string selector) {
auto e = ElementCollection(this.root);
return e[selector];
}
string _contentType = "text/html; charset=utf-8";
/// If you're using this for some other kind of XML, you can
/// set the content type here.
///
/// Note: this has no impact on the function of this class.
/// It is only used if the document is sent via a protocol like HTTP.
///
/// This may be called by parse() if it recognizes the data. Otherwise,
/// if you don't set it, it assumes text/html; charset=utf-8.
@property string contentType(string mimeType) {
_contentType = mimeType;
return _contentType;
}
/// implementing the FileResource interface, useful for sending via
/// http automatically.
override @property string contentType() const {
return _contentType;
}
/// implementing the FileResource interface; it calls toString.
override immutable(ubyte)[] getData() const {
return cast(immutable(ubyte)[]) this.toString();
}
/// Concatenates any consecutive text nodes
/*
void normalize() {
}
*/
/// This will set delegates for parseSaw* (note: this overwrites anything else you set, and you setting subsequently will overwrite this) that add those things to the dom tree when it sees them.
/// Call this before calling parse().
/// Note this will also preserve the prolog and doctype from the original file, if there was one.
void enableAddingSpecialTagsToDom() {
parseSawComment = (string) => true;
parseSawAspCode = (string) => true;
parseSawPhpCode = (string) => true;
parseSawQuestionInstruction = (string) => true;
parseSawBangInstruction = (string) => true;
}
/// If the parser sees a html comment, it will call this callback
/// <!-- comment --> will call parseSawComment(" comment ")
/// Return true if you want the node appended to the document.
bool delegate(string) parseSawComment;
/// If the parser sees <% asp code... %>, it will call this callback.
/// It will be passed "% asp code... %" or "%= asp code .. %"
/// Return true if you want the node appended to the document.
bool delegate(string) parseSawAspCode;
/// If the parser sees <?php php code... ?>, it will call this callback.
/// It will be passed "?php php code... ?" or "?= asp code .. ?"
/// Note: dom.d cannot identify the other php <? code ?> short format.
/// Return true if you want the node appended to the document.
bool delegate(string) parseSawPhpCode;
/// if it sees a <?xxx> that is not php or asp
/// it calls this function with the contents.
/// <?SOMETHING foo> calls parseSawQuestionInstruction("?SOMETHING foo")
/// Unlike the php/asp ones, this ends on the first > it sees, without requiring ?>.
/// Return true if you want the node appended to the document.
bool delegate(string) parseSawQuestionInstruction;
/// if it sees a <! that is not CDATA or comment (CDATA is handled automatically and comments call parseSawComment),
/// it calls this function with the contents.
/// <!SOMETHING foo> calls parseSawBangInstruction("SOMETHING foo")
/// Return true if you want the node appended to the document.
bool delegate(string) parseSawBangInstruction;
/// Given the kind of garbage you find on the Internet, try to make sense of it.
/// Equivalent to document.parse(data, false, false, null);
/// (Case-insensitive, non-strict, determine character encoding from the data.)
/// NOTE: this makes no attempt at added security.
///
/// It is a template so it lazily imports characterencodings.
void parseGarbage()(string data) {
parse(data, false, false, null);
}
/// Parses well-formed UTF-8, case-sensitive, XML or XHTML
/// Will throw exceptions on things like unclosed tags.
void parseStrict(string data) {
parseStream(toUtf8Stream(data), true, true);
}
/// Parses well-formed UTF-8 in loose mode (by default). Tries to correct
/// tag soup, but does NOT try to correct bad character encodings.
///
/// They will still throw an exception.
void parseUtf8(string data, bool caseSensitive = false, bool strict = false) {
parseStream(toUtf8Stream(data), caseSensitive, strict);
}
// this is a template so we get lazy import behavior
Utf8Stream handleDataEncoding()(in string rawdata, string dataEncoding, bool strict) {
import arsd.characterencodings;
// gotta determine the data encoding. If you know it, pass it in above to skip all this.
if(dataEncoding is null) {
dataEncoding = tryToDetermineEncoding(cast(const(ubyte[])) rawdata);
// it can't tell... probably a random 8 bit encoding. Let's check the document itself.
// Now, XML and HTML can both list encoding in the document, but we can't really parse
// it here without changing a lot of code until we know the encoding. So I'm going to
// do some hackish string checking.
if(dataEncoding is null) {
auto dataAsBytes = cast(immutable(ubyte)[]) rawdata;
// first, look for an XML prolog
auto idx = indexOfBytes(dataAsBytes, cast(immutable ubyte[]) "encoding=\"");
if(idx != -1) {
idx += "encoding=\"".length;
// we're probably past the prolog if it's this far in; we might be looking at
// content. Forget about it.
if(idx > 100)
idx = -1;
}
// if that fails, we're looking for Content-Type http-equiv or a meta charset (see html5)..
if(idx == -1) {
idx = indexOfBytes(dataAsBytes, cast(immutable ubyte[]) "charset=");
if(idx != -1) {
idx += "charset=".length;
if(dataAsBytes[idx] == '"')
idx++;
}
}
// found something in either branch...
if(idx != -1) {
// read till a quote or about 12 chars, whichever comes first...
auto end = idx;
while(end < dataAsBytes.length && dataAsBytes[end] != '"' && end - idx < 12)
end++;
dataEncoding = cast(string) dataAsBytes[idx .. end];
}
// otherwise, we just don't know.
}
}
if(dataEncoding is null) {
if(strict)
throw new MarkupException("I couldn't figure out the encoding of this document.");
else
// if we really don't know by here, it means we already tried UTF-8,
// looked for utf 16 and 32 byte order marks, and looked for xml or meta
// tags... let's assume it's Windows-1252, since that's probably the most
// common aside from utf that wouldn't be labeled.
dataEncoding = "Windows 1252";
}
// and now, go ahead and convert it.
string data;
if(!strict) {
// if we're in non-strict mode, we need to check
// the document for mislabeling too; sometimes
// web documents will say they are utf-8, but aren't
// actually properly encoded. If it fails to validate,
// we'll assume it's actually Windows encoding - the most
// likely candidate for mislabeled garbage.
dataEncoding = dataEncoding.toLower();
dataEncoding = dataEncoding.replace(" ", "");
dataEncoding = dataEncoding.replace("-", "");
dataEncoding = dataEncoding.replace("_", "");
if(dataEncoding == "utf8") {
try {
validate(rawdata);
} catch(UTFException e) {
dataEncoding = "Windows 1252";
}
}
}
if(dataEncoding != "UTF-8") {
if(strict)
data = convertToUtf8(cast(immutable(ubyte)[]) rawdata, dataEncoding);
else {
try {
data = convertToUtf8(cast(immutable(ubyte)[]) rawdata, dataEncoding);
} catch(Exception e) {
data = convertToUtf8(cast(immutable(ubyte)[]) rawdata, "Windows 1252");
}
}
} else
data = rawdata;
return toUtf8Stream(data);
}
private
Utf8Stream toUtf8Stream(in string rawdata) {
string data = rawdata;
static if(is(Utf8Stream == string))
return data;
else
return new Utf8Stream(data);
}
/**
Take XMLish data and try to make the DOM tree out of it.
The goal isn't to be perfect, but to just be good enough to
approximate Javascript's behavior.
If strict, it throws on something that doesn't make sense.
(Examples: mismatched tags. It doesn't validate!)
If not strict, it tries to recover anyway, and only throws
when something is REALLY unworkable.
If strict is false, it uses a magic list of tags that needn't
be closed. If you are writing a document specifically for this,
try to avoid such - use self closed tags at least. Easier to parse.
The dataEncoding argument can be used to pass a specific
charset encoding for automatic conversion. If null (which is NOT
the default!), it tries to determine from the data itself,
using the xml prolog or meta tags, and assumes UTF-8 if unsure.
If this assumption is wrong, it can throw on non-ascii
characters!
Note that it previously assumed the data was encoded as UTF-8, which
is why the dataEncoding argument defaults to that.
So it shouldn't break backward compatibility.
But, if you want the best behavior on wild data - figuring it out from the document
instead of assuming - you'll probably want to change that argument to null.
This is a template so it lazily imports arsd.characterencodings, which is required
to fix up data encodings.
If you are sure the encoding is good, try parseUtf8 or parseStrict to avoid the
dependency. If it is data from the Internet though, a random website, the encoding
is often a lie. This function, if dataEncoding == null, can correct for that, or
you can try parseGarbage. In those cases, arsd.characterencodings is required to
compile.
*/
void parse()(in string rawdata, bool caseSensitive = false, bool strict = false, string dataEncoding = "UTF-8") {
auto data = handleDataEncoding(rawdata, dataEncoding, strict);
parseStream(data, caseSensitive, strict);
}
// note: this work best in strict mode, unless data is just a simple string wrapper
void parseStream(Utf8Stream data, bool caseSensitive = false, bool strict = false) {
// FIXME: this parser could be faster; it's in the top ten biggest tree times according to the profiler
// of my big app.
assert(data !is null);
// go through character by character.
// if you see a <, consider it a tag.
// name goes until the first non tagname character
// then see if it self closes or has an attribute
// if not in a tag, anything not a tag is a big text
// node child. It ends as soon as it sees a <
// Whitespace in text or attributes is preserved, but not between attributes
// & and friends are converted when I know them, left the same otherwise
// this it should already be done correctly.. so I'm leaving it off to net a ~10% speed boost on my typical test file (really)
//validate(data); // it *must* be UTF-8 for this to work correctly
sizediff_t pos = 0;
clear();
loose = !caseSensitive;
bool sawImproperNesting = false;
bool paragraphHackfixRequired = false;
int getLineNumber(sizediff_t p) {
int line = 1;
foreach(c; data[0..p])
if(c == '\n')
line++;
return line;
}
void parseError(string message) {
throw new MarkupException(format("char %d (line %d): %s", pos, getLineNumber(pos), message));
}
void eatWhitespace() {
while(pos < data.length && (data[pos] == ' ' || data[pos] == '\n' || data[pos] == '\t'))
pos++;
}
string readTagName() {
// remember to include : for namespaces
// basically just keep going until >, /, or whitespace
auto start = pos;
while( data[pos] != '>' && data[pos] != '/' &&
data[pos] != ' ' && data[pos] != '\n' && data[pos] != '\t')
{
pos++;
if(pos == data.length) {
if(strict)
throw new Exception("tag name incomplete when file ended");
else
break;
}
}
if(!caseSensitive)
return toLower(data[start..pos]);
else
return data[start..pos];
}
string readAttributeName() {
// remember to include : for namespaces
// basically just keep going until >, /, or whitespace
auto start = pos;
while( data[pos] != '>' && data[pos] != '/' && data[pos] != '=' &&
data[pos] != ' ' && data[pos] != '\n' && data[pos] != '\t')
{
if(data[pos] == '<') {
if(strict)
throw new MarkupException("The character < can never appear in an attribute name. Line " ~ to!string(getLineNumber(pos)));
else
break; // e.g. <a href="something" <img src="poo" /></a>. The > should have been after the href, but some shitty files don't do that right and the browser handles it, so we will too, by pretending the > was indeed there
}
pos++;
if(pos == data.length) {
if(strict)
throw new Exception("unterminated attribute name");
else
break;
}
}
if(!caseSensitive)
return toLower(data[start..pos]);
else
return data[start..pos];
}
string readAttributeValue() {
if(pos >= data.length) {
if(strict)
throw new Exception("no attribute value before end of file");
else
return null;
}
switch(data[pos]) {
case '\'':
case '"':
auto started = pos;
char end = data[pos];
pos++;
auto start = pos;
while(pos < data.length && data[pos] != end)
pos++;
if(strict && pos == data.length)
throw new MarkupException("Unclosed attribute value, started on char " ~ to!string(started));
string v = htmlEntitiesDecode(data[start..pos], strict);
pos++; // skip over the end
return v;
default:
if(strict)
parseError("Attributes must be quoted");
// read until whitespace or terminator (/ or >)
auto start = pos;
while(
pos < data.length &&
data[pos] != '>' &&
// unquoted attributes might be urls, so gotta be careful with them and self-closed elements
!(data[pos] == '/' && pos + 1 < data.length && data[pos+1] == '>') &&
data[pos] != ' ' && data[pos] != '\n' && data[pos] != '\t')
pos++;
string v = htmlEntitiesDecode(data[start..pos], strict);
// don't skip the end - we'll need it later
return v;
}
}
TextNode readTextNode() {
auto start = pos;
while(pos < data.length && data[pos] != '<') {
pos++;
}
return TextNode.fromUndecodedString(this, data[start..pos]);
}
// this is obsolete!
RawSource readCDataNode() {
auto start = pos;
while(pos < data.length && data[pos] != '<') {
pos++;
}
return new RawSource(this, data[start..pos]);
}
struct Ele {
int type; // element or closing tag or nothing
/*
type == 0 means regular node, self-closed (element is valid)
type == 1 means closing tag (payload is the tag name, element may be valid)
type == 2 means you should ignore it completely
type == 3 means it is a special element that should be appended, if possible, e.g. a <!DOCTYPE> that was chosen to be kept, php code, or comment. It will be appended at the current element if inside the root, and to a special document area if not
type == 4 means the document was totally empty
*/
Element element; // for type == 0 or type == 3
string payload; // for type == 1
}
// recursively read a tag
Ele readElement(string[] parentChain = null) {
// FIXME: this is the slowest function in this module, by far, even in strict mode.
// Loose mode should perform decently, but strict mode is the important one.
if(!strict && parentChain is null)
parentChain = [];
static string[] recentAutoClosedTags;
if(pos >= data.length)
{
if(strict) {
throw new MarkupException("Gone over the input (is there no root element or did it never close?), chain: " ~ to!string(parentChain));
} else {
if(parentChain.length)
return Ele(1, null, parentChain[0]); // in loose mode, we just assume the document has ended
else
return Ele(4); // signal emptiness upstream
}
}
if(data[pos] != '<') {
return Ele(0, readTextNode(), null);
}
enforce(data[pos] == '<');
pos++;
if(pos == data.length) {
if(strict)
throw new MarkupException("Found trailing < at end of file");
// if not strict, we'll just skip the switch
} else
switch(data[pos]) {
// I don't care about these, so I just want to skip them
case '!': // might be a comment, a doctype, or a special instruction
pos++;
// FIXME: we should store these in the tree too
// though I like having it stripped out tbh.
if(pos == data.length) {
if(strict)
throw new MarkupException("<! opened at end of file");
} else if(data[pos] == '-' && (pos + 1 < data.length) && data[pos+1] == '-') {
// comment
pos += 2;
// FIXME: technically, a comment is anything
// between -- and -- inside a <!> block.
// so in <!-- test -- lol> , the " lol" is NOT a comment
// and should probably be handled differently in here, but for now
// I'll just keep running until --> since that's the common way
auto commentStart = pos;
while(pos+3 < data.length && data[pos..pos+3] != "-->")
pos++;
auto end = commentStart;
if(pos + 3 >= data.length) {
if(strict)
throw new MarkupException("unclosed comment");
end = data.length;
pos = data.length;
} else {
end = pos;
assert(data[pos] == '-');
pos++;
assert(data[pos] == '-');
pos++;
assert(data[pos] == '>');
pos++;
}
if(parseSawComment !is null)
if(parseSawComment(data[commentStart .. end])) {
return Ele(3, new HtmlComment(this, data[commentStart .. end]), null);
}
} else if(pos + 7 <= data.length && data[pos..pos + 7] == "[CDATA[") {
pos += 7;
auto cdataStart = pos;
ptrdiff_t end = -1;
typeof(end) cdataEnd;
if(pos < data.length) {
// cdata isn't allowed to nest, so this should be generally ok, as long as it is found
end = data[pos .. $].indexOf("]]>");
}
if(end == -1) {
if(strict)
throw new MarkupException("Unclosed CDATA section");
end = pos;
cdataEnd = pos;
} else {
cdataEnd = pos + end;
pos = cdataEnd + 3;
}
return Ele(0, new TextNode(this, data[cdataStart .. cdataEnd]), null);
} else {
auto start = pos;
while(pos < data.length && data[pos] != '>')
pos++;
auto bangEnds = pos;
if(pos == data.length) {
if(strict)
throw new MarkupException("unclosed processing instruction (<!xxx>)");
} else pos++; // skipping the >
if(parseSawBangInstruction !is null)
if(parseSawBangInstruction(data[start .. bangEnds])) {
// FIXME: these should be able to modify the parser state,
// doing things like adding entities, somehow.
return Ele(3, new BangInstruction(this, data[start .. bangEnds]), null);
}
}
/*
if(pos < data.length && data[pos] == '>')
pos++; // skip the >
else
assert(!strict);
*/
break;
case '%':
case '?':
/*
Here's what we want to support:
<% asp code %>
<%= asp code %>
<?php php code ?>
<?= php code ?>
The contents don't really matter, just if it opens with
one of the above for, it ends on the two char terminator.
<?something>
this is NOT php code
because I've seen this in the wild: <?EM-dummyText>
This could be php with shorttags which would be cut off
prematurely because if(a >) - that > counts as the close
of the tag, but since dom.d can't tell the difference
between that and the <?EM> real world example, it will
not try to look for the ?> ending.
The difference between this and the asp/php stuff is that it
ends on >, not ?>. ONLY <?php or <?= ends on ?>. The rest end
on >.
*/
char end = data[pos];
auto started = pos;
bool isAsp = end == '%';
int currentIndex = 0;
bool isPhp = false;
bool isEqualTag = false;
int phpCount = 0;
more:
pos++; // skip the start
if(pos == data.length) {
if(strict)
throw new MarkupException("Unclosed <"~end~" by end of file");
} else {
currentIndex++;
if(currentIndex == 1 && data[pos] == '=') {
if(!isAsp)
isPhp = true;
isEqualTag = true;
goto more;
}
if(currentIndex == 1 && data[pos] == 'p')
phpCount++;
if(currentIndex == 2 && data[pos] == 'h')
phpCount++;
if(currentIndex == 3 && data[pos] == 'p' && phpCount == 2)
isPhp = true;
if(data[pos] == '>') {
if((isAsp || isPhp) && data[pos - 1] != end)
goto more;
// otherwise we're done
} else
goto more;
}
//writefln("%s: %s", isAsp ? "ASP" : isPhp ? "PHP" : "<? ", data[started .. pos]);
auto code = data[started .. pos];
assert((pos < data.length && data[pos] == '>') || (!strict && pos == data.length));
if(pos < data.length)
pos++; // get past the >
if(isAsp && parseSawAspCode !is null) {
if(parseSawAspCode(code)) {
return Ele(3, new AspCode(this, code), null);
}
} else if(isPhp && parseSawPhpCode !is null) {
if(parseSawPhpCode(code)) {
return Ele(3, new PhpCode(this, code), null);
}
} else if(!isAsp && !isPhp && parseSawQuestionInstruction !is null) {
if(parseSawQuestionInstruction(code)) {
return Ele(3, new QuestionInstruction(this, code), null);
}
}
break;
case '/': // closing an element
pos++; // skip the start
auto p = pos;
while(pos < data.length && data[pos] != '>')
pos++;
//writefln("</%s>", data[p..pos]);
if(pos == data.length && data[pos-1] != '>') {
if(strict)
throw new MarkupException("File ended before closing tag had a required >");
else
data ~= ">"; // just hack it in
}
pos++; // skip the '>'
string tname = data[p..pos-1];
if(!caseSensitive)
tname = tname.toLower();
return Ele(1, null, tname); // closing tag reports itself here
case ' ': // assume it isn't a real element...
if(strict)
parseError("bad markup - improperly placed <");
else
return Ele(0, TextNode.fromUndecodedString(this, "<"), null);
break;
default:
if(!strict) {
// what about something that kinda looks like a tag, but isn't?
auto nextTag = data[pos .. $].indexOf("<");
auto closeTag = data[pos .. $].indexOf(">");
if(closeTag != -1 && nextTag != -1)
if(nextTag < closeTag) {
// since attribute names cannot possibly have a < in them, we'll look for an equal since it might be an attribute value... and even in garbage mode, it'd have to be a quoted one realistically
auto equal = data[pos .. $].indexOf("=\"");
if(equal != -1 && equal < closeTag) {
// this MIGHT be ok, soldier on
} else {
// definitely no good, this must be a (horribly distorted) text node
pos++; // skip the < we're on - don't want text node to end prematurely
auto node = readTextNode();
node.contents = "<" ~ node.contents; // put this back
return Ele(0, node, null);
}
}
}
string tagName = readTagName();
string[string] attributes;
Ele addTag(bool selfClosed) {
if(selfClosed)
pos++;
else {
if(!strict)
if(tagName.isInArray(selfClosedElements))
// these are de-facto self closed
selfClosed = true;
}
if(strict)
enforce(data[pos] == '>');//, format("got %s when expecting >\nContext:\n%s", data[pos], data[pos - 100 .. pos + 100]));
else {
// if we got here, it's probably because a slash was in an
// unquoted attribute - don't trust the selfClosed value
if(!selfClosed)
selfClosed = tagName.isInArray(selfClosedElements);
while(pos < data.length && data[pos] != '>')
pos++;
}
auto whereThisTagStarted = pos; // for better error messages
pos++;
auto e = createElement(tagName);
e.attributes = attributes;
version(dom_node_indexes) {
if(e.dataset.nodeIndex.length == 0)
e.dataset.nodeIndex = to!string(&(e.attributes));
}
e.selfClosed = selfClosed;
e.parseAttributes();
// HACK to handle script and style as a raw data section as it is in HTML browsers
if(tagName == "script" || tagName == "style") {
if(!selfClosed) {
string closer = "</" ~ tagName ~ ">";
ptrdiff_t ending;
if(pos >= data.length)
ending = -1;
else
ending = indexOf(data[pos..$], closer);
ending = indexOf(data[pos..$], closer, 0, (loose ? CaseSensitive.no : CaseSensitive.yes));
/*
if(loose && ending == -1 && pos < data.length)
ending = indexOf(data[pos..$], closer.toUpper());
*/
if(ending == -1) {
if(strict)
throw new Exception("tag " ~ tagName ~ " never closed");
else {
// let's call it totally empty and do the rest of the file as text. doing it as html could still result in some weird stuff like if(a<4) being read as <4 being a tag so it comes out if(a<4></4> and other weirdness) It is either a closed script tag or the rest of the file is forfeit.
if(pos < data.length) {
e = new TextNode(this, data[pos .. $]);
pos = data.length;
}
}
} else {
ending += pos;
e.innerRawSource = data[pos..ending];
pos = ending + closer.length;
}
}
return Ele(0, e, null);
}
bool closed = selfClosed;
void considerHtmlParagraphHack(Element n) {
assert(!strict);
if(e.tagName == "p" && e.tagName == n.tagName) {
// html lets you write <p> para 1 <p> para 1
// but in the dom tree, they should be siblings, not children.
paragraphHackfixRequired = true;
}
}
//writef("<%s>", tagName);
while(!closed) {
Ele n;
if(strict)
n = readElement();
else
n = readElement(parentChain ~ tagName);
if(n.type == 4) return n; // the document is empty
if(n.type == 3 && n.element !is null) {
// special node, append if possible
if(e !is null)
e.appendChild(n.element);
else
piecesBeforeRoot ~= n.element;
} else if(n.type == 0) {
if(!strict)
considerHtmlParagraphHack(n.element);
e.appendChild(n.element);
} else if(n.type == 1) {
bool found = false;
if(n.payload != tagName) {
if(strict)
parseError(format("mismatched tag: </%s> != <%s> (opened on line %d)", n.payload, tagName, getLineNumber(whereThisTagStarted)));
else {
sawImproperNesting = true;
// this is so we don't drop several levels of awful markup
if(n.element) {
if(!strict)
considerHtmlParagraphHack(n.element);
e.appendChild(n.element);
n.element = null;
}
// is the element open somewhere up the chain?
foreach(i, parent; parentChain)
if(parent == n.payload) {
recentAutoClosedTags ~= tagName;
// just rotating it so we don't inadvertently break stuff with vile crap
if(recentAutoClosedTags.length > 4)
recentAutoClosedTags = recentAutoClosedTags[1 .. $];
n.element = e;
return n;
}
// if not, this is a text node; we can't fix it up...
// If it's already in the tree somewhere, assume it is closed by algorithm
// and we shouldn't output it - odds are the user just flipped a couple tags
foreach(ele; e.tree) {
if(ele.tagName == n.payload) {
found = true;
break;
}
}
foreach(ele; recentAutoClosedTags) {
if(ele == n.payload) {
found = true;
break;
}
}
if(!found) // if not found in the tree though, it's probably just text
e.appendChild(TextNode.fromUndecodedString(this, "</"~n.payload~">"));
}
} else {
if(n.element) {
if(!strict)
considerHtmlParagraphHack(n.element);
e.appendChild(n.element);
}
}
if(n.payload == tagName) // in strict mode, this is always true
closed = true;
} else { /*throw new Exception("wtf " ~ tagName);*/ }
}
//writef("</%s>\n", tagName);
return Ele(0, e, null);
}
// if a tag was opened but not closed by end of file, we can arrive here
if(!strict && pos >= data.length)
return addTag(false);
//else if(strict) assert(0); // should be caught before
switch(data[pos]) {
default: assert(0);
case '/': // self closing tag
return addTag(true);
case '>':
return addTag(false);
case ' ':
case '\t':
case '\n':
// there might be attributes...
moreAttributes:
eatWhitespace();
// same deal as above the switch....
if(!strict && pos >= data.length)
return addTag(false);
if(strict && pos >= data.length)
throw new MarkupException("tag open, didn't find > before end of file");
switch(data[pos]) {
case '/': // self closing tag
return addTag(true);
case '>': // closed tag; open -- we now read the contents
return addTag(false);
default: // it is an attribute
string attrName = readAttributeName();
string attrValue = attrName;
if(pos >= data.length) {
if(strict)
assert(0, "this should have thrown in readAttributeName");
else {
data ~= ">";
goto blankValue;
}
}
if(data[pos] == '=') {
pos++;
attrValue = readAttributeValue();
}
blankValue:
if(strict && attrName in attributes)
throw new MarkupException("Repeated attribute: " ~ attrName);
if(attrName.strip().length)
attributes[attrName] = attrValue;
else if(strict) throw new MarkupException("wtf, zero length attribute name");
if(!strict && pos < data.length && data[pos] == '<') {
// this is the broken tag that doesn't have a > at the end
data = data[0 .. pos] ~ ">" ~ data[pos.. $];
// let's insert one as a hack
goto case '>';
}
goto moreAttributes;
}
}
}
return Ele(2, null, null); // this is a <! or <? thing that got ignored prolly.
//assert(0);
}
eatWhitespace();
Ele r;
do {
r = readElement(); // there SHOULD only be one element...
if(r.type == 3 && r.element !is null)
piecesBeforeRoot ~= r.element;
if(r.type == 4)
break; // the document is completely empty...
} while (r.type != 0 || r.element.nodeType != 1); // we look past the xml prologue and doctype; root only begins on a regular node
root = r.element;
if(!strict) // in strict mode, we'll just ignore stuff after the xml
while(r.type != 4) {
r = readElement();
if(r.type != 4 && r.type != 2) { // if not empty and not ignored
if(r.element !is null)
piecesAfterRoot ~= r.element;
}
}
if(root is null)
{
if(strict)
assert(0, "empty document should be impossible in strict mode");
else
parseUtf8(`<html><head></head><body></body></html>`); // fill in a dummy document in loose mode since that's what browsers do
}
if(paragraphHackfixRequired) {
assert(!strict); // this should never happen in strict mode; it ought to never set the hack flag...
// in loose mode, we can see some "bad" nesting (it's valid html, but poorly formed xml).
// It's hard to handle above though because my code sucks. So, we'll fix it here.
auto iterator = root.tree;
foreach(ele; iterator) {
if(ele.parentNode is null)
continue;
if(ele.tagName == "p" && ele.parentNode.tagName == ele.tagName) {
auto shouldBePreviousSibling = ele.parentNode;
auto holder = shouldBePreviousSibling.parentNode; // this is the two element's mutual holder...
holder.insertAfter(shouldBePreviousSibling, ele.removeFromTree());
iterator.currentKilled(); // the current branch can be skipped; we'll hit it soon anyway since it's now next up.
}
}
}
}
/* end massive parse function */
/// Gets the <title> element's innerText, if one exists
@property string title() {
bool doesItMatch(Element e) {
return (e.tagName == "title");
}
auto e = findFirst(&doesItMatch);
if(e)
return e.innerText();
return "";
}
/// Sets the title of the page, creating a <title> element if needed.
@property void title(string t) {
bool doesItMatch(Element e) {
return (e.tagName == "title");
}
auto e = findFirst(&doesItMatch);
if(!e) {
e = createElement("title");
auto heads = getElementsByTagName("head");
if(heads.length)
heads[0].appendChild(e);
}
if(e)
e.innerText = t;
}
// FIXME: would it work to alias root this; ???? might be a good idea
/// These functions all forward to the root element. See the documentation in the Element class.
Element getElementById(string id) {
return root.getElementById(id);
}
/// ditto
final SomeElementType requireElementById(SomeElementType = Element)(string id, string file = __FILE__, size_t line = __LINE__)
if( is(SomeElementType : Element))
out(ret) { assert(ret !is null); }
body {
return root.requireElementById!(SomeElementType)(id, file, line);
}
/// ditto
final SomeElementType requireSelector(SomeElementType = Element)(string selector, string file = __FILE__, size_t line = __LINE__)
if( is(SomeElementType : Element))
out(ret) { assert(ret !is null); }
body {
return root.requireSelector!(SomeElementType)(selector, file, line);
}
/// ditto
Element querySelector(string selector) {
return root.querySelector(selector);
}
/// ditto
Element[] querySelectorAll(string selector) {
return root.querySelectorAll(selector);
}
/// ditto
Element[] getElementsBySelector(string selector) {
return root.getElementsBySelector(selector);
}
/// ditto
Element[] getElementsByTagName(string tag) {
return root.getElementsByTagName(tag);
}
/// ditto
Element[] getElementsByClassName(string tag) {
return root.getElementsByClassName(tag);
}
/** FIXME: btw, this could just be a lazy range...... */
Element getFirstElementByTagName(string tag) {
if(loose)
tag = tag.toLower();
bool doesItMatch(Element e) {
return e.tagName == tag;
}
return findFirst(&doesItMatch);
}
/// This returns the <body> element, if there is one. (It different than Javascript, where it is called 'body', because body is a keyword in D.)
Element mainBody() {
return getFirstElementByTagName("body");
}
/// this uses a weird thing... it's [name=] if no colon and
/// [property=] if colon
string getMeta(string name) {
string thing = name.indexOf(":") == -1 ? "name" : "property";
auto e = querySelector("head meta["~thing~"="~name~"]");
if(e is null)
return null;
return e.content;
}
/// Sets a meta tag in the document header. It is kinda hacky to work easily for both Facebook open graph and traditional html meta tags/
void setMeta(string name, string value) {
string thing = name.indexOf(":") == -1 ? "name" : "property";
auto e = querySelector("head meta["~thing~"="~name~"]");
if(e is null) {
e = requireSelector("head").addChild("meta");
e.setAttribute(thing, name);
}
e.content = value;
}
///.
Form[] forms() {
return cast(Form[]) getElementsByTagName("form");
}
///.
Form createForm()
out(ret) {
assert(ret !is null);
}
body {
return cast(Form) createElement("form");
}
///.
Element createElement(string name) {
if(loose)
name = name.toLower();
auto e = Element.make(name);
e.parentDocument = this;
return e;
// return new Element(this, name, null, selfClosed);
}
///.
Element createFragment() {
return new DocumentFragment(this);
}
///.
Element createTextNode(string content) {
return new TextNode(this, content);
}
///.
Element findFirst(bool delegate(Element) doesItMatch) {
Element result;
bool goThroughElement(Element e) {
if(doesItMatch(e)) {
result = e;
return true;
}
foreach(child; e.children) {
if(goThroughElement(child))
return true;
}
return false;
}
goThroughElement(root);
return result;
}
///.
void clear() {
root = null;
loose = false;
}
///.
void setProlog(string d) {
_prolog = d;
prologWasSet = true;
}
///.
private string _prolog = "<!DOCTYPE html>\n";
private bool prologWasSet = false; // set to true if the user changed it
@property string prolog() const {
// if the user explicitly changed it, do what they want
// or if we didn't keep/find stuff from the document itself,
// we'll use the builtin one as a default.
if(prologWasSet || piecesBeforeRoot.length == 0)
return _prolog;
string p;
foreach(e; piecesBeforeRoot)
p ~= e.toString() ~ "\n";
return p;
}
///.
override string toString() const {
return prolog ~ root.toString();
}
///.
Element root;
/// if these were kept, this is stuff that appeared before the root element, such as <?xml version ?> decls and <!DOCTYPE>s
Element[] piecesBeforeRoot;
/// stuff after the root, only stored in non-strict mode and not used in toString, but available in case you want it
Element[] piecesAfterRoot;
///.
bool loose;
// what follows are for mutation events that you can observe
void delegate(DomMutationEvent)[] eventObservers;
void dispatchMutationEvent(DomMutationEvent e) {
foreach(o; eventObservers)
o(e);
}
}
/// This represents almost everything in the DOM.
class Element {
/// Calls getElementById, but throws instead of returning null if the element is not found. You can also ask for a specific subclass of Element to dynamically cast to, which also throws if it cannot be done.
final SomeElementType requireElementById(SomeElementType = Element)(string id, string file = __FILE__, size_t line = __LINE__)
if(
is(SomeElementType : Element)
)
out(ret) {
assert(ret !is null);
}
body {
auto e = cast(SomeElementType) getElementById(id);
if(e is null)
throw new ElementNotFoundException(SomeElementType.stringof, "id=" ~ id, file, line);
return e;
}
/// ditto but with selectors instead of ids
final SomeElementType requireSelector(SomeElementType = Element)(string selector, string file = __FILE__, size_t line = __LINE__)
if(
is(SomeElementType : Element)
)
out(ret) {
assert(ret !is null);
}
body {
auto e = cast(SomeElementType) querySelector(selector);
if(e is null)
throw new ElementNotFoundException(SomeElementType.stringof, selector, file, line);
return e;
}
/// get all the classes on this element
@property string[] classes() {
return split(className, " ");
}
/// Adds a string to the class attribute. The class attribute is used a lot in CSS.
Element addClass(string c) {
if(hasClass(c))
return this; // don't add it twice
string cn = getAttribute("class");
if(cn.length == 0) {
setAttribute("class", c);
return this;
} else {
setAttribute("class", cn ~ " " ~ c);
}
return this;
}
/// Removes a particular class name.
Element removeClass(string c) {
if(!hasClass(c))
return this;
string n;
foreach(name; classes) {
if(c == name)
continue; // cut it out
if(n.length)
n ~= " ";
n ~= name;
}
className = n.strip();
return this;
}
/// Returns whether the given class appears in this element.
bool hasClass(string c) {
string cn = className;
auto idx = cn.indexOf(c);
if(idx == -1)
return false;
foreach(cla; cn.split(" "))
if(cla == c)
return true;
return false;
/*
int rightSide = idx + c.length;
bool checkRight() {
if(rightSide == cn.length)
return true; // it's the only class
else if(iswhite(cn[rightSide]))
return true;
return false; // this is a substring of something else..
}
if(idx == 0) {
return checkRight();
} else {
if(!iswhite(cn[idx - 1]))
return false; // substring
return checkRight();
}
assert(0);
*/
}
/* *******************************
DOM Mutation
*********************************/
/// convenience function to quickly add a tag with some text or
/// other relevant info (for example, it's a src for an <img> element
/// instead of inner text)
Element addChild(string tagName, string childInfo = null, string childInfo2 = null)
in {
assert(tagName !is null);
}
out(e) {
assert(e.parentNode is this);
assert(e.parentDocument is this.parentDocument);
}
body {
auto e = Element.make(tagName, childInfo, childInfo2);
// FIXME (maybe): if the thing is self closed, we might want to go ahead and
// return the parent. That will break existing code though.
return appendChild(e);
}
/// Another convenience function. Adds a child directly after the current one, returning
/// the new child.
///
/// Between this, addChild, and parentNode, you can build a tree as a single expression.
Element addSibling(string tagName, string childInfo = null, string childInfo2 = null)
in {
assert(tagName !is null);
assert(parentNode !is null);
}
out(e) {
assert(e.parentNode is this.parentNode);
assert(e.parentDocument is this.parentDocument);
}
body {
auto e = Element.make(tagName, childInfo, childInfo2);
return parentNode.insertAfter(this, e);
}
///
Element addSibling(Element e) {
return parentNode.insertAfter(this, e);
}
///
Element addChild(Element e) {
return this.appendChild(e);
}
/// Convenience function to append text intermixed with other children.
/// For example: div.addChildren("You can visit my website by ", new Link("mysite.com", "clicking here"), ".");
/// or div.addChildren("Hello, ", user.name, "!");
/// See also: appendHtml. This might be a bit simpler though because you don't have to think about escaping.
void addChildren(T...)(T t) {
foreach(item; t) {
static if(is(item : Element))
appendChild(item);
else static if (is(isSomeString!(item)))
appendText(to!string(item));
else static assert(0, "Cannot pass " ~ typeof(item).stringof ~ " to addChildren");
}
}
///.
Element addChild(string tagName, Element firstChild, string info2 = null)
in {
assert(firstChild !is null);
}
out(ret) {
assert(ret !is null);
assert(ret.parentNode is this);
assert(firstChild.parentNode is ret);
assert(ret.parentDocument is this.parentDocument);
//assert(firstChild.parentDocument is this.parentDocument);
}
body {
auto e = Element.make(tagName, "", info2);
e.appendChild(firstChild);
this.appendChild(e);
return e;
}
///
Element addChild(string tagName, in Html innerHtml, string info2 = null)
in {
}
out(ret) {
assert(ret !is null);
assert(ret.parentNode is this);
assert(ret.parentDocument is this.parentDocument);
}
body {
auto e = Element.make(tagName, "", info2);
this.appendChild(e);
e.innerHTML = innerHtml.source;
return e;
}
/// .
void appendChildren(Element[] children) {
foreach(ele; children)
appendChild(ele);
}
///.
void reparent(Element newParent)
in {
assert(newParent !is null);
assert(parentNode !is null);
}
out {
assert(this.parentNode is newParent);
//assert(isInArray(this, newParent.children));
}
body {
parentNode.removeChild(this);
newParent.appendChild(this);
}
/**
Strips this tag out of the document, putting its inner html
as children of the parent.
For example, given: `<p>hello <b>there</b></p>`, if you
call `stripOut` on the `b` element, you'll be left with
`<p>hello there<p>`.
The idea here is to make it easy to get rid of garbage
markup you aren't interested in.
*/
void stripOut()
in {
assert(parentNode !is null);
}
out {
assert(parentNode is null);
assert(children.length == 0);
}
body {
foreach(c; children)
c.parentNode = null; // remove the parent
if(children.length)
parentNode.replaceChild(this, this.children);
else
parentNode.removeChild(this);
this.children.length = 0; // we reparented them all above
}
/// shorthand for `this.parentNode.removeChild(this)` with `parentNode` `null` check
/// if the element already isn't in a tree, it does nothing.
Element removeFromTree()
in {
}
out(var) {
assert(this.parentNode is null);
assert(var is this);
}
body {
if(this.parentNode is null)
return this;
this.parentNode.removeChild(this);
return this;
}
/++
Wraps this element inside the given element.
It's like `this.replaceWith(what); what.appendchild(this);`
Given: `<b>cool</b>`, if you call `b.wrapIn(new Link("site.com", "my site is "));`
you'll end up with: `<a href="site.com">my site is <b>cool</b></a>`.
+/
Element wrapIn(Element what)
in {
assert(what !is null);
}
out(ret) {
assert(this.parentNode is what);
assert(ret is what);
}
body {
this.replaceWith(what);
what.appendChild(this);
return what;
}
/// Replaces this element with something else in the tree.
Element replaceWith(Element e)
in {
assert(this.parentNode !is null);
}
body {
e.removeFromTree();
this.parentNode.replaceChild(this, e);
return e;
}
/**
Splits the className into an array of each class given
*/
string[] classNames() const {
return className().split(" ");
}
/**
Fetches the first consecutive text nodes concatenated together.
`firstInnerText` of `<example>some text<span>more text</span></example>` is `some text`. It stops at the first child tag encountered.
See_also: [directText], [innerText]
*/
string firstInnerText() const {
string s;
foreach(child; children) {
if(child.nodeType != NodeType.Text)
break;
s ~= child.nodeValue();
}
return s;
}
/**
Returns the text directly under this element.
Unlike [innerText], it does not recurse, and unlike [firstInnerText], it continues
past child tags. So, `<example>some <b>bold</b> text</example>`
will return `some text` because it only gets the text, skipping non-text children.
See_also: [firstInnerText], [innerText]
*/
@property string directText() {
string ret;
foreach(e; children) {
if(e.nodeType == NodeType.Text)
ret ~= e.nodeValue();
}
return ret;
}
/**
Sets the direct text, without modifying other child nodes.
Unlike [innerText], this does *not* remove existing elements in the element.
It only replaces the first text node it sees.
If there are no text nodes, it calls [appendText].
So, given `<div><img />text here</div>`, it will keep the `<img />`, and replace the `text here`.
*/
@property void directText(string text) {
foreach(e; children) {
if(e.nodeType == NodeType.Text) {
auto it = cast(TextNode) e;
it.contents = text;
return;
}
}
appendText(text);
}
// do nothing, this is primarily a virtual hook
// for links and forms
void setValue(string field, string value) { }
// this is a thing so i can remove observer support if it gets slow
// I have not implemented all these yet
private void sendObserverEvent(DomMutationOperations operation, string s1 = null, string s2 = null, Element r = null, Element r2 = null) {
if(parentDocument is null) return;
DomMutationEvent me;
me.operation = operation;
me.target = this;
me.relatedString = s1;
me.relatedString2 = s2;
me.related = r;
me.related2 = r2;
parentDocument.dispatchMutationEvent(me);
}
// putting all the members up front
// this ought to be private. don't use it directly.
Element[] children;
/// The name of the tag. Remember, changing this doesn't change the dynamic type of the object.
string tagName;
/// This is where the attributes are actually stored. You should use getAttribute, setAttribute, and hasAttribute instead.
string[string] attributes;
/// In XML, it is valid to write <tag /> for all elements with no children, but that breaks HTML, so I don't do it here.
/// Instead, this flag tells if it should be. It is based on the source document's notation and a html element list.
private bool selfClosed;
/// Get the parent Document object that contains this element.
/// It may be null, so remember to check for that.
Document parentDocument;
///.
Element parentNode;
// the next few methods are for implementing interactive kind of things
private CssStyle _computedStyle;
// these are here for event handlers. Don't forget that this library never fires events.
// (I'm thinking about putting this in a version statement so you don't have the baggage. The instance size of this class is 56 bytes right now.)
EventHandler[][string] bubblingEventHandlers;
EventHandler[][string] capturingEventHandlers;
EventHandler[string] defaultEventHandlers;
void addEventListener(string event, EventHandler handler, bool useCapture = false) {
if(event.length > 2 && event[0..2] == "on")
event = event[2 .. $];
if(useCapture)
capturingEventHandlers[event] ~= handler;
else
bubblingEventHandlers[event] ~= handler;
}
// and now methods
/// Convenience function to try to do the right thing for HTML. This is the main
/// way I create elements.
static Element make(string tagName, string childInfo = null, string childInfo2 = null) {
bool selfClosed = tagName.isInArray(selfClosedElements);
Element e;
// want to create the right kind of object for the given tag...
switch(tagName) {
case "#text":
e = new TextNode(null, childInfo);
return e;
// break;
case "table":
e = new Table(null);
break;
case "a":
e = new Link(null);
break;
case "form":
e = new Form(null);
break;
case "tr":
e = new TableRow(null);
break;
case "td", "th":
e = new TableCell(null, tagName);
break;
default:
e = new Element(null, tagName, null, selfClosed); // parent document should be set elsewhere
}
// make sure all the stuff is constructed properly FIXME: should probably be in all the right constructors too
e.tagName = tagName;
e.selfClosed = selfClosed;
if(childInfo !is null)
switch(tagName) {
/* html5 convenience tags */
case "audio":
if(childInfo.length)
e.addChild("source", childInfo);
if(childInfo2 !is null)
e.appendText(childInfo2);
break;
case "source":
e.src = childInfo;
if(childInfo2 !is null)
e.type = childInfo2;
break;
/* regular html 4 stuff */
case "img":
e.src = childInfo;
if(childInfo2 !is null)
e.alt = childInfo2;
break;
case "link":
e.href = childInfo;
if(childInfo2 !is null)
e.rel = childInfo2;
break;
case "option":
e.innerText = childInfo;
if(childInfo2 !is null)
e.value = childInfo2;
break;
case "input":
e.type = "hidden";
e.name = childInfo;
if(childInfo2 !is null)
e.value = childInfo2;
break;
case "button":
e.innerText = childInfo;
if(childInfo2 !is null)
e.type = childInfo2;
break;
case "a":
e.innerText = childInfo;
if(childInfo2 !is null)
e.href = childInfo2;
break;
case "script":
case "style":
e.innerRawSource = childInfo;
break;
case "meta":
e.name = childInfo;
if(childInfo2 !is null)
e.content = childInfo2;
break;
/* generically, assume we were passed text and perhaps class */
default:
e.innerText = childInfo;
if(childInfo2.length)
e.className = childInfo2;
}
return e;
}
static Element make(string tagName, in Html innerHtml, string childInfo2 = null) {
// FIXME: childInfo2 is ignored when info1 is null
auto m = Element.make(tagName, "not null"[0..0], childInfo2);
m.innerHTML = innerHtml.source;
return m;
}
static Element make(string tagName, Element child, string childInfo2 = null) {
auto m = Element.make(tagName, cast(string) null, childInfo2);
m.appendChild(child);
return m;
}
/// Generally, you don't want to call this yourself - use Element.make or document.createElement instead.
this(Document _parentDocument, string _tagName, string[string] _attributes = null, bool _selfClosed = false) {
parentDocument = _parentDocument;
tagName = _tagName;
if(_attributes !is null)
attributes = _attributes;
selfClosed = _selfClosed;
version(dom_node_indexes)
this.dataset.nodeIndex = to!string(&(this.attributes));
assert(_tagName.indexOf(" ") == -1);//, "<" ~ _tagName ~ "> is invalid");
}
/// Convenience constructor when you don't care about the parentDocument. Note this might break things on the document.
/// Note also that without a parent document, elements are always in strict, case-sensitive mode.
this(string _tagName, string[string] _attributes = null) {
tagName = _tagName;
if(_attributes !is null)
attributes = _attributes;
selfClosed = tagName.isInArray(selfClosedElements);
// this is meant to reserve some memory. It makes a small, but consistent improvement.
//children.length = 8;
//children.length = 0;
version(dom_node_indexes)
this.dataset.nodeIndex = to!string(&(this.attributes));
}
private this(Document _parentDocument) {
parentDocument = _parentDocument;
version(dom_node_indexes)
this.dataset.nodeIndex = to!string(&(this.attributes));
}
/* *******************************
Navigating the DOM
*********************************/
/// Returns the first child of this element. If it has no children, returns null.
/// Remember, text nodes are children too.
@property Element firstChild() {
return children.length ? children[0] : null;
}
///
@property Element lastChild() {
return children.length ? children[$ - 1] : null;
}
///.
@property Element previousSibling(string tagName = null) {
if(this.parentNode is null)
return null;
Element ps = null;
foreach(e; this.parentNode.childNodes) {
if(e is this)
break;
if(tagName == "*" && e.nodeType != NodeType.Text) {
ps = e;
break;
}
if(tagName is null || e.tagName == tagName)
ps = e;
}
return ps;
}
///.
@property Element nextSibling(string tagName = null) {
if(this.parentNode is null)
return null;
Element ns = null;
bool mightBe = false;
foreach(e; this.parentNode.childNodes) {
if(e is this) {
mightBe = true;
continue;
}
if(mightBe) {
if(tagName == "*" && e.nodeType != NodeType.Text) {
ns = e;
break;
}
if(tagName is null || e.tagName == tagName) {
ns = e;
break;
}
}
}
return ns;
}
/// Gets the nearest node, going up the chain, with the given tagName
/// May return null or throw.
T getParent(T = Element)(string tagName = null) if(is(T : Element)) {
if(tagName is null) {
static if(is(T == Form))
tagName = "form";
else static if(is(T == Table))
tagName = "table";
else static if(is(T == Link))
tagName == "a";
}
auto par = this.parentNode;
while(par !is null) {
if(tagName is null || par.tagName == tagName)
break;
par = par.parentNode;
}
static if(!is(T == Element)) {
auto t = cast(T) par;
if(t is null)
throw new ElementNotFoundException("", tagName ~ " parent not found");
} else
auto t = par;
return t;
}
///.
Element getElementById(string id) {
// FIXME: I use this function a lot, and it's kinda slow
// not terribly slow, but not great.
foreach(e; tree)
if(e.id == id)
return e;
return null;
}
/// Note: you can give multiple selectors, separated by commas.
/// It will return the first match it finds.
Element querySelector(string selector) {
// FIXME: inefficient; it gets all results just to discard most of them
auto list = getElementsBySelector(selector);
if(list.length == 0)
return null;
return list[0];
}
/// a more standards-compliant alias for getElementsBySelector
Element[] querySelectorAll(string selector) {
return getElementsBySelector(selector);
}
/**
Returns elements that match the given CSS selector
* -- all, default if nothing else is there
tag#id.class.class.class:pseudo[attrib=what][attrib=what] OP selector
It is all additive
OP
space = descendant
> = direct descendant
+ = sibling (E+F Matches any F element immediately preceded by a sibling element E)
[foo] Foo is present as an attribute
[foo="warning"] Matches any E element whose "foo" attribute value is exactly equal to "warning".
E[foo~="warning"] Matches any E element whose "foo" attribute value is a list of space-separated values, one of which is exactly equal to "warning"
E[lang|="en"] Matches any E element whose "lang" attribute has a hyphen-separated list of values beginning (from the left) with "en".
[item$=sdas] ends with
[item^-sdsad] begins with
Quotes are optional here.
Pseudos:
:first-child
:last-child
:link (same as a[href] for our purposes here)
There can be commas separating the selector. A comma separated list result is OR'd onto the main.
This ONLY cares about elements. text, etc, are ignored
There should be two functions: given element, does it match the selector? and given a selector, give me all the elements
*/
Element[] getElementsBySelector(string selector) {
// FIXME: this function could probably use some performance attention
// ... but only mildly so according to the profiler in the big scheme of things; probably negligible in a big app.
bool caseSensitiveTags = true;
if(parentDocument && parentDocument.loose)
caseSensitiveTags = false;
Element[] ret;
foreach(sel; parseSelectorString(selector, caseSensitiveTags))
ret ~= sel.getElements(this);
return ret;
}
/// .
Element[] getElementsByClassName(string cn) {
// is this correct?
return getElementsBySelector("." ~ cn);
}
///.
Element[] getElementsByTagName(string tag) {
if(parentDocument && parentDocument.loose)
tag = tag.toLower();
Element[] ret;
foreach(e; tree)
if(e.tagName == tag)
ret ~= e;
return ret;
}
/* *******************************
Attributes
*********************************/
/**
Gets the given attribute value, or null if the
attribute is not set.
Note that the returned string is decoded, so it no longer contains any xml entities.
*/
string getAttribute(string name) const {
if(parentDocument && parentDocument.loose)
name = name.toLower();
auto e = name in attributes;
if(e)
return *e;
else
return null;
}
/**
Sets an attribute. Returns this for easy chaining
*/
Element setAttribute(string name, string value) {
if(parentDocument && parentDocument.loose)
name = name.toLower();
// I never use this shit legitimately and neither should you
auto it = name.toLower();
if(it == "href" || it == "src") {
auto v = value.strip().toLower();
if(v.startsWith("vbscript:"))
value = value[9..$];
if(v.startsWith("javascript:"))
value = value[11..$];
}
attributes[name] = value;
sendObserverEvent(DomMutationOperations.setAttribute, name, value);
return this;
}
/**
Returns if the attribute exists.
*/
bool hasAttribute(string name) {
if(parentDocument && parentDocument.loose)
name = name.toLower();
if(name in attributes)
return true;
else
return false;
}
/**
Removes the given attribute from the element.
*/
Element removeAttribute(string name)
out(ret) {
assert(ret is this);
}
body {
if(parentDocument && parentDocument.loose)
name = name.toLower();
if(name in attributes)
attributes.remove(name);
sendObserverEvent(DomMutationOperations.removeAttribute, name);
return this;
}
/**
Gets the class attribute's contents. Returns
an empty string if it has no class.
*/
@property string className() const {
auto c = getAttribute("class");
if(c is null)
return "";
return c;
}
///.
@property Element className(string c) {
setAttribute("class", c);
return this;
}
/**
Provides easy access to common HTML attributes, object style.
---
auto element = Element.make("a");
a.href = "cool.html"; // this is the same as a.setAttribute("href", "cool.html");
string where = a.href; // same as a.getAttribute("href");
---
*/
@property string opDispatch(string name)(string v = null) if(isConvenientAttribute(name)) {
if(v !is null)
setAttribute(name, v);
return getAttribute(name);
}
/**
Old access to attributes. Use [attrs] instead.
DEPRECATED: generally open opDispatch caused a lot of unforeseen trouble with compile time duck typing and UFCS extensions.
so I want to remove it. A small whitelist of attributes is still allowed, but others are not.
Instead, use element.attrs.attribute, element.attrs["attribute"],
or element.getAttribute("attribute")/element.setAttribute("attribute").
*/
@property string opDispatch(string name)(string v = null) if(!isConvenientAttribute(name)) {
static assert(0, "Don't use " ~ name ~ " direct on Element, instead use element.attrs.attributeName");
}
/*
// this would be nice for convenience, but it broke the getter above.
@property void opDispatch(string name)(bool boolean) if(name != "popFront") {
if(boolean)
setAttribute(name, name);
else
removeAttribute(name);
}
*/
/**
Returns the element's children.
*/
@property const(Element[]) childNodes() const {
return children;
}
/// Mutable version of the same
@property Element[] childNodes() { // FIXME: the above should be inout
return children;
}
/++
HTML5's dataset property. It is an alternate view into attributes with the data- prefix.
Given `<a data-my-property="cool" />`, we get `assert(a.dataset.myProperty == "cool");`
+/
@property DataSet dataset() {
return DataSet(this);
}
/++
Gives dot/opIndex access to attributes
---
ele.attrs.largeSrc = "foo"; // same as ele.setAttribute("largeSrc", "foo")
---
+/
@property AttributeSet attrs() {
return AttributeSet(this);
}
/++
Provides both string and object style (like in Javascript) access to the style attribute.
---
element.style.color = "red"; // translates into setting `color: red;` in the `style` attribute
---
+/
@property ElementStyle style() {
return ElementStyle(this);
}
/++
This sets the style attribute with a string.
+/
@property ElementStyle style(string s) {
this.setAttribute("style", s);
return this.style;
}
private void parseAttributes(string[] whichOnes = null) {
/+
if(whichOnes is null)
whichOnes = attributes.keys;
foreach(attr; whichOnes) {
switch(attr) {
case "id":
break;
case "class":
break;
case "style":
break;
default:
// we don't care about it
}
}
+/
}
// if you change something here, it won't apply... FIXME const? but changing it would be nice if it applies to the style attribute too though you should use style there.
/// Don't use this.
@property CssStyle computedStyle() {
if(_computedStyle is null) {
auto style = this.getAttribute("style");
/* we'll treat shitty old html attributes as css here */
if(this.hasAttribute("width"))
style ~= "; width: " ~ this.attrs.width;
if(this.hasAttribute("height"))
style ~= "; height: " ~ this.attrs.height;
if(this.hasAttribute("bgcolor"))
style ~= "; background-color: " ~ this.attrs.bgcolor;
if(this.tagName == "body" && this.hasAttribute("text"))
style ~= "; color: " ~ this.attrs.text;
if(this.hasAttribute("color"))
style ~= "; color: " ~ this.attrs.color;
/* done */
_computedStyle = new CssStyle(null, style); // gives at least something to work with
}
return _computedStyle;
}
/// These properties are useless in most cases, but if you write a layout engine on top of this lib, they may be good
version(browser) {
void* expansionHook; ///ditto
int offsetWidth; ///ditto
int offsetHeight; ///ditto
int offsetLeft; ///ditto
int offsetTop; ///ditto
Element offsetParent; ///ditto
bool hasLayout; ///ditto
int zIndex; ///ditto
///ditto
int absoluteLeft() {
int a = offsetLeft;
auto p = offsetParent;
while(p) {
a += p.offsetLeft;
p = p.offsetParent;
}
return a;
}
///ditto
int absoluteTop() {
int a = offsetTop;
auto p = offsetParent;
while(p) {
a += p.offsetTop;
p = p.offsetParent;
}
return a;
}
}
// Back to the regular dom functions
public:
/* *******************************
DOM Mutation
*********************************/
/// Removes all inner content from the tag; all child text and elements are gone.
void removeAllChildren()
out {
assert(this.children.length == 0);
}
body {
children = null;
}
/// Appends the given element to this one. The given element must not have a parent already.
Element appendChild(Element e)
in {
assert(e !is null);
assert(e.parentNode is null);
}
out (ret) {
assert(e.parentNode is this);
assert(e.parentDocument is this.parentDocument);
assert(e is ret);
}
body {
selfClosed = false;
e.parentNode = this;
e.parentDocument = this.parentDocument;
children ~= e;
sendObserverEvent(DomMutationOperations.appendChild, null, null, e);
return e;
}
/// Inserts the second element to this node, right before the first param
Element insertBefore(in Element where, Element what)
in {
assert(where !is null);
assert(where.parentNode is this);
assert(what !is null);
assert(what.parentNode is null);
}
out (ret) {
assert(where.parentNode is this);
assert(what.parentNode is this);
assert(what.parentDocument is this.parentDocument);
assert(ret is what);
}
body {
foreach(i, e; children) {
if(e is where) {
children = children[0..i] ~ what ~ children[i..$];
what.parentDocument = this.parentDocument;
what.parentNode = this;
return what;
}
}
return what;
assert(0);
}
/++
Inserts the given element `what` as a sibling of the `this` element, after the element `where` in the parent node.
+/
Element insertAfter(in Element where, Element what)
in {
assert(where !is null);
assert(where.parentNode is this);
assert(what !is null);
assert(what.parentNode is null);
}
out (ret) {
assert(where.parentNode is this);
assert(what.parentNode is this);
assert(what.parentDocument is this.parentDocument);
assert(ret is what);
}
body {
foreach(i, e; children) {
if(e is where) {
children = children[0 .. i + 1] ~ what ~ children[i + 1 .. $];
what.parentNode = this;
what.parentDocument = this.parentDocument;
return what;
}
}
return what;
assert(0);
}
/// swaps one child for a new thing. Returns the old child which is now parentless.
Element swapNode(Element child, Element replacement)
in {
assert(child !is null);
assert(replacement !is null);
assert(child.parentNode is this);
}
out(ret) {
assert(ret is child);
assert(ret.parentNode is null);
assert(replacement.parentNode is this);
assert(replacement.parentDocument is this.parentDocument);
}
body {
foreach(ref c; this.children)
if(c is child) {
c.parentNode = null;
c = replacement;
c.parentNode = this;
c.parentDocument = this.parentDocument;
return child;
}
assert(0);
}
/++
Appends the given to the node.
Calling `e.appendText(" hi")` on `<example>text <b>bold</b></example>`
yields `<example>text <b>bold</b> hi</example>`.
See_Also:
[firstInnerText], [directText], [innerText], [appendChild]
+/
Element appendText(string text) {
Element e = new TextNode(parentDocument, text);
appendChild(e);
return this;
}
/++
Returns child elements which are of a tag type (excludes text, comments, etc.).
childElements of `<example>text <b>bold</b></example>` is just the `<b>` tag.
Params:
tagName = filter results to only the child elements with the given tag name.
+/
@property Element[] childElements(string tagName = null) {
Element[] ret;
foreach(c; children)
if(c.nodeType == 1 && (tagName is null || c.tagName == tagName))
ret ~= c;
return ret;
}
/++
Appends the given html to the element, returning the elements appended
This is similar to `element.innerHTML += "html string";` in Javascript.
+/
Element[] appendHtml(string html) {
Document d = new Document("<root>" ~ html ~ "</root>");
return stealChildren(d.root);
}
///.
void insertChildAfter(Element child, Element where)
in {
assert(child !is null);
assert(where !is null);
assert(where.parentNode is this);
assert(!selfClosed);
//assert(isInArray(where, children));
}
out {
assert(child.parentNode is this);
assert(where.parentNode is this);
//assert(isInArray(where, children));
//assert(isInArray(child, children));
}
body {
foreach(ref i, c; children) {
if(c is where) {
i++;
children = children[0..i] ~ child ~ children[i..$];
child.parentNode = this;
child.parentDocument = this.parentDocument;
break;
}
}
}
/++
Reparents all the child elements of `e` to `this`, leaving `e` childless.
Params:
e = the element whose children you want to steal
position = an existing child element in `this` before which you want the stolen children to be inserted. If `null`, it will append the stolen children at the end of our current children.
+/
Element[] stealChildren(Element e, Element position = null)
in {
assert(!selfClosed);
assert(e !is null);
//if(position !is null)
//assert(isInArray(position, children));
}
out (ret) {
assert(e.children.length == 0);
debug foreach(child; ret) {
assert(child.parentNode is this);
assert(child.parentDocument is this.parentDocument);
}
}
body {
foreach(c; e.children) {
c.parentNode = this;
c.parentDocument = this.parentDocument;
}
if(position is null)
children ~= e.children;
else {
foreach(i, child; children) {
if(child is position) {
children = children[0..i] ~
e.children ~
children[i..$];
break;
}
}
}
auto ret = e.children.dup;
e.children.length = 0;
return ret;
}
/// Puts the current element first in our children list. The given element must not have a parent already.
Element prependChild(Element e)
in {
assert(e.parentNode is null);
assert(!selfClosed);
}
out {
assert(e.parentNode is this);
assert(e.parentDocument is this.parentDocument);
assert(children[0] is e);
}
body {
e.parentNode = this;
e.parentDocument = this.parentDocument;
children = e ~ children;
return e;
}
/**
Returns a string containing all child elements, formatted such that it could be pasted into
an XML file.
*/
@property string innerHTML(Appender!string where = appender!string()) const {
if(children is null)
return "";
auto start = where.data.length;
foreach(child; children) {
assert(child !is null);
child.writeToAppender(where);
}
return where.data[start .. $];
}
/**
Takes some html and replaces the element's children with the tree made from the string.
*/
@property Element innerHTML(string html, bool strict = false) {
if(html.length)
selfClosed = false;
if(html.length == 0) {
// I often say innerHTML = ""; as a shortcut to clear it out,
// so let's optimize that slightly.
removeAllChildren();
return this;
}
auto doc = new Document();
doc.parseUtf8("<innerhtml>" ~ html ~ "</innerhtml>", strict, strict); // FIXME: this should preserve the strictness of the parent document
children = doc.root.children;
foreach(c; children) {
c.parentNode = this;
c.parentDocument = this.parentDocument;
}
reparentTreeDocuments();
doc.root.children = null;
return this;
}
/// ditto
@property Element innerHTML(Html html) {
return this.innerHTML = html.source;
}
private void reparentTreeDocuments() {
foreach(c; this.tree)
c.parentDocument = this.parentDocument;
}
/**
Replaces this node with the given html string, which is parsed
Note: this invalidates the this reference, since it is removed
from the tree.
Returns the new children that replace this.
*/
@property Element[] outerHTML(string html) {
auto doc = new Document();
doc.parseUtf8("<innerhtml>" ~ html ~ "</innerhtml>"); // FIXME: needs to preserve the strictness
children = doc.root.children;
foreach(c; children) {
c.parentNode = this;
c.parentDocument = this.parentDocument;
}
reparentTreeDocuments();
stripOut();
return doc.root.children;
}
/++
Returns all the html for this element, including the tag itself.
This is equivalent to calling toString().
+/
@property string outerHTML() {
return this.toString();
}
/// This sets the inner content of the element *without* trying to parse it.
/// You can inject any code in there; this serves as an escape hatch from the dom.
///
/// The only times you might actually need it are for < style > and < script > tags in html.
/// Other than that, innerHTML and/or innerText should do the job.
@property void innerRawSource(string rawSource) {
children.length = 0;
auto rs = new RawSource(parentDocument, rawSource);
rs.parentNode = this;
children ~= rs;
}
///.
Element replaceChild(Element find, Element replace)
in {
assert(find !is null);
assert(replace !is null);
assert(replace.parentNode is null);
}
out(ret) {
assert(ret is replace);
assert(replace.parentNode is this);
assert(replace.parentDocument is this.parentDocument);
assert(find.parentNode is null);
}
body {
for(int i = 0; i < children.length; i++) {
if(children[i] is find) {
replace.parentNode = this;
children[i].parentNode = null;
children[i] = replace;
replace.parentDocument = this.parentDocument;
return replace;
}
}
throw new Exception("no such child");
}
/**
Replaces the given element with a whole group.
*/
void replaceChild(Element find, Element[] replace)
in {
assert(find !is null);
assert(replace !is null);
assert(find.parentNode is this);
debug foreach(r; replace)
assert(r.parentNode is null);
}
out {
assert(find.parentNode is null);
assert(children.length >= replace.length);
debug foreach(child; children)
assert(child !is find);
debug foreach(r; replace)
assert(r.parentNode is this);
}
body {
if(replace.length == 0) {
removeChild(find);
return;
}
assert(replace.length);
for(int i = 0; i < children.length; i++) {
if(children[i] is find) {
children[i].parentNode = null; // this element should now be dead
children[i] = replace[0];
foreach(e; replace) {
e.parentNode = this;
e.parentDocument = this.parentDocument;
}
children = .insertAfter(children, i, replace[1..$]);
return;
}
}
throw new Exception("no such child");
}
/**
Removes the given child from this list.
Returns the removed element.
*/
Element removeChild(Element c)
in {
assert(c !is null);
assert(c.parentNode is this);
}
out {
debug foreach(child; children)
assert(child !is c);
assert(c.parentNode is null);
}
body {
foreach(i, e; children) {
if(e is c) {
children = children[0..i] ~ children [i+1..$];
c.parentNode = null;
return c;
}
}
throw new Exception("no such child");
}
/// This removes all the children from this element, returning the old list.
Element[] removeChildren()
out (ret) {
assert(children.length == 0);
debug foreach(r; ret)
assert(r.parentNode is null);
}
body {
Element[] oldChildren = children.dup;
foreach(c; oldChildren)
c.parentNode = null;
children.length = 0;
return oldChildren;
}
/**
Fetch the inside text, with all tags stripped out.
<p>cool <b>api</b> & code dude<p>
innerText of that is "cool api & code dude".
This does not match what real innerText does!
http://perfectionkills.com/the-poor-misunderstood-innerText/
It is more like textContent.
*/
@property string innerText() const {
string s;
foreach(child; children) {
if(child.nodeType != NodeType.Text)
s ~= child.innerText;
else
s ~= child.nodeValue();
}
return s;
}
/**
Sets the inside text, replacing all children. You don't
have to worry about entity encoding.
*/
@property void innerText(string text) {
selfClosed = false;
Element e = new TextNode(parentDocument, text);
e.parentNode = this;
children = [e];
}
/**
Strips this node out of the document, replacing it with the given text
*/
@property void outerText(string text) {
parentNode.replaceChild(this, new TextNode(parentDocument, text));
}
/**
Same result as innerText; the tag with all inner tags stripped out
*/
string outerText() const {
return innerText;
}
/* *******************************
Miscellaneous
*********************************/
/// This is a full clone of the element
@property Element cloned()
/+
out(ret) {
// FIXME: not sure why these fail...
assert(ret.children.length == this.children.length, format("%d %d", ret.children.length, this.children.length));
assert(ret.tagName == this.tagName);
}
body {
+/
{
auto e = Element.make(this.tagName);
e.parentDocument = this.parentDocument;
e.attributes = this.attributes.aadup;
e.selfClosed = this.selfClosed;
foreach(child; children) {
e.appendChild(child.cloned);
}
return e;
}
/// Clones the node. If deepClone is true, clone all inner tags too. If false, only do this tag (and its attributes), but it will have no contents.
Element cloneNode(bool deepClone) {
if(deepClone)
return this.cloned;
// shallow clone
auto e = Element.make(this.tagName);
e.parentDocument = this.parentDocument;
e.attributes = this.attributes.aadup;
e.selfClosed = this.selfClosed;
return e;
}
/// W3C DOM interface. Only really meaningful on [TextNode] instances, but the interface is present on the base class.
string nodeValue() const {
return "";
}
// should return int
///.
@property int nodeType() const {
return 1;
}
invariant () {
assert(tagName.indexOf(" ") == -1);
if(children !is null)
debug foreach(child; children) {
// assert(parentNode !is null);
assert(child !is null);
assert(child.parentNode is this, format("%s is not a parent of %s (it thought it was %s)", tagName, child.tagName, child.parentNode is null ? "null" : child.parentNode.tagName));
assert(child !is this);
assert(child !is parentNode);
}
/+ // only depend on parentNode's accuracy if you shuffle things around and use the top elements - where the contracts guarantee it on out
if(parentNode !is null) {
// if you have a parent, you should share the same parentDocument; this is appendChild()'s job
auto lol = cast(TextNode) this;
assert(parentDocument is parentNode.parentDocument, lol is null ? this.tagName : lol.contents);
}
+/
//assert(parentDocument !is null); // no more; if it is present, we use it, but it is not required
// reason is so you can create these without needing a reference to the document
}
/**
Turns the whole element, including tag, attributes, and children, into a string which could be pasted into
an XML file.
*/
override string toString() const {
return writeToAppender();
}
/// This is the actual implementation used by toString. You can pass it a preallocated buffer to save some time.
/// Returns the string it creates.
string writeToAppender(Appender!string where = appender!string()) const {
assert(tagName !is null);
where.reserve((this.children.length + 1) * 512);
auto start = where.data.length;
where.put("<");
where.put(tagName);
foreach(n, v ; attributes) {
assert(n !is null);
//assert(v !is null);
where.put(" ");
where.put(n);
where.put("=\"");
htmlEntitiesEncode(v, where);
where.put("\"");
}
if(selfClosed){
where.put(" />");
return where.data[start .. $];
}
where.put('>');
innerHTML(where);
where.put("</");
where.put(tagName);
where.put('>');
return where.data[start .. $];
}
/**
Returns a lazy range of all its children, recursively.
*/
@property ElementStream tree() {
return new ElementStream(this);
}
// I moved these from Form because they are generally useful.
// Ideally, I'd put them in arsd.html and use UFCS, but that doesn't work with the opDispatch here.
/// Tags: HTML, HTML5
// FIXME: add overloads for other label types...
Element addField(string label, string name, string type = "text", FormFieldOptions fieldOptions = FormFieldOptions.none) {
auto fs = this;
auto i = fs.addChild("label");
if(!(type == "checkbox" || type == "radio"))
i.addChild("span", label);
Element input;
if(type == "textarea")
input = i.addChild("textarea").
setAttribute("name", name).
setAttribute("rows", "6");
else
input = i.addChild("input").
setAttribute("name", name).
setAttribute("type", type);
if(type == "checkbox" || type == "radio")
i.addChild("span", label);
// these are html 5 attributes; you'll have to implement fallbacks elsewhere. In Javascript or maybe I'll add a magic thing to html.d later.
fieldOptions.applyToElement(input);
return i;
}
Element addField(Element label, string name, string type = "text", FormFieldOptions fieldOptions = FormFieldOptions.none) {
auto fs = this;
auto i = fs.addChild("label");
i.addChild(label);
Element input;
if(type == "textarea")
input = i.addChild("textarea").
setAttribute("name", name).
setAttribute("rows", "6");
else
input = i.addChild("input").
setAttribute("name", name).
setAttribute("type", type);
// these are html 5 attributes; you'll have to implement fallbacks elsewhere. In Javascript or maybe I'll add a magic thing to html.d later.
fieldOptions.applyToElement(input);
return i;
}
Element addField(string label, string name, FormFieldOptions fieldOptions) {
return addField(label, name, "text", fieldOptions);
}
Element addField(string label, string name, string[string] options, FormFieldOptions fieldOptions = FormFieldOptions.none) {
auto fs = this;
auto i = fs.addChild("label");
i.addChild("span", label);
auto sel = i.addChild("select").setAttribute("name", name);
foreach(k, opt; options)
sel.addChild("option", opt, k);
// FIXME: implement requirements somehow
return i;
}
Element addSubmitButton(string label = null) {
auto t = this;
auto holder = t.addChild("div");
holder.addClass("submit-holder");
auto i = holder.addChild("input");
i.type = "submit";
if(label.length)
i.value = label;
return holder;
}
}
// FIXME: since Document loosens the input requirements, it should probably be the sub class...
/// Specializes Document for handling generic XML. (always uses strict mode, uses xml mime type and file header)
class XmlDocument : Document {
this(string data) {
contentType = "text/xml; charset=utf-8";
_prolog = `<?xml version="1.0" encoding="UTF-8"?>` ~ "\n";
parseStrict(data);
}
}
import std.string;
/* domconvenience follows { */
/// finds comments that match the given txt. Case insensitive, strips whitespace.
Element[] findComments(Document document, string txt) {
return findComments(document.root, txt);
}
/// ditto
Element[] findComments(Element element, string txt) {
txt = txt.strip().toLower();
Element[] ret;
foreach(comment; element.getElementsByTagName("#comment")) {
string t = comment.nodeValue().strip().toLower();
if(t == txt)
ret ~= comment;
}
return ret;
}
/++
A collection of elements which forwards methods to the children.
+/
struct ElementCollection {
///
this(Element e) {
elements = [e];
}
///
this(Element e, string selector) {
elements = e.querySelectorAll(selector);
}
///
this(Element[] e) {
elements = e;
}
Element[] elements;
//alias elements this; // let it implicitly convert to the underlying array
///
ElementCollection opIndex(string selector) {
ElementCollection ec;
foreach(e; elements)
ec.elements ~= e.getElementsBySelector(selector);
return ec;
}
/// if you slice it, give the underlying array for easy forwarding of the
/// collection to range expecting algorithms or looping over.
Element[] opSlice() {
return elements;
}
/// And input range primitives so we can foreach over this
void popFront() {
elements = elements[1..$];
}
/// ditto
Element front() {
return elements[0];
}
/// ditto
bool empty() {
return !elements.length;
}
/// Forward method calls to each individual element of the collection
/// returns this so it can be chained.
ElementCollection opDispatch(string name, T...)(T t) {
foreach(e; elements) {
mixin("e." ~ name)(t);
}
return this;
}
/// Concatenates two ElementCollection together.
ElementCollection opBinary(string op : "~")(ElementCollection rhs) {
return ElementCollection(this.elements ~ rhs.elements);
}
}
/// this puts in operators and opDispatch to handle string indexes and properties, forwarding to get and set functions.
mixin template JavascriptStyleDispatch() {
///
string opDispatch(string name)(string v = null) if(name != "popFront") { // popFront will make this look like a range. Do not want.
if(v !is null)
return set(name, v);
return get(name);
}
///
string opIndex(string key) const {
return get(key);
}
///
string opIndexAssign(string value, string field) {
return set(field, value);
}
// FIXME: doesn't seem to work
string* opBinary(string op)(string key) if(op == "in") {
return key in fields;
}
}
/// A proxy object to do the Element class' dataset property. See Element.dataset for more info.
///
/// Do not create this object directly.
struct DataSet {
///
this(Element e) {
this._element = e;
}
private Element _element;
///
string set(string name, string value) {
_element.setAttribute("data-" ~ unCamelCase(name), value);
return value;
}
///
string get(string name) const {
return _element.getAttribute("data-" ~ unCamelCase(name));
}
///
mixin JavascriptStyleDispatch!();
}
/// Proxy object for attributes which will replace the main opDispatch eventually
struct AttributeSet {
///
this(Element e) {
this._element = e;
}
private Element _element;
///
string set(string name, string value) {
_element.setAttribute(name, value);
return value;
}
///
string get(string name) const {
return _element.getAttribute(name);
}
///
mixin JavascriptStyleDispatch!();
}
/// for style, i want to be able to set it with a string like a plain attribute,
/// but also be able to do properties Javascript style.
struct ElementStyle {
this(Element parent) {
_element = parent;
}
Element _element;
@property ref inout(string) _attribute() inout {
auto s = "style" in _element.attributes;
if(s is null) {
auto e = cast() _element; // const_cast
e.attributes["style"] = ""; // we need something to reference
s = cast(inout) ("style" in e.attributes);
}
assert(s !is null);
return *s;
}
alias _attribute this; // this is meant to allow element.style = element.style ~ " string "; to still work.
string set(string name, string value) {
if(name.length == 0)
return value;
if(name == "cssFloat")
name = "float";
else
name = unCamelCase(name);
auto r = rules();
r[name] = value;
_attribute = "";
foreach(k, v; r) {
if(v is null || v.length == 0) /* css can't do empty rules anyway so we'll use that to remove */
continue;
if(_attribute.length)
_attribute ~= " ";
_attribute ~= k ~ ": " ~ v ~ ";";
}
_element.setAttribute("style", _attribute); // this is to trigger the observer call
return value;
}
string get(string name) const {
if(name == "cssFloat")
name = "float";
else
name = unCamelCase(name);
auto r = rules();
if(name in r)
return r[name];
return null;
}
string[string] rules() const {
string[string] ret;
foreach(rule; _attribute.split(";")) {
rule = rule.strip();
if(rule.length == 0)
continue;
auto idx = rule.indexOf(":");
if(idx == -1)
ret[rule] = "";
else {
auto name = rule[0 .. idx].strip();
auto value = rule[idx + 1 .. $].strip();
ret[name] = value;
}
}
return ret;
}
mixin JavascriptStyleDispatch!();
}
/// Converts a camel cased propertyName to a css style dashed property-name
string unCamelCase(string a) {
string ret;
foreach(c; a)
if((c >= 'A' && c <= 'Z'))
ret ~= "-" ~ toLower("" ~ c)[0];
else
ret ~= c;
return ret;
}
/// Translates a css style property-name to a camel cased propertyName
string camelCase(string a) {
string ret;
bool justSawDash = false;
foreach(c; a)
if(c == '-') {
justSawDash = true;
} else {
if(justSawDash) {
justSawDash = false;
ret ~= toUpper("" ~ c);
} else
ret ~= c;
}
return ret;
}
// domconvenience ends }
// @safe:
// NOTE: do *NOT* override toString on Element subclasses. It won't work.
// Instead, override writeToAppender();
// FIXME: should I keep processing instructions like <?blah ?> and <!-- blah --> (comments too lol)? I *want* them stripped out of most my output, but I want to be able to parse and create them too.
// Stripping them is useful for reading php as html.... but adding them
// is good for building php.
// I need to maintain compatibility with the way it is now too.
import std.string;
import std.exception;
import std.uri;
import std.array;
import std.range;
//import std.stdio;
// tag soup works for most the crap I know now! If you have two bad closing tags back to back, it might erase one, but meh
// that's rarer than the flipped closing tags that hack fixes so I'm ok with it. (Odds are it should be erased anyway; it's
// most likely a typo so I say kill kill kill.
/++
This might belong in another module, but it represents a file with a mime type and some data.
Document implements this interface with type = text/html (see Document.contentType for more info)
and data = document.toString, so you can return Documents anywhere web.d expects FileResources.
+/
interface FileResource {
/// the content-type of the file. e.g. "text/html; charset=utf-8" or "image/png"
@property string contentType() const;
/// the data
immutable(ubyte)[] getData() const;
}
///.
enum NodeType { Text = 3 }
/// You can use this to do an easy null check or a dynamic cast+null check on any element.
T require(T = Element, string file = __FILE__, int line = __LINE__)(Element e) if(is(T : Element))
in {}
out(ret) { assert(ret !is null); }
body {
auto ret = cast(T) e;
if(ret is null)
throw new ElementNotFoundException(T.stringof, "passed value", file, line);
return ret;
}
///.
class DocumentFragment : Element {
///.
this(Document _parentDocument) {
tagName = "#fragment";
super(_parentDocument);
}
///.
override string writeToAppender(Appender!string where = appender!string()) const {
return this.innerHTML(where);
}
}
/// Given text, encode all html entities on it - &, <, >, and ". This function also
/// encodes all 8 bit characters as entities, thus ensuring the resultant text will work
/// even if your charset isn't set right.
///
/// The output parameter can be given to append to an existing buffer. You don't have to
/// pass one; regardless, the return value will be usable for you, with just the data encoded.
string htmlEntitiesEncode(string data, Appender!string output = appender!string()) {
// if there's no entities, we can save a lot of time by not bothering with the
// decoding loop. This check cuts the net toString time by better than half in my test.
// let me know if it made your tests worse though, since if you use an entity in just about
// every location, the check will add time... but I suspect the average experience is like mine
// since the check gives up as soon as it can anyway.
bool shortcut = true;
foreach(char c; data) {
// non ascii chars are always higher than 127 in utf8; we'd better go to the full decoder if we see it.
if(c == '<' || c == '>' || c == '"' || c == '&' || cast(uint) c > 127) {
shortcut = false; // there's actual work to be done
break;
}
}
if(shortcut) {
output.put(data);
return data;
}
auto start = output.data.length;
output.reserve(data.length + 64); // grab some extra space for the encoded entities
foreach(dchar d; data) {
if(d == '&')
output.put("&");
else if (d == '<')
output.put("<");
else if (d == '>')
output.put(">");
else if (d == '\"')
output.put(""");
// else if (d == '\'')
// output.put("'"); // if you are in an attribute, it might be important to encode for the same reason as double quotes
// FIXME: should I encode apostrophes too? as '... I could also do space but if your html is so bad that it doesn't
// quote attributes at all, maybe you deserve the xss. Encoding spaces will make everything really ugly so meh
// idk about apostrophes though. Might be worth it, might not.
else if (d < 128 && d > 0)
output.put(d);
else
output.put("&#" ~ std.conv.to!string(cast(int) d) ~ ";");
}
//assert(output !is null); // this fails on empty attributes.....
return output.data[start .. $];
// data = data.replace("\u00a0", " ");
}
/// An alias for htmlEntitiesEncode; it works for xml too
string xmlEntitiesEncode(string data) {
return htmlEntitiesEncode(data);
}
/// This helper function is used for decoding html entities. It has a hard-coded list of entities and characters.
dchar parseEntity(in dchar[] entity) {
switch(entity[1..$-1]) {
case "quot":
return '"';
case "apos":
return '\'';
case "lt":
return '<';
case "gt":
return '>';
case "amp":
return '&';
// the next are html rather than xml
case "Agrave": return '\u00C0';
case "Aacute": return '\u00C1';
case "Acirc": return '\u00C2';
case "Atilde": return '\u00C3';
case "Auml": return '\u00C4';
case "Aring": return '\u00C5';
case "AElig": return '\u00C6';
case "Ccedil": return '\u00C7';
case "Egrave": return '\u00C8';
case "Eacute": return '\u00C9';
case "Ecirc": return '\u00CA';
case "Euml": return '\u00CB';
case "Igrave": return '\u00CC';
case "Iacute": return '\u00CD';
case "Icirc": return '\u00CE';
case "Iuml": return '\u00CF';
case "ETH": return '\u00D0';
case "Ntilde": return '\u00D1';
case "Ograve": return '\u00D2';
case "Oacute": return '\u00D3';
case "Ocirc": return '\u00D4';
case "Otilde": return '\u00D5';
case "Ouml": return '\u00D6';
case "Oslash": return '\u00D8';
case "Ugrave": return '\u00D9';
case "Uacute": return '\u00DA';
case "Ucirc": return '\u00DB';
case "Uuml": return '\u00DC';
case "Yacute": return '\u00DD';
case "THORN": return '\u00DE';
case "szlig": return '\u00DF';
case "agrave": return '\u00E0';
case "aacute": return '\u00E1';
case "acirc": return '\u00E2';
case "atilde": return '\u00E3';
case "auml": return '\u00E4';
case "aring": return '\u00E5';
case "aelig": return '\u00E6';
case "ccedil": return '\u00E7';
case "egrave": return '\u00E8';
case "eacute": return '\u00E9';
case "ecirc": return '\u00EA';
case "euml": return '\u00EB';
case "igrave": return '\u00EC';
case "iacute": return '\u00ED';
case "icirc": return '\u00EE';
case "iuml": return '\u00EF';
case "eth": return '\u00F0';
case "ntilde": return '\u00F1';
case "ograve": return '\u00F2';
case "oacute": return '\u00F3';
case "ocirc": return '\u00F4';
case "otilde": return '\u00F5';
case "ouml": return '\u00F6';
case "oslash": return '\u00F8';
case "ugrave": return '\u00F9';
case "uacute": return '\u00FA';
case "ucirc": return '\u00FB';
case "uuml": return '\u00FC';
case "yacute": return '\u00FD';
case "thorn": return '\u00FE';
case "yuml": return '\u00FF';
case "nbsp": return '\u00A0';
case "iexcl": return '\u00A1';
case "cent": return '\u00A2';
case "pound": return '\u00A3';
case "curren": return '\u00A4';
case "yen": return '\u00A5';
case "brvbar": return '\u00A6';
case "sect": return '\u00A7';
case "uml": return '\u00A8';
case "copy": return '\u00A9';
case "ordf": return '\u00AA';
case "laquo": return '\u00AB';
case "not": return '\u00AC';
case "shy": return '\u00AD';
case "reg": return '\u00AE';
case "ldquo": return '\u201c';
case "rdquo": return '\u201d';
case "macr": return '\u00AF';
case "deg": return '\u00B0';
case "plusmn": return '\u00B1';
case "sup2": return '\u00B2';
case "sup3": return '\u00B3';
case "acute": return '\u00B4';
case "micro": return '\u00B5';
case "para": return '\u00B6';
case "middot": return '\u00B7';
case "cedil": return '\u00B8';
case "sup1": return '\u00B9';
case "ordm": return '\u00BA';
case "raquo": return '\u00BB';
case "frac14": return '\u00BC';
case "frac12": return '\u00BD';
case "frac34": return '\u00BE';
case "iquest": return '\u00BF';
case "times": return '\u00D7';
case "divide": return '\u00F7';
case "OElig": return '\u0152';
case "oelig": return '\u0153';
case "Scaron": return '\u0160';
case "scaron": return '\u0161';
case "Yuml": return '\u0178';
case "fnof": return '\u0192';
case "circ": return '\u02C6';
case "tilde": return '\u02DC';
case "trade": return '\u2122';
case "hellip": return '\u2026';
case "ndash": return '\u2013';
case "mdash": return '\u2014';
case "lsquo": return '\u2018';
case "rsquo": return '\u2019';
case "Omicron": return '\u039f';
case "omicron": return '\u03bf';
// and handling numeric entities
default:
if(entity[1] == '#') {
if(entity[2] == 'x' /*|| (!strict && entity[2] == 'X')*/) {
auto hex = entity[3..$-1];
auto p = intFromHex(to!string(hex).toLower());
return cast(dchar) p;
} else {
auto decimal = entity[2..$-1];
// dealing with broken html entities
while(decimal.length && (decimal[0] < '0' || decimal[0] > '9'))
decimal = decimal[1 .. $];
if(decimal.length == 0)
return ' '; // this is really broken html
// done with dealing with broken stuff
auto p = std.conv.to!int(decimal);
return cast(dchar) p;
}
} else
return '\ufffd'; // replacement character diamond thing
}
assert(0);
}
import std.utf;
import std.stdio;
/// This takes a string of raw HTML and decodes the entities into a nice D utf-8 string.
/// By default, it uses loose mode - it will try to return a useful string from garbage input too.
/// Set the second parameter to true if you'd prefer it to strictly throw exceptions on garbage input.
string htmlEntitiesDecode(string data, bool strict = false) {
// this check makes a *big* difference; about a 50% improvement of parse speed on my test.
if(data.indexOf("&") == -1) // all html entities begin with &
return data; // if there are no entities in here, we can return the original slice and save some time
char[] a; // this seems to do a *better* job than appender!
char[4] buffer;
bool tryingEntity = false;
dchar[] entityBeingTried;
int entityAttemptIndex = 0;
foreach(dchar ch; data) {
if(tryingEntity) {
entityAttemptIndex++;
entityBeingTried ~= ch;
// I saw some crappy html in the wild that looked like &0ї this tries to handle that.
if(ch == '&') {
if(strict)
throw new Exception("unterminated entity; & inside another at " ~ to!string(entityBeingTried));
// if not strict, let's try to parse both.
if(entityBeingTried == "&&")
a ~= "&"; // double amp means keep the first one, still try to parse the next one
else
a ~= buffer[0.. std.utf.encode(buffer, parseEntity(entityBeingTried))];
// tryingEntity is still true
entityBeingTried = entityBeingTried[0 .. 1]; // keep the &
entityAttemptIndex = 0; // restarting o this
} else
if(ch == ';') {
tryingEntity = false;
a ~= buffer[0.. std.utf.encode(buffer, parseEntity(entityBeingTried))];
} else if(ch == ' ') {
// e.g. you & i
if(strict)
throw new Exception("unterminated entity at " ~ to!string(entityBeingTried));
else {
tryingEntity = false;
a ~= to!(char[])(entityBeingTried);
}
} else {
if(entityAttemptIndex >= 9) {
if(strict)
throw new Exception("unterminated entity at " ~ to!string(entityBeingTried));
else {
tryingEntity = false;
a ~= to!(char[])(entityBeingTried);
}
}
}
} else {
if(ch == '&') {
tryingEntity = true;
entityBeingTried = null;
entityBeingTried ~= ch;
entityAttemptIndex = 0;
} else {
a ~= buffer[0 .. std.utf.encode(buffer, ch)];
}
}
}
if(tryingEntity) {
if(strict)
throw new Exception("unterminated entity at " ~ to!string(entityBeingTried));
// otherwise, let's try to recover, at least so we don't drop any data
a ~= to!string(entityBeingTried);
// FIXME: what if we have "cool &"? should we try to parse it?
}
return cast(string) a; // assumeUnique is actually kinda slow, lol
}
abstract class SpecialElement : Element {
this(Document _parentDocument) {
super(_parentDocument);
}
///.
override Element appendChild(Element e) {
assert(0, "Cannot append to a special node");
}
///.
@property override int nodeType() const {
return 100;
}
}
///.
class RawSource : SpecialElement {
///.
this(Document _parentDocument, string s) {
super(_parentDocument);
source = s;
tagName = "#raw";
}
///.
override string nodeValue() const {
return this.toString();
}
///.
override string writeToAppender(Appender!string where = appender!string()) const {
where.put(source);
return source;
}
///.
string source;
}
abstract class ServerSideCode : SpecialElement {
this(Document _parentDocument, string type) {
super(_parentDocument);
tagName = "#" ~ type;
}
///.
override string nodeValue() const {
return this.source;
}
///.
override string writeToAppender(Appender!string where = appender!string()) const {
auto start = where.data.length;
where.put("<");
where.put(source);
where.put(">");
return where.data[start .. $];
}
///.
string source;
}
///.
class PhpCode : ServerSideCode {
///.
this(Document _parentDocument, string s) {
super(_parentDocument, "php");
source = s;
}
}
///.
class AspCode : ServerSideCode {
///.
this(Document _parentDocument, string s) {
super(_parentDocument, "asp");
source = s;
}
}
///.
class BangInstruction : SpecialElement {
///.
this(Document _parentDocument, string s) {
super(_parentDocument);
source = s;
tagName = "#bpi";
}
///.
override string nodeValue() const {
return this.source;
}
///.
override string writeToAppender(Appender!string where = appender!string()) const {
auto start = where.data.length;
where.put("<!");
where.put(source);
where.put(">");
return where.data[start .. $];
}
///.
string source;
}
///.
class QuestionInstruction : SpecialElement {
///.
this(Document _parentDocument, string s) {
super(_parentDocument);
source = s;
tagName = "#qpi";
}
///.
override string nodeValue() const {
return this.source;
}
///.
override string writeToAppender(Appender!string where = appender!string()) const {
auto start = where.data.length;
where.put("<");
where.put(source);
where.put(">");
return where.data[start .. $];
}
///.
string source;
}
///.
class HtmlComment : SpecialElement {
///.
this(Document _parentDocument, string s) {
super(_parentDocument);
source = s;
tagName = "#comment";
}
///.
override string nodeValue() const {
return this.source;
}
///.
override string writeToAppender(Appender!string where = appender!string()) const {
auto start = where.data.length;
where.put("<!--");
where.put(source);
where.put("-->");
return where.data[start .. $];
}
///.
string source;
}
///.
class TextNode : Element {
public:
///.
this(Document _parentDocument, string e) {
super(_parentDocument);
contents = e;
tagName = "#text";
}
///
this(string e) {
this(null, e);
}
string opDispatch(string name)(string v = null) if(0) { return null; } // text nodes don't have attributes
///.
static TextNode fromUndecodedString(Document _parentDocument, string html) {
auto e = new TextNode(_parentDocument, "");
e.contents = htmlEntitiesDecode(html, _parentDocument is null ? false : !_parentDocument.loose);
return e;
}
///.
override @property Element cloned() {
auto n = new TextNode(parentDocument, contents);
return n;
}
///.
override string nodeValue() const {
return this.contents; //toString();
}
///.
@property override int nodeType() const {
return NodeType.Text;
}
///.
override string writeToAppender(Appender!string where = appender!string()) const {
string s;
if(contents.length)
s = htmlEntitiesEncode(contents, where);
else
s = "";
assert(s !is null);
return s;
}
///.
override Element appendChild(Element e) {
assert(0, "Cannot append to a text node");
}
///.
string contents;
// alias contents content; // I just mistype this a lot,
}
/**
There are subclasses of Element offering improved helper
functions for the element in HTML.
*/
///.
class Link : Element {
///.
this(Document _parentDocument) {
super(_parentDocument);
this.tagName = "a";
}
///.
this(string href, string text) {
super("a");
setAttribute("href", href);
innerText = text;
}
/+
/// Returns everything in the href EXCEPT the query string
@property string targetSansQuery() {
}
///.
@property string domainName() {
}
///.
@property string path
+/
/// This gets a variable from the URL's query string.
string getValue(string name) {
auto vars = variablesHash();
if(name in vars)
return vars[name];
return null;
}
private string[string] variablesHash() {
string href = getAttribute("href");
if(href is null)
return null;
auto ques = href.indexOf("?");
string str = "";
if(ques != -1) {
str = href[ques+1..$];
auto fragment = str.indexOf("#");
if(fragment != -1)
str = str[0..fragment];
}
string[] variables = str.split("&");
string[string] hash;
foreach(var; variables) {
auto index = var.indexOf("=");
if(index == -1)
hash[var] = "";
else {
hash[decodeComponent(var[0..index])] = decodeComponent(var[index + 1 .. $]);
}
}
return hash;
}
///.
/*private*/ void updateQueryString(string[string] vars) {
string href = getAttribute("href");
auto question = href.indexOf("?");
if(question != -1)
href = href[0..question];
string frag = "";
auto fragment = href.indexOf("#");
if(fragment != -1) {
frag = href[fragment..$];
href = href[0..fragment];
}
string query = "?";
bool first = true;
foreach(name, value; vars) {
if(!first)
query ~= "&";
else
first = false;
query ~= encodeComponent(name);
if(value.length)
query ~= "=" ~ encodeComponent(value);
}
if(query != "?")
href ~= query;
href ~= frag;
setAttribute("href", href);
}
/// Sets or adds the variable with the given name to the given value
/// It automatically URI encodes the values and takes care of the ? and &.
override void setValue(string name, string variable) {
auto vars = variablesHash();
vars[name] = variable;
updateQueryString(vars);
}
/// Removes the given variable from the query string
void removeValue(string name) {
auto vars = variablesHash();
vars.remove(name);
updateQueryString(vars);
}
/*
///.
override string toString() {
}
///.
override string getAttribute(string name) {
if(name == "href") {
} else
return super.getAttribute(name);
}
*/
}
///.
class Form : Element {
///.
this(Document _parentDocument) {
super(_parentDocument);
tagName = "form";
}
override Element addField(string label, string name, string type = "text", FormFieldOptions fieldOptions = FormFieldOptions.none) {
auto t = this.querySelector("fieldset div");
if(t is null)
return super.addField(label, name, type, fieldOptions);
else
return t.addField(label, name, type, fieldOptions);
}
override Element addField(string label, string name, FormFieldOptions fieldOptions) {
auto type = "text";
auto t = this.querySelector("fieldset div");
if(t is null)
return super.addField(label, name, type, fieldOptions);
else
return t.addField(label, name, type, fieldOptions);
}
override Element addField(string label, string name, string[string] options, FormFieldOptions fieldOptions = FormFieldOptions.none) {
auto t = this.querySelector("fieldset div");
if(t is null)
return super.addField(label, name, options, fieldOptions);
else
return t.addField(label, name, options, fieldOptions);
}
override void setValue(string field, string value) {
setValue(field, value, true);
}
// FIXME: doesn't handle arrays; multiple fields can have the same name
/// Set's the form field's value. For input boxes, this sets the value attribute. For
/// textareas, it sets the innerText. For radio boxes and select boxes, it removes
/// the checked/selected attribute from all, and adds it to the one matching the value.
/// For checkboxes, if the value is non-null and not empty, it checks the box.
/// If you set a value that doesn't exist, it throws an exception if makeNew is false.
/// Otherwise, it makes a new input with type=hidden to keep the value.
void setValue(string field, string value, bool makeNew) {
auto eles = getField(field);
if(eles.length == 0) {
if(makeNew) {
addInput(field, value);
return;
} else
throw new Exception("form field does not exist");
}
if(eles.length == 1) {
auto e = eles[0];
switch(e.tagName) {
default: assert(0);
case "textarea":
e.innerText = value;
break;
case "input":
string type = e.getAttribute("type");
if(type is null) {
e.value = value;
return;
}
switch(type) {
case "checkbox":
case "radio":
if(value.length)
e.setAttribute("checked", "checked");
else
e.removeAttribute("checked");
break;
default:
e.value = value;
return;
}
break;
case "select":
bool found = false;
foreach(child; e.tree) {
if(child.tagName != "option")
continue;
string val = child.getAttribute("value");
if(val is null)
val = child.innerText;
if(val == value) {
child.setAttribute("selected", "selected");
found = true;
} else
child.removeAttribute("selected");
}
if(!found) {
e.addChild("option", value)
.setAttribute("selected", "selected");
}
break;
}
} else {
// assume radio boxes
foreach(e; eles) {
string val = e.getAttribute("value");
//if(val is null)
// throw new Exception("don't know what to do with radio boxes with null value");
if(val == value)
e.setAttribute("checked", "checked");
else
e.removeAttribute("checked");
}
}
}
/// This takes an array of strings and adds hidden <input> elements for each one of them. Unlike setValue,
/// it makes no attempt to find and modify existing elements in the form to the new values.
void addValueArray(string key, string[] arrayOfValues) {
foreach(arr; arrayOfValues)
addChild("input", key, arr);
}
/// Gets the value of the field; what would be given if it submitted right now. (so
/// it handles select boxes and radio buttons too). For checkboxes, if a value isn't
/// given, but it is checked, it returns "checked", since null and "" are indistinguishable
string getValue(string field) {
auto eles = getField(field);
if(eles.length == 0)
return "";
if(eles.length == 1) {
auto e = eles[0];
switch(e.tagName) {
default: assert(0);
case "input":
if(e.type == "checkbox") {
if(e.checked)
return e.value.length ? e.value : "checked";
return "";
} else
return e.value;
case "textarea":
return e.innerText;
case "select":
foreach(child; e.tree) {
if(child.tagName != "option")
continue;
if(child.selected)
return child.value;
}
break;
}
} else {
// assuming radio
foreach(e; eles) {
if(e.checked)
return e.value;
}
}
return "";
}
// FIXME: doesn't handle multiple elements with the same name (except radio buttons)
///.
string getPostableData() {
bool[string] namesDone;
string ret;
bool outputted = false;
foreach(e; getElementsBySelector("[name]")) {
if(e.name in namesDone)
continue;
if(outputted)
ret ~= "&";
else
outputted = true;
ret ~= std.uri.encodeComponent(e.name) ~ "=" ~ std.uri.encodeComponent(getValue(e.name));
namesDone[e.name] = true;
}
return ret;
}
/// Gets the actual elements with the given name
Element[] getField(string name) {
Element[] ret;
foreach(e; tree) {
if(e.name == name)
ret ~= e;
}
return ret;
}
/// Grabs the <label> with the given for tag, if there is one.
Element getLabel(string forId) {
foreach(e; tree)
if(e.tagName == "label" && e.getAttribute("for") == forId)
return e;
return null;
}
/// Adds a new INPUT field to the end of the form with the given attributes.
Element addInput(string name, string value, string type = "hidden") {
auto e = new Element(parentDocument, "input", null, true);
e.name = name;
e.value = value;
e.type = type;
appendChild(e);
return e;
}
/// Removes the given field from the form. It finds the element and knocks it right out.
void removeField(string name) {
foreach(e; getField(name))
e.parentNode.removeChild(e);
}
/+
/// Returns all form members.
@property Element[] elements() {
}
///.
string opDispatch(string name)(string v = null)
// filter things that should actually be attributes on the form
if( name != "method" && name != "action" && name != "enctype"
&& name != "style" && name != "name" && name != "id" && name != "class")
{
}
+/
/+
void submit() {
// take its elements and submit them through http
}
+/
}
import std.conv;
///.
class Table : Element {
///.
this(Document _parentDocument) {
super(_parentDocument);
tagName = "table";
}
///.
Element th(T)(T t) {
Element e;
if(parentDocument !is null)
e = parentDocument.createElement("th");
else
e = Element.make("th");
static if(is(T == Html))
e.innerHTML = t;
else
e.innerText = to!string(t);
return e;
}
///.
Element td(T)(T t) {
Element e;
if(parentDocument !is null)
e = parentDocument.createElement("td");
else
e = Element.make("td");
static if(is(T == Html))
e.innerHTML = t;
else
e.innerText = to!string(t);
return e;
}
/// .
Element appendHeaderRow(T...)(T t) {
return appendRowInternal("th", "thead", t);
}
/// .
Element appendFooterRow(T...)(T t) {
return appendRowInternal("td", "tfoot", t);
}
/// .
Element appendRow(T...)(T t) {
return appendRowInternal("td", "tbody", t);
}
void addColumnClasses(string[] classes...) {
auto grid = getGrid();
foreach(row; grid)
foreach(i, cl; classes) {
if(cl.length)
if(i < row.length)
row[i].addClass(cl);
}
}
private Element appendRowInternal(T...)(string innerType, string findType, T t) {
Element row = Element.make("tr");
foreach(e; t) {
static if(is(typeof(e) : Element)) {
if(e.tagName == "td" || e.tagName == "th")
row.appendChild(e);
else {
Element a = Element.make(innerType);
a.appendChild(e);
row.appendChild(a);
}
} else static if(is(typeof(e) == Html)) {
Element a = Element.make(innerType);
a.innerHTML = e.source;
row.appendChild(a);
} else static if(is(typeof(e) == Element[])) {
Element a = Element.make(innerType);
foreach(ele; e)
a.appendChild(ele);
row.appendChild(a);
} else {
Element a = Element.make(innerType);
a.innerText = to!string(e);
row.appendChild(a);
}
}
foreach(e; children) {
if(e.tagName == findType) {
e.appendChild(row);
return row;
}
}
// the type was not found if we are here... let's add it so it is well-formed
auto lol = this.addChild(findType);
lol.appendChild(row);
return row;
}
///.
Element captionElement() {
Element cap;
foreach(c; children) {
if(c.tagName == "caption") {
cap = c;
break;
}
}
if(cap is null) {
cap = Element.make("caption");
appendChild(cap);
}
return cap;
}
///.
@property string caption() {
return captionElement().innerText;
}
///.
@property void caption(string text) {
captionElement().innerText = text;
}
/// Gets the logical layout of the table as a rectangular grid of
/// cells. It considers rowspan and colspan. A cell with a large
/// span is represented in the grid by being referenced several times.
/// The tablePortition parameter can get just a <thead>, <tbody>, or
/// <tfoot> portion if you pass one.
///
/// Note: the rectangular grid might include null cells.
///
/// This is kinda expensive so you should call once when you want the grid,
/// then do lookups on the returned array.
TableCell[][] getGrid(Element tablePortition = null)
in {
if(tablePortition is null)
assert(tablePortition is null);
else {
assert(tablePortition !is null);
assert(tablePortition.parentNode is this);
assert(
tablePortition.tagName == "tbody"
||
tablePortition.tagName == "tfoot"
||
tablePortition.tagName == "thead"
);
}
}
body {
if(tablePortition is null)
tablePortition = this;
TableCell[][] ret;
// FIXME: will also return rows of sub tables!
auto rows = tablePortition.getElementsByTagName("tr");
ret.length = rows.length;
int maxLength = 0;
int insertCell(int row, int position, TableCell cell) {
if(row >= ret.length)
return position; // not supposed to happen - a rowspan is prolly too big.
if(position == -1) {
position++;
foreach(item; ret[row]) {
if(item is null)
break;
position++;
}
}
if(position < ret[row].length)
ret[row][position] = cell;
else
foreach(i; ret[row].length .. position + 1) {
if(i == position)
ret[row] ~= cell;
else
ret[row] ~= null;
}
return position;
}
foreach(int i, rowElement; rows) {
auto row = cast(TableRow) rowElement;
assert(row !is null);
assert(i < ret.length);
int position = 0;
foreach(cellElement; rowElement.childNodes) {
auto cell = cast(TableCell) cellElement;
if(cell is null)
continue;
// FIXME: colspan == 0 or rowspan == 0
// is supposed to mean fill in the rest of
// the table, not skip it
foreach(int j; 0 .. cell.colspan) {
foreach(int k; 0 .. cell.rowspan)
// if the first row, always append.
insertCell(k + i, k == 0 ? -1 : position, cell);
position++;
}
}
if(ret[i].length > maxLength)
maxLength = cast(int) ret[i].length;
}
// want to ensure it's rectangular
foreach(ref r; ret) {
foreach(i; r.length .. maxLength)
r ~= null;
}
return ret;
}
}
/// Represents a table row element - a <tr>
class TableRow : Element {
///.
this(Document _parentDocument) {
super(_parentDocument);
tagName = "tr";
}
// FIXME: the standard says there should be a lot more in here,
// but meh, I never use it and it's a pain to implement.
}
/// Represents anything that can be a table cell - <td> or <th> html.
class TableCell : Element {
///.
this(Document _parentDocument, string _tagName) {
super(_parentDocument, _tagName);
}
@property int rowspan() const {
int ret = 1;
auto it = getAttribute("rowspan");
if(it.length)
ret = to!int(it);
return ret;
}
@property int colspan() const {
int ret = 1;
auto it = getAttribute("colspan");
if(it.length)
ret = to!int(it);
return ret;
}
@property int rowspan(int i) {
setAttribute("rowspan", to!string(i));
return i;
}
@property int colspan(int i) {
setAttribute("colspan", to!string(i));
return i;
}
}
///.
class MarkupException : Exception {
///.
this(string message, string file = __FILE__, size_t line = __LINE__) {
super(message, file, line);
}
}
/// This is used when you are using one of the require variants of navigation, and no matching element can be found in the tree.
class ElementNotFoundException : Exception {
/// type == kind of element you were looking for and search == a selector describing the search.
this(string type, string search, string file = __FILE__, size_t line = __LINE__) {
super("Element of type '"~type~"' matching {"~search~"} not found.", file, line);
}
}
/// The html struct is used to differentiate between regular text nodes and html in certain functions
///
/// Easiest way to construct it is like this: `auto html = Html("<p>hello</p>");`
struct Html {
/// This string holds the actual html. Use it to retrieve the contents.
string source;
}
// for the observers
enum DomMutationOperations {
setAttribute,
removeAttribute,
appendChild, // tagname, attributes[], innerHTML
insertBefore,
truncateChildren,
removeChild,
appendHtml,
replaceHtml,
appendText,
replaceText,
replaceTextOnly
}
// and for observers too
struct DomMutationEvent {
DomMutationOperations operation;
Element target;
Element related; // what this means differs with the operation
Element related2;
string relatedString;
string relatedString2;
}
private enum static string[] selfClosedElements = [
// html 4
"img", "hr", "input", "br", "col", "link", "meta",
// html 5
"source" ];
static import std.conv;
///.
int intFromHex(string hex) {
int place = 1;
int value = 0;
for(sizediff_t a = hex.length - 1; a >= 0; a--) {
int v;
char q = hex[a];
if( q >= '0' && q <= '9')
v = q - '0';
else if (q >= 'a' && q <= 'f')
v = q - 'a' + 10;
else throw new Exception("Illegal hex character: " ~ q);
value += v * place;
place *= 16;
}
return value;
}
// CSS selector handling
// EXTENSIONS
// dd - dt means get the dt directly before that dd (opposite of +) NOT IMPLEMENTED
// dd -- dt means rewind siblings until you hit a dt, go as far as you need to NOT IMPLEMENTED
// dt < dl means get the parent of that dt iff it is a dl (usable for "get a dt that are direct children of dl")
// dt << dl means go as far up as needed to find a dl (you have an element and want its containers) NOT IMPLEMENTED
// :first means to stop at the first hit, don't do more (so p + p == p ~ p:first
// CSS4 draft currently says you can change the subject (the element actually returned) by putting a ! at the end of it.
// That might be useful to implement, though I do have parent selectors too.
///.
static immutable string[] selectorTokens = [
// It is important that the 2 character possibilities go first here for accurate lexing
"~=", "*=", "|=", "^=", "$=", "!=", // "::" should be there too for full standard
"::", ">>",
"<<", // my any-parent extension (reciprocal of whitespace)
// " - ", // previous-sibling extension (whitespace required to disambiguate tag-names)
".", ">", "+", "*", ":", "[", "]", "=", "\"", "#", ",", " ", "~", "<", "(", ")"
]; // other is white space or a name.
///.
sizediff_t idToken(string str, sizediff_t position) {
sizediff_t tid = -1;
char c = str[position];
foreach(a, token; selectorTokens)
if(c == token[0]) {
if(token.length > 1) {
if(position + 1 >= str.length || str[position+1] != token[1])
continue; // not this token
}
tid = a;
break;
}
return tid;
}
///.
// look, ma, no phobos!
// new lexer by ketmar
string[] lexSelector (string selstr) {
static sizediff_t idToken (string str, size_t stpos) {
char c = str[stpos];
foreach (sizediff_t tidx, immutable token; selectorTokens) {
if (c == token[0]) {
if (token.length > 1) {
assert(token.length == 2, token); // we don't have 3-char tokens yet
if (str.length-stpos < 2 || str[stpos+1] != token[1]) continue;
}
return tidx;
}
}
return -1;
}
// skip spaces and comments
static string removeLeadingBlanks (string str) {
size_t curpos = 0;
while (curpos < str.length) {
immutable char ch = str[curpos];
// this can overflow on 4GB strings on 32-bit; 'cmon, don't be silly, nobody cares!
if (ch == '/' && str.length-curpos > 1 && str[curpos+1] == '*') {
// comment
curpos += 2;
while (curpos < str.length) {
if (str[curpos] == '*' && str.length-curpos > 1 && str[curpos+1] == '/') {
curpos += 2;
break;
}
++curpos;
}
} else if (ch < 32) { // The < instead of <= is INTENTIONAL. See note from adr below.
++curpos;
// FROM ADR: This does NOT catch ' '! Spaces have semantic meaning in CSS! While
// "foo bar" is clear, and can only have one meaning, consider ".foo .bar".
// That is not the same as ".foo.bar". If the space is stripped, important
// information is lost, despite the tokens being separatable anyway.
//
// The parser really needs to be aware of the presence of a space.
} else {
break;
}
}
return str[curpos..$];
}
static bool isBlankAt() (string str, size_t pos) {
// we should consider unicode spaces too, but... unicode sux anyway.
return
(pos < str.length && // in string
(str[pos] <= 32 || // space
(str.length-pos > 1 && str[pos] == '/' && str[pos+1] == '*'))); // comment
}
string[] tokens;
// lexx it!
while ((selstr = removeLeadingBlanks(selstr)).length > 0) {
if(selstr[0] == '\"' || selstr[0] == '\'') {
auto end = selstr[0];
auto pos = 1;
bool escaping;
while(pos < selstr.length && !escaping && selstr[pos] != end) {
if(escaping)
escaping = false;
else if(selstr[pos] == '\\')
escaping = true;
pos++;
}
// FIXME: do better unescaping
tokens ~= selstr[1 .. pos].replace(`\"`, `"`).replace(`\'`, `'`).replace(`\\`, `\`);
if(pos+1 >= selstr.length)
assert(0, selstr);
selstr = selstr[pos + 1.. $];
continue;
}
// no tokens starts with escape
immutable tid = idToken(selstr, 0);
if (tid >= 0) {
// special token
tokens ~= selectorTokens[tid]; // it's funnier this way
selstr = selstr[selectorTokens[tid].length..$];
continue;
}
// from start to space or special token
size_t escapePos = size_t.max;
size_t curpos = 0; // i can has chizburger^w escape at the start
while (curpos < selstr.length) {
if (selstr[curpos] == '\\') {
// this is escape, just skip it and next char
if (escapePos == size_t.max) escapePos = curpos;
curpos = (selstr.length-curpos >= 2 ? curpos+2 : selstr.length);
} else {
if (isBlankAt(selstr, curpos) || idToken(selstr, curpos) >= 0) break;
++curpos;
}
}
// identifier
if (escapePos != size_t.max) {
// i hate it when it happens
string id = selstr[0..escapePos];
while (escapePos < curpos) {
if (curpos-escapePos < 2) break;
id ~= selstr[escapePos+1]; // escaped char
escapePos += 2;
immutable stp = escapePos;
while (escapePos < curpos && selstr[escapePos] != '\\') ++escapePos;
if (escapePos > stp) id ~= selstr[stp..escapePos];
}
if (id.length > 0) tokens ~= id;
} else {
tokens ~= selstr[0..curpos];
}
selstr = selstr[curpos..$];
}
return tokens;
}
version(unittest_domd_lexer) unittest {
assert(lexSelector(r" test\=me /*d*/") == [r"test=me"]);
assert(lexSelector(r"div/**/. id") == ["div", ".", "id"]);
assert(lexSelector(r" < <") == ["<", "<"]);
assert(lexSelector(r" <<") == ["<<"]);
assert(lexSelector(r" <</") == ["<<", "/"]);
assert(lexSelector(r" <</*") == ["<<"]);
assert(lexSelector(r" <\</*") == ["<", "<"]);
assert(lexSelector(r"heh\") == ["heh"]);
assert(lexSelector(r"alice \") == ["alice"]);
assert(lexSelector(r"alice,is#best") == ["alice", ",", "is", "#", "best"]);
}
///.
struct SelectorPart {
string tagNameFilter; ///.
string[] attributesPresent; /// [attr]
string[2][] attributesEqual; /// [attr=value]
string[2][] attributesStartsWith; /// [attr^=value]
string[2][] attributesEndsWith; /// [attr$=value]
// split it on space, then match to these
string[2][] attributesIncludesSeparatedBySpaces; /// [attr~=value]
// split it on dash, then match to these
string[2][] attributesIncludesSeparatedByDashes; /// [attr|=value]
string[2][] attributesInclude; /// [attr*=value]
string[2][] attributesNotEqual; /// [attr!=value] -- extension by me
string[] hasSelectors; /// :has(this)
string[] notSelectors; /// :not(this)
ParsedNth[] nthOfType; /// .
ParsedNth[] nthLastOfType; /// .
ParsedNth[] nthChild; /// .
bool firstChild; ///.
bool lastChild; ///.
bool firstOfType; /// .
bool lastOfType; /// .
bool emptyElement; ///.
bool whitespaceOnly; ///
bool oddChild; ///.
bool evenChild; ///.
bool rootElement; ///.
int separation = -1; /// -1 == only itself; the null selector, 0 == tree, 1 == childNodes, 2 == childAfter, 3 == youngerSibling, 4 == parentOf
bool isCleanSlateExceptSeparation() {
auto cp = this;
cp.separation = -1;
return cp is SelectorPart.init;
}
///.
string toString() {
string ret;
switch(separation) {
default: assert(0);
case -1: break;
case 0: ret ~= " "; break;
case 1: ret ~= " > "; break;
case 2: ret ~= " + "; break;
case 3: ret ~= " ~ "; break;
case 4: ret ~= " < "; break;
}
ret ~= tagNameFilter;
foreach(a; attributesPresent) ret ~= "[" ~ a ~ "]";
foreach(a; attributesEqual) ret ~= "[" ~ a[0] ~ "=\"" ~ a[1] ~ "\"]";
foreach(a; attributesEndsWith) ret ~= "[" ~ a[0] ~ "$=\"" ~ a[1] ~ "\"]";
foreach(a; attributesStartsWith) ret ~= "[" ~ a[0] ~ "^=\"" ~ a[1] ~ "\"]";
foreach(a; attributesNotEqual) ret ~= "[" ~ a[0] ~ "!=\"" ~ a[1] ~ "\"]";
foreach(a; attributesInclude) ret ~= "[" ~ a[0] ~ "*=\"" ~ a[1] ~ "\"]";
foreach(a; attributesIncludesSeparatedByDashes) ret ~= "[" ~ a[0] ~ "|=\"" ~ a[1] ~ "\"]";
foreach(a; attributesIncludesSeparatedBySpaces) ret ~= "[" ~ a[0] ~ "~=\"" ~ a[1] ~ "\"]";
foreach(a; notSelectors) ret ~= ":not(" ~ a ~ ")";
foreach(a; hasSelectors) ret ~= ":has(" ~ a ~ ")";
foreach(a; nthChild) ret ~= ":nth-child(" ~ a.toString ~ ")";
foreach(a; nthOfType) ret ~= ":nth-of-type(" ~ a.toString ~ ")";
foreach(a; nthLastOfType) ret ~= ":nth-last-of-type(" ~ a.toString ~ ")";
if(firstChild) ret ~= ":first-child";
if(lastChild) ret ~= ":last-child";
if(firstOfType) ret ~= ":first-of-type";
if(lastOfType) ret ~= ":last-of-type";
if(emptyElement) ret ~= ":empty";
if(whitespaceOnly) ret ~= ":whitespace-only";
if(oddChild) ret ~= ":odd-child";
if(evenChild) ret ~= ":even-child";
if(rootElement) ret ~= ":root";
return ret;
}
// USEFUL
///.
bool matchElement(Element e) {
// FIXME: this can be called a lot of times, and really add up in times according to the profiler.
// Each individual call is reasonably fast already, but it adds up.
if(e is null) return false;
if(e.nodeType != 1) return false;
if(tagNameFilter != "" && tagNameFilter != "*")
if(e.tagName != tagNameFilter)
return false;
if(firstChild) {
if(e.parentNode is null)
return false;
if(e.parentNode.childElements[0] !is e)
return false;
}
if(lastChild) {
if(e.parentNode is null)
return false;
auto ce = e.parentNode.childElements;
if(ce[$-1] !is e)
return false;
}
if(firstOfType) {
if(e.parentNode is null)
return false;
auto ce = e.parentNode.childElements;
foreach(c; ce) {
if(c.tagName == e.tagName) {
if(c is e)
return true;
else
return false;
}
}
}
if(lastOfType) {
if(e.parentNode is null)
return false;
auto ce = e.parentNode.childElements;
foreach_reverse(c; ce) {
if(c.tagName == e.tagName) {
if(c is e)
return true;
else
return false;
}
}
}
if(emptyElement) {
if(e.children.length)
return false;
}
if(whitespaceOnly) {
if(e.innerText.strip.length)
return false;
}
if(rootElement) {
if(e.parentNode !is null)
return false;
}
if(oddChild || evenChild) {
if(e.parentNode is null)
return false;
foreach(i, child; e.parentNode.childElements) {
if(child is e) {
if(oddChild && !(i&1))
return false;
if(evenChild && (i&1))
return false;
break;
}
}
}
bool matchWithSeparator(string attr, string value, string separator) {
foreach(s; attr.split(separator))
if(s == value)
return true;
return false;
}
foreach(a; attributesPresent)
if(a !in e.attributes)
return false;
foreach(a; attributesEqual)
if(a[0] !in e.attributes || e.attributes[a[0]] != a[1])
return false;
foreach(a; attributesNotEqual)
// FIXME: maybe it should say null counts... this just bit me.
// I did [attr][attr!=value] to work around.
//
// if it's null, it's not equal, right?
//if(a[0] !in e.attributes || e.attributes[a[0]] == a[1])
if(e.getAttribute(a[0]) == a[1])
return false;
foreach(a; attributesInclude)
if(a[0] !in e.attributes || (e.attributes[a[0]].indexOf(a[1]) == -1))
return false;
foreach(a; attributesStartsWith)
if(a[0] !in e.attributes || !e.attributes[a[0]].startsWith(a[1]))
return false;
foreach(a; attributesEndsWith)
if(a[0] !in e.attributes || !e.attributes[a[0]].endsWith(a[1]))
return false;
foreach(a; attributesIncludesSeparatedBySpaces)
if(a[0] !in e.attributes || !matchWithSeparator(e.attributes[a[0]], a[1], " "))
return false;
foreach(a; attributesIncludesSeparatedByDashes)
if(a[0] !in e.attributes || !matchWithSeparator(e.attributes[a[0]], a[1], "-"))
return false;
foreach(a; hasSelectors) {
if(e.querySelector(a) is null)
return false;
}
foreach(a; notSelectors) {
auto sel = Selector(a);
if(sel.matchesElement(e))
return false;
}
foreach(a; nthChild) {
if(e.parentNode is null)
return false;
auto among = e.parentNode.childElements;
if(!a.solvesFor(among, e))
return false;
}
foreach(a; nthOfType) {
if(e.parentNode is null)
return false;
auto among = e.parentNode.childElements(e.tagName);
if(!a.solvesFor(among, e))
return false;
}
foreach(a; nthLastOfType) {
if(e.parentNode is null)
return false;
auto among = retro(e.parentNode.childElements(e.tagName));
if(!a.solvesFor(among, e))
return false;
}
return true;
}
}
struct ParsedNth {
int multiplier;
int adder;
string of;
this(string text) {
auto original = text;
consumeWhitespace(text);
if(text.startsWith("odd")) {
multiplier = 2;
adder = 1;
text = text[3 .. $];
} else if(text.startsWith("even")) {
multiplier = 2;
adder = 1;
text = text[4 .. $];
} else {
int n = (text.length && text[0] == 'n') ? 1 : parseNumber(text);
consumeWhitespace(text);
if(text.length && text[0] == 'n') {
multiplier = n;
text = text[1 .. $];
consumeWhitespace(text);
if(text.length) {
if(text[0] == '+') {
text = text[1 .. $];
adder = parseNumber(text);
} else if(text[0] == '-') {
text = text[1 .. $];
adder = -parseNumber(text);
} else if(text[0] == 'o') {
// continue, this is handled below
} else
throw new Exception("invalid css string at " ~ text ~ " in " ~ original);
}
} else {
adder = n;
}
}
consumeWhitespace(text);
if(text.startsWith("of")) {
text = text[2 .. $];
consumeWhitespace(text);
of = text[0 .. $];
}
}
string toString() {
return format("%dn%s%d%s%s", multiplier, adder >= 0 ? "+" : "", adder, of.length ? " of " : "", of);
}
bool solvesFor(R)(R elements, Element e) {
int idx = 1;
bool found = false;
foreach(ele; elements) {
if(of.length) {
auto sel = Selector(of);
if(!sel.matchesElement(ele))
continue;
}
if(ele is e) {
found = true;
break;
}
idx++;
}
if(!found) return false;
// multiplier* n + adder = idx
// if there is a solution for integral n, it matches
idx -= adder;
if(multiplier) {
if(idx % multiplier == 0)
return true;
} else {
return idx == 0;
}
return false;
}
private void consumeWhitespace(ref string text) {
while(text.length && text[0] == ' ')
text = text[1 .. $];
}
private int parseNumber(ref string text) {
consumeWhitespace(text);
if(text.length == 0) return 0;
bool negative = text[0] == '-';
if(text[0] == '+')
text = text[1 .. $];
if(negative) text = text[1 .. $];
int i = 0;
while(i < text.length && (text[i] >= '0' && text[i] <= '9'))
i++;
if(i == 0)
return 0;
int cool = to!int(text[0 .. i]);
text = text[i .. $];
return negative ? -cool : cool;
}
}
// USEFUL
///.
Element[] getElementsBySelectorParts(Element start, SelectorPart[] parts) {
Element[] ret;
if(!parts.length) {
return [start]; // the null selector only matches the start point; it
// is what terminates the recursion
}
auto part = parts[0];
switch(part.separation) {
default: assert(0);
case -1:
case 0: // tree
foreach(e; start.tree) {
if(part.separation == 0 && start is e)
continue; // space doesn't match itself!
if(part.matchElement(e)) {
ret ~= getElementsBySelectorParts(e, parts[1..$]);
}
}
break;
case 1: // children
foreach(e; start.childNodes) {
if(part.matchElement(e)) {
ret ~= getElementsBySelectorParts(e, parts[1..$]);
}
}
break;
case 2: // next-sibling
auto e = start.nextSibling("*");
if(part.matchElement(e))
ret ~= getElementsBySelectorParts(e, parts[1..$]);
break;
case 3: // younger sibling
auto tmp = start.parentNode;
if(tmp !is null) {
sizediff_t pos = -1;
auto children = tmp.childElements;
foreach(i, child; children) {
if(child is start) {
pos = i;
break;
}
}
assert(pos != -1);
foreach(e; children[pos+1..$]) {
if(part.matchElement(e))
ret ~= getElementsBySelectorParts(e, parts[1..$]);
}
}
break;
case 4: // immediate parent node, an extension of mine to walk back up the tree
auto e = start.parentNode;
if(part.matchElement(e)) {
ret ~= getElementsBySelectorParts(e, parts[1..$]);
}
/*
Example of usefulness:
Consider you have an HTML table. If you want to get all rows that have a th, you can do:
table th < tr
Get all th descendants of the table, then walk back up the tree to fetch their parent tr nodes
*/
break;
case 5: // any parent note, another extension of mine to go up the tree (backward of the whitespace operator)
/*
Like with the < operator, this is best used to find some parent of a particular known element.
Say you have an anchor inside a
*/
}
return ret;
}
/++
Represents a parsed CSS selector.
See_Also:
[Element.querySelector]
[Element.querySelectorAll]
[Document.querySelector]
[Document.querySelectorAll]
+/
struct Selector {
SelectorComponent[] components;
string original;
/++
Parses the selector string and returns the usable structure.
+/
this(string cssSelector) {
components = parseSelectorString(cssSelector);
original = cssSelector;
}
/++
Returns true if the given element matches this selector,
considered relative to an arbitrary element.
You can do a form of lazy [Element.querySelectorAll|querySelectorAll] by using this
with [std.algorithm.iteration.filter]:
---
Selector sel = Selector("foo > bar");
auto lazySelectorRange = element.tree.filter!(e => sel.matchElement(e))(document.root);
---
+/
bool matchesElement(Element e, Element relativeTo = null) {
foreach(component; components)
if(component.matchElement(e, relativeTo))
return true;
return false;
}
/++
Reciprocal of [Element.querySelectorAll]
+/
Element[] getMatchingElements(Element start) {
Element[] ret;
foreach(component; components)
ret ~= getElementsBySelectorParts(start, component.parts);
return removeDuplicates(ret);
}
/++
Like [getMatchingElements], but returns a lazy range. Be careful
about mutating the dom as you iterate through this.
+/
auto getMatchingElementsLazy(Element start, Element relativeTo = null) {
import std.algorithm.iteration;
return start.tree.filter!(a => this.matchesElement(a, relativeTo));
}
/// Returns the string this was built from
string toString() {
return original;
}
/++
Returns a string from the parsed result
(may not match the original, this is mostly for debugging right now but in the future might be useful for pretty-printing)
+/
string parsedToString() {
string ret;
foreach(idx, component; components) {
if(idx) ret ~= ", ";
ret ~= component.toString();
}
return ret;
}
}
///.
struct SelectorComponent {
///.
SelectorPart[] parts;
///.
string toString() {
string ret;
foreach(part; parts)
ret ~= part.toString();
return ret;
}
// USEFUL
///.
Element[] getElements(Element start) {
return removeDuplicates(getElementsBySelectorParts(start, parts));
}
// USEFUL (but not implemented)
/// If relativeTo == null, it assumes the root of the parent document.
bool matchElement(Element e, Element relativeTo = null) {
if(e is null) return false;
Element where = e;
int lastSeparation = -1;
foreach(part; retro(parts)) {
// writeln("matching ", where, " with ", part, " via ", lastSeparation);
if(lastSeparation == -1) {
if(!part.matchElement(where))
return false;
} else if(lastSeparation == 0) { // generic parent
// need to go up the whole chain
where = where.parentNode;
while(where !is null) {
if(part.matchElement(where))
break;
if(where is relativeTo)
return false;
where = where.parentNode;
}
if(where is null)
return false;
} else if(lastSeparation == 1) { // the > operator
where = where.parentNode;
if(!part.matchElement(where))
return false;
} else if(lastSeparation == 2) { // the + operator
where = where.previousSibling("*");
if(!part.matchElement(where))
return false;
} else if(lastSeparation == 3) { // the ~ operator
where = where.previousSibling("*");
while(where !is null) {
if(part.matchElement(where))
break;
if(where is relativeTo)
return false;
where = where.previousSibling("*");
}
if(where is null)
return false;
} else if(lastSeparation == 4) { // my bad idea extension < operator, don't use this anymore
// FIXME
}
lastSeparation = part.separation;
if(where is relativeTo)
return false; // at end of line, if we aren't done by now, the match fails
}
return true; // if we got here, it is a success
}
// the string should NOT have commas. Use parseSelectorString for that instead
///.
static SelectorComponent fromString(string selector) {
return parseSelector(lexSelector(selector));
}
}
///.
SelectorComponent[] parseSelectorString(string selector, bool caseSensitiveTags = true) {
SelectorComponent[] ret;
auto tokens = lexSelector(selector); // this will parse commas too
// and now do comma-separated slices (i haz phobosophobia!)
while (tokens.length > 0) {
size_t end = 0;
while (end < tokens.length && tokens[end] != ",") ++end;
if (end > 0) ret ~= parseSelector(tokens[0..end], caseSensitiveTags);
if (tokens.length-end < 2) break;
tokens = tokens[end+1..$];
}
return ret;
}
///.
SelectorComponent parseSelector(string[] tokens, bool caseSensitiveTags = true) {
SelectorComponent s;
SelectorPart current;
void commit() {
// might as well skip null items
if(!current.isCleanSlateExceptSeparation()) {
s.parts ~= current;
current = current.init; // start right over
}
}
enum State {
Starting,
ReadingClass,
ReadingId,
ReadingAttributeSelector,
ReadingAttributeComparison,
ExpectingAttributeCloser,
ReadingPseudoClass,
ReadingAttributeValue,
SkippingFunctionalSelector,
}
State state = State.Starting;
string attributeName, attributeValue, attributeComparison;
int parensCount;
foreach(idx, token; tokens) {
string readFunctionalSelector() {
string s;
if(tokens[idx + 1] != "(")
throw new Exception("parse error");
int pc = 1;
foreach(t; tokens[idx + 2 .. $]) {
if(t == "(")
pc++;
if(t == ")")
pc--;
if(pc == 0)
break;
s ~= t;
}
return s;
}
sizediff_t tid = -1;
foreach(i, item; selectorTokens)
if(token == item) {
tid = i;
break;
}
final switch(state) {
case State.Starting: // fresh, might be reading an operator or a tagname
if(tid == -1) {
if(!caseSensitiveTags)
token = token.toLower();
if(current.isCleanSlateExceptSeparation()) {
current.tagNameFilter = token;
} else {
// if it was already set, we must see two thingies
// separated by whitespace...
commit();
current.separation = 0; // tree
current.tagNameFilter = token;
}
} else {
// Selector operators
switch(token) {
case "*":
current.tagNameFilter = "*";
break;
case " ":
// If some other separation has already been set,
// this is irrelevant whitespace, so we should skip it.
// this happens in the case of "foo > bar" for example.
if(current.isCleanSlateExceptSeparation() && current.separation > 0)
continue;
commit();
current.separation = 0; // tree
break;
case ">>":
commit();
current.separation = 0; // alternate syntax for tree from html5 css
break;
case ">":
commit();
current.separation = 1; // child
break;
case "+":
commit();
current.separation = 2; // sibling directly after
break;
case "~":
commit();
current.separation = 3; // any sibling after
break;
case "<":
commit();
current.separation = 4; // immediate parent of
break;
case "[":
state = State.ReadingAttributeSelector;
break;
case ".":
state = State.ReadingClass;
break;
case "#":
state = State.ReadingId;
break;
case ":":
case "::":
state = State.ReadingPseudoClass;
break;
default:
assert(0, token);
}
}
break;
case State.ReadingClass:
current.attributesIncludesSeparatedBySpaces ~= ["class", token];
state = State.Starting;
break;
case State.ReadingId:
current.attributesEqual ~= ["id", token];
state = State.Starting;
break;
case State.ReadingPseudoClass:
switch(token) {
case "first-of-type":
current.firstOfType = true;
break;
case "last-of-type":
current.lastOfType = true;
break;
case "only-of-type":
current.firstOfType = true;
current.lastOfType = true;
break;
case "first-child":
current.firstChild = true;
break;
case "last-child":
current.lastChild = true;
break;
case "only-child":
current.firstChild = true;
current.lastChild = true;
break;
case "empty":
// one with no children
current.emptyElement = true;
break;
case "whitespace-only":
current.whitespaceOnly = true;
break;
case "link":
current.attributesPresent ~= "href";
break;
case "root":
current.rootElement = true;
break;
case "nth-child":
current.nthChild ~= ParsedNth(readFunctionalSelector());
state = State.SkippingFunctionalSelector;
continue;
case "nth-of-type":
current.nthOfType ~= ParsedNth(readFunctionalSelector());
state = State.SkippingFunctionalSelector;
continue;
case "nth-last-of-type":
current.nthLastOfType ~= ParsedNth(readFunctionalSelector());
state = State.SkippingFunctionalSelector;
continue;
case "not":
state = State.SkippingFunctionalSelector;
current.notSelectors ~= readFunctionalSelector();
continue; // now the rest of the parser skips past the parens we just handled
case "has":
state = State.SkippingFunctionalSelector;
current.hasSelectors ~= readFunctionalSelector();
continue; // now the rest of the parser skips past the parens we just handled
// back to standards though not quite right lol
case "disabled":
current.attributesPresent ~= "disabled";
break;
case "checked":
current.attributesPresent ~= "checked";
break;
case "visited", "active", "hover", "target", "focus", "selected":
current.attributesPresent ~= "nothing";
// FIXME
/*
// defined in the standard, but I don't implement it
case "not":
*/
/+
// extensions not implemented
//case "text": // takes the text in the element and wraps it in an element, returning it
+/
goto case;
case "before", "after":
current.attributesPresent ~= "FIXME";
break;
// My extensions
case "odd-child":
current.oddChild = true;
break;
case "even-child":
current.evenChild = true;
break;
default:
//if(token.indexOf("lang") == -1)
//assert(0, token);
break;
}
state = State.Starting;
break;
case State.SkippingFunctionalSelector:
if(token == "(") {
parensCount++;
} else if(token == ")") {
parensCount--;
}
if(parensCount == 0)
state = State.Starting;
break;
case State.ReadingAttributeSelector:
attributeName = token;
attributeComparison = null;
attributeValue = null;
state = State.ReadingAttributeComparison;
break;
case State.ReadingAttributeComparison:
// FIXME: these things really should be quotable in the proper lexer...
if(token != "]") {
if(token.indexOf("=") == -1) {
// not a comparison; consider it
// part of the attribute
attributeValue ~= token;
} else {
attributeComparison = token;
state = State.ReadingAttributeValue;
}
break;
}
goto case;
case State.ExpectingAttributeCloser:
if(token != "]") {
// not the closer; consider it part of comparison
if(attributeComparison == "")
attributeName ~= token;
else
attributeValue ~= token;
break;
}
// Selector operators
switch(attributeComparison) {
default: assert(0);
case "":
current.attributesPresent ~= attributeName;
break;
case "=":
current.attributesEqual ~= [attributeName, attributeValue];
break;
case "|=":
current.attributesIncludesSeparatedByDashes ~= [attributeName, attributeValue];
break;
case "~=":
current.attributesIncludesSeparatedBySpaces ~= [attributeName, attributeValue];
break;
case "$=":
current.attributesEndsWith ~= [attributeName, attributeValue];
break;
case "^=":
current.attributesStartsWith ~= [attributeName, attributeValue];
break;
case "*=":
current.attributesInclude ~= [attributeName, attributeValue];
break;
case "!=":
current.attributesNotEqual ~= [attributeName, attributeValue];
break;
}
state = State.Starting;
break;
case State.ReadingAttributeValue:
attributeValue = token;
state = State.ExpectingAttributeCloser;
break;
}
}
commit();
return s;
}
///.
Element[] removeDuplicates(Element[] input) {
Element[] ret;
bool[Element] already;
foreach(e; input) {
if(e in already) continue;
already[e] = true;
ret ~= e;
}
return ret;
}
// done with CSS selector handling
// FIXME: use the better parser from html.d
/// This is probably not useful to you unless you're writing a browser or something like that.
/// It represents a *computed* style, like what the browser gives you after applying stylesheets, inline styles, and html attributes.
/// From here, you can start to make a layout engine for the box model and have a css aware browser.
class CssStyle {
///.
this(string rule, string content) {
rule = rule.strip();
content = content.strip();
if(content.length == 0)
return;
originatingRule = rule;
originatingSpecificity = getSpecificityOfRule(rule); // FIXME: if there's commas, this won't actually work!
foreach(part; content.split(";")) {
part = part.strip();
if(part.length == 0)
continue;
auto idx = part.indexOf(":");
if(idx == -1)
continue;
//throw new Exception("Bad css rule (no colon): " ~ part);
Property p;
p.name = part[0 .. idx].strip();
p.value = part[idx + 1 .. $].replace("! important", "!important").replace("!important", "").strip(); // FIXME don't drop important
p.givenExplicitly = true;
p.specificity = originatingSpecificity;
properties ~= p;
}
foreach(property; properties)
expandShortForm(property, originatingSpecificity);
}
///.
Specificity getSpecificityOfRule(string rule) {
Specificity s;
if(rule.length == 0) { // inline
// s.important = 2;
} else {
// FIXME
}
return s;
}
string originatingRule; ///.
Specificity originatingSpecificity; ///.
///.
union Specificity {
uint score; ///.
// version(little_endian)
///.
struct {
ubyte tags; ///.
ubyte classes; ///.
ubyte ids; ///.
ubyte important; /// 0 = none, 1 = stylesheet author, 2 = inline style, 3 = user important
}
}
///.
struct Property {
bool givenExplicitly; /// this is false if for example the user said "padding" and this is "padding-left"
string name; ///.
string value; ///.
Specificity specificity; ///.
// do we care about the original source rule?
}
///.
Property[] properties;
///.
string opDispatch(string nameGiven)(string value = null) if(nameGiven != "popFront") {
string name = unCamelCase(nameGiven);
if(value is null)
return getValue(name);
else
return setValue(name, value, 0x02000000 /* inline specificity */);
}
/// takes dash style name
string getValue(string name) {
foreach(property; properties)
if(property.name == name)
return property.value;
return null;
}
/// takes dash style name
string setValue(string name, string value, Specificity newSpecificity, bool explicit = true) {
value = value.replace("! important", "!important");
if(value.indexOf("!important") != -1) {
newSpecificity.important = 1; // FIXME
value = value.replace("!important", "").strip();
}
foreach(ref property; properties)
if(property.name == name) {
if(newSpecificity.score >= property.specificity.score) {
property.givenExplicitly = explicit;
expandShortForm(property, newSpecificity);
return (property.value = value);
} else {
if(name == "display")
{}//writeln("Not setting ", name, " to ", value, " because ", newSpecificity.score, " < ", property.specificity.score);
return value; // do nothing - the specificity is too low
}
}
// it's not here...
Property p;
p.givenExplicitly = true;
p.name = name;
p.value = value;
p.specificity = originatingSpecificity;
properties ~= p;
expandShortForm(p, originatingSpecificity);
return value;
}
private void expandQuadShort(string name, string value, Specificity specificity) {
auto parts = value.split(" ");
switch(parts.length) {
case 1:
setValue(name ~"-left", parts[0], specificity, false);
setValue(name ~"-right", parts[0], specificity, false);
setValue(name ~"-top", parts[0], specificity, false);
setValue(name ~"-bottom", parts[0], specificity, false);
break;
case 2:
setValue(name ~"-left", parts[1], specificity, false);
setValue(name ~"-right", parts[1], specificity, false);
setValue(name ~"-top", parts[0], specificity, false);
setValue(name ~"-bottom", parts[0], specificity, false);
break;
case 3:
setValue(name ~"-top", parts[0], specificity, false);
setValue(name ~"-right", parts[1], specificity, false);
setValue(name ~"-bottom", parts[2], specificity, false);
setValue(name ~"-left", parts[2], specificity, false);
break;
case 4:
setValue(name ~"-top", parts[0], specificity, false);
setValue(name ~"-right", parts[1], specificity, false);
setValue(name ~"-bottom", parts[2], specificity, false);
setValue(name ~"-left", parts[3], specificity, false);
break;
default:
assert(0, value);
}
}
///.
void expandShortForm(Property p, Specificity specificity) {
switch(p.name) {
case "margin":
case "padding":
expandQuadShort(p.name, p.value, specificity);
break;
case "border":
case "outline":
setValue(p.name ~ "-left", p.value, specificity, false);
setValue(p.name ~ "-right", p.value, specificity, false);
setValue(p.name ~ "-top", p.value, specificity, false);
setValue(p.name ~ "-bottom", p.value, specificity, false);
break;
case "border-top":
case "border-bottom":
case "border-left":
case "border-right":
case "outline-top":
case "outline-bottom":
case "outline-left":
case "outline-right":
default: {}
}
}
///.
override string toString() {
string ret;
if(originatingRule.length)
ret = originatingRule ~ " {";
foreach(property; properties) {
if(!property.givenExplicitly)
continue; // skip the inferred shit
if(originatingRule.length)
ret ~= "\n\t";
else
ret ~= " ";
ret ~= property.name ~ ": " ~ property.value ~ ";";
}
if(originatingRule.length)
ret ~= "\n}\n";
return ret;
}
}
string cssUrl(string url) {
return "url(\"" ~ url ~ "\")";
}
/// This probably isn't useful, unless you're writing a browser or something like that.
/// You might want to look at arsd.html for css macro, nesting, etc., or just use standard css
/// as text.
///
/// The idea, however, is to represent a kind of CSS object model, complete with specificity,
/// that you can apply to your documents to build the complete computedStyle object.
class StyleSheet {
///.
CssStyle[] rules;
///.
this(string source) {
// FIXME: handle @ rules and probably could improve lexer
// add nesting?
int state;
string currentRule;
string currentValue;
string* currentThing = ¤tRule;
foreach(c; source) {
handle: switch(state) {
default: assert(0);
case 0: // starting - we assume we're reading a rule
switch(c) {
case '@':
state = 4;
break;
case '/':
state = 1;
break;
case '{':
currentThing = ¤tValue;
break;
case '}':
if(currentThing is ¤tValue) {
rules ~= new CssStyle(currentRule, currentValue);
currentRule = "";
currentValue = "";
currentThing = ¤tRule;
} else {
// idk what is going on here.
// check sveit.com to reproduce
currentRule = "";
currentValue = "";
}
break;
default:
(*currentThing) ~= c;
}
break;
case 1: // expecting *
if(c == '*')
state = 2;
else {
state = 0;
(*currentThing) ~= "/" ~ c;
}
break;
case 2: // inside comment
if(c == '*')
state = 3;
break;
case 3: // expecting / to end comment
if(c == '/')
state = 0;
else
state = 2; // it's just a comment so no need to append
break;
case 4:
if(c == '{')
state = 5;
if(c == ';')
state = 0; // just skipping import
break;
case 5:
if(c == '}')
state = 0; // skipping font face probably
}
}
}
/// Run through the document and apply this stylesheet to it. The computedStyle member will be accurate after this call
void apply(Document document) {
foreach(rule; rules) {
if(rule.originatingRule.length == 0)
continue; // this shouldn't happen here in a stylesheet
foreach(element; document.querySelectorAll(rule.originatingRule)) {
// note: this should be a different object than the inline style
// since givenExplicitly is likely destroyed here
auto current = element.computedStyle;
foreach(item; rule.properties)
current.setValue(item.name, item.value, item.specificity);
}
}
}
}
/// This is kinda private; just a little utility container for use by the ElementStream class.
final class Stack(T) {
this() {
internalLength = 0;
arr = initialBuffer[];
}
///.
void push(T t) {
if(internalLength >= arr.length) {
auto oldarr = arr;
if(arr.length < 4096)
arr = new T[arr.length * 2];
else
arr = new T[arr.length + 4096];
arr[0 .. oldarr.length] = oldarr[];
}
arr[internalLength] = t;
internalLength++;
}
///.
T pop() {
assert(internalLength);
internalLength--;
return arr[internalLength];
}
///.
T peek() {
assert(internalLength);
return arr[internalLength - 1];
}
///.
@property bool empty() {
return internalLength ? false : true;
}
///.
private T[] arr;
private size_t internalLength;
private T[64] initialBuffer;
// the static array is allocated with this object, so if we have a small stack (which we prolly do; dom trees usually aren't insanely deep),
// using this saves us a bunch of trips to the GC. In my last profiling, I got about a 50x improvement in the push()
// function thanks to this, and push() was actually one of the slowest individual functions in the code!
}
/// This is the lazy range that walks the tree for you. It tries to go in the lexical order of the source: node, then children from first to last, each recursively.
final class ElementStream {
///.
@property Element front() {
return current.element;
}
/// Use Element.tree instead.
this(Element start) {
current.element = start;
current.childPosition = -1;
isEmpty = false;
stack = new Stack!(Current);
}
/*
Handle it
handle its children
*/
///.
void popFront() {
more:
if(isEmpty) return;
// FIXME: the profiler says this function is somewhat slow (noticeable because it can be called a lot of times)
current.childPosition++;
if(current.childPosition >= current.element.children.length) {
if(stack.empty())
isEmpty = true;
else {
current = stack.pop();
goto more;
}
} else {
stack.push(current);
current.element = current.element.children[current.childPosition];
current.childPosition = -1;
}
}
/// You should call this when you remove an element from the tree. It then doesn't recurse into that node and adjusts the current position, keeping the range stable.
void currentKilled() {
if(stack.empty) // should never happen
isEmpty = true;
else {
current = stack.pop();
current.childPosition--; // when it is killed, the parent is brought back a lil so when we popFront, this is then right
}
}
///.
@property bool empty() {
return isEmpty;
}
private:
struct Current {
Element element;
int childPosition;
}
Current current;
Stack!(Current) stack;
bool isEmpty;
}
// unbelievable.
// Don't use any of these in your own code. Instead, try to use phobos or roll your own, as I might kill these at any time.
sizediff_t indexOfBytes(immutable(ubyte)[] haystack, immutable(ubyte)[] needle) {
static import std.algorithm;
auto found = std.algorithm.find(haystack, needle);
if(found.length == 0)
return -1;
return haystack.length - found.length;
}
private T[] insertAfter(T)(T[] arr, int position, T[] what) {
assert(position < arr.length);
T[] ret;
ret.length = arr.length + what.length;
int a = 0;
foreach(i; arr[0..position+1])
ret[a++] = i;
foreach(i; what)
ret[a++] = i;
foreach(i; arr[position+1..$])
ret[a++] = i;
return ret;
}
package bool isInArray(T)(T item, T[] arr) {
foreach(i; arr)
if(item == i)
return true;
return false;
}
private string[string] aadup(in string[string] arr) {
string[string] ret;
foreach(k, v; arr)
ret[k] = v;
return ret;
}
// dom event support, if you want to use it
/// used for DOM events
alias EventHandler = void delegate(Element handlerAttachedTo, Event event);
/// This is a DOM event, like in javascript. Note that this library never fires events - it is only here for you to use if you want it.
class Event {
this(string eventName, Element target) {
this.eventName = eventName;
this.srcElement = target;
}
/// Prevents the default event handler (if there is one) from being called
void preventDefault() {
defaultPrevented = true;
}
/// Stops the event propagation immediately.
void stopPropagation() {
propagationStopped = true;
}
bool defaultPrevented;
bool propagationStopped;
string eventName;
Element srcElement;
alias srcElement target;
Element relatedTarget;
int clientX;
int clientY;
int button;
bool isBubbling;
/// this sends it only to the target. If you want propagation, use dispatch() instead.
void send() {
if(srcElement is null)
return;
auto e = srcElement;
if(eventName in e.bubblingEventHandlers)
foreach(handler; e.bubblingEventHandlers[eventName])
handler(e, this);
if(!defaultPrevented)
if(eventName in e.defaultEventHandlers)
e.defaultEventHandlers[eventName](e, this);
}
/// this dispatches the element using the capture -> target -> bubble process
void dispatch() {
if(srcElement is null)
return;
// first capture, then bubble
Element[] chain;
Element curr = srcElement;
while(curr) {
auto l = curr;
chain ~= l;
curr = curr.parentNode;
}
isBubbling = false;
foreach(e; chain.retro()) {
if(eventName in e.capturingEventHandlers)
foreach(handler; e.capturingEventHandlers[eventName])
handler(e, this);
// the default on capture should really be to always do nothing
//if(!defaultPrevented)
// if(eventName in e.defaultEventHandlers)
// e.defaultEventHandlers[eventName](e.element, this);
if(propagationStopped)
break;
}
isBubbling = true;
if(!propagationStopped)
foreach(e; chain) {
if(eventName in e.bubblingEventHandlers)
foreach(handler; e.bubblingEventHandlers[eventName])
handler(e, this);
if(propagationStopped)
break;
}
if(!defaultPrevented)
foreach(e; chain) {
if(eventName in e.defaultEventHandlers)
e.defaultEventHandlers[eventName](e, this);
}
}
}
struct FormFieldOptions {
// usable for any
/// this is a regex pattern used to validate the field
string pattern;
/// must the field be filled in? Even with a regex, it can be submitted blank if this is false.
bool isRequired;
/// this is displayed as an example to the user
string placeholder;
// usable for numeric ones
// convenience methods to quickly get some options
@property static FormFieldOptions none() {
FormFieldOptions f;
return f;
}
static FormFieldOptions required() {
FormFieldOptions f;
f.isRequired = true;
return f;
}
static FormFieldOptions regex(string pattern, bool required = false) {
FormFieldOptions f;
f.pattern = pattern;
f.isRequired = required;
return f;
}
static FormFieldOptions fromElement(Element e) {
FormFieldOptions f;
if(e.hasAttribute("required"))
f.isRequired = true;
if(e.hasAttribute("pattern"))
f.pattern = e.pattern;
if(e.hasAttribute("placeholder"))
f.placeholder = e.placeholder;
return f;
}
Element applyToElement(Element e) {
if(this.isRequired)
e.required = "required";
if(this.pattern.length)
e.pattern = this.pattern;
if(this.placeholder.length)
e.placeholder = this.placeholder;
return e;
}
}
// this needs to look just like a string, but can expand as needed
version(no_dom_stream)
alias string Utf8Stream;
else
class Utf8Stream {
protected:
// these two should be overridden in subclasses to actually do the stream magic
string getMore() {
if(getMoreHelper !is null)
return getMoreHelper();
return null;
}
bool hasMore() {
if(hasMoreHelper !is null)
return hasMoreHelper();
return false;
}
// the rest should be ok
public:
this(string d) {
this.data = d;
}
this(string delegate() getMoreHelper, bool delegate() hasMoreHelper) {
this.getMoreHelper = getMoreHelper;
this.hasMoreHelper = hasMoreHelper;
if(hasMore())
this.data ~= getMore();
stdout.flush();
}
@property final size_t length() {
// the parser checks length primarily directly before accessing the next character
// so this is the place we'll hook to append more if possible and needed.
if(lastIdx + 1 >= data.length && hasMore()) {
data ~= getMore();
}
return data.length;
}
final char opIndex(size_t idx) {
if(idx > lastIdx)
lastIdx = idx;
return data[idx];
}
final string opSlice(size_t start, size_t end) {
if(end > lastIdx)
lastIdx = end;
return data[start .. end];
}
final size_t opDollar() {
return length();
}
final Utf8Stream opBinary(string op : "~")(string s) {
this.data ~= s;
return this;
}
final Utf8Stream opOpAssign(string op : "~")(string s) {
this.data ~= s;
return this;
}
final Utf8Stream opAssign(string rhs) {
this.data = rhs;
return this;
}
private:
string data;
size_t lastIdx;
bool delegate() hasMoreHelper;
string delegate() getMoreHelper;
/+
// used to maybe clear some old stuff
// you might have to remove elements parsed with it too since they can hold slices into the
// old stuff, preventing gc
void dropFront(int bytes) {
posAdjustment += bytes;
data = data[bytes .. $];
}
int posAdjustment;
+/
}
void fillForm(T)(Form form, T obj, string name) {
import arsd.database;
fillData((k, v) => form.setValue(k, v), obj, name);
}
/*
Copyright: Adam D. Ruppe, 2010 - 2016
License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
Authors: Adam D. Ruppe, with contributions by Nick Sabalausky, Trass3r, and ketmar among others
Copyright Adam D. Ruppe 2010-2016.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
|
D
|
module user.controller.logout.logout;
import user;
class LogoutController : UserControllerPrototype{
this(){
super();
this.name = "logout";
//this.init();
}
@method(HTTPMethod.GET){
@path("/")
void getLogout(){
//this.app.session.authenticated = false;
terminateSession();
redirect("/");
}
}
}
|
D
|
module spock.ai.l2;
import spock.board;
import spock.player;
import std.random;
import std.algorithm;
import std.array;
import std.typecons;
auto player(int SIZE)(ref Board!SIZE board, Side side)
{
return new AI2!SIZE(board, side);
}
auto player(int SIZE)(Board!SIZE *board, Side side)
{
return new AI2!SIZE(*board, side);
}
class AI2(int SIZE) : Player
{
private Board!SIZE *board;
this(ref Board!SIZE board, Side side) {
super(side);
this.board=&board;
}
override void make_turn() {
if(board.turn != mine)
return;
if(!board.spock(mine)) {
board.lock(Side.none);
return;
}
board.move(random_move);
board.lock(mine.opposite);
}
private auto random_move() {
auto r=Board!SIZE.Move();
uint N=0;
foreach(m; board.variants_of(mine).filter!(a => board.is_safe_move(a))) {
if(board.unit(m.to) == Unit.knight && board.side(m.to) == mine.opposite)
return m;
if(uniform(0,++N) == 0)
r=m;
}
return (r[0] && r[1])? r : random_unsafe_move;
}
private auto random_unsafe_move() {
auto r=Board!SIZE.Move();
uint N=0;
foreach(m; board.variants_of(mine))
if(uniform(0,++N) == 0)
r=m;
return r;
}
}
|
D
|
/Users/Shinkangsan/Desktop/SiriKit-Demo/build/SiriKitDemo.build/Debug-iphonesimulator/SiriExtensionDemoUI.build/Objects-normal/x86_64/PaymentsContact.o : /Users/Shinkangsan/Desktop/SiriKit-Demo/SiriExtensionDemoUI/IntentViewController.swift /Users/Shinkangsan/Desktop/SiriKit-Demo/SiriKitDemo/PaymentsContact.swift /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Intents.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule
/Users/Shinkangsan/Desktop/SiriKit-Demo/build/SiriKitDemo.build/Debug-iphonesimulator/SiriExtensionDemoUI.build/Objects-normal/x86_64/PaymentsContact~partial.swiftmodule : /Users/Shinkangsan/Desktop/SiriKit-Demo/SiriExtensionDemoUI/IntentViewController.swift /Users/Shinkangsan/Desktop/SiriKit-Demo/SiriKitDemo/PaymentsContact.swift /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Intents.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule
/Users/Shinkangsan/Desktop/SiriKit-Demo/build/SiriKitDemo.build/Debug-iphonesimulator/SiriExtensionDemoUI.build/Objects-normal/x86_64/PaymentsContact~partial.swiftdoc : /Users/Shinkangsan/Desktop/SiriKit-Demo/SiriExtensionDemoUI/IntentViewController.swift /Users/Shinkangsan/Desktop/SiriKit-Demo/SiriKitDemo/PaymentsContact.swift /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Intents.swiftmodule /Users/Shinkangsan/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule
|
D
|
module mutils.bindings.libcoro;
enum CORO_VERSION = 3;
alias coro_func = extern (C) void function(void*);
extern (C) void coro_create(coro_context* ctx, coro_func coro, void* arg, void* sptr, size_t ssze);
extern (C) void coro_transfer(coro_context* prev, coro_context* next);
extern (C) void coro_destroy(coro_context* ctx);
extern (C) int coro_stack_alloc(coro_stack* stack, uint size);
struct coro_context {
void*[128] data; // Platform/system dependant, this should be enought
}
struct coro_stack {
void* sptr;
size_t ssze;
int valgrind_id;
}
// Does not work on Windows
/*version(Posix) unittest{
__gshared static coro_context ctx, mainctx;
__gshared static coro_stack stack;
__gshared static int num;
extern(C) static void coro_body(void *arg)
{
assert(num==0);
num=1;
coro_transfer(&ctx, &mainctx);
assert(num==2);
num=3;
coro_transfer(&ctx, &mainctx);
assert(0);
}
coro_create(&mainctx, null, null, null, 0);
coro_stack_alloc(&stack, 0);
coro_create(&ctx, &coro_body, null, stack.sptr, stack.ssze);
assert(num==0);
coro_transfer(&mainctx, &ctx);
assert(num==1);
num=2;
coro_transfer(&mainctx, &ctx);
assert(num==3);
}*/
|
D
|
// Written in the D programming language.
/**
Copyright: Copyright Digital Mars 2000-2013.
License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(HTTP walterbright.com, Walter Bright), $(HTTP erdani.com,
Andrei Alexandrescu), and Kenji Hara
Source: $(PHOBOSSRC std/_format.d)
*/
module undead.doformat;
//debug=format; // uncomment to turn on debugging printf's
import core.vararg;
import std.exception;
import std.meta;
import std.range.primitives;
import std.traits;
import std.format;
version(CRuntime_DigitalMars)
{
version = DigitalMarsC;
}
version (DigitalMarsC)
{
// This is DMC's internal floating point formatting function
extern (C)
{
extern shared char* function(int c, int flags, int precision,
in real* pdval,
char* buf, size_t* psl, int width) __pfloatfmt;
}
}
/**********************************************************************
* Signals a mismatch between a format and its corresponding argument.
*/
class FormatException : Exception
{
@safe pure nothrow
this()
{
super("format error");
}
@safe pure nothrow
this(string msg, string fn = __FILE__, size_t ln = __LINE__, Throwable next = null)
{
super(msg, fn, ln, next);
}
}
// Legacy implementation
enum Mangle : char
{
Tvoid = 'v',
Tbool = 'b',
Tbyte = 'g',
Tubyte = 'h',
Tshort = 's',
Tushort = 't',
Tint = 'i',
Tuint = 'k',
Tlong = 'l',
Tulong = 'm',
Tfloat = 'f',
Tdouble = 'd',
Treal = 'e',
Tifloat = 'o',
Tidouble = 'p',
Tireal = 'j',
Tcfloat = 'q',
Tcdouble = 'r',
Tcreal = 'c',
Tchar = 'a',
Twchar = 'u',
Tdchar = 'w',
Tarray = 'A',
Tsarray = 'G',
Taarray = 'H',
Tpointer = 'P',
Tfunction = 'F',
Tident = 'I',
Tclass = 'C',
Tstruct = 'S',
Tenum = 'E',
Ttypedef = 'T',
Tdelegate = 'D',
Tconst = 'x',
Timmutable = 'y',
}
// return the TypeInfo for a primitive type and null otherwise. This
// is required since for arrays of ints we only have the mangled char
// to work from. If arrays always subclassed TypeInfo_Array this
// routine could go away.
private TypeInfo primitiveTypeInfo(Mangle m)
{
// BUG: should fix this in static this() to avoid double checked locking bug
__gshared TypeInfo[Mangle] dic;
if (!dic.length)
{
dic = [
Mangle.Tvoid : typeid(void),
Mangle.Tbool : typeid(bool),
Mangle.Tbyte : typeid(byte),
Mangle.Tubyte : typeid(ubyte),
Mangle.Tshort : typeid(short),
Mangle.Tushort : typeid(ushort),
Mangle.Tint : typeid(int),
Mangle.Tuint : typeid(uint),
Mangle.Tlong : typeid(long),
Mangle.Tulong : typeid(ulong),
Mangle.Tfloat : typeid(float),
Mangle.Tdouble : typeid(double),
Mangle.Treal : typeid(real),
Mangle.Tifloat : typeid(ifloat),
Mangle.Tidouble : typeid(idouble),
Mangle.Tireal : typeid(ireal),
Mangle.Tcfloat : typeid(cfloat),
Mangle.Tcdouble : typeid(cdouble),
Mangle.Tcreal : typeid(creal),
Mangle.Tchar : typeid(char),
Mangle.Twchar : typeid(wchar),
Mangle.Tdchar : typeid(dchar)
];
}
auto p = m in dic;
return p ? *p : null;
}
// This stuff has been removed from the docs and is planned for deprecation.
/*
* Interprets variadic argument list pointed to by argptr whose types
* are given by arguments[], formats them according to embedded format
* strings in the variadic argument list, and sends the resulting
* characters to putc.
*
* The variadic arguments are consumed in order. Each is formatted
* into a sequence of chars, using the default format specification
* for its type, and the characters are sequentially passed to putc.
* If a $(D char[]), $(D wchar[]), or $(D dchar[]) argument is
* encountered, it is interpreted as a format string. As many
* arguments as specified in the format string are consumed and
* formatted according to the format specifications in that string and
* passed to putc. If there are too few remaining arguments, a
* $(D FormatException) is thrown. If there are more remaining arguments than
* needed by the format specification, the default processing of
* arguments resumes until they are all consumed.
*
* Params:
* putc = Output is sent do this delegate, character by character.
* arguments = Array of $(D TypeInfo)s, one for each argument to be formatted.
* argptr = Points to variadic argument list.
*
* Throws:
* Mismatched arguments and formats result in a $(D FormatException) being thrown.
*
* Format_String:
* <a name="format-string">$(I Format strings)</a>
* consist of characters interspersed with
* $(I format specifications). Characters are simply copied
* to the output (such as putc) after any necessary conversion
* to the corresponding UTF-8 sequence.
*
* A $(I format specification) starts with a '%' character,
* and has the following grammar:
$(CONSOLE
$(I FormatSpecification):
$(B '%%')
$(B '%') $(I Flags) $(I Width) $(I Precision) $(I FormatChar)
$(I Flags):
$(I empty)
$(B '-') $(I Flags)
$(B '+') $(I Flags)
$(B '#') $(I Flags)
$(B '0') $(I Flags)
$(B ' ') $(I Flags)
$(I Width):
$(I empty)
$(I Integer)
$(B '*')
$(I Precision):
$(I empty)
$(B '.')
$(B '.') $(I Integer)
$(B '.*')
$(I Integer):
$(I Digit)
$(I Digit) $(I Integer)
$(I Digit):
$(B '0')
$(B '1')
$(B '2')
$(B '3')
$(B '4')
$(B '5')
$(B '6')
$(B '7')
$(B '8')
$(B '9')
$(I FormatChar):
$(B 's')
$(B 'b')
$(B 'd')
$(B 'o')
$(B 'x')
$(B 'X')
$(B 'e')
$(B 'E')
$(B 'f')
$(B 'F')
$(B 'g')
$(B 'G')
$(B 'a')
$(B 'A')
)
$(DL
$(DT $(I Flags))
$(DL
$(DT $(B '-'))
$(DD
Left justify the result in the field.
It overrides any $(B 0) flag.)
$(DT $(B '+'))
$(DD Prefix positive numbers in a signed conversion with a $(B +).
It overrides any $(I space) flag.)
$(DT $(B '#'))
$(DD Use alternative formatting:
$(DL
$(DT For $(B 'o'):)
$(DD Add to precision as necessary so that the first digit
of the octal formatting is a '0', even if both the argument
and the $(I Precision) are zero.)
$(DT For $(B 'x') ($(B 'X')):)
$(DD If non-zero, prefix result with $(B 0x) ($(B 0X)).)
$(DT For floating point formatting:)
$(DD Always insert the decimal point.)
$(DT For $(B 'g') ($(B 'G')):)
$(DD Do not elide trailing zeros.)
))
$(DT $(B '0'))
$(DD For integer and floating point formatting when not nan or
infinity, use leading zeros
to pad rather than spaces.
Ignore if there's a $(I Precision).)
$(DT $(B ' '))
$(DD Prefix positive numbers in a signed conversion with a space.)
)
$(DT $(I Width))
$(DD
Specifies the minimum field width.
If the width is a $(B *), the next argument, which must be
of type $(B int), is taken as the width.
If the width is negative, it is as if the $(B -) was given
as a $(I Flags) character.)
$(DT $(I Precision))
$(DD Gives the precision for numeric conversions.
If the precision is a $(B *), the next argument, which must be
of type $(B int), is taken as the precision. If it is negative,
it is as if there was no $(I Precision).)
$(DT $(I FormatChar))
$(DD
$(DL
$(DT $(B 's'))
$(DD The corresponding argument is formatted in a manner consistent
with its type:
$(DL
$(DT $(B bool))
$(DD The result is <tt>'true'</tt> or <tt>'false'</tt>.)
$(DT integral types)
$(DD The $(B %d) format is used.)
$(DT floating point types)
$(DD The $(B %g) format is used.)
$(DT string types)
$(DD The result is the string converted to UTF-8.)
A $(I Precision) specifies the maximum number of characters
to use in the result.
$(DT classes derived from $(B Object))
$(DD The result is the string returned from the class instance's
$(B .toString()) method.
A $(I Precision) specifies the maximum number of characters
to use in the result.)
$(DT non-string static and dynamic arrays)
$(DD The result is [s<sub>0</sub>, s<sub>1</sub>, ...]
where s<sub>k</sub> is the kth element
formatted with the default format.)
))
$(DT $(B 'b','d','o','x','X'))
$(DD The corresponding argument must be an integral type
and is formatted as an integer. If the argument is a signed type
and the $(I FormatChar) is $(B d) it is converted to
a signed string of characters, otherwise it is treated as
unsigned. An argument of type $(B bool) is formatted as '1'
or '0'. The base used is binary for $(B b), octal for $(B o),
decimal
for $(B d), and hexadecimal for $(B x) or $(B X).
$(B x) formats using lower case letters, $(B X) uppercase.
If there are fewer resulting digits than the $(I Precision),
leading zeros are used as necessary.
If the $(I Precision) is 0 and the number is 0, no digits
result.)
$(DT $(B 'e','E'))
$(DD A floating point number is formatted as one digit before
the decimal point, $(I Precision) digits after, the $(I FormatChar),
±, followed by at least a two digit exponent: $(I d.dddddd)e$(I ±dd).
If there is no $(I Precision), six
digits are generated after the decimal point.
If the $(I Precision) is 0, no decimal point is generated.)
$(DT $(B 'f','F'))
$(DD A floating point number is formatted in decimal notation.
The $(I Precision) specifies the number of digits generated
after the decimal point. It defaults to six. At least one digit
is generated before the decimal point. If the $(I Precision)
is zero, no decimal point is generated.)
$(DT $(B 'g','G'))
$(DD A floating point number is formatted in either $(B e) or
$(B f) format for $(B g); $(B E) or $(B F) format for
$(B G).
The $(B f) format is used if the exponent for an $(B e) format
is greater than -5 and less than the $(I Precision).
The $(I Precision) specifies the number of significant
digits, and defaults to six.
Trailing zeros are elided after the decimal point, if the fractional
part is zero then no decimal point is generated.)
$(DT $(B 'a','A'))
$(DD A floating point number is formatted in hexadecimal
exponential notation 0x$(I h.hhhhhh)p$(I ±d).
There is one hexadecimal digit before the decimal point, and as
many after as specified by the $(I Precision).
If the $(I Precision) is zero, no decimal point is generated.
If there is no $(I Precision), as many hexadecimal digits as
necessary to exactly represent the mantissa are generated.
The exponent is written in as few digits as possible,
but at least one, is in decimal, and represents a power of 2 as in
$(I h.hhhhhh)*2<sup>$(I ±d)</sup>.
The exponent for zero is zero.
The hexadecimal digits, x and p are in upper case if the
$(I FormatChar) is upper case.)
)
Floating point NaN's are formatted as $(B nan) if the
$(I FormatChar) is lower case, or $(B NAN) if upper.
Floating point infinities are formatted as $(B inf) or
$(B infinity) if the
$(I FormatChar) is lower case, or $(B INF) or $(B INFINITY) if upper.
))
Example:
-------------------------
import core.stdc.stdio;
import std.format;
void myPrint(...)
{
void putc(dchar c)
{
fputc(c, stdout);
}
std.format.doFormat(&putc, _arguments, _argptr);
}
void main()
{
int x = 27;
// prints 'The answer is 27:6'
myPrint("The answer is %s:", x, 6);
}
------------------------
*/
void doFormat()(scope void delegate(dchar) putc, TypeInfo[] arguments, va_list ap)
{
import std.utf : toUCSindex, isValidDchar, UTFException, toUTF8;
import core.stdc.string : strlen;
import core.stdc.stdlib : alloca, malloc, realloc, free;
import core.stdc.stdio : snprintf;
size_t bufLength = 1024;
void* argBuffer = malloc(bufLength);
scope(exit) free(argBuffer);
size_t bufUsed = 0;
foreach (ti; arguments)
{
// Ensure the required alignment
bufUsed += ti.talign - 1;
bufUsed -= (cast(size_t)argBuffer + bufUsed) & (ti.talign - 1);
auto pos = bufUsed;
// Align to next word boundary
bufUsed += ti.tsize + size_t.sizeof - 1;
bufUsed -= (cast(size_t)argBuffer + bufUsed) & (size_t.sizeof - 1);
// Resize buffer if necessary
while (bufUsed > bufLength)
{
bufLength *= 2;
argBuffer = realloc(argBuffer, bufLength);
}
// Copy argument into buffer
va_arg(ap, ti, argBuffer + pos);
}
auto argptr = argBuffer;
void* skipArg(TypeInfo ti)
{
// Ensure the required alignment
argptr += ti.talign - 1;
argptr -= cast(size_t)argptr & (ti.talign - 1);
auto p = argptr;
// Align to next word boundary
argptr += ti.tsize + size_t.sizeof - 1;
argptr -= cast(size_t)argptr & (size_t.sizeof - 1);
return p;
}
auto getArg(T)()
{
return *cast(T*)skipArg(typeid(T));
}
TypeInfo ti;
Mangle m;
uint flags;
int field_width;
int precision;
enum : uint
{
FLdash = 1,
FLplus = 2,
FLspace = 4,
FLhash = 8,
FLlngdbl = 0x20,
FL0pad = 0x40,
FLprecision = 0x80,
}
static TypeInfo skipCI(TypeInfo valti)
{
for (;;)
{
if (typeid(valti).name.length == 18 &&
typeid(valti).name[9..18] == "Invariant")
valti = (cast(TypeInfo_Invariant)valti).base;
else if (typeid(valti).name.length == 14 &&
typeid(valti).name[9..14] == "Const")
valti = (cast(TypeInfo_Const)valti).base;
else
break;
}
return valti;
}
void formatArg(char fc)
{
bool vbit;
ulong vnumber;
char vchar;
dchar vdchar;
Object vobject;
real vreal;
creal vcreal;
Mangle m2;
int signed = 0;
uint base = 10;
int uc;
char[ulong.sizeof * 8] tmpbuf; // long enough to print long in binary
const(char)* prefix = "";
string s;
void putstr(const char[] s)
{
//printf("putstr: s = %.*s, flags = x%x\n", s.length, s.ptr, flags);
ptrdiff_t padding = field_width -
(strlen(prefix) + toUCSindex(s, s.length));
ptrdiff_t prepad = 0;
ptrdiff_t postpad = 0;
if (padding > 0)
{
if (flags & FLdash)
postpad = padding;
else
prepad = padding;
}
if (flags & FL0pad)
{
while (*prefix)
putc(*prefix++);
while (prepad--)
putc('0');
}
else
{
while (prepad--)
putc(' ');
while (*prefix)
putc(*prefix++);
}
foreach (dchar c; s)
putc(c);
while (postpad--)
putc(' ');
}
void putreal(real v)
{
//printf("putreal %Lg\n", vreal);
switch (fc)
{
case 's':
fc = 'g';
break;
case 'f', 'F', 'e', 'E', 'g', 'G', 'a', 'A':
break;
default:
//printf("fc = '%c'\n", fc);
Lerror:
throw new FormatException("incompatible format character for floating point type");
}
version (DigitalMarsC)
{
uint sl;
char[] fbuf = tmpbuf;
if (!(flags & FLprecision))
precision = 6;
while (1)
{
sl = fbuf.length;
prefix = (*__pfloatfmt)(fc, flags | FLlngdbl,
precision, &v, cast(char*)fbuf, &sl, field_width);
if (sl != -1)
break;
sl = fbuf.length * 2;
fbuf = (cast(char*)alloca(sl * char.sizeof))[0 .. sl];
}
putstr(fbuf[0 .. sl]);
}
else
{
ptrdiff_t sl;
char[] fbuf = tmpbuf;
char[12] format;
format[0] = '%';
int i = 1;
if (flags & FLdash)
format[i++] = '-';
if (flags & FLplus)
format[i++] = '+';
if (flags & FLspace)
format[i++] = ' ';
if (flags & FLhash)
format[i++] = '#';
if (flags & FL0pad)
format[i++] = '0';
format[i + 0] = '*';
format[i + 1] = '.';
format[i + 2] = '*';
format[i + 3] = 'L';
format[i + 4] = fc;
format[i + 5] = 0;
if (!(flags & FLprecision))
precision = -1;
while (1)
{
sl = fbuf.length;
int n;
version (CRuntime_Microsoft)
{
import std.math : isNaN, isInfinity;
if (isNaN(v)) // snprintf writes 1.#QNAN
n = snprintf(fbuf.ptr, sl, "nan");
else if (isInfinity(v)) // snprintf writes 1.#INF
n = snprintf(fbuf.ptr, sl, v < 0 ? "-inf" : "inf");
else
n = snprintf(fbuf.ptr, sl, format.ptr, field_width,
precision, cast(double)v);
}
else
n = snprintf(fbuf.ptr, sl, format.ptr, field_width,
precision, v);
//printf("format = '%s', n = %d\n", cast(char*)format, n);
if (n >= 0 && n < sl)
{ sl = n;
break;
}
if (n < 0)
sl = sl * 2;
else
sl = n + 1;
fbuf = (cast(char*)alloca(sl * char.sizeof))[0 .. sl];
}
putstr(fbuf[0 .. sl]);
}
return;
}
static Mangle getMan(TypeInfo ti)
{
auto m = cast(Mangle)typeid(ti).name[9];
if (typeid(ti).name.length == 20 &&
typeid(ti).name[9..20] == "StaticArray")
m = cast(Mangle)'G';
return m;
}
/* p = pointer to the first element in the array
* len = number of elements in the array
* valti = type of the elements
*/
void putArray(void* p, size_t len, TypeInfo valti)
{
//printf("\nputArray(len = %u), tsize = %u\n", len, valti.tsize);
putc('[');
valti = skipCI(valti);
size_t tsize = valti.tsize;
auto argptrSave = argptr;
auto tiSave = ti;
auto mSave = m;
ti = valti;
//printf("\n%.*s\n", typeid(valti).name.length, typeid(valti).name.ptr);
m = getMan(valti);
while (len--)
{
//doFormat(putc, (&valti)[0 .. 1], p);
argptr = p;
formatArg('s');
p += tsize;
if (len > 0) putc(',');
}
m = mSave;
ti = tiSave;
argptr = argptrSave;
putc(']');
}
void putAArray(ubyte[long] vaa, TypeInfo valti, TypeInfo keyti)
{
putc('[');
bool comma=false;
auto argptrSave = argptr;
auto tiSave = ti;
auto mSave = m;
valti = skipCI(valti);
keyti = skipCI(keyti);
foreach (ref fakevalue; vaa)
{
if (comma) putc(',');
comma = true;
void *pkey = &fakevalue;
version (D_LP64)
pkey -= (long.sizeof + 15) & ~(15);
else
pkey -= (long.sizeof + size_t.sizeof - 1) & ~(size_t.sizeof - 1);
// the key comes before the value
auto keysize = keyti.tsize;
version (D_LP64)
auto keysizet = (keysize + 15) & ~(15);
else
auto keysizet = (keysize + size_t.sizeof - 1) & ~(size_t.sizeof - 1);
void* pvalue = pkey + keysizet;
//doFormat(putc, (&keyti)[0..1], pkey);
m = getMan(keyti);
argptr = pkey;
ti = keyti;
formatArg('s');
putc(':');
//doFormat(putc, (&valti)[0..1], pvalue);
m = getMan(valti);
argptr = pvalue;
ti = valti;
formatArg('s');
}
m = mSave;
ti = tiSave;
argptr = argptrSave;
putc(']');
}
//printf("formatArg(fc = '%c', m = '%c')\n", fc, m);
int mi;
switch (m)
{
case Mangle.Tbool:
vbit = getArg!(bool)();
if (fc != 's')
{ vnumber = vbit;
goto Lnumber;
}
putstr(vbit ? "true" : "false");
return;
case Mangle.Tchar:
vchar = getArg!(char)();
if (fc != 's')
{ vnumber = vchar;
goto Lnumber;
}
L2:
putstr((&vchar)[0 .. 1]);
return;
case Mangle.Twchar:
vdchar = getArg!(wchar)();
goto L1;
case Mangle.Tdchar:
vdchar = getArg!(dchar)();
L1:
if (fc != 's')
{ vnumber = vdchar;
goto Lnumber;
}
if (vdchar <= 0x7F)
{ vchar = cast(char)vdchar;
goto L2;
}
else
{ if (!isValidDchar(vdchar))
throw new UTFException("invalid dchar in format");
char[4] vbuf;
putstr(toUTF8(vbuf, vdchar));
}
return;
case Mangle.Tbyte:
signed = 1;
vnumber = getArg!(byte)();
goto Lnumber;
case Mangle.Tubyte:
vnumber = getArg!(ubyte)();
goto Lnumber;
case Mangle.Tshort:
signed = 1;
vnumber = getArg!(short)();
goto Lnumber;
case Mangle.Tushort:
vnumber = getArg!(ushort)();
goto Lnumber;
case Mangle.Tint:
signed = 1;
vnumber = getArg!(int)();
goto Lnumber;
case Mangle.Tuint:
Luint:
vnumber = getArg!(uint)();
goto Lnumber;
case Mangle.Tlong:
signed = 1;
vnumber = cast(ulong)getArg!(long)();
goto Lnumber;
case Mangle.Tulong:
Lulong:
vnumber = getArg!(ulong)();
goto Lnumber;
case Mangle.Tclass:
vobject = getArg!(Object)();
if (vobject is null)
s = "null";
else
s = vobject.toString();
goto Lputstr;
case Mangle.Tpointer:
vnumber = cast(ulong)getArg!(void*)();
if (fc != 'x') uc = 1;
flags |= FL0pad;
if (!(flags & FLprecision))
{ flags |= FLprecision;
precision = (void*).sizeof;
}
base = 16;
goto Lnumber;
case Mangle.Tfloat:
case Mangle.Tifloat:
if (fc == 'x' || fc == 'X')
goto Luint;
vreal = getArg!(float)();
goto Lreal;
case Mangle.Tdouble:
case Mangle.Tidouble:
if (fc == 'x' || fc == 'X')
goto Lulong;
vreal = getArg!(double)();
goto Lreal;
case Mangle.Treal:
case Mangle.Tireal:
vreal = getArg!(real)();
goto Lreal;
case Mangle.Tcfloat:
vcreal = getArg!(cfloat)();
goto Lcomplex;
case Mangle.Tcdouble:
vcreal = getArg!(cdouble)();
goto Lcomplex;
case Mangle.Tcreal:
vcreal = getArg!(creal)();
goto Lcomplex;
case Mangle.Tsarray:
putArray(argptr, (cast(TypeInfo_StaticArray)ti).len, (cast(TypeInfo_StaticArray)ti).next);
return;
case Mangle.Tarray:
mi = 10;
if (typeid(ti).name.length == 14 &&
typeid(ti).name[9..14] == "Array")
{ // array of non-primitive types
TypeInfo tn = (cast(TypeInfo_Array)ti).next;
tn = skipCI(tn);
switch (cast(Mangle)typeid(tn).name[9])
{
case Mangle.Tchar: goto LarrayChar;
case Mangle.Twchar: goto LarrayWchar;
case Mangle.Tdchar: goto LarrayDchar;
default:
break;
}
void[] va = getArg!(void[])();
putArray(va.ptr, va.length, tn);
return;
}
if (typeid(ti).name.length == 25 &&
typeid(ti).name[9..25] == "AssociativeArray")
{ // associative array
ubyte[long] vaa = getArg!(ubyte[long])();
putAArray(vaa,
(cast(TypeInfo_AssociativeArray)ti).next,
(cast(TypeInfo_AssociativeArray)ti).key);
return;
}
while (1)
{
m2 = cast(Mangle)typeid(ti).name[mi];
switch (m2)
{
case Mangle.Tchar:
LarrayChar:
s = getArg!(string)();
goto Lputstr;
case Mangle.Twchar:
LarrayWchar:
wchar[] sw = getArg!(wchar[])();
s = toUTF8(sw);
goto Lputstr;
case Mangle.Tdchar:
LarrayDchar:
s = toUTF8(getArg!(dstring)());
Lputstr:
if (fc != 's')
throw new FormatException("string");
if (flags & FLprecision && precision < s.length)
s = s[0 .. precision];
putstr(s);
break;
case Mangle.Tconst:
case Mangle.Timmutable:
mi++;
continue;
default:
TypeInfo ti2 = primitiveTypeInfo(m2);
if (!ti2)
goto Lerror;
void[] va = getArg!(void[])();
putArray(va.ptr, va.length, ti2);
}
return;
}
assert(0);
case Mangle.Ttypedef:
ti = (cast(TypeInfo_Typedef)ti).base;
m = cast(Mangle)typeid(ti).name[9];
formatArg(fc);
return;
case Mangle.Tenum:
ti = (cast(TypeInfo_Enum)ti).base;
m = cast(Mangle)typeid(ti).name[9];
formatArg(fc);
return;
case Mangle.Tstruct:
{ TypeInfo_Struct tis = cast(TypeInfo_Struct)ti;
if (tis.xtoString is null)
throw new FormatException("Can't convert " ~ tis.toString()
~ " to string: \"string toString()\" not defined");
s = tis.xtoString(skipArg(tis));
goto Lputstr;
}
default:
goto Lerror;
}
Lnumber:
switch (fc)
{
case 's':
case 'd':
if (signed)
{ if (cast(long)vnumber < 0)
{ prefix = "-";
vnumber = -vnumber;
}
else if (flags & FLplus)
prefix = "+";
else if (flags & FLspace)
prefix = " ";
}
break;
case 'b':
signed = 0;
base = 2;
break;
case 'o':
signed = 0;
base = 8;
break;
case 'X':
uc = 1;
if (flags & FLhash && vnumber)
prefix = "0X";
signed = 0;
base = 16;
break;
case 'x':
if (flags & FLhash && vnumber)
prefix = "0x";
signed = 0;
base = 16;
break;
default:
goto Lerror;
}
if (!signed)
{
switch (m)
{
case Mangle.Tbyte:
vnumber &= 0xFF;
break;
case Mangle.Tshort:
vnumber &= 0xFFFF;
break;
case Mangle.Tint:
vnumber &= 0xFFFFFFFF;
break;
default:
break;
}
}
if (flags & FLprecision && fc != 'p')
flags &= ~FL0pad;
if (vnumber < base)
{
if (vnumber == 0 && precision == 0 && flags & FLprecision &&
!(fc == 'o' && flags & FLhash))
{
putstr(null);
return;
}
if (precision == 0 || !(flags & FLprecision))
{ vchar = cast(char)('0' + vnumber);
if (vnumber < 10)
vchar = cast(char)('0' + vnumber);
else
vchar = cast(char)((uc ? 'A' - 10 : 'a' - 10) + vnumber);
goto L2;
}
}
{
ptrdiff_t n = tmpbuf.length;
char c;
int hexoffset = uc ? ('A' - ('9' + 1)) : ('a' - ('9' + 1));
while (vnumber)
{
c = cast(char)((vnumber % base) + '0');
if (c > '9')
c += hexoffset;
vnumber /= base;
tmpbuf[--n] = c;
}
if (tmpbuf.length - n < precision && precision < tmpbuf.length)
{
ptrdiff_t m = tmpbuf.length - precision;
tmpbuf[m .. n] = '0';
n = m;
}
else if (flags & FLhash && fc == 'o')
prefix = "0";
putstr(tmpbuf[n .. tmpbuf.length]);
return;
}
Lreal:
putreal(vreal);
return;
Lcomplex:
putreal(vcreal.re);
if (vcreal.im >= 0)
{
putc('+');
}
putreal(vcreal.im);
putc('i');
return;
Lerror:
throw new FormatException("formatArg");
}
for (int j = 0; j < arguments.length; )
{
ti = arguments[j++];
//printf("arg[%d]: '%.*s' %d\n", j, typeid(ti).name.length, typeid(ti).name.ptr, typeid(ti).name.length);
//ti.print();
flags = 0;
precision = 0;
field_width = 0;
ti = skipCI(ti);
int mi = 9;
do
{
if (typeid(ti).name.length <= mi)
goto Lerror;
m = cast(Mangle)typeid(ti).name[mi++];
} while (m == Mangle.Tconst || m == Mangle.Timmutable);
if (m == Mangle.Tarray)
{
if (typeid(ti).name.length == 14 &&
typeid(ti).name[9..14] == "Array")
{
TypeInfo tn = (cast(TypeInfo_Array)ti).next;
tn = skipCI(tn);
switch (cast(Mangle)typeid(tn).name[9])
{
case Mangle.Tchar:
case Mangle.Twchar:
case Mangle.Tdchar:
ti = tn;
mi = 9;
break;
default:
break;
}
}
L1:
Mangle m2 = cast(Mangle)typeid(ti).name[mi];
string fmt; // format string
wstring wfmt;
dstring dfmt;
/* For performance reasons, this code takes advantage of the
* fact that most format strings will be ASCII, and that the
* format specifiers are always ASCII. This means we only need
* to deal with UTF in a couple of isolated spots.
*/
switch (m2)
{
case Mangle.Tchar:
fmt = getArg!(string)();
break;
case Mangle.Twchar:
wfmt = getArg!(wstring)();
fmt = toUTF8(wfmt);
break;
case Mangle.Tdchar:
dfmt = getArg!(dstring)();
fmt = toUTF8(dfmt);
break;
case Mangle.Tconst:
case Mangle.Timmutable:
mi++;
goto L1;
default:
formatArg('s');
continue;
}
for (size_t i = 0; i < fmt.length; )
{ dchar c = fmt[i++];
dchar getFmtChar()
{ // Valid format specifier characters will never be UTF
if (i == fmt.length)
throw new FormatException("invalid specifier");
return fmt[i++];
}
int getFmtInt()
{ int n;
while (1)
{
n = n * 10 + (c - '0');
if (n < 0) // overflow
throw new FormatException("int overflow");
c = getFmtChar();
if (c < '0' || c > '9')
break;
}
return n;
}
int getFmtStar()
{ Mangle m;
TypeInfo ti;
if (j == arguments.length)
throw new FormatException("too few arguments");
ti = arguments[j++];
m = cast(Mangle)typeid(ti).name[9];
if (m != Mangle.Tint)
throw new FormatException("int argument expected");
return getArg!(int)();
}
if (c != '%')
{
if (c > 0x7F) // if UTF sequence
{
i--; // back up and decode UTF sequence
import std.utf : decode;
c = decode(fmt, i);
}
Lputc:
putc(c);
continue;
}
// Get flags {-+ #}
flags = 0;
while (1)
{
c = getFmtChar();
switch (c)
{
case '-': flags |= FLdash; continue;
case '+': flags |= FLplus; continue;
case ' ': flags |= FLspace; continue;
case '#': flags |= FLhash; continue;
case '0': flags |= FL0pad; continue;
case '%': if (flags == 0)
goto Lputc;
break;
default: break;
}
break;
}
// Get field width
field_width = 0;
if (c == '*')
{
field_width = getFmtStar();
if (field_width < 0)
{ flags |= FLdash;
field_width = -field_width;
}
c = getFmtChar();
}
else if (c >= '0' && c <= '9')
field_width = getFmtInt();
if (flags & FLplus)
flags &= ~FLspace;
if (flags & FLdash)
flags &= ~FL0pad;
// Get precision
precision = 0;
if (c == '.')
{ flags |= FLprecision;
//flags &= ~FL0pad;
c = getFmtChar();
if (c == '*')
{
precision = getFmtStar();
if (precision < 0)
{ precision = 0;
flags &= ~FLprecision;
}
c = getFmtChar();
}
else if (c >= '0' && c <= '9')
precision = getFmtInt();
}
if (j == arguments.length)
goto Lerror;
ti = arguments[j++];
ti = skipCI(ti);
mi = 9;
do
{
m = cast(Mangle)typeid(ti).name[mi++];
} while (m == Mangle.Tconst || m == Mangle.Timmutable);
if (c > 0x7F) // if UTF sequence
goto Lerror; // format specifiers can't be UTF
formatArg(cast(char)c);
}
}
else
{
formatArg('s');
}
}
return;
Lerror:
throw new FormatException();
}
private bool needToSwapEndianess(Char)(ref FormatSpec!Char f)
{
import std.system : endian, Endian;
return endian == Endian.littleEndian && f.flPlus
|| endian == Endian.bigEndian && f.flDash;
}
/* ======================== Unit Tests ====================================== */
unittest
{
import std.conv : octal;
int i;
string s;
debug(format) printf("std.format.format.unittest\n");
s = format("hello world! %s %s %s%s%s", true, 57, 1_000_000_000, 'x', " foo");
assert(s == "hello world! true 57 1000000000x foo");
s = format("%s %A %s", 1.67, -1.28, float.nan);
/* The host C library is used to format floats.
* C99 doesn't specify what the hex digit before the decimal point
* is for %A.
*/
//version (linux)
// assert(s == "1.67 -0XA.3D70A3D70A3D8P-3 nan");
//else version (OSX)
// assert(s == "1.67 -0XA.3D70A3D70A3D8P-3 nan", s);
//else
version (MinGW)
assert(s == "1.67 -0XA.3D70A3D70A3D8P-3 nan", s);
else version (CRuntime_Microsoft)
assert(s == "1.67 -0X1.47AE14P+0 nan"
|| s == "1.67 -0X1.47AE147AE147BP+0 nan", s); // MSVCRT 14+ (VS 2015)
else
assert(s == "1.67 -0X1.47AE147AE147BP+0 nan", s);
s = format("%x %X", 0x1234AF, 0xAFAFAFAF);
assert(s == "1234af AFAFAFAF");
s = format("%b %o", 0x1234AF, 0xAFAFAFAF);
assert(s == "100100011010010101111 25753727657");
s = format("%d %s", 0x1234AF, 0xAFAFAFAF);
assert(s == "1193135 2947526575");
//version(X86_64)
//{
// pragma(msg, "several format tests disabled on x86_64 due to bug 5625");
//}
//else
//{
s = format("%s", 1.2 + 3.4i);
assert(s == "1.2+3.4i", s);
//s = format("%x %X", 1.32, 6.78f);
//assert(s == "3ff51eb851eb851f 40D8F5C3");
//}
s = format("%#06.*f",2,12.345);
assert(s == "012.35");
s = format("%#0*.*f",6,2,12.345);
assert(s == "012.35");
s = format("%7.4g:", 12.678);
assert(s == " 12.68:");
s = format("%7.4g:", 12.678L);
assert(s == " 12.68:");
s = format("%04f|%05d|%#05x|%#5x",-4.0,-10,1,1);
assert(s == "-4.000000|-0010|0x001| 0x1");
i = -10;
s = format("%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i);
assert(s == "-10|-10|-10|-10|-10.0000");
i = -5;
s = format("%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i);
assert(s == "-5| -5|-05|-5|-5.0000");
i = 0;
s = format("%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i);
assert(s == "0| 0|000|0|0.0000");
i = 5;
s = format("%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i);
assert(s == "5| 5|005|5|5.0000");
i = 10;
s = format("%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i);
assert(s == "10| 10|010|10|10.0000");
s = format("%.0d", 0);
assert(s == "");
s = format("%.g", .34);
assert(s == "0.3");
s = format("%.0g", .34);
assert(s == "0.3");
s = format("%.2g", .34);
assert(s == "0.34");
s = format("%0.0008f", 1e-08);
assert(s == "0.00000001");
s = format("%0.0008f", 1e-05);
assert(s == "0.00001000");
s = "helloworld";
string r;
r = format("%.2s", s[0..5]);
assert(r == "he");
r = format("%.20s", s[0..5]);
assert(r == "hello");
r = format("%8s", s[0..5]);
assert(r == " hello");
byte[] arrbyte = new byte[4];
arrbyte[0] = 100;
arrbyte[1] = -99;
arrbyte[3] = 0;
r = format("%s", arrbyte);
assert(r == "[100, -99, 0, 0]");
ubyte[] arrubyte = new ubyte[4];
arrubyte[0] = 100;
arrubyte[1] = 200;
arrubyte[3] = 0;
r = format("%s", arrubyte);
assert(r == "[100, 200, 0, 0]");
short[] arrshort = new short[4];
arrshort[0] = 100;
arrshort[1] = -999;
arrshort[3] = 0;
r = format("%s", arrshort);
assert(r == "[100, -999, 0, 0]");
ushort[] arrushort = new ushort[4];
arrushort[0] = 100;
arrushort[1] = 20_000;
arrushort[3] = 0;
r = format("%s", arrushort);
assert(r == "[100, 20000, 0, 0]");
int[] arrint = new int[4];
arrint[0] = 100;
arrint[1] = -999;
arrint[3] = 0;
r = format("%s", arrint);
assert(r == "[100, -999, 0, 0]");
long[] arrlong = new long[4];
arrlong[0] = 100;
arrlong[1] = -999;
arrlong[3] = 0;
r = format("%s", arrlong);
assert(r == "[100, -999, 0, 0]");
ulong[] arrulong = new ulong[4];
arrulong[0] = 100;
arrulong[1] = 999;
arrulong[3] = 0;
r = format("%s", arrulong);
assert(r == "[100, 999, 0, 0]");
string[] arr2 = new string[4];
arr2[0] = "hello";
arr2[1] = "world";
arr2[3] = "foo";
r = format("%s", arr2);
assert(r == `["hello", "world", "", "foo"]`);
r = format("%.8d", 7);
assert(r == "00000007");
r = format("%.8x", 10);
assert(r == "0000000a");
r = format("%-3d", 7);
assert(r == "7 ");
r = format("%*d", -3, 7);
assert(r == "7 ");
r = format("%.*d", -3, 7);
assert(r == "7");
r = format("abc"c);
assert(r == "abc");
//format() returns the same type as inputted.
wstring wr;
wr = format("def"w);
assert(wr == "def"w);
dstring dr;
dr = format("ghi"d);
assert(dr == "ghi"d);
void* p = cast(void*)0xDEADBEEF;
r = format("%s", p);
assert(r == "DEADBEEF");
r = format("%#x", 0xabcd);
assert(r == "0xabcd");
r = format("%#X", 0xABCD);
assert(r == "0XABCD");
r = format("%#o", octal!12345);
assert(r == "012345");
r = format("%o", 9);
assert(r == "11");
r = format("%#o", 0); // issue 15663
assert(r == "0");
r = format("%+d", 123);
assert(r == "+123");
r = format("%+d", -123);
assert(r == "-123");
r = format("% d", 123);
assert(r == " 123");
r = format("% d", -123);
assert(r == "-123");
r = format("%%");
assert(r == "%");
r = format("%d", true);
assert(r == "1");
r = format("%d", false);
assert(r == "0");
r = format("%d", 'a');
assert(r == "97");
wchar wc = 'a';
r = format("%d", wc);
assert(r == "97");
dchar dc = 'a';
r = format("%d", dc);
assert(r == "97");
byte b = byte.max;
r = format("%x", b);
assert(r == "7f");
r = format("%x", ++b);
assert(r == "80");
r = format("%x", ++b);
assert(r == "81");
short sh = short.max;
r = format("%x", sh);
assert(r == "7fff");
r = format("%x", ++sh);
assert(r == "8000");
r = format("%x", ++sh);
assert(r == "8001");
i = int.max;
r = format("%x", i);
assert(r == "7fffffff");
r = format("%x", ++i);
assert(r == "80000000");
r = format("%x", ++i);
assert(r == "80000001");
r = format("%x", 10);
assert(r == "a");
r = format("%X", 10);
assert(r == "A");
r = format("%x", 15);
assert(r == "f");
r = format("%X", 15);
assert(r == "F");
Object c = null;
r = format("%s", c);
assert(r == "null");
enum TestEnum
{
Value1, Value2
}
r = format("%s", TestEnum.Value2);
assert(r == "Value2");
immutable(char[5])[int] aa = ([3:"hello", 4:"betty"]);
r = format("%s", aa.values);
assert(r == `["hello", "betty"]` || r == `["betty", "hello"]`);
r = format("%s", aa);
assert(r == `[3:"hello", 4:"betty"]` || r == `[4:"betty", 3:"hello"]`);
static const dchar[] ds = ['a','b'];
for (int j = 0; j < ds.length; ++j)
{
r = format(" %d", ds[j]);
if (j == 0)
assert(r == " 97");
else
assert(r == " 98");
}
r = format(">%14d<, %s", 15, [1,2,3]);
assert(r == "> 15<, [1, 2, 3]");
assert(format("%8s", "bar") == " bar");
assert(format("%8s", "b\u00e9ll\u00f4") == " b\u00e9ll\u00f4");
}
|
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="_jBRXoF0kEem7yKe9qSXl1Q-Statemachine.notation#_p-2HI127Eem9TInVy14vbA"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="_jBRXoF0kEem7yKe9qSXl1Q-Statemachine.notation#_p-2HI127Eem9TInVy14vbA"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
|
D
|
/**
* Contains druntime startup and shutdown routines.
*
* Copyright: Copyright Digital Mars 2000 - 2018.
* License: Distributed under the
* $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
* (See accompanying file LICENSE)
* Authors: Walter Bright, Sean Kelly
* Source: $(DRUNTIMESRC rt/_dmain2.d)
*/
/* NOTE: This file has been patched from the original DMD distribution to
* work with the GDC compiler.
*/
module rt.dmain2;
import rt.memory;
import rt.sections;
import core.atomic;
import core.stdc.stddef;
import core.stdc.stdlib;
import core.stdc.string;
import core.stdc.stdio; // for printf()
import core.stdc.errno : errno;
version (Windows)
{
import core.stdc.wchar_;
import core.sys.windows.basetsd : HANDLE;
import core.sys.windows.shellapi : CommandLineToArgvW;
import core.sys.windows.winbase : FreeLibrary, GetCommandLineW, GetProcAddress,
IsDebuggerPresent, LoadLibraryW, LocalFree, WriteFile;
import core.sys.windows.wincon : CONSOLE_SCREEN_BUFFER_INFO, GetConsoleOutputCP,
GetConsoleScreenBufferInfo;
import core.sys.windows.winnls : CP_UTF8, MultiByteToWideChar, WideCharToMultiByte;
import core.sys.windows.winnt : WCHAR;
import core.sys.windows.winuser : MB_ICONERROR, MessageBoxW;
pragma(lib, "shell32.lib"); // needed for CommandLineToArgvW
}
version (FreeBSD)
{
import core.stdc.fenv;
}
version (NetBSD)
{
import core.stdc.fenv;
}
version (DragonFlyBSD)
{
import core.stdc.fenv;
}
// not sure why we can't define this in one place, but this is to keep this
// module from importing core.runtime.
struct UnitTestResult
{
size_t executed;
size_t passed;
bool runMain;
bool summarize;
}
extern (C) void _d_monitor_staticctor();
extern (C) void _d_monitor_staticdtor();
extern (C) void _d_critical_init();
extern (C) void _d_critical_term();
extern (C) void gc_init();
extern (C) void gc_term();
extern (C) void thread_init() @nogc;
extern (C) void thread_term() @nogc;
extern (C) void lifetime_init();
extern (C) void rt_moduleCtor();
extern (C) void rt_moduleTlsCtor();
extern (C) void rt_moduleDtor();
extern (C) void rt_moduleTlsDtor();
extern (C) void thread_joinAll();
extern (C) UnitTestResult runModuleUnitTests();
extern (C) void _d_initMonoTime();
version (CRuntime_Microsoft)
{
extern(C) void init_msvc();
}
/* To get out-of-band access to the args[] passed to main().
*/
__gshared string[] _d_args = null;
extern (C) string[] rt_args()
{
return _d_args;
}
// This variable is only ever set by a debugger on initialization so it should
// be fine to leave it as __gshared.
extern (C) __gshared bool rt_trapExceptions = true;
alias void delegate(Throwable) ExceptionHandler;
/**
* Keep track of how often rt_init/rt_term were called.
*/
shared size_t _initCount;
/**********************************************
* Initialize druntime.
* If a C program wishes to call D code, and there's no D main(), then it
* must call rt_init() and rt_term().
*/
extern (C) int rt_init()
{
/* @@BUG 11380 @@ Need to synchronize rt_init/rt_term calls for
version (Shared) druntime, because multiple C threads might
initialize different D libraries without knowing about the
shared druntime. Also we need to attach any thread that calls
rt_init. */
if (atomicOp!"+="(_initCount, 1) > 1) return 1;
version (CRuntime_Microsoft)
init_msvc();
_d_monitor_staticctor();
_d_critical_init();
try
{
initSections();
// this initializes mono time before anything else to allow usage
// in other druntime systems.
_d_initMonoTime();
thread_init();
// TODO: fixme - calls GC.addRange -> Initializes GC
initStaticDataGC();
lifetime_init();
rt_moduleCtor();
rt_moduleTlsCtor();
return 1;
}
catch (Throwable t)
{
atomicStore!(MemoryOrder.raw)(_initCount, 0);
_d_print_throwable(t);
}
_d_critical_term();
_d_monitor_staticdtor();
return 0;
}
/**********************************************
* Terminate use of druntime.
*/
extern (C) int rt_term()
{
if (atomicLoad!(MemoryOrder.raw)(_initCount) == 0) return 0; // was never initialized
if (atomicOp!"-="(_initCount, 1)) return 1;
try
{
rt_moduleTlsDtor();
thread_joinAll();
rt_moduleDtor();
gc_term();
thread_term();
return 1;
}
catch (Throwable t)
{
_d_print_throwable(t);
}
finally
{
finiSections();
_d_critical_term();
_d_monitor_staticdtor();
}
return 0;
}
/**********************************************
* Trace handler
*/
alias Throwable.TraceInfo function(void* ptr) TraceHandler;
private __gshared TraceHandler traceHandler = null;
/**
* Overrides the default trace hander with a user-supplied version.
*
* Params:
* h = The new trace handler. Set to null to use the default handler.
*/
extern (C) void rt_setTraceHandler(TraceHandler h)
{
traceHandler = h;
}
/**
* Return the current trace handler
*/
extern (C) TraceHandler rt_getTraceHandler()
{
return traceHandler;
}
/**
* This function will be called when an exception is constructed. The
* user-supplied trace handler will be called if one has been supplied,
* otherwise no trace will be generated.
*
* Params:
* ptr = A pointer to the location from which to generate the trace, or null
* if the trace should be generated from within the trace handler
* itself.
*
* Returns:
* An object describing the current calling context or null if no handler is
* supplied.
*/
extern (C) Throwable.TraceInfo _d_traceContext(void* ptr = null)
{
if (traceHandler is null)
return null;
return traceHandler(ptr);
}
/***********************************
* Provide out-of-band access to the original C argc/argv
* passed to this program via main(argc,argv).
*/
struct CArgs
{
int argc;
char** argv;
}
__gshared CArgs _cArgs;
extern (C) CArgs rt_cArgs() @nogc
{
return _cArgs;
}
/// Type of the D main() function (`_Dmain`).
private alias extern(C) int function(char[][] args) MainFunc;
/**
* Sets up the D char[][] command-line args, initializes druntime,
* runs embedded unittests and then runs the given D main() function,
* optionally catching and printing any unhandled exceptions.
*/
extern (C) int _d_run_main(int argc, char** argv, MainFunc mainFunc)
{
// Set up _cArgs and array of D char[] slices, then forward to _d_run_main2
// Remember the original C argc/argv
_cArgs.argc = argc;
_cArgs.argv = argv;
version (Windows)
{
/* Because we want args[] to be UTF-8, and Windows doesn't guarantee that,
* we ignore argc/argv and go get the Windows command line again as UTF-16.
* Then, reparse into wargc/wargs, and then use Windows API to convert
* to UTF-8.
*/
const wCommandLine = GetCommandLineW();
immutable size_t wCommandLineLength = wcslen(wCommandLine);
int wargc;
auto wargs = CommandLineToArgvW(wCommandLine, &wargc);
// assert(wargc == argc); /* argc can be broken by Unicode arguments */
// Allocate args[] on the stack - use wargc
char[][] args = (cast(char[]*) alloca(wargc * (char[]).sizeof))[0 .. wargc];
// This is required because WideCharToMultiByte requires int as input.
assert(wCommandLineLength <= cast(size_t) int.max, "Wide char command line length must not exceed int.max");
immutable size_t totalArgsLength = WideCharToMultiByte(CP_UTF8, 0, wCommandLine, cast(int)wCommandLineLength, null, 0, null, null);
{
char* totalArgsBuff = cast(char*) alloca(totalArgsLength);
size_t j = 0;
foreach (i; 0 .. wargc)
{
immutable size_t wlen = wcslen(wargs[i]);
assert(wlen <= cast(size_t) int.max, "wlen cannot exceed int.max");
immutable int len = WideCharToMultiByte(CP_UTF8, 0, &wargs[i][0], cast(int) wlen, null, 0, null, null);
args[i] = totalArgsBuff[j .. j + len];
if (len == 0)
continue;
j += len;
assert(j <= totalArgsLength);
WideCharToMultiByte(CP_UTF8, 0, &wargs[i][0], cast(int) wlen, &args[i][0], len, null, null);
}
}
LocalFree(wargs);
wargs = null;
wargc = 0;
}
else version (Posix)
{
// Allocate args[] on the stack
char[][] args = (cast(char[]*) alloca(argc * (char[]).sizeof))[0 .. argc];
size_t totalArgsLength = 0;
foreach (i, ref arg; args)
{
arg = argv[i][0 .. strlen(argv[i])];
totalArgsLength += arg.length;
}
}
else
static assert(0);
return _d_run_main2(args, totalArgsLength, mainFunc);
}
/**
* Windows-specific version for wide command-line arguments, e.g.,
* from a wmain/wWinMain C entry point.
* This wide version uses the specified arguments, unlike narrow
* _d_run_main which uses the actual (wide) process arguments instead.
*/
version (Windows)
extern (C) int _d_wrun_main(int argc, wchar** wargv, MainFunc mainFunc)
{
// Allocate args[] on the stack
char[][] args = (cast(char[]*) alloca(argc * (char[]).sizeof))[0 .. argc];
// 1st pass: compute each argument's length as UTF-16 and UTF-8
size_t totalArgsLength = 0;
foreach (i; 0 .. argc)
{
const warg = wargv[i];
const size_t wlen = wcslen(warg) + 1; // incl. terminating null
assert(wlen <= cast(size_t) int.max, "wlen cannot exceed int.max");
const int len = WideCharToMultiByte(CP_UTF8, 0, warg, cast(int) wlen, null, 0, null, null);
args[i] = (cast(char*) wlen)[0 .. len]; // args[i].ptr = wlen, args[i].length = len
totalArgsLength += len;
}
// Allocate a single buffer for all (null-terminated) argument strings in UTF-8 on the stack
char* utf8Buffer = cast(char*) alloca(totalArgsLength);
// 2nd pass: convert to UTF-8 and finalize `args`
char* utf8 = utf8Buffer;
foreach (i; 0 .. argc)
{
const wlen = cast(int) args[i].ptr;
const len = cast(int) args[i].length;
WideCharToMultiByte(CP_UTF8, 0, wargv[i], wlen, utf8, len, null, null);
args[i] = utf8[0 .. len-1]; // excl. terminating null
utf8 += len;
}
// Set C argc/argv; argv is a new stack-allocated array of UTF-8 C strings
char*[] argv = (cast(char**) alloca(argc * (char*).sizeof))[0 .. argc];
foreach (i, ref arg; argv)
arg = args[i].ptr;
_cArgs.argc = argc;
_cArgs.argv = argv.ptr;
totalArgsLength -= argc; // excl. null terminator per arg
return _d_run_main2(args, totalArgsLength, mainFunc);
}
private extern (C) int _d_run_main2(char[][] args, size_t totalArgsLength, MainFunc mainFunc)
{
int result;
version (FreeBSD) version (D_InlineAsm_X86)
{
/*
* FreeBSD/i386 sets the FPU precision mode to 53 bit double.
* Make it 64 bit extended.
*/
ushort fpucw;
asm
{
fstsw fpucw;
or fpucw, 0b11_00_111111; // 11: use 64 bit extended-precision
// 111111: mask all FP exceptions
fldcw fpucw;
}
}
version (CRuntime_Microsoft)
{
// enable full precision for reals
version (D_InlineAsm_X86_64)
{
asm
{
push RAX;
fstcw word ptr [RSP];
or [RSP], 0b11_00_111111; // 11: use 64 bit extended-precision
// 111111: mask all FP exceptions
fldcw word ptr [RSP];
pop RAX;
}
}
else version (D_InlineAsm_X86)
{
asm
{
push EAX;
fstcw word ptr [ESP];
or [ESP], 0b11_00_111111; // 11: use 64 bit extended-precision
// 111111: mask all FP exceptions
fldcw word ptr [ESP];
pop EAX;
}
}
else version (GNU_InlineAsm)
{
size_t fpu_cw;
asm { "fstcw %0" : "=m" (fpu_cw); }
fpu_cw |= 0b11_00_111111; // 11: use 64 bit extended-precision
// 111111: mask all FP exceptions
asm { "fldcw %0" : "=m" (fpu_cw); }
}
}
/* Create a copy of args[] on the stack to be used for main, so that rt_args()
* cannot be modified by the user.
* Note that when this function returns, _d_args will refer to garbage.
*/
{
_d_args = cast(string[]) args;
auto buff = cast(char[]*) alloca(args.length * (char[]).sizeof + totalArgsLength);
char[][] argsCopy = buff[0 .. args.length];
auto argBuff = cast(char*) (buff + args.length);
size_t j = 0;
import rt.config : rt_cmdline_enabled;
bool parseOpts = rt_cmdline_enabled!();
foreach (arg; args)
{
// Do not pass Druntime options to the program
if (parseOpts && arg.length >= 6 && arg[0 .. 6] == "--DRT-")
continue;
// https://issues.dlang.org/show_bug.cgi?id=20459
if (arg == "--")
parseOpts = false;
argsCopy[j++] = (argBuff[0 .. arg.length] = arg[]);
argBuff += arg.length;
}
args = argsCopy[0..j];
}
auto useExceptionTrap = parseExceptionOptions();
version (Windows)
{
if (IsDebuggerPresent())
useExceptionTrap = false;
}
void tryExec(scope void delegate() dg)
{
if (useExceptionTrap)
{
try
{
dg();
}
catch (Throwable t)
{
_d_print_throwable(t);
result = EXIT_FAILURE;
}
}
else
{
dg();
}
}
// NOTE: The lifetime of a process is much like the lifetime of an object:
// it is initialized, then used, then destroyed. If initialization
// fails, the successive two steps are never reached. However, if
// initialization succeeds, then cleanup will occur even if the use
// step fails in some way. Here, the use phase consists of running
// the user's main function. If main terminates with an exception,
// the exception is handled and then cleanup begins. An exception
// thrown during cleanup, however, will abort the cleanup process.
void runAll()
{
if (rt_init())
{
auto utResult = runModuleUnitTests();
assert(utResult.passed <= utResult.executed);
if (utResult.passed == utResult.executed)
{
if (utResult.summarize)
{
if (utResult.passed == 0)
.fprintf(.stderr, "No unittests run\n");
else
.fprintf(.stderr, "%d modules passed unittests\n",
cast(int)utResult.passed);
}
if (utResult.runMain)
tryExec({ result = mainFunc(args); });
else
result = EXIT_SUCCESS;
}
else
{
if (utResult.summarize)
.fprintf(.stderr, "%d/%d modules FAILED unittests\n",
cast(int)(utResult.executed - utResult.passed),
cast(int)utResult.executed);
result = EXIT_FAILURE;
}
}
else
result = EXIT_FAILURE;
if (!rt_term())
result = (result == EXIT_SUCCESS) ? EXIT_FAILURE : result;
}
tryExec(&runAll);
// Issue 10344: flush stdout and return nonzero on failure
if (.fflush(.stdout) != 0)
{
.fprintf(.stderr, "Failed to flush stdout: %s\n", .strerror(.errno));
if (result == 0)
{
result = EXIT_FAILURE;
}
}
return result;
}
private void formatThrowable(Throwable t, scope void delegate(in char[] s) nothrow sink)
{
foreach (u; t)
{
u.toString(sink); sink("\n");
auto e = cast(Error)u;
if (e is null || e.bypassedException is null) continue;
sink("=== Bypassed ===\n");
foreach (t2; e.bypassedException)
{
t2.toString(sink); sink("\n");
}
sink("=== ~Bypassed ===\n");
}
}
private auto parseExceptionOptions()
{
import rt.config : rt_configOption;
import core.internal.parseoptions : rt_parseOption;
const optName = "trapExceptions";
auto option = rt_configOption(optName);
auto trap = rt_trapExceptions;
if (option.length)
rt_parseOption(optName, option, trap, "");
return trap;
}
extern (C) void _d_print_throwable(Throwable t)
{
// On Windows, a console may not be present to print the output to.
// Show a message box instead. If the console is present, convert to
// the correct encoding.
version (Windows)
{
static struct WSink
{
WCHAR* ptr; size_t len;
void sink(const scope char[] s) scope nothrow
{
if (!s.length) return;
int swlen = MultiByteToWideChar(
CP_UTF8, 0, s.ptr, cast(int)s.length, null, 0);
if (!swlen) return;
auto newPtr = cast(WCHAR*)realloc(ptr,
(this.len + swlen + 1) * WCHAR.sizeof);
if (!newPtr) return;
ptr = newPtr;
auto written = MultiByteToWideChar(
CP_UTF8, 0, s.ptr, cast(int)s.length, ptr+len, swlen);
len += written;
}
typeof(ptr) get() { if (ptr) ptr[len] = 0; return ptr; }
void free() { .free(ptr); }
}
HANDLE windowsHandle(int fd)
{
version (CRuntime_Microsoft)
return cast(HANDLE)_get_osfhandle(fd);
else
return _fdToHandle(fd);
}
auto hStdErr = windowsHandle(fileno(stderr));
CONSOLE_SCREEN_BUFFER_INFO sbi;
bool isConsole = GetConsoleScreenBufferInfo(hStdErr, &sbi) != 0;
// ensure the exception is shown at the beginning of the line, while also
// checking whether stderr is a valid file
int written = fprintf(stderr, "\n");
if (written <= 0)
{
WSink buf;
formatThrowable(t, &buf.sink);
if (buf.ptr)
{
WSink caption;
if (t)
caption.sink(typeid(t).name);
// Avoid static user32.dll dependency for console applications
// by loading it dynamically as needed
auto user32 = LoadLibraryW("user32.dll");
if (user32)
{
alias typeof(&MessageBoxW) PMessageBoxW;
auto pMessageBoxW = cast(PMessageBoxW)
GetProcAddress(user32, "MessageBoxW");
if (pMessageBoxW)
pMessageBoxW(null, buf.get(), caption.get(), MB_ICONERROR);
}
FreeLibrary(user32);
caption.free();
buf.free();
}
return;
}
else if (isConsole)
{
WSink buf;
formatThrowable(t, &buf.sink);
if (buf.ptr)
{
uint codepage = GetConsoleOutputCP();
int slen = WideCharToMultiByte(codepage, 0,
buf.ptr, cast(int)buf.len, null, 0, null, null);
auto sptr = cast(char*)malloc(slen * char.sizeof);
if (sptr)
{
WideCharToMultiByte(codepage, 0,
buf.ptr, cast(int)buf.len, sptr, slen, null, null);
WriteFile(hStdErr, sptr, slen, null, null);
free(sptr);
}
buf.free();
}
return;
}
}
void sink(in char[] buf) scope nothrow
{
fwrite(buf.ptr, char.sizeof, buf.length, stderr);
}
formatThrowable(t, &sink);
}
|
D
|
/Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/DerivedData/mealify/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/ComponentBase.o : /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Filters/DataApproximator+N.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/Legend.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/MarkerImage.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/Range.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/AxisBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/ComponentBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/Fill.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/Platform.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/Description.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/IMarker.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/Transformer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Renderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Animation/Animator.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Filters/DataApproximator.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/XAxis.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/YAxis.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/ChartUtils.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/Highlight.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/MarkerView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/PieChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/LineChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/BarChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/RadarChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/LegendEntry.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/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/DerivedData/mealify/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Charts.build/unextended-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/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/CoreText.framework/Headers/CoreText.apinotes
/Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/DerivedData/mealify/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/ComponentBase~partial.swiftmodule : /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Filters/DataApproximator+N.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/Legend.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/MarkerImage.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/Range.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/AxisBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/ComponentBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/Fill.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/Platform.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/Description.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/IMarker.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/Transformer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Renderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Animation/Animator.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Filters/DataApproximator.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/XAxis.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/YAxis.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/ChartUtils.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/Highlight.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/MarkerView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/PieChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/LineChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/BarChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/RadarChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/LegendEntry.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/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/DerivedData/mealify/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Charts.build/unextended-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/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/CoreText.framework/Headers/CoreText.apinotes
/Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/DerivedData/mealify/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/ComponentBase~partial.swiftdoc : /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Filters/DataApproximator+N.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/Legend.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/MarkerImage.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/Range.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/AxisBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/ComponentBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/Fill.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/Platform.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/Description.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/IMarker.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/Transformer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Renderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Animation/Animator.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Filters/DataApproximator.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/XAxis.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/YAxis.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/ChartUtils.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Highlight/Highlight.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/MarkerView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/PieChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/LineChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/BarChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/RadarChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Charts/Source/Charts/Components/LegendEntry.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/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/justinlew/Documents/SFU/CMPT276/justinlew.mealify.io/DerivedData/mealify/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Charts.build/unextended-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/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/CoreText.framework/Headers/CoreText.apinotes
|
D
|
module dwinbar.backend.applist;
import dwinbar.backend.xbackend;
import dwinbar.backend.icongen;
import dwinbar.bar;
import std.algorithm;
import std.array;
import std.range;
import std.string;
import imageformats;
enum AppState
{
visible,
minimized,
urgent
}
struct AppInfo
{
Window window;
string title;
AppState state;
string iconName;
IFImage icon;
}
string getWindowTitle(XBackend x, Window window)
{
XTextProperty prop;
XGetTextProperty(x.display, window, &prop, XAtom[AtomName._NET_WM_NAME]);
return cast(string) prop.value[0 .. prop.nitems].dup;
}
struct AppList
{
// Keep X first because of unions
XBackend x;
AppInfo[] infos;
Window activeWindow;
alias infos this;
void updateActive()
{
Atom actualType;
int actualFormat;
ulong numItems, bytesAfter;
Window* result;
scope (exit)
XFree(result);
XGetWindowProperty(x.display, x.rootWindow, XAtom[AtomName._NET_ACTIVE_WINDOW],
0, int.max, false, XA_WINDOW, &actualType, &actualFormat, &numItems,
&bytesAfter, cast(ubyte**)&result);
activeWindow = *result;
}
void updateClientList(int iconSize)
{
Atom actualType;
int actualFormat;
ulong numItems, bytesAfter;
Window* result;
scope (exit)
XFree(result);
XGetWindowProperty(x.display, x.rootWindow, XAtom[AtomName._NET_CLIENT_LIST],
0, int.max, false, XA_WINDOW, &actualType, &actualFormat, &numItems,
&bytesAfter, cast(ubyte**)&result);
Window[] apps = result[0 .. numItems];
Window[] added;
XTextProperty prop;
AppLoop: foreach (app; apps)
{
if (updateWindow(app, iconSize))
added ~= app;
}
auto toRemove = infos.map!"a.window".enumerate.array;
foreach (app; added)
{
auto idx = toRemove.countUntil!"a.value == b"(app);
if (idx != -1)
toRemove = toRemove.remove(idx);
}
foreach_reverse (rem; toRemove)
infos = infos.remove(rem.index);
}
bool updateWindow(Window window, int iconSize)
{
Atom actualType;
int actualFormat;
ulong numItems, bytesAfter;
Atom* atomsResult;
scope (exit)
XFree(atomsResult);
if (XGetWindowProperty(x.display, window, XAtom[AtomName._NET_WM_STATE], 0,
32, false, XA_ATOM, &actualType, &actualFormat, &numItems,
&bytesAfter, cast(ubyte**)&atomsResult) == Success)
{
auto existingIndex = infos.countUntil!"a.window == b"(window);
AppInfo info;
info.window = window;
if (existingIndex != -1)
info = infos[existingIndex];
Atom[] atoms = atomsResult[0 .. numItems];
foreach (atom; atoms)
{
if (atom == XAtom[AtomName._NET_WM_STATE_SKIP_TASKBAR])
{
if (existingIndex != -1)
infos = infos.remove(existingIndex);
return false;
}
if (info.state == AppState.visible)
{
if (atom == XAtom[AtomName._NET_WM_STATE_HIDDEN])
info.state = AppState.minimized;
}
if (atom == XAtom[AtomName._NET_WM_STATE_DEMANDS_ATTENTION])
info.state = AppState.urgent;
}
info.title = getWindowTitle(x, window);
XWMHints* hints = XGetWMHints(x.display, window);
if (hints)
{
scope (exit)
XFree(hints);
if (hints.flags & XUrgencyHint)
info.state = AppState.urgent;
}
if (existingIndex == -1)
{
infos ~= info;
XSetWindowAttributes attrib;
attrib.event_mask = PropertyChangeMask;
XChangeWindowAttributes(x.display, window, CWEventMask, &attrib);
updateIcon(window, iconSize);
}
else
infos[existingIndex] = info;
return true;
}
else
return false;
}
bool updateIcon(Window window, int targetSize)
{
Atom actualType;
int actualFormat;
ulong numItems, bytesAfter;
Atom* result;
auto existingIndex = infos.countUntil!"a.window == b"(window);
if (existingIndex == -1)
return false;
if (XGetWindowProperty(x.display, window, XAtom[AtomName._NET_WM_ICON], 0,
uint.max, false, XA_CARDINAL, &actualType, &actualFormat, &numItems,
&bytesAfter, cast(ubyte**)&result) == Success && numItems > 2)
{
ulong[] data = result[0 .. numItems];
size_t start = findBestIcon(data, targetSize);
int w = cast(int) data[start];
int h = cast(int) data[start + 1];
immutable ulong offset = start + 2;
ulong[] scaled = scaleImage(targetSize, targetSize, data[offset .. offset + w * h], w, h);
auto pixels = new ubyte[targetSize * targetSize * 4];
for (int i = 0; i < targetSize * targetSize; i++)
{
immutable ulong color = scaled[i];
ubyte alpha = (color >> 24) & 0xFF;
pixels[i * 4 + 0] = (((color >> 0) & 0xFF) * cast(int) alpha / 255) & 0xFF;
pixels[i * 4 + 1] = (((color >> 8) & 0xFF) * cast(int) alpha / 255) & 0xFF;
pixels[i * 4 + 2] = (((color >> 16) & 0xFF) * cast(int) alpha / 255) & 0xFF;
pixels[i * 4 + 3] = alpha;
}
infos[existingIndex].icon.w = infos[existingIndex].icon.h = targetSize;
infos[existingIndex].icon.c = ColFmt.RGBA;
infos[existingIndex].icon.pixels = pixels;
return true;
}
else
return false;
}
}
size_t findBestIcon(ulong[] data, uint targetIconSize)
{
import std.math;
if (data.length < 3)
return 0;
size_t currentBest = 0;
ulong currentArea = data[0] * data[1];
ulong targetArea = (targetIconSize * 2) * (targetIconSize * 2);
size_t cursor = 2 + currentArea;
while (cursor < data.length)
{
ulong selectedArea = data[cursor] * data[cursor + 1];
if (abs(targetArea - selectedArea) <= abs(targetArea - currentArea))
{
currentBest = cursor;
}
cursor += 2 + selectedArea;
}
return currentBest;
}
|
D
|
/mnt/c/Users/Max Kelly/Documents/Github/rust/crawler/target/debug/deps/libdebug_unreachable-6f38f36a2b19c8a8.rlib: /home/trinitok/.cargo/registry/src/github.com-1ecc6299db9ec823/new_debug_unreachable-1.0.1/src/lib.rs
/mnt/c/Users/Max Kelly/Documents/Github/rust/crawler/target/debug/deps/debug_unreachable-6f38f36a2b19c8a8.d: /home/trinitok/.cargo/registry/src/github.com-1ecc6299db9ec823/new_debug_unreachable-1.0.1/src/lib.rs
/home/trinitok/.cargo/registry/src/github.com-1ecc6299db9ec823/new_debug_unreachable-1.0.1/src/lib.rs:
|
D
|
/**
* Interface for reading files and convert it to the `rpdl.tree.RpdlTree`
*
* Copyright: © 2017 Andrey Kabylin
* License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
*/
module rpdl.reader;
import std.file;
import std.stdio;
import std.conv;
import rpdl.node;
import rpdl.value;
import rpdl.exception;
/// Declare interface for readers and tell them - how to read each type of node to file.
interface IReader {
///
void readObjects();
/// Read `rpdl.node.ObjectNode` and insert it to `parent`
void readObject(Node parent);
/// Read `rpdl.node.Parameter` and insert it to `parent`
void readParameter(Node parent);
/// Read `rpdl.value.Value` and insert it to `parent`
void readValue(Node parent);
/// Read `rpdl.value.NumberValue` and insert it to `parent`
void readNumberValue(Node parent);
/// Read `rpdl.value.BooleanValue` and insert it to `parent`
void readBooleanValue(Node parent);
/// Read `rpdl.value.StringValue` and insert it to `parent`
void readStringValue(Node parent);
/// Read `rpdl.value.IdentifierValue` and insert it to `parent`
void readIdentifierValue(Node parent);
/// Read `rpdl.value.ArrayValue` and insert it to `parent`
void readArrayValue(Node parent);
}
abstract class Reader : IReader {
this(Node root) {
this.root = root;
}
void read(in string fileName) {
this.file = File(fileName, "r");
readObjects();
}
protected:
Node root;
File file;
override void readObjects() {}
override void readObject(Node parent) {}
override void readParameter(Node parent) {}
override void readValue(Node parent) {}
override void readNumberValue(Node parent) {}
override void readBooleanValue(Node parent) {}
override void readStringValue(Node parent) {}
override void readIdentifierValue(Node parent) {}
override void readArrayValue(Node parent) {}
}
|
D
|
/Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/Core.build/FutureEncoder.swift.o : /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Data+Base64URL.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/NestedData.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Thread+Async.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Deprecated.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/NotFound.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Reflectable.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/LosslessDataConvertible.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/File.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/MediaType.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/OptionalType.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Process+Execute.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/HeaderValue.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/DirectoryConfig.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CaseInsensitiveString.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Future+Unwrap.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/FutureEncoder.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CoreError.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/String+Utilities.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/DataCoders.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Exports.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Data+Hex.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/BasicKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/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/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/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/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio-zlib-support/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/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.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/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/Core.build/FutureEncoder~partial.swiftmodule : /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Data+Base64URL.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/NestedData.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Thread+Async.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Deprecated.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/NotFound.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Reflectable.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/LosslessDataConvertible.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/File.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/MediaType.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/OptionalType.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Process+Execute.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/HeaderValue.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/DirectoryConfig.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CaseInsensitiveString.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Future+Unwrap.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/FutureEncoder.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CoreError.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/String+Utilities.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/DataCoders.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Exports.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Data+Hex.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/BasicKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/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/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/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/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio-zlib-support/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/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.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/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/Core.build/FutureEncoder~partial.swiftdoc : /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Data+Base64URL.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/NestedData.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Thread+Async.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Deprecated.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/NotFound.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Reflectable.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/LosslessDataConvertible.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/File.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/MediaType.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/OptionalType.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Process+Execute.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/HeaderValue.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/DirectoryConfig.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CaseInsensitiveString.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Future+Unwrap.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/FutureEncoder.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CoreError.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/String+Utilities.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/DataCoders.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Exports.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/Data+Hex.swift /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/core/Sources/Core/BasicKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/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/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/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/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/mhassanin/Developer/CupcakeVapor/CupcakeCorner/.build/checkouts/swift-nio-zlib-support/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/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.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
|
any piece of work that is undertaken or attempted
a specific piece of work required to be done as a duty or for a specific fee
assign a task to
use to the limit
|
D
|
/Users/dali/Documents/GitHub/rustlings/target/release/deps/memchr-850f59f03aaf9c4e.rmeta: /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/lib.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/cow.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/fallback.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/iter.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/naive.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/x86/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/x86/avx.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/x86/sse2.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/byte_frequencies.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/genericsimd.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/fallback.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/genericsimd.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/x86/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/x86/avx.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/x86/sse.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/rabinkarp.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/rarebytes.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/twoway.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/util.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/vector.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/x86/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/x86/avx.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/x86/sse.rs
/Users/dali/Documents/GitHub/rustlings/target/release/deps/libmemchr-850f59f03aaf9c4e.rlib: /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/lib.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/cow.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/fallback.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/iter.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/naive.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/x86/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/x86/avx.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/x86/sse2.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/byte_frequencies.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/genericsimd.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/fallback.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/genericsimd.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/x86/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/x86/avx.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/x86/sse.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/rabinkarp.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/rarebytes.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/twoway.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/util.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/vector.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/x86/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/x86/avx.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/x86/sse.rs
/Users/dali/Documents/GitHub/rustlings/target/release/deps/memchr-850f59f03aaf9c4e.d: /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/lib.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/cow.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/fallback.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/iter.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/naive.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/x86/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/x86/avx.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/x86/sse2.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/byte_frequencies.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/genericsimd.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/fallback.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/genericsimd.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/x86/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/x86/avx.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/x86/sse.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/rabinkarp.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/rarebytes.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/twoway.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/util.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/vector.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/x86/mod.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/x86/avx.rs /Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/x86/sse.rs
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/lib.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/cow.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/mod.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/fallback.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/iter.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/naive.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/x86/mod.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/x86/avx.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memchr/x86/sse2.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/mod.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/byte_frequencies.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/genericsimd.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/mod.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/fallback.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/genericsimd.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/x86/mod.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/x86/avx.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/prefilter/x86/sse.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/rabinkarp.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/rarebytes.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/twoway.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/util.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/vector.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/x86/mod.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/x86/avx.rs:
/Users/dali/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/memchr-2.4.0/src/memmem/x86/sse.rs:
|
D
|
module connection.peerconnection;
class RTCPeerConnection {
private {
RTCSignalingState _signalingState;
RTCIceGatheringState _iceGatheringState;
RTCPeerConnectionState _peerConnectionState;
RTCIceConnectionState _iceConnectionState;
}
this(RTCConfiguration conf) {
_signalingState = stable;
_iceGatheringState = complete;
_peerConnectionState = closed;
_iceConnectionState = closed;
}
}
|
D
|
//************************************
// Minecrawler WARRIOR Prototype
//************************************
PROTOTYPE Mst_Default_MinecrawlerWarrior(C_Npc)
{
//----- Monster -----
name = "Minecrawler Warrior";
guild = GIL_MINECRAWLER;
aivar[AIV_MM_REAL_ID] = ID_MINECRAWLERWARRIOR;
level = 18;
//----- Attribute ----
attribute [ATR_STRENGTH] = 90;
attribute [ATR_DEXTERITY] = 90;
attribute [ATR_HITPOINTS_MAX] = 180;
attribute [ATR_HITPOINTS] = 180;
attribute [ATR_MANA_MAX] = 0;
attribute [ATR_MANA] = 0;
//----- Protections ----
protection [PROT_BLUNT] = 90;
protection [PROT_EDGE] = 90;
protection [PROT_POINT] = 90;
protection [PROT_FIRE] = 90;
protection [PROT_FLY] = 90;
protection [PROT_MAGIC] = 0;
//----- Damage Types ----
damagetype = DAM_EDGE;
// damage [DAM_INDEX_BLUNT] = 0;
// damage [DAM_INDEX_EDGE] = 0;
// damage [DAM_INDEX_POINT] = 0;
// damage [DAM_INDEX_FIRE] = 0;
// damage [DAM_INDEX_FLY] = 0;
// damage [DAM_INDEX_MAGIC] = 0;
//----- Kampf-Taktik ----
fight_tactic = FAI_MINECRAWLER;
//----- Senses & Ranges ----
senses = SENSE_HEAR | SENSE_SEE | SENSE_SMELL;
senses_range = PERC_DIST_MONSTER_ACTIVE_MAX;
aivar[AIV_MM_ThreatenBeforeAttack] = TRUE;
aivar[AIV_MM_FollowTime] = FOLLOWTIME_MEDIUM;
aivar[AIV_MM_FollowInWater] = FALSE;
//----- DAily Routine -----
start_aistate = ZS_MM_AllScheduler;
aivar[AIV_MM_WuselStart] = OnlyRoutine;
};
//************
// Visuals
//************
func void B_SetVisuals_MinecrawlerWarrior()
{
Mdl_SetVisual (self, "Crawler.mds");
// Body-Mesh Body-Tex Skin-Color Head-MMS Head-Tex Teeth-Tex ARMOR
Mdl_SetVisualBody (self, "Cr2_Body", DEFAULT, DEFAULT, "", DEFAULT, DEFAULT, -1);
};
//************************
// MinecrawlerWarrior
//************************
INSTANCE MinecrawlerWarrior (Mst_Default_MinecrawlerWarrior)
{
B_SetVisuals_MinecrawlerWarrior();
Npc_SetToFistMode(self);
};
INSTANCE aMinecrawler (Mst_Default_MinecrawlerWarrior)
{
B_SetVisuals_MinecrawlerWarrior();
Npc_SetToFistMode(self);
};
|
D
|
/**
* This module implements custom assertions via $(D shouldXXX) functions
* that throw exceptions containing information about why the assertion
* failed.
*/
module unit_threaded.assertions;
import unit_threaded.exception: fail, UnitTestException;
import std.traits; // too many to list
import std.range; // also
/**
* Verify that the condition is `true`.
* Throws: UnitTestException on failure.
*/
void shouldBeTrue(E)(lazy E condition, in string file = __FILE__, in size_t line = __LINE__)
{
shouldEqual(cast(bool)condition, true, file, line);
}
///
@safe pure unittest
{
shouldBeTrue(true);
}
/**
* Verify that the condition is `false`.
* Throws: UnitTestException on failure.
*/
void shouldBeFalse(E)(lazy E condition, in string file = __FILE__, in size_t line = __LINE__)
{
shouldEqual(cast(bool)condition, false, file, line);
}
///
@safe pure unittest
{
shouldBeFalse(false);
}
/**
* Verify that two values are the same.
* Floating point values are compared using $(D std.math.approxEqual).
* Throws: UnitTestException on failure
*/
void shouldEqual(V, E)(scope auto ref V value, scope auto ref E expected, in string file = __FILE__, in size_t line = __LINE__)
{
if (!isEqual(value, expected))
{
const msg = formatValueInItsOwnLine("Expected: ", expected) ~
formatValueInItsOwnLine(" Got: ", value);
throw new UnitTestException(msg, file, line);
}
}
///
@safe pure unittest {
shouldEqual(true, true);
shouldEqual(false, false);
shouldEqual(1, 1) ;
shouldEqual("foo", "foo") ;
shouldEqual([2, 3], [2, 3]) ;
shouldEqual(iota(3), [0, 1, 2]);
shouldEqual([[0, 1], [0, 1, 2]], [[0, 1], [0, 1, 2]]);
shouldEqual([[0, 1], [0, 1, 2]], [iota(2), iota(3)]);
shouldEqual([iota(2), iota(3)], [[0, 1], [0, 1, 2]]);
}
/**
* Verify that two values are not the same.
* Throws: UnitTestException on failure
*/
void shouldNotEqual(V, E)(V value, E expected, in string file = __FILE__, in size_t line = __LINE__)
{
if (isEqual(value, expected))
{
const msg = ["Value:",
formatValueInItsOwnLine("", value).join(""),
"is not expected to be equal to:",
formatValueInItsOwnLine("", expected).join("")
];
throw new UnitTestException(msg, file, line);
}
}
///
@safe pure unittest
{
shouldNotEqual(true, false);
shouldNotEqual(1, 2);
shouldNotEqual("f", "b");
shouldNotEqual([2, 3], [2, 3, 4]);
}
///
@safe unittest {
shouldNotEqual(1.0, 2.0);
}
/**
* Verify that the value is null.
* Throws: UnitTestException on failure
*/
void shouldBeNull(T)(in auto ref T value, in string file = __FILE__, in size_t line = __LINE__)
{
if (value !is null)
fail("Value is not null", file, line);
}
///
@safe pure unittest
{
shouldBeNull(null);
}
/**
* Verify that the value is not null.
* Throws: UnitTestException on failure
*/
void shouldNotBeNull(T)(in auto ref T value, in string file = __FILE__, in size_t line = __LINE__)
{
if (value is null)
fail("Value is null", file, line);
}
///
@safe pure unittest
{
class Foo
{
this(int i) { this.i = i; }
override string toString() const
{
import std.conv: to;
return i.to!string;
}
int i;
}
shouldNotBeNull(new Foo(4));
}
enum isLikeAssociativeArray(T, K) = is(typeof({
if(K.init in T) { }
if(K.init !in T) { }
}));
static assert(isLikeAssociativeArray!(string[string], string));
static assert(!isLikeAssociativeArray!(string[string], int));
/**
* Verify that the value is in the container.
* Throws: UnitTestException on failure
*/
void shouldBeIn(T, U)(in auto ref T value, in auto ref U container, in string file = __FILE__, in size_t line = __LINE__)
if (isLikeAssociativeArray!(U, T))
{
import std.conv: to;
if (value !in container)
{
fail(formatValueInItsOwnLine("Value ", value) ~ formatValueInItsOwnLine("not in ", container),
file, line);
}
}
///
@safe pure unittest {
5.shouldBeIn([5: "foo"]);
struct AA {
int onlyKey;
bool opBinaryRight(string op)(in int key) const {
return key == onlyKey;
}
}
5.shouldBeIn(AA(5));
}
/**
* Verify that the value is in the container.
* Throws: UnitTestException on failure
*/
void shouldBeIn(T, U)(in auto ref T value, U container, in string file = __FILE__, in size_t line = __LINE__)
if (!isLikeAssociativeArray!(U, T) && isInputRange!U)
{
import std.algorithm: find;
import std.conv: to;
if (find(container, value).empty)
{
fail(formatValueInItsOwnLine("Value ", value) ~ formatValueInItsOwnLine("not in ", container),
file, line);
}
}
///
@safe pure unittest
{
shouldBeIn(4, [1, 2, 4]);
shouldBeIn("foo", ["foo" : 1]);
}
/**
* Verify that the value is not in the container.
* Throws: UnitTestException on failure
*/
void shouldNotBeIn(T, U)(in auto ref T value, in auto ref U container,
in string file = __FILE__, in size_t line = __LINE__)
if (isLikeAssociativeArray!(U, T))
{
import std.conv: to;
if (value in container)
{
fail(formatValueInItsOwnLine("Value ", value) ~ formatValueInItsOwnLine("is in ", container),
file, line);
}
}
///
@safe pure unittest {
5.shouldNotBeIn([4: "foo"]);
struct AA {
int onlyKey;
bool opBinaryRight(string op)(in int key) const {
return key == onlyKey;
}
}
5.shouldNotBeIn(AA(4));
}
/**
* Verify that the value is not in the container.
* Throws: UnitTestException on failure
*/
void shouldNotBeIn(T, U)(in auto ref T value, U container,
in string file = __FILE__, in size_t line = __LINE__)
if (!isLikeAssociativeArray!(U, T) && isInputRange!U)
{
import std.algorithm: find;
import std.conv: to;
if (!find(container, value).empty)
{
fail(formatValueInItsOwnLine("Value ", value) ~ formatValueInItsOwnLine("is in ", container),
file, line);
}
}
///
@safe unittest
{
auto arrayRangeWithoutLength(T)(T[] array)
{
struct ArrayRangeWithoutLength(T)
{
private:
T[] array;
public:
T front() const @property
{
return array[0];
}
void popFront()
{
array = array[1 .. $];
}
bool empty() const @property
{
return array.empty;
}
}
return ArrayRangeWithoutLength!T(array);
}
shouldNotBeIn(3.5, [1.1, 2.2, 4.4]);
shouldNotBeIn(1.0, [2.0 : 1, 3.0 : 2]);
shouldNotBeIn(1, arrayRangeWithoutLength([2, 3, 4]));
}
private struct ThrownInfo
{
TypeInfo typeInfo;
string msg;
}
/**
* Verify that expr throws the templated Exception class.
* This succeeds if the expression throws a child class of
* the template parameter.
* Returns: A `ThrownInfo` containing info about the throwable
* Throws: UnitTestException on failure (when expr does not
* throw the expected exception)
*/
auto shouldThrow(T : Throwable = Exception, E)
(lazy E expr, in string file = __FILE__, in size_t line = __LINE__)
{
import std.conv: text;
// separate in order to not be inside the @trusted
auto callThrew() { return threw!T(expr); }
void wrongThrowableType(scope Throwable t) {
fail(text("Expression threw ", typeid(t), " instead of the expected ", T.stringof, ":\n", t.msg), file, line);
}
void didntThrow() { fail("Expression did not throw", file, line); }
// insert dummy call outside @trusted to correctly infer the attributes of shouldThrow
if (false) {
callThrew();
wrongThrowableType(null);
didntThrow();
}
return () @trusted { // @trusted because of catching Throwable
try {
const result = callThrew();
if (result.threw)
return result.info;
}
catch(Throwable t)
wrongThrowableType(t);
didntThrow();
assert(0);
}();
}
///
@safe pure unittest {
void funcThrows(string msg) { throw new Exception(msg); }
try {
auto exceptionInfo = funcThrows("foo bar").shouldThrow;
assert(exceptionInfo.msg == "foo bar");
} catch(Exception e) {
assert(false, "should not have thrown anything and threw: " ~ e.msg);
}
}
///
@safe pure unittest {
void func() {}
try {
func.shouldThrow;
assert(false, "Should never get here");
} catch(Exception e)
assert(e.msg == "Expression did not throw");
}
///
@safe pure unittest {
void funcAsserts() { assert(false, "Oh noes"); }
try {
funcAsserts.shouldThrow;
assert(false, "Should never get here");
} catch(Exception e)
assert(e.msg ==
"Expression threw core.exception.AssertError instead of the expected Exception:\nOh noes");
}
/**
* Verify that expr throws the templated Exception class.
* This only succeeds if the expression throws an exception of
* the exact type of the template parameter.
* Returns: A `ThrownInfo` containing info about the throwable
* Throws: UnitTestException on failure (when expr does not
* throw the expected exception)
*/
auto shouldThrowExactly(T : Throwable = Exception, E)(lazy E expr,
in string file = __FILE__, in size_t line = __LINE__)
{
import std.conv: text;
const threw = threw!T(expr);
if (!threw.threw)
fail("Expression did not throw", file, line);
//Object.opEquals is @system and impure
const sameType = () @trusted { return threw.info.typeInfo == typeid(T); }();
if (!sameType)
fail(text("Expression threw wrong type ", threw.info.typeInfo,
"instead of expected type ", typeid(T)), file, line);
return threw.info;
}
/**
* Verify that expr does not throw the templated Exception class.
* Throws: UnitTestException on failure
*/
void shouldNotThrow(T: Throwable = Exception, E)(lazy E expr,
in string file = __FILE__, in size_t line = __LINE__)
{
if (threw!T(expr).threw)
fail("Expression threw", file, line);
}
/**
* Verify that an exception is thrown with the right message
*/
void shouldThrowWithMessage(T : Throwable = Exception, E)(lazy E expr,
string msg,
string file = __FILE__,
size_t line = __LINE__) {
auto threw = threw!T(expr);
if (!threw.threw)
fail("Expression did not throw", file, line);
threw.info.msg.shouldEqual(msg, file, line);
}
///
@safe pure unittest {
void funcThrows(string msg) { throw new Exception(msg); }
funcThrows("foo bar").shouldThrowWithMessage!Exception("foo bar");
funcThrows("foo bar").shouldThrowWithMessage("foo bar");
}
private auto threw(T : Throwable, E)(lazy E expr)
{
import std.typecons : tuple;
import std.array: array;
import std.conv: text;
auto ret = tuple!("threw", "info")(false, ThrownInfo.init);
// separate in order to not be inside the @trusted
void makeRet(scope T e) {
// the message might have to be copied because of lifetime issues
// .msg is sometimes a range, so .array
// but .array sometimes returns dchar[] (autodecoding), so .text
ret = typeof(ret)(true, ThrownInfo(typeid(e), e.msg.array.dup.text));
}
// insert dummy call outside @trusted to correctly infer the attributes of shouldThrow
if (false)
makeRet(null);
(() @trusted { // @trusted because of catching Throwable
try
expr();
catch (T e)
makeRet(e);
})();
return ret;
}
// Formats output in different lines
private string[] formatValueInItsOwnLine(T)(in string prefix, scope auto ref T value) {
import std.conv: to;
import std.traits: isSomeString;
import std.range.primitives: isInputRange;
static if(isSomeString!T) {
// isSomeString is true for wstring and dstring,
// so call .to!string anyway
return [ prefix ~ `"` ~ value.to!string ~ `"`];
} else static if(isInputRange!T) {
return formatRange(prefix, value);
} else {
return [prefix ~ convertToString(value)];
}
}
// helper function for non-copyable types
string convertToString(T)(scope auto ref T value) { // std.conv.to sometimes is @system
import std.conv: to;
import std.traits: Unqual, isFloatingPoint;
import std.format: format;
static if(isFloatingPoint!T) {
return format!"%.6f"(value);
} else static if(__traits(compiles, () @trusted { return value.to!string; }()))
return () @trusted { return value.to!string; }();
else static if(__traits(compiles, value.toString)) {
static if(isObject!T)
return () @trusted { return (cast(Unqual!T)value).toString; }();
else
return value.toString;
} else
return T.stringof ~ "<cannot print>";
}
private string[] formatRange(T)(in string prefix, scope auto ref T value) {
import std.conv: text;
import std.range: ElementType;
import std.algorithm: map, reduce, max;
//some versions of `text` are @system
auto defaultLines = () @trusted { return [prefix ~ value.text]; }();
static if (!isInputRange!(ElementType!T))
return defaultLines;
else
{
import std.array: array;
const maxElementSize = value.empty ? 0 : value.map!(a => a.array.length).reduce!max;
const tooBigForOneLine = (value.array.length > 5 && maxElementSize > 5) || maxElementSize > 10;
if (!tooBigForOneLine)
return defaultLines;
return [prefix ~ "["] ~
value.map!(a => formatValueInItsOwnLine(" ", a).join("") ~ ",").array ~
" ]";
}
}
private enum isObject(T) = is(T == class) || is(T == interface);
bool isEqual(V, E)(in auto ref V value, in auto ref E expected)
if (!isObject!V &&
!isFloatingPoint!V && !isFloatingPoint!E &&
is(typeof(value == expected) == bool))
{
return value == expected;
}
bool isEqual(V, E)(in V value, in E expected)
if (!isObject!V && (isFloatingPoint!V || isFloatingPoint!E) && is(typeof(value == expected) == bool))
{
return value == expected;
}
void shouldApproxEqual(V, E)(in V value, in E expected, double maxRelDiff = 1e-2, double maxAbsDiff = 1e-5, string file = __FILE__, size_t line = __LINE__)
if (!isObject!V && (isFloatingPoint!V || isFloatingPoint!E) && is(typeof(value == expected) == bool))
{
import std.math: approxEqual;
if (!approxEqual(value, expected, maxRelDiff, maxAbsDiff))
{
const msg =
formatValueInItsOwnLine("Expected approx: ", expected) ~
formatValueInItsOwnLine(" Got : ", value);
throw new UnitTestException(msg, file, line);
}
}
///
@safe unittest {
1.0.shouldApproxEqual(1.0001);
}
bool isEqual(V, E)(scope V value, scope E expected)
if (!isObject!V && isInputRange!V && isInputRange!E && !isSomeString!V &&
is(typeof(isEqual(value.front, expected.front))))
{
while (!value.empty && !expected.empty) {
if(!isEqual(value.front, expected.front)) return false;
value.popFront;
expected.popFront;
}
return value.empty && expected.empty;
}
bool isEqual(V, E)(scope V value, scope E expected)
if (!isObject!V && isInputRange!V && isInputRange!E && isSomeString!V && isSomeString!E &&
is(typeof(isEqual(value.front, expected.front))))
{
if(value.length != expected.length) return false;
// prevent auto-decoding
foreach(i; 0 .. value.length)
if(value[i] != expected[i]) return false;
return true;
}
template IsField(A...) if(A.length == 1) {
enum IsField = __traits(compiles, A[0].init);
}
bool isEqual(V, E)(scope V value, scope E expected)
if (isObject!V && isObject!E)
{
import std.meta: staticMap, Filter, staticIndexOf;
static assert(is(typeof(() { string s1 = value.toString; string s2 = expected.toString;})),
"Cannot compare instances of " ~ V.stringof ~
" or " ~ E.stringof ~ " unless toString is overridden for both");
if(value is null && expected !is null) return false;
if(value !is null && expected is null) return false;
if(value is null && expected is null) return true;
// If it has opEquals, use it
static if(staticIndexOf!("opEquals", __traits(derivedMembers, V)) != -1) {
return value.opEquals(expected);
} else {
template IsFieldOf(T, string s) {
static if(__traits(compiles, IsField!(typeof(__traits(getMember, T.init, s)))))
enum IsFieldOf = IsField!(typeof(__traits(getMember, T.init, s)));
else
enum IsFieldOf = false;
}
auto members(T)(T obj) {
import std.typecons: Tuple;
alias Member(string name) = typeof(__traits(getMember, T, name));
alias IsFieldOfT(string s) = IsFieldOf!(T, s);
alias FieldNames = Filter!(IsFieldOfT, __traits(allMembers, T));
alias FieldTypes = staticMap!(Member, FieldNames);
Tuple!FieldTypes ret;
foreach(i, name; FieldNames)
ret[i] = __traits(getMember, obj, name);
return ret;
}
static if(is(V == interface))
return false;
else
return members(value) == members(expected);
}
}
/**
* Verify that rng is empty.
* Throws: UnitTestException on failure.
*/
void shouldBeEmpty(R)(in auto ref R rng, in string file = __FILE__, in size_t line = __LINE__)
if (isInputRange!R)
{
import std.conv: text;
if (!rng.empty)
fail(text("Range not empty: ", rng), file, line);
}
/**
* Verify that rng is empty.
* Throws: UnitTestException on failure.
*/
void shouldBeEmpty(R)(auto ref shared(R) rng, in string file = __FILE__, in size_t line = __LINE__)
if (isInputRange!R)
{
import std.conv: text;
if (!rng.empty)
fail(text("Range not empty: ", rng), file, line);
}
/**
* Verify that aa is empty.
* Throws: UnitTestException on failure.
*/
void shouldBeEmpty(T)(auto ref T aa, in string file = __FILE__, in size_t line = __LINE__)
if (isAssociativeArray!T)
{
//keys is @system
() @trusted{ if (!aa.keys.empty) fail("AA not empty", file, line); }();
}
///
@safe pure unittest
{
int[] ints;
string[] strings;
string[string] aa;
shouldBeEmpty(ints);
shouldBeEmpty(strings);
shouldBeEmpty(aa);
ints ~= 1;
strings ~= "foo";
aa["foo"] = "bar";
}
/**
* Verify that rng is not empty.
* Throws: UnitTestException on failure.
*/
void shouldNotBeEmpty(R)(R rng, in string file = __FILE__, in size_t line = __LINE__)
if (isInputRange!R)
{
if (rng.empty)
fail("Range empty", file, line);
}
/**
* Verify that aa is not empty.
* Throws: UnitTestException on failure.
*/
void shouldNotBeEmpty(T)(in auto ref T aa, in string file = __FILE__, in size_t line = __LINE__)
if (isAssociativeArray!T)
{
//keys is @system
() @trusted{ if (aa.keys.empty)
fail("AA empty", file, line); }();
}
///
@safe pure unittest
{
int[] ints;
string[] strings;
string[string] aa;
ints ~= 1;
strings ~= "foo";
aa["foo"] = "bar";
shouldNotBeEmpty(ints);
shouldNotBeEmpty(strings);
shouldNotBeEmpty(aa);
}
/**
* Verify that t is greater than u.
* Throws: UnitTestException on failure.
*/
void shouldBeGreaterThan(T, U)(in auto ref T t, in auto ref U u,
in string file = __FILE__, in size_t line = __LINE__)
{
import std.conv: text;
if (t <= u)
fail(text(t, " is not > ", u), file, line);
}
///
@safe pure unittest
{
shouldBeGreaterThan(7, 5);
}
/**
* Verify that t is smaller than u.
* Throws: UnitTestException on failure.
*/
void shouldBeSmallerThan(T, U)(in auto ref T t, in auto ref U u,
in string file = __FILE__, in size_t line = __LINE__)
{
import std.conv: text;
if (t >= u)
fail(text(t, " is not < ", u), file, line);
}
///
@safe pure unittest
{
shouldBeSmallerThan(5, 7);
}
/**
* Verify that t and u represent the same set (ordering is not important).
* Throws: UnitTestException on failure.
*/
void shouldBeSameSetAs(V, E)(auto ref V value, auto ref E expected, in string file = __FILE__, in size_t line = __LINE__)
if (isInputRange!V && isInputRange!E && is(typeof(value.front != expected.front) == bool))
{
import std.algorithm: sort;
import std.array: array;
if (!isSameSet(value, expected))
{
static if(__traits(compiles, sort(expected.array)))
const expPrintRange = sort(expected.array).array;
else
alias expPrintRange = expected;
static if(__traits(compiles, sort(value.array)))
const actPrintRange = sort(value.array).array;
else
alias actPrintRange = value;
const msg = formatValueInItsOwnLine("Expected: ", expPrintRange) ~
formatValueInItsOwnLine(" Got: ", actPrintRange);
throw new UnitTestException(msg, file, line);
}
}
///
@safe pure unittest
{
import std.range: iota;
auto inOrder = iota(4);
auto noOrder = [2, 3, 0, 1];
auto oops = [2, 3, 4, 5];
inOrder.shouldBeSameSetAs(noOrder);
inOrder.shouldBeSameSetAs(oops).shouldThrow!UnitTestException;
struct Struct
{
int i;
}
[Struct(1), Struct(4)].shouldBeSameSetAs([Struct(4), Struct(1)]);
}
private bool isSameSet(T, U)(auto ref T t, auto ref U u) {
import std.algorithm: canFind;
//sort makes the element types have to implement opCmp
//instead, try one by one
auto ta = t.array;
auto ua = u.array;
if (ta.length != ua.length) return false;
foreach(element; ta)
{
if (!ua.canFind(element)) return false;
}
return true;
}
/**
* Verify that value and expected do not represent the same set (ordering is not important).
* Throws: UnitTestException on failure.
*/
void shouldNotBeSameSetAs(V, E)(auto ref V value, auto ref E expected, in string file = __FILE__, in size_t line = __LINE__)
if (isInputRange!V && isInputRange!E && is(typeof(value.front != expected.front) == bool))
{
if (isSameSet(value, expected))
{
const msg = ["Value:",
formatValueInItsOwnLine("", value).join(""),
"is not expected to be equal to:",
formatValueInItsOwnLine("", expected).join("")
];
throw new UnitTestException(msg, file, line);
}
}
///
@safe pure unittest
{
auto inOrder = iota(4);
auto noOrder = [2, 3, 0, 1];
auto oops = [2, 3, 4, 5];
inOrder.shouldNotBeSameSetAs(oops);
inOrder.shouldNotBeSameSetAs(noOrder).shouldThrow!UnitTestException;
}
/**
If two strings represent the same JSON regardless of formatting
*/
void shouldBeSameJsonAs(in string actual,
in string expected,
in string file = __FILE__,
in size_t line = __LINE__)
@trusted // not @safe pure due to parseJSON
{
import std.json: parseJSON, JSONException;
auto parse(in string str) {
try
return str.parseJSON;
catch(JSONException ex)
throw new UnitTestException("Error parsing JSON: " ~ ex.msg, file, line);
}
parse(actual).toPrettyString.shouldEqual(parse(expected).toPrettyString, file, line);
}
///
@safe unittest { // not pure because parseJSON isn't pure
`{"foo": "bar"}`.shouldBeSameJsonAs(`{"foo": "bar"}`);
`{"foo": "bar"}`.shouldBeSameJsonAs(`{"foo":"bar"}`);
`{"foo":"bar"}`.shouldBeSameJsonAs(`{"foo": "baz"}`).shouldThrow!UnitTestException;
try
`oops`.shouldBeSameJsonAs(`oops`);
catch(Exception e)
assert(e.msg == "Error parsing JSON: Unexpected character 'o'. (Line 1:1)");
}
auto should(V)(scope auto ref V value){
import std.functional: forward;
struct ShouldNot {
bool opEquals(U)(auto ref U other,
in string file = __FILE__,
in size_t line = __LINE__)
{
shouldNotEqual(forward!value, other, file, line);
return true;
}
void opBinary(string op, R)(R range,
in string file = __FILE__,
in size_t line = __LINE__) const if(op == "in") {
shouldNotBeIn(forward!value, range, file, line);
}
void opBinary(string op, R)(R range,
in string file = __FILE__,
in size_t line = __LINE__) const
if(op == "~" && isInputRange!R)
{
shouldThrow!UnitTestException(shouldBeSameSetAs(forward!value, range), file, line);
}
void opBinary(string op, E)
(in E expected, string file = __FILE__, size_t line = __LINE__)
if (isFloatingPoint!E)
{
shouldThrow!UnitTestException(shouldApproxEqual(forward!value, expected), file, line);
}
}
struct Should {
bool opEquals(U)(auto ref U other,
in string file = __FILE__,
in size_t line = __LINE__)
{
shouldEqual(forward!value, other, file, line);
return true;
}
void opBinary(string op, R)(R range,
in string file = __FILE__,
in size_t line = __LINE__) const
if(op == "in")
{
shouldBeIn(forward!value, range, file, line);
}
void opBinary(string op, R)(R range,
in string file = __FILE__,
in size_t line = __LINE__) const
if(op == "~" && isInputRange!R)
{
shouldBeSameSetAs(forward!value, range, file, line);
}
void opBinary(string op, E)
(in E expected, string file = __FILE__, size_t line = __LINE__)
if (isFloatingPoint!E)
{
shouldApproxEqual(forward!value, expected, 1e-2, 1e-5, file, line);
}
auto not() {
return ShouldNot();
}
}
return Should();
}
T be(T)(T sh) {
return sh;
}
///
@safe pure unittest {
1.should.be == 1;
1.should.not.be == 2;
1.should.be in [1, 2, 3];
4.should.not.be in [1, 2, 3];
}
/**
Asserts that `lowerBound` <= `actual` < `upperBound`
*/
void shouldBeBetween(A, L, U)
(auto ref A actual,
auto ref L lowerBound,
auto ref U upperBound,
in string file = __FILE__,
in size_t line = __LINE__)
{
import std.conv: text;
if(actual < lowerBound || actual >= upperBound)
fail(text(actual, " is not between ", lowerBound, " and ", upperBound), file, line);
}
|
D
|
/* $OpenBSD: cmac.h,v 1.3 2014/06/21 13:42:14 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
/* ====================================================================
* Copyright (c) 2010 The OpenSSL Project. All rights reserved.
*
* 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.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED 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 OpenSSL PROJECT OR
* ITS 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 libressl.openssl.cmac;
private static import libressl.openssl.ossl_typ;
public import libressl.openssl.evp;
extern (C):
nothrow @nogc:
/* Opaque */
struct CMAC_CTX_st;
alias CMAC_CTX = .CMAC_CTX_st;
.CMAC_CTX* CMAC_CTX_new();
void CMAC_CTX_cleanup(.CMAC_CTX* ctx);
void CMAC_CTX_free(.CMAC_CTX* ctx);
libressl.openssl.ossl_typ.EVP_CIPHER_CTX* CMAC_CTX_get0_cipher_ctx(.CMAC_CTX* ctx);
int CMAC_CTX_copy(.CMAC_CTX* out_, const (.CMAC_CTX)* in_);
int CMAC_Init(.CMAC_CTX* ctx, const (void)* key, size_t keylen, const (libressl.openssl.ossl_typ.EVP_CIPHER)* cipher, libressl.openssl.ossl_typ.ENGINE* impl);
int CMAC_Update(.CMAC_CTX* ctx, const (void)* data, size_t dlen);
int CMAC_Final(.CMAC_CTX* ctx, ubyte* out_, size_t* poutlen);
int CMAC_resume(.CMAC_CTX* ctx);
|
D
|
// Copyright (C) 2002-2013 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine" for the D programming language.
// For conditions of distribution and use, see copyright notice in irrlicht.d module.
module irrlicht.scene.ICameraSceneNode;
import irrlicht.scene.ISceneNode;
import irrlicht.scene.ISceneManager;
import irrlicht.scene.SViewFrustum;
import irrlicht.io.IAttributes;
import irrlicht.io.IAttributeExchangingObject;
import irrlicht.IEventReceiver;
import irrlicht.core.vector3d;
import irrlicht.core.matrix4;
/// Scene Node which is a (controlable) camera.
/**
* The whole scene will be rendered from the cameras point of view.
* Because the ICameraScenNode is a SceneNode, it can be attached to any
* other scene node, and will follow its parents movement, rotation and so
* on.
*/
abstract class ICameraSceneNode : ISceneNode, IEventReceiver
{
/// Constructor
this(ISceneNode parent, ISceneManager mgr, int id,
const vector3df position = vector3df(0,0,0),
const vector3df rotation = vector3df(0,0,0),
const vector3df scale = vector3df(1.0f,1.0f,1.0f))
{
super(parent, mgr, id, position, rotation, scale);
IsOrthogonal = false;
}
/// Sets the projection matrix of the camera.
/**
* The matrix4 class has some methods to build a
* projection matrix. e.g:
* matrix4.buildProjectionMatrixPerspectiveFovLH.
* Note that the matrix will only stay as set by this method until
* one of the following Methods are called: setNearValue,
* setFarValue, setAspectRatio, setFOV.
* Params:
* projection= The new projection matrix of the camera.
* isOrthogonal= Set this to true if the matrix is an
* orthogonal one (e.g. from matrix4.buildProjectionMatrixOrtho).
*/
void setProjectionMatrix(ref const matrix4 projection, bool isOrthogonal = false);
final void setProjectionMatrix(matrix4 projection, bool isOrthogonal = false)
{
setProjectionMatrix(projection, isOrthogonal);
}
/// Gets the current projection matrix of the camera.
/**
* Returns: The current projection matrix of the camera.
*/
ref const matrix4 getProjectionMatrix() const;
/// Gets the current view matrix of the camera.
/**
* Returns: The current view matrix of the camera.
*/
ref const matrix4 getViewMatrix() const;
/// Sets a custom view matrix affector.
/**
* The matrix passed here, will be multiplied with the view
* matrix when it gets updated. This allows for custom camera
* setups like, for example, a reflection camera.
* Params:
* affector= The affector matrix.
*/
void setViewMatrixAffector(ref const matrix4 affector);
final void setViewMatrixAffector(matrix4 affector)
{
setViewMatrixAffector(affector);
}
/// Get the custom view matrix affector.
/**
* Returns: The affector matrix.
*/
ref const matrix4 getViewMatrixAffector() const;
/// It is possible to send mouse and key events to the camera.
/**
* Most cameras may ignore this input, but camera scene nodes
* which are created for example with
* ISceneManager.addCameraSceneNodeMaya or
* ISceneManager.addCameraSceneNodeFPS, may want to get
* this input for changing their position, look at target or
* whatever.
*/
// bool OnEvent(ref const SEvent event);
/// Sets the look at target of the camera
/**
* If the camera's target and rotation are bound ( @see
* bindTargetAndRotation() ) then calling this will also change
* the camera's scene node rotation to match the target.
* Note that setTarget uses the current absolute position
* internally, so if you changed setPosition since last rendering you must
* call updateAbsolutePosition before using this function.
* Params:
* pos= Look at target of the camera, in world co-ordinates.
*/
void setTarget(ref const vector3df pos);
final void setTarget(vector3df pos)
{
setTarget(pos);
}
/// Sets the rotation of the node.
/**
* This only modifies the relative rotation of the node.
* If the camera's target and rotation are bound ( @see
* bindTargetAndRotation() ) then calling this will also change
* the camera's target to match the rotation.
* Params:
* rotation= New rotation of the node in degrees.
*/
void setRotation(ref const vector3df rotation);
final void setRotation(vector3df rotation)
{
setRotation(rotation);
}
/// Gets the current look at target of the camera
/**
* Returns: The current look at target of the camera, in world co-ordinates
*/
ref const vector3df getTarget() const;
/// Sets the up vector of the camera.
/**
* Params:
* pos= New upvector of the camera.
*/
void setUpVector(ref const vector3df pos);
final void setUpVector(vector3df pos)
{
setUpVector(pos);
}
/// Gets the up vector of the camera.
/**
* Returns: The up vector of the camera, in world space.
*/
ref const vector3df getUpVector() const;
/// Gets the value of the near plane of the camera.
/**
* Returns: The value of the near plane of the camera.
*/
float getNearValue() const;
/// Gets the value of the far plane of the camera.
/**
* Returns: The value of the far plane of the camera.
*/
float getFarValue() const;
/// Gets the aspect ratio of the camera.
/**
* Returns: The aspect ratio of the camera.
*/
float getAspectRatio() const;
/// Gets the field of view of the camera.
/**
* Returns: The field of view of the camera in radians.
*/
float getFOV() const;
/// Sets the value of the near clipping plane. (default: 1.0f)
/**
* Params:
* zn= New z near value.
*/
void setNearValue(float zn);
/// Sets the value of the far clipping plane (default: 2000.0f)
/**
* Params:
* zf= New z far value.
*/
void setFarValue(float zf);
/// Sets the aspect ratio (default: 4.0f / 3.0f)
/**
* Params:
* aspect= New aspect ratio.
*/
void setAspectRatio(float aspect);
/// Sets the field of view (Default: PI / 2.5f)
/**
* Params:
* fovy= New field of view in radians.
*/
void setFOV(float fovy);
/// Get the view frustum.
/**
* Needed sometimes by bspTree or LOD render nodes.
* Returns: The current view frustum.
*/
ref const SViewFrustum getViewFrustum() const;
/// Disables or enables the camera to get key or mouse inputs.
/**
* If this is set to true, the camera will respond to key
* inputs otherwise not.
*/
void setInputReceiverEnabled(bool enabled);
/// Checks if the input receiver of the camera is currently enabled.
bool isInputReceiverEnabled() const;
/// Checks if a camera is orthogonal.
bool isOrthogonal() const
{
return IsOrthogonal;
}
/// Binds the camera scene node's rotation to its target position and vice vera, or unbinds them.
/**
* When bound, calling setRotation() will update the camera's
* target position to be along its +Z axis, and likewise calling
* setTarget() will update its rotation so that its +Z axis will
* point at the target point. FPS camera use this binding by
* default; other cameras do not.
* Params:
* bound= True to bind the camera's scene node rotation
* and targetting, false to unbind them.
* @see getTargetAndRotationBinding()
*/
void bindTargetAndRotation(bool bound);
/// Queries if the camera scene node's rotation and its target position are bound together.
/**
* @see bindTargetAndRotation()
*/
bool getTargetAndRotationBinding() const;
/// Writes attributes of the camera node
override void serializeAttributes(out IAttributes outAttr, SAttributeReadWriteOptions options = SAttributeReadWriteOptions()) const
{
super.serializeAttributes(outAttr, options);
if (outAttr is null)
return;
outAttr.add("IsOrthogonal", IsOrthogonal );
}
/// Reads attributes of the camera node
override void deserializeAttributes(IAttributes inAttr, SAttributeReadWriteOptions options = SAttributeReadWriteOptions())
{
super.deserializeAttributes(inAttr, options);
if (inAttr is null)
return;
if ( inAttr.findAttribute("IsOrthogonal") )
IsOrthogonal = inAttr.getAttribute!bool("IsOrthogonal");
}
protected void cloneMembers(ICameraSceneNode toCopyFrom)
{
IsOrthogonal = toCopyFrom.IsOrthogonal;
}
protected bool IsOrthogonal;
}
|
D
|
// Written in the D programming language.
/**
Functions and types that manipulate built-in arrays and associative arrays.
This module provides all kinds of functions to create, manipulate or convert arrays:
$(SCRIPT inhibitQuickIndex = 1;)
$(BOOKTABLE ,
$(TR $(TH Function Name) $(TH Description)
)
$(TR $(TD $(LREF _array))
$(TD Returns a copy of the input in a newly allocated dynamic _array.
))
$(TR $(TD $(LREF appender))
$(TD Returns a new $(LREF Appender) or $(LREF RefAppender) initialized with a given _array.
))
$(TR $(TD $(LREF assocArray))
$(TD Returns a newly allocated associative _array from a range of key/value tuples.
))
$(TR $(TD $(LREF byPair))
$(TD Construct a range iterating over an associative _array by key/value tuples.
))
$(TR $(TD $(LREF insertInPlace))
$(TD Inserts into an existing _array at a given position.
))
$(TR $(TD $(LREF join))
$(TD Concatenates a range of ranges into one _array.
))
$(TR $(TD $(LREF minimallyInitializedArray))
$(TD Returns a new _array of type $(D T).
))
$(TR $(TD $(LREF replace))
$(TD Returns a new _array with all occurrences of a certain subrange replaced.
))
$(TR $(TD $(LREF replaceFirst))
$(TD Returns a new _array with the first occurrence of a certain subrange replaced.
))
$(TR $(TD $(LREF replaceInPlace))
$(TD Replaces all occurrences of a certain subrange and puts the result into a given _array.
))
$(TR $(TD $(LREF replaceInto))
$(TD Replaces all occurrences of a certain subrange and puts the result into an output range.
))
$(TR $(TD $(LREF replaceLast))
$(TD Returns a new _array with the last occurrence of a certain subrange replaced.
))
$(TR $(TD $(LREF replaceSlice))
$(TD Returns a new _array with a given slice replaced.
))
$(TR $(TD $(LREF replicate))
$(TD Creates a new _array out of several copies of an input _array or range.
))
$(TR $(TD $(LREF sameHead))
$(TD Checks if the initial segments of two arrays refer to the same
place in memory.
))
$(TR $(TD $(LREF sameTail))
$(TD Checks if the final segments of two arrays refer to the same place
in memory.
))
$(TR $(TD $(LREF split))
$(TD Eagerly split a range or string into an _array.
))
$(TR $(TD $(LREF uninitializedArray))
$(TD Returns a new _array of type $(D T) without initializing its elements.
))
)
Copyright: Copyright Andrei Alexandrescu 2008- and Jonathan M Davis 2011-.
License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(HTTP erdani.org, Andrei Alexandrescu) and Jonathan M Davis
Source: $(PHOBOSSRC std/_array.d)
*/
module std.array;
import std.meta;
import std.traits;
import std.functional;
static import std.algorithm.iteration; // FIXME, remove with alias of splitter
import std.range.primitives;
public import std.range.primitives : save, empty, popFront, popBack, front, back;
/**
* Allocates an array and initializes it with copies of the elements
* of range $(D r).
*
* Narrow strings are handled as a special case in an overload.
*
* Params:
* r = range (or aggregate with $(D opApply) function) whose elements are copied into the allocated array
* Returns:
* allocated and initialized array
*/
ForeachType!Range[] array(Range)(Range r)
if (isIterable!Range && !isNarrowString!Range && !isInfinite!Range)
{
if (__ctfe)
{
// Compile-time version to avoid memcpy calls.
// Also used to infer attributes of array().
typeof(return) result;
foreach (e; r)
result ~= e;
return result;
}
alias E = ForeachType!Range;
static if (hasLength!Range)
{
auto length = r.length;
if (length == 0)
return null;
import std.conv : emplaceRef;
auto result = (() @trusted => uninitializedArray!(Unqual!E[])(length))();
// Every element of the uninitialized array must be initialized
size_t i;
foreach (e; r)
{
emplaceRef!E(result[i], e);
++i;
}
return (() @trusted => cast(E[]) result)();
}
else
{
auto a = appender!(E[])();
foreach (e; r)
{
a.put(e);
}
return a.data;
}
}
///
@safe pure nothrow unittest
{
auto a = array([1, 2, 3, 4, 5][]);
assert(a == [ 1, 2, 3, 4, 5 ]);
}
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
struct Foo
{
int a;
}
auto a = array([Foo(1), Foo(2), Foo(3), Foo(4), Foo(5)][]);
assert(equal(a, [Foo(1), Foo(2), Foo(3), Foo(4), Foo(5)]));
}
@system unittest
{
import std.algorithm.comparison : equal;
struct Foo
{
int a;
void opAssign(Foo foo)
{
assert(0);
}
auto opEquals(Foo foo)
{
return a == foo.a;
}
}
auto a = array([Foo(1), Foo(2), Foo(3), Foo(4), Foo(5)][]);
assert(equal(a, [Foo(1), Foo(2), Foo(3), Foo(4), Foo(5)]));
}
@safe unittest
{
// Issue 12315
static struct Bug12315 { immutable int i; }
enum bug12315 = [Bug12315(123456789)].array();
static assert(bug12315[0].i == 123456789);
}
@safe unittest
{
import std.range;
static struct S{int* p;}
auto a = array(immutable(S).init.repeat(5));
}
/**
Convert a narrow string to an array type that fully supports random access.
This is handled as a special case and always returns an array of `dchar`
Params:
str = `isNarrowString` to be converted to an array of `dchar`
Returns:
a $(D dchar[]), $(D const(dchar)[]), or $(D immutable(dchar)[]) depending on the constness of
the input.
*/
@trusted ElementType!String[] array(String)(scope String str)
if (isNarrowString!String)
{
import std.utf : toUTF32;
/* This function is @trusted because the following cast
* is unsafe - converting a dstring[] to a dchar[], for example.
* Our special knowledge of toUTF32 is needed to know the cast is safe.
*/
return cast(typeof(return)) str.toUTF32;
}
@system unittest
{
// @system due to array!string
import std.conv : to;
static struct TestArray { int x; string toString() @safe { return to!string(x); } }
static struct OpAssign
{
uint num;
this(uint num) { this.num = num; }
// Templating opAssign to make sure the bugs with opAssign being
// templated are fixed.
void opAssign(T)(T rhs) { this.num = rhs.num; }
}
static struct OpApply
{
int opApply(scope int delegate(ref int) dg)
{
int res;
foreach (i; 0 .. 10)
{
res = dg(i);
if (res) break;
}
return res;
}
}
auto a = array([1, 2, 3, 4, 5][]);
//writeln(a);
assert(a == [ 1, 2, 3, 4, 5 ]);
auto b = array([TestArray(1), TestArray(2)][]);
//writeln(b);
class C
{
int x;
this(int y) { x = y; }
override string toString() const @safe { return to!string(x); }
}
auto c = array([new C(1), new C(2)][]);
//writeln(c);
auto d = array([1.0, 2.2, 3][]);
assert(is(typeof(d) == double[]));
//writeln(d);
auto e = [OpAssign(1), OpAssign(2)];
auto f = array(e);
assert(e == f);
assert(array(OpApply.init) == [0,1,2,3,4,5,6,7,8,9]);
assert(array("ABC") == "ABC"d);
assert(array("ABC".dup) == "ABC"d.dup);
}
//Bug# 8233
@safe unittest
{
assert(array("hello world"d) == "hello world"d);
immutable a = [1, 2, 3, 4, 5];
assert(array(a) == a);
const b = a;
assert(array(b) == a);
//To verify that the opAssign branch doesn't get screwed up by using Unqual.
//EDIT: array no longer calls opAssign.
struct S
{
ref S opAssign(S)(const ref S rhs)
{
assert(0);
}
int i;
}
foreach (T; AliasSeq!(S, const S, immutable S))
{
auto arr = [T(1), T(2), T(3), T(4)];
assert(array(arr) == arr);
}
}
@safe unittest
{
//9824
static struct S
{
@disable void opAssign(S);
int i;
}
auto arr = [S(0), S(1), S(2)];
arr.array();
}
// Bugzilla 10220
@safe unittest
{
import std.exception;
import std.algorithm.comparison : equal;
import std.range : repeat;
static struct S
{
int val;
@disable this();
this(int v) { val = v; }
}
assertCTFEable!(
{
auto r = S(1).repeat(2).array();
assert(equal(r, [S(1), S(1)]));
});
}
@safe unittest
{
//Turn down infinity:
static assert(!is(typeof(
repeat(1).array()
)));
}
/**
Returns a newly allocated associative _array from a range of key/value tuples.
Params:
r = An $(REF_ALTTEXT input range, isInputRange, std,range,primitives)
of tuples of keys and values.
Returns: A newly allocated associative array out of elements of the input
range, which must be a range of tuples (Key, Value). Returns a null associative
array reference when given an empty range.
Duplicates: Associative arrays have unique keys. If r contains duplicate keys,
then the result will contain the value of the last pair for that key in r.
See_Also: $(REF Tuple, std,typecons), $(REF zip, std,range)
*/
auto assocArray(Range)(Range r)
if (isInputRange!Range)
{
import std.typecons : isTuple;
alias E = ElementType!Range;
static assert(isTuple!E, "assocArray: argument must be a range of tuples");
static assert(E.length == 2, "assocArray: tuple dimension must be 2");
alias KeyType = E.Types[0];
alias ValueType = E.Types[1];
static assert(isMutable!ValueType, "assocArray: value type must be mutable");
ValueType[KeyType] aa;
foreach (t; r)
aa[t[0]] = t[1];
return aa;
}
///
@safe pure /*nothrow*/ unittest
{
import std.range;
import std.typecons;
auto a = assocArray(zip([0, 1, 2], ["a", "b", "c"])); // aka zipMap
assert(is(typeof(a) == string[int]));
assert(a == [0:"a", 1:"b", 2:"c"]);
auto b = assocArray([ tuple("foo", "bar"), tuple("baz", "quux") ]);
assert(is(typeof(b) == string[string]));
assert(b == ["foo":"bar", "baz":"quux"]);
}
// @@@11053@@@ - Cannot be version(unittest) - recursive instantiation error
@safe unittest
{
import std.typecons;
static assert(!__traits(compiles, [ tuple("foo", "bar", "baz") ].assocArray()));
static assert(!__traits(compiles, [ tuple("foo") ].assocArray()));
assert([ tuple("foo", "bar") ].assocArray() == ["foo": "bar"]);
}
// Issue 13909
@safe unittest
{
import std.typecons;
auto a = [tuple!(const string, string)("foo", "bar")];
auto b = [tuple!(string, const string)("foo", "bar")];
assert(assocArray(a) == [cast(const(string)) "foo": "bar"]);
static assert(!__traits(compiles, assocArray(b)));
}
/**
Construct a range iterating over an associative array by key/value tuples.
Params: aa = The associative array to iterate over.
Returns: A $(REF_ALTTEXT forward range, isForwardRange, std,_range,primitives)
of Tuple's of key and value pairs from the given associative array.
*/
auto byPair(Key, Value)(Value[Key] aa)
{
import std.typecons : tuple;
import std.algorithm.iteration : map;
return aa.byKeyValue.map!(pair => tuple(pair.key, pair.value));
}
///
@system unittest
{
import std.typecons : tuple, Tuple;
import std.algorithm.sorting : sort;
auto aa = ["a": 1, "b": 2, "c": 3];
Tuple!(string, int)[] pairs;
// Iteration over key/value pairs.
foreach (pair; aa.byPair)
{
pairs ~= pair;
}
// Iteration order is implementation-dependent, so we should sort it to get
// a fixed order.
sort(pairs);
assert(pairs == [
tuple("a", 1),
tuple("b", 2),
tuple("c", 3)
]);
}
@system unittest
{
import std.typecons : tuple, Tuple;
auto aa = ["a":2];
auto pairs = aa.byPair();
static assert(is(typeof(pairs.front) == Tuple!(string,int)));
static assert(isForwardRange!(typeof(pairs)));
assert(!pairs.empty);
assert(pairs.front == tuple("a", 2));
auto savedPairs = pairs.save;
pairs.popFront();
assert(pairs.empty);
assert(!savedPairs.empty);
assert(savedPairs.front == tuple("a", 2));
}
private template blockAttribute(T)
{
import core.memory;
static if (hasIndirections!(T) || is(T == void))
{
enum blockAttribute = 0;
}
else
{
enum blockAttribute = GC.BlkAttr.NO_SCAN;
}
}
version(unittest)
{
import core.memory : UGC = GC;
static assert(!(blockAttribute!void & UGC.BlkAttr.NO_SCAN));
}
// Returns the number of dimensions in an array T.
private template nDimensions(T)
{
static if (isArray!T)
{
enum nDimensions = 1 + nDimensions!(typeof(T.init[0]));
}
else
{
enum nDimensions = 0;
}
}
version(unittest)
{
static assert(nDimensions!(uint[]) == 1);
static assert(nDimensions!(float[][]) == 2);
}
/++
Returns a new array of type $(D T) allocated on the garbage collected heap
without initializing its elements. This can be a useful optimization if every
element will be immediately initialized. $(D T) may be a multidimensional
array. In this case sizes may be specified for any number of dimensions from 0
to the number in $(D T).
uninitializedArray is nothrow and weakly pure.
uninitializedArray is @system if the uninitialized element type has pointers.
+/
auto uninitializedArray(T, I...)(I sizes) nothrow @system
if (isDynamicArray!T && allSatisfy!(isIntegral, I) && hasIndirections!(ElementEncodingType!T))
{
enum isSize_t(E) = is (E : size_t);
alias toSize_t(E) = size_t;
static assert(allSatisfy!(isSize_t, I),
"Argument types in "~I.stringof~" are not all convertible to size_t: "
~Filter!(templateNot!(isSize_t), I).stringof);
//Eagerlly transform non-size_t into size_t to avoid template bloat
alias ST = staticMap!(toSize_t, I);
return arrayAllocImpl!(false, T, ST)(sizes);
}
///
auto uninitializedArray(T, I...)(I sizes) nothrow @trusted
if (isDynamicArray!T && allSatisfy!(isIntegral, I) && !hasIndirections!(ElementEncodingType!T))
{
enum isSize_t(E) = is (E : size_t);
alias toSize_t(E) = size_t;
static assert(allSatisfy!(isSize_t, I),
"Argument types in "~I.stringof~" are not all convertible to size_t: "
~Filter!(templateNot!(isSize_t), I).stringof);
//Eagerlly transform non-size_t into size_t to avoid template bloat
alias ST = staticMap!(toSize_t, I);
return arrayAllocImpl!(false, T, ST)(sizes);
}
///
@system nothrow pure unittest
{
double[] arr = uninitializedArray!(double[])(100);
assert(arr.length == 100);
double[][] matrix = uninitializedArray!(double[][])(42, 31);
assert(matrix.length == 42);
assert(matrix[0].length == 31);
char*[] ptrs = uninitializedArray!(char*[])(100);
assert(ptrs.length == 100);
}
/++
Returns a new array of type $(D T) allocated on the garbage collected heap.
Partial initialization is done for types with indirections, for preservation
of memory safety. Note that elements will only be initialized to 0, but not
necessarily the element type's $(D .init).
minimallyInitializedArray is nothrow and weakly pure.
+/
auto minimallyInitializedArray(T, I...)(I sizes) nothrow @trusted
if (isDynamicArray!T && allSatisfy!(isIntegral, I))
{
enum isSize_t(E) = is (E : size_t);
alias toSize_t(E) = size_t;
static assert(allSatisfy!(isSize_t, I),
"Argument types in "~I.stringof~" are not all convertible to size_t: "
~Filter!(templateNot!(isSize_t), I).stringof);
//Eagerlly transform non-size_t into size_t to avoid template bloat
alias ST = staticMap!(toSize_t, I);
return arrayAllocImpl!(true, T, ST)(sizes);
}
@safe pure nothrow unittest
{
cast(void) minimallyInitializedArray!(int[][][][][])();
double[] arr = minimallyInitializedArray!(double[])(100);
assert(arr.length == 100);
double[][] matrix = minimallyInitializedArray!(double[][])(42);
assert(matrix.length == 42);
foreach (elem; matrix)
{
assert(elem.ptr is null);
}
}
private auto arrayAllocImpl(bool minimallyInitialized, T, I...)(I sizes) nothrow
{
static assert(I.length <= nDimensions!T,
I.length.stringof~"dimensions specified for a "~nDimensions!T.stringof~" dimensional array.");
alias E = ElementEncodingType!T;
E[] ret;
static if (I.length != 0)
{
static assert(is(I[0] == size_t));
alias size = sizes[0];
}
static if (I.length == 1)
{
if (__ctfe)
{
static if (__traits(compiles, new E[](size)))
ret = new E[](size);
else static if (__traits(compiles, ret ~= E.init))
{
try
{
//Issue: if E has an impure postblit, then all of arrayAllocImpl
//Will be impure, even during non CTFE.
foreach (i; 0 .. size)
ret ~= E.init;
}
catch (Exception e)
throw new Error(e.msg);
}
else
assert(0, "No postblit nor default init on " ~ E.stringof ~
": At least one is required for CTFE.");
}
else
{
import core.stdc.string : memset;
import core.memory : GC;
import core.checkedint : mulu;
bool overflow;
const nbytes = mulu(size, E.sizeof, overflow);
if (overflow) assert(0);
auto ptr = cast(E*) GC.malloc(nbytes, blockAttribute!E);
static if (minimallyInitialized && hasIndirections!E)
memset(ptr, 0, nbytes);
ret = ptr[0 .. size];
}
}
else static if (I.length > 1)
{
ret = arrayAllocImpl!(false, E[])(size);
foreach (ref elem; ret)
elem = arrayAllocImpl!(minimallyInitialized, E)(sizes[1..$]);
}
return ret;
}
@safe nothrow pure unittest
{
auto s1 = uninitializedArray!(int[])();
auto s2 = minimallyInitializedArray!(int[])();
assert(s1.length == 0);
assert(s2.length == 0);
}
@safe nothrow pure unittest //@@@9803@@@
{
auto a = minimallyInitializedArray!(int*[])(1);
assert(a[0] == null);
auto b = minimallyInitializedArray!(int[][])(1);
assert(b[0].empty);
auto c = minimallyInitializedArray!(int*[][])(1, 1);
assert(c[0][0] == null);
}
@safe unittest //@@@10637@@@
{
static struct S
{
static struct I{int i; alias i this;}
int* p;
this() @disable;
this(int i)
{
p = &(new I(i)).i;
}
this(this)
{
p = &(new I(*p)).i;
}
~this()
{
assert(p != null);
}
}
auto a = minimallyInitializedArray!(S[])(1);
assert(a[0].p == null);
enum b = minimallyInitializedArray!(S[])(1);
}
@safe nothrow unittest
{
static struct S1
{
this() @disable;
this(this) @disable;
}
auto a1 = minimallyInitializedArray!(S1[][])(2, 2);
//enum b1 = minimallyInitializedArray!(S1[][])(2, 2);
static struct S2
{
this() @disable;
//this(this) @disable;
}
auto a2 = minimallyInitializedArray!(S2[][])(2, 2);
enum b2 = minimallyInitializedArray!(S2[][])(2, 2);
static struct S3
{
//this() @disable;
this(this) @disable;
}
auto a3 = minimallyInitializedArray!(S3[][])(2, 2);
enum b3 = minimallyInitializedArray!(S3[][])(2, 2);
}
// overlap
/*
NOTE: Undocumented for now, overlap does not yet work with ctfe.
Returns the overlapping portion, if any, of two arrays. Unlike $(D
equal), $(D overlap) only compares the pointers in the ranges, not the
values referred by them. If $(D r1) and $(D r2) have an overlapping
slice, returns that slice. Otherwise, returns the null slice.
*/
auto overlap(T, U)(T[] r1, U[] r2) @trusted pure nothrow
if (is(typeof(r1.ptr < r2.ptr) == bool))
{
import std.algorithm.comparison : min, max;
auto b = max(r1.ptr, r2.ptr);
auto e = min(r1.ptr + r1.length, r2.ptr + r2.length);
return b < e ? b[0 .. e - b] : null;
}
///
@safe pure /*nothrow*/ unittest
{
int[] a = [ 10, 11, 12, 13, 14 ];
int[] b = a[1 .. 3];
assert(overlap(a, b) == [ 11, 12 ]);
b = b.dup;
// overlap disappears even though the content is the same
assert(overlap(a, b).empty);
}
@safe /*nothrow*/ unittest
{
static void test(L, R)(L l, R r)
{
import std.stdio;
scope(failure) writeln("Types: L %s R %s", L.stringof, R.stringof);
assert(overlap(l, r) == [ 100, 12 ]);
assert(overlap(l, l[0 .. 2]) is l[0 .. 2]);
assert(overlap(l, l[3 .. 5]) is l[3 .. 5]);
assert(overlap(l[0 .. 2], l) is l[0 .. 2]);
assert(overlap(l[3 .. 5], l) is l[3 .. 5]);
}
int[] a = [ 10, 11, 12, 13, 14 ];
int[] b = a[1 .. 3];
a[1] = 100;
immutable int[] c = a.idup;
immutable int[] d = c[1 .. 3];
test(a, b);
assert(overlap(a, b.dup).empty);
test(c, d);
assert(overlap(c, d.idup).empty);
}
@safe pure nothrow unittest // bugzilla 9836
{
// range primitives for array should work with alias this types
struct Wrapper
{
int[] data;
alias data this;
@property Wrapper save() { return this; }
}
auto w = Wrapper([1,2,3,4]);
std.array.popFront(w); // should work
static assert(isInputRange!Wrapper);
static assert(isForwardRange!Wrapper);
static assert(isBidirectionalRange!Wrapper);
static assert(isRandomAccessRange!Wrapper);
}
private void copyBackwards(T)(T[] src, T[] dest)
{
import core.stdc.string : memmove;
assert(src.length == dest.length);
if (!__ctfe || hasElaborateCopyConstructor!T)
{
/* insertInPlace relies on dest being uninitialized, so no postblits allowed,
* as this is a MOVE that overwrites the destination, not a COPY.
* BUG: insertInPlace will not work with ctfe and postblits
*/
memmove(dest.ptr, src.ptr, src.length * T.sizeof);
}
else
{
immutable len = src.length;
for (size_t i = len; i-- > 0;)
{
dest[i] = src[i];
}
}
}
/++
Inserts $(D stuff) (which must be an input range or any number of
implicitly convertible items) in $(D array) at position $(D pos).
Params:
array = The array that $(D stuff) will be inserted into.
pos = The position in $(D array) to insert the $(D stuff).
stuff = An $(REF_ALTTEXT input range, isInputRange, std,range,primitives),
or any number of implicitly convertible items to insert into $(D array).
+/
void insertInPlace(T, U...)(ref T[] array, size_t pos, U stuff)
if (!isSomeString!(T[])
&& allSatisfy!(isInputRangeOrConvertible!T, U) && U.length > 0)
{
static if (allSatisfy!(isInputRangeWithLengthOrConvertible!T, U))
{
import std.conv : emplaceRef;
immutable oldLen = array.length;
size_t to_insert = 0;
foreach (i, E; U)
{
static if (is(E : T)) //a single convertible value, not a range
to_insert += 1;
else
to_insert += stuff[i].length;
}
if (to_insert)
{
array.length += to_insert;
// Takes arguments array, pos, stuff
// Spread apart array[] at pos by moving elements
(() @trusted { copyBackwards(array[pos .. oldLen], array[pos+to_insert..$]); })();
// Initialize array[pos .. pos+to_insert] with stuff[]
auto j = 0;
foreach (i, E; U)
{
static if (is(E : T))
{
emplaceRef!T(array[pos + j++], stuff[i]);
}
else
{
foreach (v; stuff[i])
{
emplaceRef!T(array[pos + j++], v);
}
}
}
}
}
else
{
// stuff has some InputRanges in it that don't have length
// assume that stuff to be inserted is typically shorter
// then the array that can be arbitrary big
// TODO: needs a better implementation as there is no need to build an _array_
// a singly-linked list of memory blocks (rope, etc.) will do
auto app = appender!(T[])();
foreach (i, E; U)
app.put(stuff[i]);
insertInPlace(array, pos, app.data);
}
}
/// Ditto
void insertInPlace(T, U...)(ref T[] array, size_t pos, U stuff)
if (isSomeString!(T[]) && allSatisfy!(isCharOrStringOrDcharRange, U))
{
static if (is(Unqual!T == T)
&& allSatisfy!(isInputRangeWithLengthOrConvertible!dchar, U))
{
import std.utf : codeLength;
// mutable, can do in place
//helper function: re-encode dchar to Ts and store at *ptr
static T* putDChar(T* ptr, dchar ch)
{
static if (is(T == dchar))
{
*ptr++ = ch;
return ptr;
}
else
{
import std.utf : encode;
T[dchar.sizeof/T.sizeof] buf;
immutable len = encode(buf, ch);
final switch (len)
{
static if (T.sizeof == char.sizeof)
{
case 4:
ptr[3] = buf[3];
goto case;
case 3:
ptr[2] = buf[2];
goto case;
}
case 2:
ptr[1] = buf[1];
goto case;
case 1:
ptr[0] = buf[0];
}
ptr += len;
return ptr;
}
}
size_t to_insert = 0;
//count up the number of *codeunits* to insert
foreach (i, E; U)
to_insert += codeLength!T(stuff[i]);
array.length += to_insert;
@trusted static void moveToRight(T[] arr, size_t gap)
{
static assert(!hasElaborateCopyConstructor!T);
import core.stdc.string : memmove;
if (__ctfe)
{
for (size_t i = arr.length - gap; i; --i)
arr[gap + i - 1] = arr[i - 1];
}
else
memmove(arr.ptr + gap, arr.ptr, (arr.length - gap) * T.sizeof);
}
moveToRight(array[pos .. $], to_insert);
auto ptr = array.ptr + pos;
foreach (i, E; U)
{
static if (is(E : dchar))
{
ptr = putDChar(ptr, stuff[i]);
}
else
{
foreach (dchar ch; stuff[i])
ptr = putDChar(ptr, ch);
}
}
assert(ptr == array.ptr + pos + to_insert, "(ptr == array.ptr + pos + to_insert) is false");
}
else
{
// immutable/const, just construct a new array
auto app = appender!(T[])();
app.put(array[0 .. pos]);
foreach (i, E; U)
app.put(stuff[i]);
app.put(array[pos..$]);
array = app.data;
}
}
///
@safe pure unittest
{
int[] a = [ 1, 2, 3, 4 ];
a.insertInPlace(2, [ 1, 2 ]);
assert(a == [ 1, 2, 1, 2, 3, 4 ]);
a.insertInPlace(3, 10u, 11);
assert(a == [ 1, 2, 1, 10, 11, 2, 3, 4]);
}
//constraint helpers
private template isInputRangeWithLengthOrConvertible(E)
{
template isInputRangeWithLengthOrConvertible(R)
{
//hasLength not defined for char[], wchar[] and dchar[]
enum isInputRangeWithLengthOrConvertible =
(isInputRange!R && is(typeof(R.init.length))
&& is(ElementType!R : E)) || is(R : E);
}
}
//ditto
private template isCharOrStringOrDcharRange(T)
{
enum isCharOrStringOrDcharRange = isSomeString!T || isSomeChar!T ||
(isInputRange!T && is(ElementType!T : dchar));
}
//ditto
private template isInputRangeOrConvertible(E)
{
template isInputRangeOrConvertible(R)
{
enum isInputRangeOrConvertible =
(isInputRange!R && is(ElementType!R : E)) || is(R : E);
}
}
@system unittest
{
// @system due to insertInPlace
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filter;
import core.exception;
import std.conv : to;
import std.exception;
bool test(T, U, V)(T orig, size_t pos, U toInsert, V result,
string file = __FILE__, size_t line = __LINE__)
{
{
static if (is(T == typeof(T.init.dup)))
auto a = orig.dup;
else
auto a = orig.idup;
a.insertInPlace(pos, toInsert);
if (!equal(a, result))
return false;
}
static if (isInputRange!U)
{
orig.insertInPlace(pos, filter!"true"(toInsert));
return equal(orig, result);
}
else
return true;
}
assert(test([1, 2, 3, 4], 0, [6, 7], [6, 7, 1, 2, 3, 4]));
assert(test([1, 2, 3, 4], 2, [8, 9], [1, 2, 8, 9, 3, 4]));
assert(test([1, 2, 3, 4], 4, [10, 11], [1, 2, 3, 4, 10, 11]));
assert(test([1, 2, 3, 4], 0, 22, [22, 1, 2, 3, 4]));
assert(test([1, 2, 3, 4], 2, 23, [1, 2, 23, 3, 4]));
assert(test([1, 2, 3, 4], 4, 24, [1, 2, 3, 4, 24]));
void testStr(T, U)(string file = __FILE__, size_t line = __LINE__)
{
auto l = to!T("hello");
auto r = to!U(" વિશ્વ");
enforce(test(l, 0, r, " વિશ્વhello"),
new AssertError("testStr failure 1", file, line));
enforce(test(l, 3, r, "hel વિશ્વlo"),
new AssertError("testStr failure 2", file, line));
enforce(test(l, l.length, r, "hello વિશ્વ"),
new AssertError("testStr failure 3", file, line));
}
foreach (T; AliasSeq!(char, wchar, dchar,
immutable(char), immutable(wchar), immutable(dchar)))
{
foreach (U; AliasSeq!(char, wchar, dchar,
immutable(char), immutable(wchar), immutable(dchar)))
{
testStr!(T[], U[])();
}
}
// variadic version
bool testVar(T, U...)(T orig, size_t pos, U args)
{
static if (is(T == typeof(T.init.dup)))
auto a = orig.dup;
else
auto a = orig.idup;
auto result = args[$-1];
a.insertInPlace(pos, args[0..$-1]);
if (!equal(a, result))
return false;
return true;
}
assert(testVar([1, 2, 3, 4], 0, 6, 7u, [6, 7, 1, 2, 3, 4]));
assert(testVar([1L, 2, 3, 4], 2, 8, 9L, [1, 2, 8, 9, 3, 4]));
assert(testVar([1L, 2, 3, 4], 4, 10L, 11, [1, 2, 3, 4, 10, 11]));
assert(testVar([1L, 2, 3, 4], 4, [10, 11], 40L, 42L,
[1, 2, 3, 4, 10, 11, 40, 42]));
assert(testVar([1L, 2, 3, 4], 4, 10, 11, [40L, 42],
[1, 2, 3, 4, 10, 11, 40, 42]));
assert(testVar("t".idup, 1, 'e', 's', 't', "test"));
assert(testVar("!!"w.idup, 1, "\u00e9ll\u00f4", 'x', "TTT"w, 'y',
"!\u00e9ll\u00f4xTTTy!"));
assert(testVar("flipflop"d.idup, 4, '_',
"xyz"w, '\U00010143', '_', "abc"d, "__",
"flip_xyz\U00010143_abc__flop"));
}
@system unittest
{
import std.algorithm.comparison : equal;
// insertInPlace interop with postblit
static struct Int
{
int* payload;
this(int k)
{
payload = new int;
*payload = k;
}
this(this)
{
int* np = new int;
*np = *payload;
payload = np;
}
~this()
{
if (payload)
*payload = 0; //'destroy' it
}
@property int getPayload(){ return *payload; }
alias getPayload this;
}
Int[] arr = [Int(1), Int(4), Int(5)];
assert(arr[0] == 1);
insertInPlace(arr, 1, Int(2), Int(3));
assert(equal(arr, [1, 2, 3, 4, 5])); //check it works with postblit
version (none) // illustrates that insertInPlace() will not work with CTFE and postblit
{
static bool testctfe()
{
Int[] arr = [Int(1), Int(4), Int(5)];
assert(arr[0] == 1);
insertInPlace(arr, 1, Int(2), Int(3));
return equal(arr, [1, 2, 3, 4, 5]); //check it works with postblit
}
enum E = testctfe();
}
}
@safe unittest
{
import std.exception;
assertCTFEable!(
{
int[] a = [1, 2];
a.insertInPlace(2, 3);
a.insertInPlace(0, -1, 0);
return a == [-1, 0, 1, 2, 3];
});
}
@system unittest // bugzilla 6874
{
import core.memory;
// allocate some space
byte[] a;
a.length = 1;
// fill it
a.length = a.capacity;
// write beyond
byte[] b = a[$ .. $];
b.insertInPlace(0, a);
// make sure that reallocation has happened
assert(GC.addrOf(&b[0]) == GC.addrOf(&b[$-1]));
}
/++
Returns whether the $(D front)s of $(D lhs) and $(D rhs) both refer to the
same place in memory, making one of the arrays a slice of the other which
starts at index $(D 0).
+/
@safe
pure nothrow bool sameHead(T)(in T[] lhs, in T[] rhs)
{
return lhs.ptr == rhs.ptr;
}
///
@safe pure nothrow unittest
{
auto a = [1, 2, 3, 4, 5];
auto b = a[0 .. 2];
assert(a.sameHead(b));
}
/++
Returns whether the $(D back)s of $(D lhs) and $(D rhs) both refer to the
same place in memory, making one of the arrays a slice of the other which
end at index $(D $).
+/
@trusted
pure nothrow bool sameTail(T)(in T[] lhs, in T[] rhs)
{
return lhs.ptr + lhs.length == rhs.ptr + rhs.length;
}
///
@safe pure nothrow unittest
{
auto a = [1, 2, 3, 4, 5];
auto b = a[3..$];
assert(a.sameTail(b));
}
@safe pure nothrow unittest
{
foreach (T; AliasSeq!(int[], const(int)[], immutable(int)[], const int[], immutable int[]))
{
T a = [1, 2, 3, 4, 5];
T b = a;
T c = a[1 .. $];
T d = a[0 .. 1];
T e = null;
assert(sameHead(a, a));
assert(sameHead(a, b));
assert(!sameHead(a, c));
assert(sameHead(a, d));
assert(!sameHead(a, e));
assert(sameTail(a, a));
assert(sameTail(a, b));
assert(sameTail(a, c));
assert(!sameTail(a, d));
assert(!sameTail(a, e));
//verifies R-value compatibilty
assert(a.sameHead(a[0 .. 0]));
assert(a.sameTail(a[$ .. $]));
}
}
/********************************************
Returns an array that consists of $(D s) (which must be an input
range) repeated $(D n) times. This function allocates, fills, and
returns a new array. For a lazy version, refer to $(REF repeat, std,range).
*/
ElementEncodingType!S[] replicate(S)(S s, size_t n)
if (isDynamicArray!S)
{
alias RetType = ElementEncodingType!S[];
// Optimization for return join(std.range.repeat(s, n));
if (n == 0)
return RetType.init;
if (n == 1)
return cast(RetType) s;
auto r = new Unqual!(typeof(s[0]))[n * s.length];
if (s.length == 1)
r[] = s[0];
else
{
immutable len = s.length, nlen = n * len;
for (size_t i = 0; i < nlen; i += len)
{
r[i .. i + len] = s[];
}
}
return r;
}
/// ditto
ElementType!S[] replicate(S)(S s, size_t n)
if (isInputRange!S && !isDynamicArray!S)
{
import std.range : repeat;
return join(std.range.repeat(s, n));
}
///
@safe unittest
{
auto a = "abc";
auto s = replicate(a, 3);
assert(s == "abcabcabc");
auto b = [1, 2, 3];
auto c = replicate(b, 3);
assert(c == [1, 2, 3, 1, 2, 3, 1, 2, 3]);
auto d = replicate(b, 0);
assert(d == []);
}
@safe unittest
{
import std.conv : to;
debug(std_array) printf("array.replicate.unittest\n");
foreach (S; AliasSeq!(string, wstring, dstring, char[], wchar[], dchar[]))
{
S s;
immutable S t = "abc";
assert(replicate(to!S("1234"), 0) is null);
assert(replicate(to!S("1234"), 0) is null);
assert(replicate(to!S("1234"), 1) == "1234");
assert(replicate(to!S("1234"), 2) == "12341234");
assert(replicate(to!S("1"), 4) == "1111");
assert(replicate(t, 3) == "abcabcabc");
assert(replicate(cast(S) null, 4) is null);
}
}
/++
Eagerly split the string $(D s) into an array of words, using whitespace as
delimiter. Runs of whitespace are merged together (no empty words are produced).
$(D @safe), $(D pure) and $(D CTFE)-able.
See_Also:
$(REF splitter, std,algorithm,iteration) for a version that splits using any
separator.
$(REF splitter, std,regex) for a version that splits using a regular
expression defined separator.
+/
S[] split(S)(S s) @safe pure
if (isSomeString!S)
{
size_t istart;
bool inword = false;
S[] result;
foreach (i, dchar c ; s)
{
import std.uni : isWhite;
if (isWhite(c))
{
if (inword)
{
result ~= s[istart .. i];
inword = false;
}
}
else
{
if (!inword)
{
istart = i;
inword = true;
}
}
}
if (inword)
result ~= s[istart .. $];
return result;
}
@safe unittest
{
import std.conv : to;
import std.format;
import std.typecons;
static auto makeEntry(S)(string l, string[] r)
{return tuple(l.to!S(), r.to!(S[])());}
foreach (S; AliasSeq!(string, wstring, dstring,))
{
auto entries =
[
makeEntry!S("", []),
makeEntry!S(" ", []),
makeEntry!S("hello", ["hello"]),
makeEntry!S(" hello ", ["hello"]),
makeEntry!S(" h e l l o ", ["h", "e", "l", "l", "o"]),
makeEntry!S("peter\t\npaul\rjerry", ["peter", "paul", "jerry"]),
makeEntry!S(" \t\npeter paul\tjerry \n", ["peter", "paul", "jerry"]),
makeEntry!S("\u2000日\u202F本\u205F語\u3000", ["日", "本", "語"]),
makeEntry!S(" 哈・郎博尔德} ___一个", ["哈・郎博尔德}", "___一个"])
];
foreach (entry; entries)
assert(entry[0].split() == entry[1], format("got: %s, expected: %s.", entry[0].split(), entry[1]));
}
//Just to test that an immutable is split-able
immutable string s = " \t\npeter paul\tjerry \n";
assert(split(s) == ["peter", "paul", "jerry"]);
}
@safe unittest //purity, ctfe ...
{
import std.exception;
void dg() @safe pure {
assert(split("hello world"c) == ["hello"c, "world"c]);
assert(split("hello world"w) == ["hello"w, "world"w]);
assert(split("hello world"d) == ["hello"d, "world"d]);
}
dg();
assertCTFEable!dg;
}
///
@safe unittest
{
assert(split("hello world") == ["hello","world"]);
assert(split("192.168.0.1", ".") == ["192", "168", "0", "1"]);
auto a = split([1, 2, 3, 4, 5, 1, 2, 3, 4, 5], [2, 3]);
assert(a == [[1], [4, 5, 1], [4, 5]]);
}
// Explicitly undocumented. It will be removed in January 2018. @@@DEPRECATED_2018-01@@@
deprecated("Please use std.algorithm.iteration.splitter instead.")
alias splitter = std.algorithm.iteration.splitter;
/++
Eagerly splits $(D range) into an array, using $(D sep) as the delimiter.
The _range must be a
$(REF_ALTTEXT forward _range, isForwardRange, std,_range,primitives).
The separator can be a value of the same type as the elements in $(D range)
or it can be another forward _range.
Example:
If $(D range) is a $(D string), $(D sep) can be a $(D char) or another
$(D string). The return type will be an array of strings. If $(D range) is
an $(D int) array, $(D sep) can be an $(D int) or another $(D int) array.
The return type will be an array of $(D int) arrays.
Params:
range = a forward _range.
sep = a value of the same type as the elements of $(D range) or another
forward range.
Returns:
An array containing the divided parts of $(D range).
See_Also:
$(REF splitter, std,algorithm,iteration) for the lazy version of this
function.
+/
auto split(Range, Separator)(Range range, Separator sep)
if (isForwardRange!Range && is(typeof(ElementType!Range.init == Separator.init)))
{
import std.algorithm.iteration : splitter;
return range.splitter(sep).array;
}
///ditto
auto split(Range, Separator)(Range range, Separator sep)
if (
isForwardRange!Range && isForwardRange!Separator
&& is(typeof(ElementType!Range.init == ElementType!Separator.init)))
{
import std.algorithm.iteration : splitter;
return range.splitter(sep).array;
}
///ditto
auto split(alias isTerminator, Range)(Range range)
if (isForwardRange!Range && is(typeof(unaryFun!isTerminator(range.front))))
{
import std.algorithm.iteration : splitter;
return range.splitter!isTerminator.array;
}
@safe unittest
{
import std.conv;
import std.algorithm.comparison : cmp;
debug(std_array) printf("array.split\n");
foreach (S; AliasSeq!(string, wstring, dstring,
immutable(string), immutable(wstring), immutable(dstring),
char[], wchar[], dchar[],
const(char)[], const(wchar)[], const(dchar)[],
const(char[]), immutable(char[])))
{
S s = to!S(",peter,paul,jerry,");
auto words = split(s, ",");
assert(words.length == 5, text(words.length));
assert(cmp(words[0], "") == 0);
assert(cmp(words[1], "peter") == 0);
assert(cmp(words[2], "paul") == 0);
assert(cmp(words[3], "jerry") == 0);
assert(cmp(words[4], "") == 0);
auto s1 = s[0 .. s.length - 1]; // lop off trailing ','
words = split(s1, ",");
assert(words.length == 4);
assert(cmp(words[3], "jerry") == 0);
auto s2 = s1[1 .. s1.length]; // lop off leading ','
words = split(s2, ",");
assert(words.length == 3);
assert(cmp(words[0], "peter") == 0);
auto s3 = to!S(",,peter,,paul,,jerry,,");
words = split(s3, ",,");
assert(words.length == 5);
assert(cmp(words[0], "") == 0);
assert(cmp(words[1], "peter") == 0);
assert(cmp(words[2], "paul") == 0);
assert(cmp(words[3], "jerry") == 0);
assert(cmp(words[4], "") == 0);
auto s4 = s3[0 .. s3.length - 2]; // lop off trailing ',,'
words = split(s4, ",,");
assert(words.length == 4);
assert(cmp(words[3], "jerry") == 0);
auto s5 = s4[2 .. s4.length]; // lop off leading ',,'
words = split(s5, ",,");
assert(words.length == 3);
assert(cmp(words[0], "peter") == 0);
}
}
/++
Conservative heuristic to determine if a range can be iterated cheaply.
Used by $(D join) in decision to do an extra iteration of the range to
compute the resultant length. If iteration is not cheap then precomputing
length could be more expensive than using $(D Appender).
For now, we only assume arrays are cheap to iterate.
+/
private enum bool hasCheapIteration(R) = isArray!R;
/++
Eagerly concatenates all of the ranges in `ror` together (with the GC)
into one array using `sep` as the separator if present.
Params:
ror = An $(REF_ALTTEXT input range, isInputRange, std,range,primitives)
of input ranges
sep = An input range, or a single element, to join the ranges on
Returns:
An array of elements
See_Also:
For a lazy version, see $(REF joiner, std,algorithm,iteration)
+/
ElementEncodingType!(ElementType!RoR)[] join(RoR, R)(RoR ror, scope R sep)
if (isInputRange!RoR &&
isInputRange!(Unqual!(ElementType!RoR)) &&
isInputRange!R &&
is(Unqual!(ElementType!(ElementType!RoR)) == Unqual!(ElementType!R)))
{
alias RetType = typeof(return);
alias RetTypeElement = Unqual!(ElementEncodingType!RetType);
alias RoRElem = ElementType!RoR;
if (ror.empty)
return RetType.init;
// Constraint only requires input range for sep.
// This converts sep to an array (forward range) if it isn't one,
// and makes sure it has the same string encoding for string types.
static if (isSomeString!RetType &&
!is(RetTypeElement == Unqual!(ElementEncodingType!R)))
{
import std.conv : to;
auto sepArr = to!RetType(sep);
}
else static if (!isArray!R)
auto sepArr = array(sep);
else
alias sepArr = sep;
static if (hasCheapIteration!RoR && (hasLength!RoRElem || isNarrowString!RoRElem))
{
import std.conv : emplaceRef;
size_t length; // length of result array
size_t rorLength; // length of range ror
foreach (r; ror.save)
{
length += r.length;
++rorLength;
}
if (!rorLength)
return null;
length += (rorLength - 1) * sepArr.length;
auto result = (() @trusted => uninitializedArray!(RetTypeElement[])(length))();
size_t len;
foreach (e; ror.front)
emplaceRef(result[len++], e);
ror.popFront();
foreach (r; ror)
{
foreach (e; sepArr)
emplaceRef(result[len++], e);
foreach (e; r)
emplaceRef(result[len++], e);
}
assert(len == result.length);
return (() @trusted => cast(RetType) result)();
}
else
{
auto result = appender!RetType();
put(result, ror.front);
ror.popFront();
for (; !ror.empty; ror.popFront())
{
put(result, sep);
put(result, ror.front);
}
return result.data;
}
}
@safe unittest // Issue 14230
{
string[] ary = ["","aa","bb","cc"]; // leaded by _empty_ element
assert(ary.join(" @") == " @aa @bb @cc"); // OK in 2.067b1 and olders
}
/// Ditto
ElementEncodingType!(ElementType!RoR)[] join(RoR, E)(RoR ror, scope E sep)
if (isInputRange!RoR &&
isInputRange!(Unqual!(ElementType!RoR)) &&
is(E : ElementType!(ElementType!RoR)))
{
alias RetType = typeof(return);
alias RetTypeElement = Unqual!(ElementEncodingType!RetType);
alias RoRElem = ElementType!RoR;
if (ror.empty)
return RetType.init;
static if (hasCheapIteration!RoR && (hasLength!RoRElem || isNarrowString!RoRElem))
{
static if (isSomeChar!E && isSomeChar!RetTypeElement && E.sizeof > RetTypeElement.sizeof)
{
import std.utf : encode;
RetTypeElement[4 / RetTypeElement.sizeof] encodeSpace;
immutable size_t sepArrLength = encode(encodeSpace, sep);
return join(ror, encodeSpace[0 .. sepArrLength]);
}
else
{
import std.conv : emplaceRef;
size_t length;
size_t rorLength;
foreach (r; ror.save)
{
length += r.length;
++rorLength;
}
if (!rorLength)
return null;
length += rorLength - 1;
auto result = uninitializedArray!(RetTypeElement[])(length);
size_t len;
foreach (e; ror.front)
emplaceRef(result[len++], e);
ror.popFront();
foreach (r; ror)
{
emplaceRef(result[len++], sep);
foreach (e; r)
emplaceRef(result[len++], e);
}
assert(len == result.length);
return (() @trusted => cast(RetType) result)();
}
}
else
{
auto result = appender!RetType();
put(result, ror.front);
ror.popFront();
for (; !ror.empty; ror.popFront())
{
put(result, sep);
put(result, ror.front);
}
return result.data;
}
}
@safe unittest // Issue 10895
{
class A
{
string name;
alias name this;
this(string name) { this.name = name; }
}
auto a = [new A(`foo`)];
assert(a[0].length == 3);
auto temp = join(a, " ");
assert(a[0].length == 3);
}
@safe unittest // Issue 14230
{
string[] ary = ["","aa","bb","cc"];
assert(ary.join('@') == "@aa@bb@cc");
}
/// Ditto
ElementEncodingType!(ElementType!RoR)[] join(RoR)(RoR ror)
if (isInputRange!RoR &&
isInputRange!(Unqual!(ElementType!RoR)))
{
alias RetType = typeof(return);
alias RetTypeElement = Unqual!(ElementEncodingType!RetType);
alias RoRElem = ElementType!RoR;
if (ror.empty)
return RetType.init;
static if (hasCheapIteration!RoR && (hasLength!RoRElem || isNarrowString!RoRElem))
{
import std.conv : emplaceRef;
size_t length;
foreach (r; ror.save)
length += r.length;
auto result = (() @trusted => uninitializedArray!(RetTypeElement[])(length))();
size_t len;
foreach (r; ror)
foreach (e; r)
emplaceRef(result[len++], e);
assert(len == result.length);
return (() @trusted => cast(RetType) result)();
}
else
{
auto result = appender!RetType();
for (; !ror.empty; ror.popFront())
put(result, ror.front);
return result.data;
}
}
///
@safe pure nothrow unittest
{
assert(join(["hello", "silly", "world"], " ") == "hello silly world");
assert(join(["hello", "silly", "world"]) == "hellosillyworld");
assert(join([[1, 2, 3], [4, 5]], [72, 73]) == [1, 2, 3, 72, 73, 4, 5]);
assert(join([[1, 2, 3], [4, 5]]) == [1, 2, 3, 4, 5]);
const string[] arr = ["apple", "banana"];
assert(arr.join(",") == "apple,banana");
assert(arr.join() == "applebanana");
}
@safe pure unittest
{
import std.conv : to;
foreach (T; AliasSeq!(string,wstring,dstring))
{
auto arr2 = "Здравствуй Мир Unicode".to!(T);
auto arr = ["Здравствуй", "Мир", "Unicode"].to!(T[]);
assert(join(arr) == "ЗдравствуйМирUnicode");
foreach (S; AliasSeq!(char,wchar,dchar))
{
auto jarr = arr.join(to!S(' '));
static assert(is(typeof(jarr) == T));
assert(jarr == arr2);
}
foreach (S; AliasSeq!(string,wstring,dstring))
{
auto jarr = arr.join(to!S(" "));
static assert(is(typeof(jarr) == T));
assert(jarr == arr2);
}
}
foreach (T; AliasSeq!(string,wstring,dstring))
{
auto arr2 = "Здравствуй\u047CМир\u047CUnicode".to!(T);
auto arr = ["Здравствуй", "Мир", "Unicode"].to!(T[]);
foreach (S; AliasSeq!(wchar,dchar))
{
auto jarr = arr.join(to!S('\u047C'));
static assert(is(typeof(jarr) == T));
assert(jarr == arr2);
}
}
const string[] arr = ["apple", "banana"];
assert(arr.join(',') == "apple,banana");
}
@system unittest
{
import std.conv : to;
import std.algorithm;
import std.range;
debug(std_array) printf("array.join.unittest\n");
foreach (R; AliasSeq!(string, wstring, dstring))
{
R word1 = "日本語";
R word2 = "paul";
R word3 = "jerry";
R[] words = [word1, word2, word3];
auto filteredWord1 = filter!"true"(word1);
auto filteredLenWord1 = takeExactly(filteredWord1, word1.walkLength());
auto filteredWord2 = filter!"true"(word2);
auto filteredLenWord2 = takeExactly(filteredWord2, word2.walkLength());
auto filteredWord3 = filter!"true"(word3);
auto filteredLenWord3 = takeExactly(filteredWord3, word3.walkLength());
auto filteredWordsArr = [filteredWord1, filteredWord2, filteredWord3];
auto filteredLenWordsArr = [filteredLenWord1, filteredLenWord2, filteredLenWord3];
auto filteredWords = filter!"true"(filteredWordsArr);
foreach (S; AliasSeq!(string, wstring, dstring))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
assert(join(filteredWords, to!S(", ")) == "日本語, paul, jerry");
assert(join(filteredWords, to!(ElementType!S)(',')) == "日本語,paul,jerry");
assert(join(filteredWordsArr, to!(ElementType!(S))(',')) == "日本語,paul,jerry");
assert(join(filteredWordsArr, to!S(", ")) == "日本語, paul, jerry");
assert(join(filteredWordsArr, to!(ElementType!(S))(',')) == "日本語,paul,jerry");
assert(join(filteredLenWordsArr, to!S(", ")) == "日本語, paul, jerry");
assert(join(filter!"true"(words), to!S(", ")) == "日本語, paul, jerry");
assert(join(words, to!S(", ")) == "日本語, paul, jerry");
assert(join(filteredWords, to!S("")) == "日本語pauljerry");
assert(join(filteredWordsArr, to!S("")) == "日本語pauljerry");
assert(join(filteredLenWordsArr, to!S("")) == "日本語pauljerry");
assert(join(filter!"true"(words), to!S("")) == "日本語pauljerry");
assert(join(words, to!S("")) == "日本語pauljerry");
assert(join(filter!"true"([word1]), to!S(", ")) == "日本語");
assert(join([filteredWord1], to!S(", ")) == "日本語");
assert(join([filteredLenWord1], to!S(", ")) == "日本語");
assert(join(filter!"true"([filteredWord1]), to!S(", ")) == "日本語");
assert(join([word1], to!S(", ")) == "日本語");
assert(join(filteredWords, to!S(word1)) == "日本語日本語paul日本語jerry");
assert(join(filteredWordsArr, to!S(word1)) == "日本語日本語paul日本語jerry");
assert(join(filteredLenWordsArr, to!S(word1)) == "日本語日本語paul日本語jerry");
assert(join(filter!"true"(words), to!S(word1)) == "日本語日本語paul日本語jerry");
assert(join(words, to!S(word1)) == "日本語日本語paul日本語jerry");
auto filterComma = filter!"true"(to!S(", "));
assert(join(filteredWords, filterComma) == "日本語, paul, jerry");
assert(join(filteredWordsArr, filterComma) == "日本語, paul, jerry");
assert(join(filteredLenWordsArr, filterComma) == "日本語, paul, jerry");
assert(join(filter!"true"(words), filterComma) == "日本語, paul, jerry");
assert(join(words, filterComma) == "日本語, paul, jerry");
}();
assert(join(filteredWords) == "日本語pauljerry");
assert(join(filteredWordsArr) == "日本語pauljerry");
assert(join(filteredLenWordsArr) == "日本語pauljerry");
assert(join(filter!"true"(words)) == "日本語pauljerry");
assert(join(words) == "日本語pauljerry");
assert(join(filteredWords, filter!"true"(", ")) == "日本語, paul, jerry");
assert(join(filteredWordsArr, filter!"true"(", ")) == "日本語, paul, jerry");
assert(join(filteredLenWordsArr, filter!"true"(", ")) == "日本語, paul, jerry");
assert(join(filter!"true"(words), filter!"true"(", ")) == "日本語, paul, jerry");
assert(join(words, filter!"true"(", ")) == "日本語, paul, jerry");
assert(join(filter!"true"(cast(typeof(filteredWordsArr))[]), ", ").empty);
assert(join(cast(typeof(filteredWordsArr))[], ", ").empty);
assert(join(cast(typeof(filteredLenWordsArr))[], ", ").empty);
assert(join(filter!"true"(cast(R[])[]), ", ").empty);
assert(join(cast(R[])[], ", ").empty);
assert(join(filter!"true"(cast(typeof(filteredWordsArr))[])).empty);
assert(join(cast(typeof(filteredWordsArr))[]).empty);
assert(join(cast(typeof(filteredLenWordsArr))[]).empty);
assert(join(filter!"true"(cast(R[])[])).empty);
assert(join(cast(R[])[]).empty);
}
assert(join([[1, 2], [41, 42]], [5, 6]) == [1, 2, 5, 6, 41, 42]);
assert(join([[1, 2], [41, 42]], cast(int[])[]) == [1, 2, 41, 42]);
assert(join([[1, 2]], [5, 6]) == [1, 2]);
assert(join(cast(int[][])[], [5, 6]).empty);
assert(join([[1, 2], [41, 42]]) == [1, 2, 41, 42]);
assert(join(cast(int[][])[]).empty);
alias f = filter!"true";
assert(join([[1, 2], [41, 42]], [5, 6]) == [1, 2, 5, 6, 41, 42]);
assert(join(f([[1, 2], [41, 42]]), [5, 6]) == [1, 2, 5, 6, 41, 42]);
assert(join([f([1, 2]), f([41, 42])], [5, 6]) == [1, 2, 5, 6, 41, 42]);
assert(join(f([f([1, 2]), f([41, 42])]), [5, 6]) == [1, 2, 5, 6, 41, 42]);
assert(join([[1, 2], [41, 42]], f([5, 6])) == [1, 2, 5, 6, 41, 42]);
assert(join(f([[1, 2], [41, 42]]), f([5, 6])) == [1, 2, 5, 6, 41, 42]);
assert(join([f([1, 2]), f([41, 42])], f([5, 6])) == [1, 2, 5, 6, 41, 42]);
assert(join(f([f([1, 2]), f([41, 42])]), f([5, 6])) == [1, 2, 5, 6, 41, 42]);
}
// Issue 10683
@safe unittest
{
import std.range : join;
import std.typecons : tuple;
assert([[tuple(1)]].join == [tuple(1)]);
assert([[tuple("x")]].join == [tuple("x")]);
}
// Issue 13877
@safe unittest
{
// Test that the range is iterated only once.
import std.algorithm.iteration : map;
int c = 0;
auto j1 = [1, 2, 3].map!(_ => [c++]).join;
assert(c == 3);
assert(j1 == [0, 1, 2]);
c = 0;
auto j2 = [1, 2, 3].map!(_ => [c++]).join(9);
assert(c == 3);
assert(j2 == [0, 9, 1, 9, 2]);
c = 0;
auto j3 = [1, 2, 3].map!(_ => [c++]).join([9]);
assert(c == 3);
assert(j3 == [0, 9, 1, 9, 2]);
}
/++
Replace occurrences of $(D from) with $(D to) in $(D subject). Returns a new
array without changing the contents of $(D subject), or the original array
if no match is found.
+/
E[] replace(E, R1, R2)(E[] subject, R1 from, R2 to)
if (isDynamicArray!(E[]) && isForwardRange!R1 && isForwardRange!R2
&& (hasLength!R2 || isSomeString!R2))
{
import std.algorithm.searching : find;
if (from.empty) return subject;
auto balance = find(subject, from.save);
if (balance.empty)
return subject;
auto app = appender!(E[])();
app.put(subject[0 .. subject.length - balance.length]);
app.put(to.save);
replaceInto(app, balance[from.length .. $], from, to);
return app.data;
}
///
@safe unittest
{
assert("Hello Wörld".replace("o Wö", "o Wo") == "Hello World");
assert("Hello Wörld".replace("l", "h") == "Hehho Wörhd");
}
/++
Same as above, but outputs the result via OutputRange $(D sink).
If no match is found the original array is transferred to $(D sink) as is.
+/
void replaceInto(E, Sink, R1, R2)(Sink sink, E[] subject, R1 from, R2 to)
if (isOutputRange!(Sink, E) && isDynamicArray!(E[])
&& isForwardRange!R1 && isForwardRange!R2
&& (hasLength!R2 || isSomeString!R2))
{
import std.algorithm.searching : find;
if (from.empty)
{
sink.put(subject);
return;
}
for (;;)
{
auto balance = find(subject, from.save);
if (balance.empty)
{
sink.put(subject);
break;
}
sink.put(subject[0 .. subject.length - balance.length]);
sink.put(to.save);
subject = balance[from.length .. $];
}
}
///
@safe unittest
{
auto arr = [1, 2, 3, 4, 5];
auto from = [2, 3];
auto to = [4, 6];
auto sink = appender!(int[])();
replaceInto(sink, arr, from, to);
assert(sink.data == [1, 4, 6, 4, 5]);
}
@safe unittest
{
import std.conv : to;
import std.algorithm.comparison : cmp;
debug(std_array) printf("array.replace.unittest\n");
foreach (S; AliasSeq!(string, wstring, dstring, char[], wchar[], dchar[]))
{
foreach (T; AliasSeq!(string, wstring, dstring, char[], wchar[], dchar[]))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
auto s = to!S("This is a foo foo list");
auto from = to!T("foo");
auto into = to!S("silly");
S r;
int i;
r = replace(s, from, into);
i = cmp(r, "This is a silly silly list");
assert(i == 0);
r = replace(s, to!S(""), into);
i = cmp(r, "This is a foo foo list");
assert(i == 0);
assert(replace(r, to!S("won't find this"), to!S("whatever")) is r);
}();
}
immutable s = "This is a foo foo list";
assert(replace(s, "foo", "silly") == "This is a silly silly list");
}
@safe unittest
{
import std.conv : to;
import std.algorithm.searching : skipOver;
struct CheckOutput(C)
{
C[] desired;
this(C[] arr){ desired = arr; }
void put(C[] part){ assert(skipOver(desired, part)); }
}
foreach (S; AliasSeq!(string, wstring, dstring, char[], wchar[], dchar[]))
{
alias Char = ElementEncodingType!S;
S s = to!S("yet another dummy text, yet another ...");
S from = to!S("yet another");
S into = to!S("some");
replaceInto(CheckOutput!(Char)(to!S("some dummy text, some ..."))
, s, from, into);
}
}
/++
Replaces elements from $(D array) with indices ranging from $(D from)
(inclusive) to $(D to) (exclusive) with the range $(D stuff). Returns a new
array without changing the contents of $(D subject).
+/
T[] replace(T, Range)(T[] subject, size_t from, size_t to, Range stuff)
if (isInputRange!Range &&
(is(ElementType!Range : T) ||
isSomeString!(T[]) && is(ElementType!Range : dchar)))
{
static if (hasLength!Range && is(ElementEncodingType!Range : T))
{
import std.algorithm.mutation : copy;
assert(from <= to);
immutable sliceLen = to - from;
auto retval = new Unqual!(T)[](subject.length - sliceLen + stuff.length);
retval[0 .. from] = subject[0 .. from];
if (!stuff.empty)
copy(stuff, retval[from .. from + stuff.length]);
retval[from + stuff.length .. $] = subject[to .. $];
return cast(T[]) retval;
}
else
{
auto app = appender!(T[])();
app.put(subject[0 .. from]);
app.put(stuff);
app.put(subject[to .. $]);
return app.data;
}
}
///
@safe unittest
{
auto a = [ 1, 2, 3, 4 ];
auto b = a.replace(1, 3, [ 9, 9, 9 ]);
assert(a == [ 1, 2, 3, 4 ]);
assert(b == [ 1, 9, 9, 9, 4 ]);
}
@system unittest
{
import core.exception;
import std.conv : to;
import std.exception;
import std.algorithm.iteration : filter;
auto a = [ 1, 2, 3, 4 ];
assert(replace(a, 0, 0, [5, 6, 7]) == [5, 6, 7, 1, 2, 3, 4]);
assert(replace(a, 0, 2, cast(int[])[]) == [3, 4]);
assert(replace(a, 0, 4, [5, 6, 7]) == [5, 6, 7]);
assert(replace(a, 0, 2, [5, 6, 7]) == [5, 6, 7, 3, 4]);
assert(replace(a, 2, 4, [5, 6, 7]) == [1, 2, 5, 6, 7]);
assert(replace(a, 0, 0, filter!"true"([5, 6, 7])) == [5, 6, 7, 1, 2, 3, 4]);
assert(replace(a, 0, 2, filter!"true"(cast(int[])[])) == [3, 4]);
assert(replace(a, 0, 4, filter!"true"([5, 6, 7])) == [5, 6, 7]);
assert(replace(a, 0, 2, filter!"true"([5, 6, 7])) == [5, 6, 7, 3, 4]);
assert(replace(a, 2, 4, filter!"true"([5, 6, 7])) == [1, 2, 5, 6, 7]);
assert(a == [ 1, 2, 3, 4 ]);
void testStr(T, U)(string file = __FILE__, size_t line = __LINE__)
{
auto l = to!T("hello");
auto r = to!U(" world");
enforce(replace(l, 0, 0, r) == " worldhello",
new AssertError("testStr failure 1", file, line));
enforce(replace(l, 0, 3, r) == " worldlo",
new AssertError("testStr failure 2", file, line));
enforce(replace(l, 3, l.length, r) == "hel world",
new AssertError("testStr failure 3", file, line));
enforce(replace(l, 0, l.length, r) == " world",
new AssertError("testStr failure 4", file, line));
enforce(replace(l, l.length, l.length, r) == "hello world",
new AssertError("testStr failure 5", file, line));
}
testStr!(string, string)();
testStr!(string, wstring)();
testStr!(string, dstring)();
testStr!(wstring, string)();
testStr!(wstring, wstring)();
testStr!(wstring, dstring)();
testStr!(dstring, string)();
testStr!(dstring, wstring)();
testStr!(dstring, dstring)();
enum s = "0123456789";
enum w = "⁰¹²³⁴⁵⁶⁷⁸⁹"w;
enum d = "⁰¹²³⁴⁵⁶⁷⁸⁹"d;
assert(replace(s, 0, 0, "***") == "***0123456789");
assert(replace(s, 10, 10, "***") == "0123456789***");
assert(replace(s, 3, 8, "1012") == "012101289");
assert(replace(s, 0, 5, "43210") == "4321056789");
assert(replace(s, 5, 10, "43210") == "0123443210");
assert(replace(w, 0, 0, "***"w) == "***⁰¹²³⁴⁵⁶⁷⁸⁹"w);
assert(replace(w, 10, 10, "***"w) == "⁰¹²³⁴⁵⁶⁷⁸⁹***"w);
assert(replace(w, 3, 8, "¹⁰¹²"w) == "⁰¹²¹⁰¹²⁸⁹"w);
assert(replace(w, 0, 5, "⁴³²¹⁰"w) == "⁴³²¹⁰⁵⁶⁷⁸⁹"w);
assert(replace(w, 5, 10, "⁴³²¹⁰"w) == "⁰¹²³⁴⁴³²¹⁰"w);
assert(replace(d, 0, 0, "***"d) == "***⁰¹²³⁴⁵⁶⁷⁸⁹"d);
assert(replace(d, 10, 10, "***"d) == "⁰¹²³⁴⁵⁶⁷⁸⁹***"d);
assert(replace(d, 3, 8, "¹⁰¹²"d) == "⁰¹²¹⁰¹²⁸⁹"d);
assert(replace(d, 0, 5, "⁴³²¹⁰"d) == "⁴³²¹⁰⁵⁶⁷⁸⁹"d);
assert(replace(d, 5, 10, "⁴³²¹⁰"d) == "⁰¹²³⁴⁴³²¹⁰"d);
}
/++
Replaces elements from $(D array) with indices ranging from $(D from)
(inclusive) to $(D to) (exclusive) with the range $(D stuff). Expands or
shrinks the array as needed.
+/
void replaceInPlace(T, Range)(ref T[] array, size_t from, size_t to, Range stuff)
if (is(typeof(replace(array, from, to, stuff))))
{
static if (isDynamicArray!Range &&
is(Unqual!(ElementEncodingType!Range) == T) &&
!isNarrowString!(T[]))
{
// optimized for homogeneous arrays that can be overwritten.
import std.algorithm.mutation : remove;
import std.typecons : tuple;
if (overlap(array, stuff).length)
{
// use slower/conservative method
array = array[0 .. from] ~ stuff ~ array[to .. $];
}
else if (stuff.length <= to - from)
{
// replacement reduces length
immutable stuffEnd = from + stuff.length;
array[from .. stuffEnd] = stuff[];
if (stuffEnd < to)
array = remove(array, tuple(stuffEnd, to));
}
else
{
// replacement increases length
// @@@TODO@@@: optimize this
immutable replaceLen = to - from;
array[from .. to] = stuff[0 .. replaceLen];
insertInPlace(array, to, stuff[replaceLen .. $]);
}
}
else
{
// default implementation, just do what replace does.
array = replace(array, from, to, stuff);
}
}
///
@safe unittest
{
int[] a = [1, 4, 5];
replaceInPlace(a, 1u, 2u, [2, 3, 4]);
assert(a == [1, 2, 3, 4, 5]);
replaceInPlace(a, 1u, 2u, cast(int[])[]);
assert(a == [1, 3, 4, 5]);
replaceInPlace(a, 1u, 3u, a[2 .. 4]);
assert(a == [1, 4, 5, 5]);
}
@safe unittest
{
// Bug# 12889
int[1][] arr = [[0], [1], [2], [3], [4], [5], [6]];
int[1][] stuff = [[0], [1]];
replaceInPlace(arr, 4, 6, stuff);
assert(arr == [[0], [1], [2], [3], [0], [1], [6]]);
}
@system unittest
{
// Bug# 14925
char[] a = "mon texte 1".dup;
char[] b = "abc".dup;
replaceInPlace(a, 4, 9, b);
assert(a == "mon abc 1");
// ensure we can replace in place with different encodings
string unicoded = "\U00010437";
string unicodedLong = "\U00010437aaaaa";
string base = "abcXXXxyz";
string result = "abc\U00010437xyz";
string resultLong = "abc\U00010437aaaaaxyz";
size_t repstart = 3;
size_t repend = 3 + 3;
void testStringReplaceInPlace(T, U)()
{
import std.conv;
import std.algorithm.comparison : equal;
auto a = unicoded.to!(U[]);
auto b = unicodedLong.to!(U[]);
auto test = base.to!(T[]);
test.replaceInPlace(repstart, repend, a);
assert(equal(test, result), "Failed for types " ~ T.stringof ~ " and " ~ U.stringof);
test = base.to!(T[]);
test.replaceInPlace(repstart, repend, b);
assert(equal(test, resultLong), "Failed for types " ~ T.stringof ~ " and " ~ U.stringof);
}
import std.meta : AliasSeq;
alias allChars = AliasSeq!(char, immutable(char), const(char),
wchar, immutable(wchar), const(wchar),
dchar, immutable(dchar), const(dchar));
foreach (T; allChars)
foreach (U; allChars)
testStringReplaceInPlace!(T, U)();
void testInout(inout(int)[] a)
{
// will be transferred to the 'replace' function
replaceInPlace(a, 1, 2, [1,2,3]);
}
}
@safe unittest
{
// the constraint for the first overload used to match this, which wouldn't compile.
import std.algorithm.comparison : equal;
long[] a = [1L, 2, 3];
int[] b = [4, 5, 6];
a.replaceInPlace(1, 2, b);
assert(equal(a, [1L, 4, 5, 6, 3]));
}
@system unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : filter;
import core.exception;
import std.conv : to;
import std.exception;
bool test(T, U, V)(T orig, size_t from, size_t to, U toReplace, V result,
string file = __FILE__, size_t line = __LINE__)
{
{
static if (is(T == typeof(T.init.dup)))
auto a = orig.dup;
else
auto a = orig.idup;
a.replaceInPlace(from, to, toReplace);
if (!equal(a, result))
return false;
}
static if (isInputRange!U)
{
orig.replaceInPlace(from, to, filter!"true"(toReplace));
return equal(orig, result);
}
else
return true;
}
assert(test([1, 2, 3, 4], 0, 0, [5, 6, 7], [5, 6, 7, 1, 2, 3, 4]));
assert(test([1, 2, 3, 4], 0, 2, cast(int[])[], [3, 4]));
assert(test([1, 2, 3, 4], 0, 4, [5, 6, 7], [5, 6, 7]));
assert(test([1, 2, 3, 4], 0, 2, [5, 6, 7], [5, 6, 7, 3, 4]));
assert(test([1, 2, 3, 4], 2, 4, [5, 6, 7], [1, 2, 5, 6, 7]));
assert(test([1, 2, 3, 4], 0, 0, filter!"true"([5, 6, 7]), [5, 6, 7, 1, 2, 3, 4]));
assert(test([1, 2, 3, 4], 0, 2, filter!"true"(cast(int[])[]), [3, 4]));
assert(test([1, 2, 3, 4], 0, 4, filter!"true"([5, 6, 7]), [5, 6, 7]));
assert(test([1, 2, 3, 4], 0, 2, filter!"true"([5, 6, 7]), [5, 6, 7, 3, 4]));
assert(test([1, 2, 3, 4], 2, 4, filter!"true"([5, 6, 7]), [1, 2, 5, 6, 7]));
void testStr(T, U)(string file = __FILE__, size_t line = __LINE__)
{
auto l = to!T("hello");
auto r = to!U(" world");
enforce(test(l, 0, 0, r, " worldhello"),
new AssertError("testStr failure 1", file, line));
enforce(test(l, 0, 3, r, " worldlo"),
new AssertError("testStr failure 2", file, line));
enforce(test(l, 3, l.length, r, "hel world"),
new AssertError("testStr failure 3", file, line));
enforce(test(l, 0, l.length, r, " world"),
new AssertError("testStr failure 4", file, line));
enforce(test(l, l.length, l.length, r, "hello world"),
new AssertError("testStr failure 5", file, line));
}
testStr!(string, string)();
testStr!(string, wstring)();
testStr!(string, dstring)();
testStr!(wstring, string)();
testStr!(wstring, wstring)();
testStr!(wstring, dstring)();
testStr!(dstring, string)();
testStr!(dstring, wstring)();
testStr!(dstring, dstring)();
}
/++
Replaces the first occurrence of $(D from) with $(D to) in $(D a). Returns a
new array without changing the contents of $(D subject), or the original
array if no match is found.
+/
E[] replaceFirst(E, R1, R2)(E[] subject, R1 from, R2 to)
if (isDynamicArray!(E[]) &&
isForwardRange!R1 && is(typeof(appender!(E[])().put(from[0 .. 1]))) &&
isForwardRange!R2 && is(typeof(appender!(E[])().put(to[0 .. 1]))))
{
if (from.empty) return subject;
static if (isSomeString!(E[]))
{
import std.string : indexOf;
immutable idx = subject.indexOf(from);
}
else
{
import std.algorithm.searching : countUntil;
immutable idx = subject.countUntil(from);
}
if (idx == -1)
return subject;
auto app = appender!(E[])();
app.put(subject[0 .. idx]);
app.put(to);
static if (isSomeString!(E[]) && isSomeString!R1)
{
import std.utf : codeLength;
immutable fromLength = codeLength!(Unqual!E, R1)(from);
}
else
immutable fromLength = from.length;
app.put(subject[idx + fromLength .. $]);
return app.data;
}
///
@safe unittest
{
auto a = [1, 2, 2, 3, 4, 5];
auto b = a.replaceFirst([2], [1337]);
assert(b == [1, 1337, 2, 3, 4, 5]);
auto s = "This is a foo foo list";
auto r = s.replaceFirst("foo", "silly");
assert(r == "This is a silly foo list");
}
@safe unittest
{
import std.conv : to;
import std.algorithm.comparison : cmp;
debug(std_array) printf("array.replaceFirst.unittest\n");
foreach (S; AliasSeq!(string, wstring, dstring, char[], wchar[], dchar[],
const(char[]), immutable(char[])))
{
foreach (T; AliasSeq!(string, wstring, dstring, char[], wchar[], dchar[],
const(char[]), immutable(char[])))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
auto s = to!S("This is a foo foo list");
auto s2 = to!S("Thüs is a ßöö foo list");
auto from = to!T("foo");
auto from2 = to!T("ßöö");
auto into = to!T("silly");
auto into2 = to!T("sälly");
S r1 = replaceFirst(s, from, into);
assert(cmp(r1, "This is a silly foo list") == 0);
S r11 = replaceFirst(s2, from2, into2);
assert(cmp(r11, "Thüs is a sälly foo list") == 0,
to!string(r11) ~ " : " ~ S.stringof ~ " " ~ T.stringof);
S r2 = replaceFirst(r1, from, into);
assert(cmp(r2, "This is a silly silly list") == 0);
S r3 = replaceFirst(s, to!T(""), into);
assert(cmp(r3, "This is a foo foo list") == 0);
assert(replaceFirst(r3, to!T("won't find"), to!T("whatever")) is r3);
}();
}
}
//Bug# 8187
@safe unittest
{
auto res = ["a", "a"];
assert(replace(res, "a", "b") == ["b", "b"]);
assert(replaceFirst(res, "a", "b") == ["b", "a"]);
}
/++
Replaces the last occurrence of $(D from) with $(D to) in $(D a). Returns a
new array without changing the contents of $(D subject), or the original
array if no match is found.
+/
E[] replaceLast(E, R1, R2)(E[] subject, R1 from , R2 to)
if (isDynamicArray!(E[]) &&
isForwardRange!R1 && is(typeof(appender!(E[])().put(from[0 .. 1]))) &&
isForwardRange!R2 && is(typeof(appender!(E[])().put(to[0 .. 1]))))
{
import std.range : retro;
if (from.empty) return subject;
static if (isSomeString!(E[]))
{
import std.string : lastIndexOf;
auto idx = subject.lastIndexOf(from);
}
else
{
import std.algorithm.searching : countUntil;
auto idx = retro(subject).countUntil(retro(from));
}
if (idx == -1)
return subject;
static if (isSomeString!(E[]) && isSomeString!R1)
{
import std.utf : codeLength;
auto fromLength = codeLength!(Unqual!E, R1)(from);
}
else
auto fromLength = from.length;
auto app = appender!(E[])();
static if (isSomeString!(E[]))
app.put(subject[0 .. idx]);
else
app.put(subject[0 .. $ - idx - fromLength]);
app.put(to);
static if (isSomeString!(E[]))
app.put(subject[idx+fromLength .. $]);
else
app.put(subject[$ - idx .. $]);
return app.data;
}
///
@safe unittest
{
auto a = [1, 2, 2, 3, 4, 5];
auto b = a.replaceLast([2], [1337]);
assert(b == [1, 2, 1337, 3, 4, 5]);
auto s = "This is a foo foo list";
auto r = s.replaceLast("foo", "silly");
assert(r == "This is a foo silly list", r);
}
@safe unittest
{
import std.conv : to;
import std.algorithm.comparison : cmp;
debug(std_array) printf("array.replaceLast.unittest\n");
foreach (S; AliasSeq!(string, wstring, dstring, char[], wchar[], dchar[],
const(char[]), immutable(char[])))
{
foreach (T; AliasSeq!(string, wstring, dstring, char[], wchar[], dchar[],
const(char[]), immutable(char[])))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
auto s = to!S("This is a foo foo list");
auto s2 = to!S("Thüs is a ßöö ßöö list");
auto from = to!T("foo");
auto from2 = to!T("ßöö");
auto into = to!T("silly");
auto into2 = to!T("sälly");
S r1 = replaceLast(s, from, into);
assert(cmp(r1, "This is a foo silly list") == 0, to!string(r1));
S r11 = replaceLast(s2, from2, into2);
assert(cmp(r11, "Thüs is a ßöö sälly list") == 0,
to!string(r11) ~ " : " ~ S.stringof ~ " " ~ T.stringof);
S r2 = replaceLast(r1, from, into);
assert(cmp(r2, "This is a silly silly list") == 0);
S r3 = replaceLast(s, to!T(""), into);
assert(cmp(r3, "This is a foo foo list") == 0);
assert(replaceLast(r3, to!T("won't find"), to!T("whatever")) is r3);
}();
}
}
/++
Returns a new array that is $(D s) with $(D slice) replaced by
$(D replacement[]).
+/
inout(T)[] replaceSlice(T)(inout(T)[] s, in T[] slice, in T[] replacement)
in
{
// Verify that slice[] really is a slice of s[]
assert(overlap(s, slice) is slice);
}
body
{
auto result = new T[s.length - slice.length + replacement.length];
immutable so = slice.ptr - s.ptr;
result[0 .. so] = s[0 .. so];
result[so .. so + replacement.length] = replacement[];
result[so + replacement.length .. result.length] =
s[so + slice.length .. s.length];
return cast(inout(T)[]) result;
}
///
@system unittest
{
auto a = [1, 2, 3, 4, 5];
auto b = replaceSlice(a, a[1 .. 4], [0, 0, 0]);
assert(b == [1, 0, 0, 0, 5]);
}
@system unittest
{
import std.algorithm.comparison : cmp;
debug(std_array) printf("array.replaceSlice.unittest\n");
string s = "hello";
string slice = s[2 .. 4];
auto r = replaceSlice(s, slice, "bar");
int i;
i = cmp(r, "hebaro");
assert(i == 0);
}
/**
Implements an output range that appends data to an array. This is
recommended over $(D array ~= data) when appending many elements because it is more
efficient. `Appender` maintains its own array metadata locally, so it can avoid
global locking for each append where $(LREF capacity) is non-zero.
See_Also: $(LREF appender)
*/
struct Appender(A)
if (isDynamicArray!A)
{
import core.memory : GC;
private alias T = ElementEncodingType!A;
private struct Data
{
size_t capacity;
Unqual!T[] arr;
bool canExtend = false;
}
private Data* _data;
/**
* Constructs an `Appender` with a given array. Note that this does not copy the
* data. If the array has a larger capacity as determined by `arr.capacity`,
* it will be used by the appender. After initializing an appender on an array,
* appending to the original array will reallocate.
*/
this(A arr) @trusted pure nothrow
{
// initialize to a given array.
_data = new Data;
_data.arr = cast(Unqual!T[]) arr; //trusted
if (__ctfe)
return;
// We want to use up as much of the block the array is in as possible.
// if we consume all the block that we can, then array appending is
// safe WRT built-in append, and we can use the entire block.
// We only do this for mutable types that can be extended.
static if (isMutable!T && is(typeof(arr.length = size_t.max)))
{
immutable cap = arr.capacity; //trusted
// Replace with "GC.setAttr( Not Appendable )" once pure (and fixed)
if (cap > arr.length)
arr.length = cap;
}
_data.capacity = arr.length;
}
/**
* Reserve at least newCapacity elements for appending. Note that more elements
* may be reserved than requested. If `newCapacity <= capacity`, then nothing is
* done.
*/
void reserve(size_t newCapacity) @safe pure nothrow
{
if (_data)
{
if (newCapacity > _data.capacity)
ensureAddable(newCapacity - _data.arr.length);
}
else
{
ensureAddable(newCapacity);
}
}
/**
* Returns the capacity of the array (the maximum number of elements the
* managed array can accommodate before triggering a reallocation). If any
* appending will reallocate, $(D capacity) returns $(D 0).
*/
@property size_t capacity() const @safe pure nothrow
{
return _data ? _data.capacity : 0;
}
/**
* Returns the managed array.
*/
@property inout(ElementEncodingType!A)[] data() inout @trusted pure nothrow
{
/* @trusted operation:
* casting Unqual!T[] to inout(T)[]
*/
return cast(typeof(return))(_data ? _data.arr : null);
}
// ensure we can add nelems elements, resizing as necessary
private void ensureAddable(size_t nelems) @trusted pure nothrow
{
if (!_data)
_data = new Data;
immutable len = _data.arr.length;
immutable reqlen = len + nelems;
if (_data.capacity >= reqlen)
return;
// need to increase capacity
if (__ctfe)
{
static if (__traits(compiles, new Unqual!T[1]))
{
_data.arr.length = reqlen;
}
else
{
// avoid restriction of @disable this()
_data.arr = _data.arr[0 .. _data.capacity];
foreach (i; _data.capacity .. reqlen)
_data.arr ~= Unqual!T.init;
}
_data.arr = _data.arr[0 .. len];
_data.capacity = reqlen;
}
else
{
// Time to reallocate.
// We need to almost duplicate what's in druntime, except we
// have better access to the capacity field.
auto newlen = appenderNewCapacity!(T.sizeof)(_data.capacity, reqlen);
// first, try extending the current block
if (_data.canExtend)
{
immutable u = GC.extend(_data.arr.ptr, nelems * T.sizeof, (newlen - len) * T.sizeof);
if (u)
{
// extend worked, update the capacity
_data.capacity = u / T.sizeof;
return;
}
}
// didn't work, must reallocate
import core.checkedint : mulu;
bool overflow;
const nbytes = mulu(newlen, T.sizeof, overflow);
if (overflow) assert(0);
auto bi = GC.qalloc(nbytes, blockAttribute!T);
_data.capacity = bi.size / T.sizeof;
import core.stdc.string : memcpy;
if (len)
memcpy(bi.base, _data.arr.ptr, len * T.sizeof);
_data.arr = (cast(Unqual!T*) bi.base)[0 .. len];
_data.canExtend = true;
// leave the old data, for safety reasons
}
}
private template canPutItem(U)
{
enum bool canPutItem =
isImplicitlyConvertible!(U, T) ||
isSomeChar!T && isSomeChar!U;
}
private template canPutConstRange(Range)
{
enum bool canPutConstRange =
isInputRange!(Unqual!Range) &&
!isInputRange!Range;
}
private template canPutRange(Range)
{
enum bool canPutRange =
isInputRange!Range &&
is(typeof(Appender.init.put(Range.init.front)));
}
/**
* Appends `item` to the managed array.
*/
void put(U)(U item) if (canPutItem!U)
{
static if (isSomeChar!T && isSomeChar!U && T.sizeof < U.sizeof)
{
/* may throwable operation:
* - std.utf.encode
*/
// must do some transcoding around here
import std.utf : encode;
Unqual!T[T.sizeof == 1 ? 4 : 2] encoded;
auto len = encode(encoded, item);
put(encoded[0 .. len]);
}
else
{
import std.conv : emplaceRef;
ensureAddable(1);
immutable len = _data.arr.length;
auto bigData = (() @trusted => _data.arr.ptr[0 .. len + 1])();
emplaceRef!(Unqual!T)(bigData[len], cast(Unqual!T) item);
//We do this at the end, in case of exceptions
_data.arr = bigData;
}
}
// Const fixing hack.
void put(Range)(Range items) if (canPutConstRange!Range)
{
alias p = put!(Unqual!Range);
p(items);
}
/**
* Appends an entire range to the managed array.
*/
void put(Range)(Range items) if (canPutRange!Range)
{
// note, we disable this branch for appending one type of char to
// another because we can't trust the length portion.
static if (!(isSomeChar!T && isSomeChar!(ElementType!Range) &&
!is(immutable Range == immutable T[])) &&
is(typeof(items.length) == size_t))
{
// optimization -- if this type is something other than a string,
// and we are adding exactly one element, call the version for one
// element.
static if (!isSomeChar!T)
{
if (items.length == 1)
{
put(items.front);
return;
}
}
// make sure we have enough space, then add the items
@trusted auto bigDataFun(size_t extra)
{
ensureAddable(extra);
return _data.arr.ptr[0 .. _data.arr.length + extra];
}
auto bigData = bigDataFun(items.length);
immutable len = _data.arr.length;
immutable newlen = bigData.length;
alias UT = Unqual!T;
static if (is(typeof(_data.arr[] = items[])) &&
!hasElaborateAssign!UT && isAssignable!(UT, ElementEncodingType!Range))
{
bigData[len .. newlen] = items[];
}
else
{
import std.conv : emplaceRef;
foreach (ref it ; bigData[len .. newlen])
{
emplaceRef!T(it, items.front);
items.popFront();
}
}
//We do this at the end, in case of exceptions
_data.arr = bigData;
}
else
{
//pragma(msg, Range.stringof);
// Generic input range
for (; !items.empty; items.popFront())
{
put(items.front);
}
}
}
/**
* Appends `rhs` to the managed array.
* Params:
* rhs = Element or range.
*/
void opOpAssign(string op : "~", U)(U rhs)
if (__traits(compiles, put(rhs)))
{
put(rhs);
}
// only allow overwriting data on non-immutable and non-const data
static if (isMutable!T)
{
/**
* Clears the managed array. This allows the elements of the array to be reused
* for appending.
*
* Note: clear is disabled for immutable or const element types, due to the
* possibility that $(D Appender) might overwrite immutable data.
*/
void clear() @trusted pure nothrow
{
if (_data)
{
_data.arr = _data.arr.ptr[0 .. 0];
}
}
/**
* Shrinks the managed array to the given length.
*
* Throws: $(D Exception) if newlength is greater than the current array length.
* Note: shrinkTo is disabled for immutable or const element types.
*/
void shrinkTo(size_t newlength) @trusted pure
{
import std.exception : enforce;
if (_data)
{
enforce(newlength <= _data.arr.length, "Attempting to shrink Appender with newlength > length");
_data.arr = _data.arr.ptr[0 .. newlength];
}
else
enforce(newlength == 0, "Attempting to shrink empty Appender with non-zero newlength");
}
}
void toString(Writer)(scope Writer w)
{
import std.format : formattedWrite;
w.formattedWrite(typeof(this).stringof ~ "(%s)", data);
}
}
///
@safe unittest
{
auto app = appender!string();
string b = "abcdefg";
foreach (char c; b)
app.put(c);
assert(app.data == "abcdefg");
int[] a = [ 1, 2 ];
auto app2 = appender(a);
app2.put(3);
app2.put([ 4, 5, 6 ]);
assert(app2.data == [ 1, 2, 3, 4, 5, 6 ]);
}
@safe unittest
{
import std.format : format;
auto app = appender!(int[])();
app.put(1);
app.put(2);
app.put(3);
assert("%s".format(app) == "Appender!(int[])(%s)".format([1,2,3]));
}
//Calculates an efficient growth scheme based on the old capacity
//of data, and the minimum requested capacity.
//arg curLen: The current length
//arg reqLen: The length as requested by the user
//ret sugLen: A suggested growth.
private size_t appenderNewCapacity(size_t TSizeOf)(size_t curLen, size_t reqLen) @safe pure nothrow
{
import core.bitop : bsr;
import std.algorithm.comparison : max;
if (curLen == 0)
return max(reqLen,8);
ulong mult = 100 + (1000UL) / (bsr(curLen * TSizeOf) + 1);
// limit to doubling the length, we don't want to grow too much
if (mult > 200)
mult = 200;
auto sugLen = cast(size_t)((curLen * mult + 99) / 100);
return max(reqLen, sugLen);
}
/**
* A version of $(LREF Appender) that can update an array in-place.
* It forwards all calls to an underlying appender implementation.
* Any calls made to the appender also update the pointer to the
* original array passed in.
*
* Tip: Use the `arrayPtr` overload of $(LREF appender) for construction with type-inference.
*/
struct RefAppender(A)
if (isDynamicArray!A)
{
private
{
Appender!A impl;
A* arr;
}
/**
* Constructs a `RefAppender` with a given array reference. This does not copy the
* data. If the array has a larger capacity as determined by `arr.capacity`, it
* will be used by the appender.
*
* Note: Do not use built-in appending (i.e. `~=`) on the original array
* until you are done with the appender, because subsequent calls to the appender
* will reallocate the array data without those appends.
*
* Params:
* arr = Pointer to an array. Must not be _null.
*/
this(A* arr)
{
impl = Appender!A(*arr);
this.arr = arr;
}
/** Wraps remaining `Appender` methods such as $(LREF put).
* Params:
* fn = Method name to call.
* args = Arguments to pass to the method.
*/
void opDispatch(string fn, Args...)(Args args)
if (__traits(compiles, (Appender!A a) => mixin("a." ~ fn ~ "(args)")))
{
// we do it this way because we can't cache a void return
scope(exit) *this.arr = impl.data;
mixin("return impl." ~ fn ~ "(args);");
}
/**
* Appends `rhs` to the managed array.
* Params:
* rhs = Element or range.
*/
void opOpAssign(string op : "~", U)(U rhs)
if (__traits(compiles, (Appender!A a){ a.put(rhs); }))
{
scope(exit) *this.arr = impl.data;
impl.put(rhs);
}
/**
* Returns the capacity of the array (the maximum number of elements the
* managed array can accommodate before triggering a reallocation). If any
* appending will reallocate, $(D capacity) returns $(D 0).
*/
@property size_t capacity() const
{
return impl.capacity;
}
/**
* Returns the managed array.
*/
@property inout(ElementEncodingType!A)[] data() inout
{
return impl.data;
}
}
/++
Convenience function that returns an $(LREF Appender) instance,
optionally initialized with $(D array).
+/
Appender!A appender(A)()
if (isDynamicArray!A)
{
return Appender!A(null);
}
/// ditto
Appender!(E[]) appender(A : E[], E)(auto ref A array)
{
static assert(!isStaticArray!A || __traits(isRef, array),
"Cannot create Appender from an rvalue static array");
return Appender!(E[])(array);
}
@safe pure nothrow unittest
{
import std.exception;
{
auto app = appender!(char[])();
string b = "abcdefg";
foreach (char c; b) app.put(c);
assert(app.data == "abcdefg");
}
{
auto app = appender!(char[])();
string b = "abcdefg";
foreach (char c; b) app ~= c;
assert(app.data == "abcdefg");
}
{
int[] a = [ 1, 2 ];
auto app2 = appender(a);
assert(app2.data == [ 1, 2 ]);
app2.put(3);
app2.put([ 4, 5, 6 ][]);
assert(app2.data == [ 1, 2, 3, 4, 5, 6 ]);
app2.put([ 7 ]);
assert(app2.data == [ 1, 2, 3, 4, 5, 6, 7 ]);
}
int[] a = [ 1, 2 ];
auto app2 = appender(a);
assert(app2.data == [ 1, 2 ]);
app2 ~= 3;
app2 ~= [ 4, 5, 6 ][];
assert(app2.data == [ 1, 2, 3, 4, 5, 6 ]);
app2 ~= [ 7 ];
assert(app2.data == [ 1, 2, 3, 4, 5, 6, 7 ]);
app2.reserve(5);
assert(app2.capacity >= 5);
try // shrinkTo may throw
{
app2.shrinkTo(3);
}
catch (Exception) assert(0);
assert(app2.data == [ 1, 2, 3 ]);
assertThrown(app2.shrinkTo(5));
const app3 = app2;
assert(app3.capacity >= 3);
assert(app3.data == [1, 2, 3]);
auto app4 = appender([]);
try // shrinkTo may throw
{
app4.shrinkTo(0);
}
catch (Exception) assert(0);
// Issue 5663 & 9725 tests
foreach (S; AliasSeq!(char[], const(char)[], string))
{
{
Appender!S app5663i;
assertNotThrown(app5663i.put("\xE3"));
assert(app5663i.data == "\xE3");
Appender!S app5663c;
assertNotThrown(app5663c.put(cast(const(char)[])"\xE3"));
assert(app5663c.data == "\xE3");
Appender!S app5663m;
assertNotThrown(app5663m.put("\xE3".dup));
assert(app5663m.data == "\xE3");
}
// ditto for ~=
{
Appender!S app5663i;
assertNotThrown(app5663i ~= "\xE3");
assert(app5663i.data == "\xE3");
Appender!S app5663c;
assertNotThrown(app5663c ~= cast(const(char)[])"\xE3");
assert(app5663c.data == "\xE3");
Appender!S app5663m;
assertNotThrown(app5663m ~= "\xE3".dup);
assert(app5663m.data == "\xE3");
}
}
static struct S10122
{
int val;
@disable this();
this(int v) @safe pure nothrow { val = v; }
}
assertCTFEable!(
{
auto w = appender!(S10122[])();
w.put(S10122(1));
assert(w.data.length == 1 && w.data[0].val == 1);
});
}
@safe pure nothrow unittest
{
{
auto w = appender!string();
w.reserve(4);
cast(void) w.capacity;
cast(void) w.data;
try
{
wchar wc = 'a';
dchar dc = 'a';
w.put(wc); // decoding may throw
w.put(dc); // decoding may throw
}
catch (Exception) assert(0);
}
{
auto w = appender!(int[])();
w.reserve(4);
cast(void) w.capacity;
cast(void) w.data;
w.put(10);
w.put([10]);
w.clear();
try
{
w.shrinkTo(0);
}
catch (Exception) assert(0);
struct N
{
int payload;
alias payload this;
}
w.put(N(1));
w.put([N(2)]);
struct S(T)
{
@property bool empty() { return true; }
@property T front() { return T.init; }
void popFront() {}
}
S!int r;
w.put(r);
}
}
@safe unittest
{
import std.typecons;
import std.algorithm;
//10690
[tuple(1)].filter!(t => true).array; // No error
[tuple("A")].filter!(t => true).array; // error
}
@system unittest
{
import std.range;
//Coverage for put(Range)
struct S1
{
}
struct S2
{
void opAssign(S2){}
}
auto a1 = Appender!(S1[])();
auto a2 = Appender!(S2[])();
auto au1 = Appender!(const(S1)[])();
auto au2 = Appender!(const(S2)[])();
a1.put(S1().repeat().take(10));
a2.put(S2().repeat().take(10));
auto sc1 = const(S1)();
auto sc2 = const(S2)();
au1.put(sc1.repeat().take(10));
au2.put(sc2.repeat().take(10));
}
@system unittest
{
struct S
{
int* p;
}
auto a0 = Appender!(S[])();
auto a1 = Appender!(const(S)[])();
auto a2 = Appender!(immutable(S)[])();
auto s0 = S(null);
auto s1 = const(S)(null);
auto s2 = immutable(S)(null);
a1.put(s0);
a1.put(s1);
a1.put(s2);
a1.put([s0]);
a1.put([s1]);
a1.put([s2]);
a0.put(s0);
static assert(!is(typeof(a0.put(a1))));
static assert(!is(typeof(a0.put(a2))));
a0.put([s0]);
static assert(!is(typeof(a0.put([a1]))));
static assert(!is(typeof(a0.put([a2]))));
static assert(!is(typeof(a2.put(a0))));
static assert(!is(typeof(a2.put(a1))));
a2.put(s2);
static assert(!is(typeof(a2.put([a0]))));
static assert(!is(typeof(a2.put([a1]))));
a2.put([s2]);
}
@safe unittest
{
//9528
const(E)[] fastCopy(E)(E[] src) {
auto app = appender!(const(E)[])();
foreach (i, e; src)
app.put(e);
return app.data;
}
class C {}
struct S { const(C) c; }
S[] s = [ S(new C) ];
auto t = fastCopy(s); // Does not compile
}
@safe unittest
{
import std.algorithm.iteration : map;
//10753
struct Foo {
immutable dchar d;
}
struct Bar {
immutable int x;
}
"12".map!Foo.array;
[1, 2].map!Bar.array;
}
@safe unittest
{
//New appender signature tests
alias mutARR = int[];
alias conARR = const(int)[];
alias immARR = immutable(int)[];
mutARR mut;
conARR con;
immARR imm;
{auto app = Appender!mutARR(mut);} //Always worked. Should work. Should not create a warning.
static assert(!is(typeof(Appender!mutARR(con)))); //Never worked. Should not work.
static assert(!is(typeof(Appender!mutARR(imm)))); //Never worked. Should not work.
{auto app = Appender!conARR(mut);} //Always worked. Should work. Should not create a warning.
{auto app = Appender!conARR(con);} //Didn't work. Now works. Should not create a warning.
{auto app = Appender!conARR(imm);} //Didn't work. Now works. Should not create a warning.
//{auto app = Appender!immARR(mut);} //Worked. Will cease to work. Creates warning.
//static assert(!is(typeof(Appender!immARR(mut)))); //Worked. Will cease to work. Uncomment me after full deprecation.
static assert(!is(typeof(Appender!immARR(con)))); //Never worked. Should not work.
{auto app = Appender!immARR(imm);} //Didn't work. Now works. Should not create a warning.
//Deprecated. Please uncomment and make sure this doesn't work:
//char[] cc;
//static assert(!is(typeof(Appender!string(cc))));
//This should always work:
{auto app = appender!string(null);}
{auto app = appender!(const(char)[])(null);}
{auto app = appender!(char[])(null);}
}
@safe unittest //Test large allocations (for GC.extend)
{
import std.range;
import std.algorithm.comparison : equal;
Appender!(char[]) app;
app.reserve(1); //cover reserve on non-initialized
foreach (_; 0 .. 100_000)
app.put('a');
assert(equal(app.data, 'a'.repeat(100_000)));
}
@safe unittest
{
auto reference = new ubyte[](2048 + 1); //a number big enough to have a full page (EG: the GC extends)
auto arr = reference.dup;
auto app = appender(arr[0 .. 0]);
app.reserve(1); //This should not trigger a call to extend
app.put(ubyte(1)); //Don't clobber arr
assert(reference[] == arr[]);
}
@safe unittest // clear method is supported only for mutable element types
{
Appender!string app;
static assert(!__traits(compiles, app.clear()));
}
@safe unittest
{
static struct D//dynamic
{
int[] i;
alias i this;
}
static struct S//static
{
int[5] i;
alias i this;
}
static assert(!is(Appender!(char[5])));
static assert(!is(Appender!D));
static assert(!is(Appender!S));
enum int[5] a = [];
int[5] b;
D d;
S s;
int[5] foo(){return a;}
static assert(!is(typeof(appender(a))));
static assert( is(typeof(appender(b))));
static assert( is(typeof(appender(d))));
static assert( is(typeof(appender(s))));
static assert(!is(typeof(appender(foo()))));
}
@system unittest
{
// Issue 13077
static class A {}
// reduced case
auto w = appender!(shared(A)[])();
w.put(new shared A());
// original case
import std.range;
InputRange!(shared A) foo()
{
return [new shared A].inputRangeObject;
}
auto res = foo.array;
}
/++
Convenience function that returns a $(LREF RefAppender) instance initialized
with `arrayPtr`. Don't use null for the array pointer, use the other
version of $(D appender) instead.
+/
RefAppender!(E[]) appender(P : E[]*, E)(P arrayPtr)
{
return RefAppender!(E[])(arrayPtr);
}
@system unittest
{
import std.exception;
{
auto arr = new char[0];
auto app = appender(&arr);
string b = "abcdefg";
foreach (char c; b) app.put(c);
assert(app.data == "abcdefg");
assert(arr == "abcdefg");
}
{
auto arr = new char[0];
auto app = appender(&arr);
string b = "abcdefg";
foreach (char c; b) app ~= c;
assert(app.data == "abcdefg");
assert(arr == "abcdefg");
}
{
int[] a = [ 1, 2 ];
auto app2 = appender(&a);
assert(app2.data == [ 1, 2 ]);
assert(a == [ 1, 2 ]);
app2.put(3);
app2.put([ 4, 5, 6 ][]);
assert(app2.data == [ 1, 2, 3, 4, 5, 6 ]);
assert(a == [ 1, 2, 3, 4, 5, 6 ]);
}
int[] a = [ 1, 2 ];
auto app2 = appender(&a);
assert(app2.data == [ 1, 2 ]);
assert(a == [ 1, 2 ]);
app2 ~= 3;
app2 ~= [ 4, 5, 6 ][];
assert(app2.data == [ 1, 2, 3, 4, 5, 6 ]);
assert(a == [ 1, 2, 3, 4, 5, 6 ]);
app2.reserve(5);
assert(app2.capacity >= 5);
try // shrinkTo may throw
{
app2.shrinkTo(3);
}
catch (Exception) assert(0);
assert(app2.data == [ 1, 2, 3 ]);
assertThrown(app2.shrinkTo(5));
const app3 = app2;
assert(app3.capacity >= 3);
assert(app3.data == [1, 2, 3]);
}
@safe unittest // issue 14605
{
static assert(isOutputRange!(Appender!(int[]), int));
static assert(isOutputRange!(RefAppender!(int[]), int));
}
@safe unittest
{
Appender!(int[]) app;
short[] range = [1, 2, 3];
app.put(range);
assert(app.data == [1, 2, 3]);
}
@safe unittest
{
string s = "hello".idup;
char[] a = "hello".dup;
auto appS = appender(s);
auto appA = appender(a);
put(appS, 'w');
put(appA, 'w');
s ~= 'a'; //Clobbers here?
a ~= 'a'; //Clobbers here?
assert(appS.data == "hellow");
assert(appA.data == "hellow");
}
|
D
|
// Written in the D programming language.
/**
<script type="text/javascript">inhibitQuickIndex = 1</script>
$(BOOKTABLE ,
$(TR $(TH Category) $(TH Functions)
)
$(TR $(TDNW High level) $(TD $(MYREF download) $(MYREF upload) $(MYREF get)
$(MYREF post) $(MYREF put) $(MYREF del) $(MYREF options) $(MYREF trace)
$(MYREF connect) $(MYREF byLine) $(MYREF byChunk)
$(MYREF byLineAsync) $(MYREF byChunkAsync) )
)
$(TR $(TDNW Low level) $(TD $(MYREF HTTP) $(MYREF FTP) $(MYREF
SMTP) )
)
)
Networking client functionality as provided by $(WEB _curl.haxx.se/libcurl,
libcurl). The libcurl library must be installed on the system in order to use
this module.
Compared to using libcurl directly this module allows simpler client code for
common uses, requires no unsafe operations, and integrates better with the rest
of the language. Futhermore it provides <a href="std_range.html">$(D range)</a>
access to protocols supported by libcurl both synchronously and asynchronously.
A high level and a low level API are available. The high level API is built
entirely on top of the low level one.
The high level API is for commonly used functionality such as HTTP/FTP get. The
$(LREF byLineAsync) and $(LREF byChunkAsync) provides asynchronous <a
href="std_range.html">$(D ranges)</a> that performs the request in another
thread while handling a line/chunk in the current thread.
The low level API allows for streaming and other advanced features.
$(BOOKTABLE Cheat Sheet,
$(TR $(TH Function Name) $(TH Description)
)
$(LEADINGROW High level)
$(TR $(TDNW $(LREF download)) $(TD $(D
download("ftp.digitalmars.com/sieve.ds", "/tmp/downloaded-ftp-file"))
downloads file from URL to file system.)
)
$(TR $(TDNW $(LREF upload)) $(TD $(D
upload("/tmp/downloaded-ftp-file", "ftp.digitalmars.com/sieve.ds");)
uploads file from file system to URL.)
)
$(TR $(TDNW $(LREF get)) $(TD $(D
get("dlang.org")) returns a string containing the dlang.org web page.)
)
$(TR $(TDNW $(LREF put)) $(TD $(D
put("dlang.org", "Hi")) returns a string containing
the dlang.org web page. after a HTTP PUT of "hi")
)
$(TR $(TDNW $(LREF post)) $(TD $(D
post("dlang.org", "Hi")) returns a string containing
the dlang.org web page. after a HTTP POST of "hi")
)
$(TR $(TDNW $(LREF byLine)) $(TD $(D
byLine("dlang.org")) returns a range of strings containing the
dlang.org web page.)
)
$(TR $(TDNW $(LREF byChunk)) $(TD $(D
byChunk("dlang.org", 10)) returns a range of ubyte[10] containing the
dlang.org web page.)
)
$(TR $(TDNW $(LREF byLineAsync)) $(TD $(D
byLineAsync("dlang.org")) returns a range of strings containing the dlang.org web
page asynchronously.)
)
$(TR $(TDNW $(LREF byChunkAsync)) $(TD $(D
byChunkAsync("dlang.org", 10)) returns a range of ubyte[10] containing the
dlang.org web page asynchronously.)
)
$(LEADINGROW Low level
)
$(TR $(TDNW $(LREF HTTP)) $(TD $(D HTTP) struct for advanced usage))
$(TR $(TDNW $(LREF FTP)) $(TD $(D FTP) struct for advanced usage))
$(TR $(TDNW $(LREF SMTP)) $(TD $(D SMTP) struct for advanced usage))
)
Example:
---
import std.net.curl, std.stdio;
// Return a string containing the content specified by an URL
string content = get("dlang.org");
// Post data and return a string containing the content specified by an URL
string content = post("mydomain.com/here.cgi", "post data");
// Get content of file from ftp server
string content = get("ftp.digitalmars.com/sieve.ds");
// Post and print out content line by line. The request is done in another thread.
foreach (line; byLineAsync("dlang.org", "Post data"))
writeln(line);
// Get using a line range and proxy settings
auto client = HTTP();
client.proxy = "1.2.3.4";
foreach (line; byLine("dlang.org", client))
writeln(line);
---
For more control than the high level functions provide, use the low level API:
Example:
---
import std.net.curl, std.stdio;
// GET with custom data receivers
auto http = HTTP("dlang.org");
http.onReceiveHeader =
(in char[] key, in char[] value) { writeln(key, ": ", value); };
http.onReceive = (ubyte[] data) { /+ drop +/ return data.length; };
http.perform();
---
First, an instance of the reference-counted HTTP struct is created. Then the
custom delegates are set. These will be called whenever the HTTP instance
receives a header and a data buffer, respectively. In this simple example, the
headers are writting to stdout and the data is ignored. If the request should be
stopped before it has finished then return something less than data.length from
the onReceive callback. See $(LREF onReceiveHeader)/$(LREF onReceive) for more
information. Finally the HTTP request is effected by calling perform(), which is
synchronous.
Macros:
MYREF = <font face='Consolas, "Bitstream Vera Sans Mono", "Andale Mono", Monaco, "DejaVu Sans Mono", "Lucida Console", monospace'><a href="#$1">$1</a> </font>
Source: $(PHOBOSSRC std/net/_curl.d)
Copyright: Copyright Jonas Drewsen 2011-2012
License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
Authors: Jonas Drewsen. Some of the SMTP code contributed by Jimmy Cao.
Credits: The functionally is based on $(WEB _curl.haxx.se/libcurl, libcurl).
LibCurl is licensed under an MIT/X derivate license.
*/
/*
Copyright Jonas Drewsen 2011 - 2012.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
module std.net.curl;
import core.thread;
import etc.c.curl;
import std.algorithm;
import std.array;
import std.concurrency;
import std.conv;
import std.datetime;
import std.encoding;
import std.exception;
import std.regex;
import std.socket : InternetAddress;
import std.stream;
import std.string;
import std.traits;
import std.typecons;
import std.typetuple;
version(unittest)
{
// Run unit test with the PHOBOS_TEST_ALLOW_NET=1 set in order to
// allow net traffic
import std.stdio;
import std.c.stdlib;
import std.range;
enum testUrl1 = "http://d-lang.appspot.com/testUrl1";
enum testUrl2 = "http://d-lang.appspot.com/testUrl2";
enum testUrl3 = "ftp://ftp.digitalmars.com/sieve.ds";
enum testUrl4 = "d-lang.appspot.com/testUrl1";
}
version(StdDdoc) import std.stdio;
pragma(lib, "curl");
extern (C) void exit(int);
// Default data timeout for Protcools
private enum _defaultDataTimeout = dur!"minutes"(2);
/** Connection type used when the URL should be used to auto detect the protocol.
*
* This struct is used as placeholder for the connection parameter when calling
* the high level API and the connection type (HTTP/FTP) should be guessed by
* inspecting the URL parameter.
*
* The rules for guessing the protocol are:
* 1, if URL starts with ftp://, ftps:// or ftp. then FTP connection is assumed.
* 2, HTTP connection otherwise.
*
* Example:
* ---
* import std.net.curl;
* // Two requests below will do the same.
* string content;
*
* // Explicit connection provided
* content = get!HTTP("dlang.org");
*
* // Guess connection type by looking at the URL
* content = get!AutoProtocol("ftp://foo.com/file");
* // and since AutoProtocol is default this is the same as
* connect = get("ftp://foo.com/file");
* // and will end up detecting FTP from the url and be the same as
* connect = get!FTP("ftp://foo.com/file");
* ---
*/
struct AutoProtocol { }
// Returns true if the url points to an FTP resource
private bool isFTPUrl(const(char)[] url)
{
return startsWith(url.toLower(), "ftp://", "ftps://", "ftp.") != 0;
}
// Is true if the Conn type is a valid Curl Connection type.
private template isCurlConn(Conn)
{
enum auto isCurlConn = is(Conn : HTTP) ||
is(Conn : FTP) || is(Conn : AutoProtocol);
}
/** HTTP/FTP download to local file system.
*
* Params:
* url = resource to download
* saveToPath = path to store the downloaded content on local disk
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
* Example:
* ----
* import std.net.curl;
* download("ftp.digitalmars.com/sieve.ds", "/tmp/downloaded-ftp-file");
* download("d-lang.appspot.com/testUrl2", "/tmp/downloaded-http-file");
* ----
*/
void download(Conn = AutoProtocol)(const(char)[] url, string saveToPath, Conn conn = Conn())
if (isCurlConn!Conn)
{
static if (is(Conn : HTTP) || is(Conn : FTP))
{
conn.url = url;
auto f = new std.stream.BufferedFile(saveToPath, FileMode.OutNew);
scope (exit) f.close();
conn.onReceive = (ubyte[] data) { return f.write(data); };
conn.perform();
}
else
{
if (isFTPUrl(url))
return download!FTP(url, saveToPath, FTP());
else
return download!HTTP(url, saveToPath, HTTP());
}
}
unittest
{
if (!netAllowed()) return;
download("ftp.digitalmars.com/sieve.ds", "/tmp/downloaded-ftp-file");
download("d-lang.appspot.com/testUrl1", "/tmp/downloaded-http-file");
}
/** Upload file from local files system using the HTTP or FTP protocol.
*
* Params:
* loadFromPath = path load data from local disk.
* url = resource to upload to
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
* Example:
* ----
* import std.net.curl;
* upload("/tmp/downloaded-ftp-file", "ftp.digitalmars.com/sieve.ds");
* upload("/tmp/downloaded-http-file", "d-lang.appspot.com/testUrl2");
* ----
*/
void upload(Conn = AutoProtocol)(string loadFromPath, const(char)[] url, Conn conn = Conn())
if (isCurlConn!Conn)
{
static if (is(Conn : HTTP))
{
conn.url = url;
conn.method = HTTP.Method.put;
}
else static if (is(Conn : FTP))
{
conn.url = url;
conn.handle.set(CurlOption.upload, 1L);
}
else
{
if (isFTPUrl(url))
return upload!FTP(loadFromPath, url, FTP());
else
return upload!HTTP(loadFromPath, url, HTTP());
}
static if (is(Conn : HTTP) || is(Conn : FTP))
{
auto f = new std.stream.BufferedFile(loadFromPath, FileMode.In);
scope (exit) f.close();
conn.onSend = (void[] data)
{
return f.read(cast(ubyte[])data);
};
conn.contentLength = cast(size_t)f.size;
conn.perform();
}
}
unittest
{
if (!netAllowed()) return;
// upload("/tmp/downloaded-ftp-file", "ftp.digitalmars.com/sieve.ds");
upload("/tmp/downloaded-http-file", "d-lang.appspot.com/testUrl2");
}
/** HTTP/FTP get content.
*
* Params:
* url = resource to get
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
* The template parameter $(D T) specifies the type to return. Possible values
* are $(D char) and $(D ubyte) to return $(D char[]) or $(D ubyte[]).
*
* Example:
* ----
* import std.net.curl;
* string content = get("d-lang.appspot.com/testUrl2");
* ----
*
* Returns:
* A T[] range containing the content of the resource pointed to by the URL.
*
* See_Also: $(LREF HTTP.Method)
*/
T[] get(Conn = AutoProtocol, T = char)(const(char)[] url, Conn conn = Conn())
if ( isCurlConn!Conn && (is(T == char) || is(T == ubyte)) )
{
static if (is(Conn : HTTP))
{
conn.method = HTTP.Method.get;
return _basicHTTP!(T)(url, "", conn);
}
else static if (is(Conn : FTP))
{
return _basicFTP!(T)(url, "", conn);
}
else
{
if (isFTPUrl(url))
return get!(FTP,T)(url, FTP());
else
return get!(HTTP,T)(url, HTTP());
}
}
unittest
{
if (!netAllowed()) return;
auto res = get(testUrl1);
assert(res == "Hello world\n",
"get!HTTP() returns unexpected content " ~ res);
res = get(testUrl4);
assert(res == "Hello world\n",
"get!HTTP() returns unexpected content: " ~ res);
res = get(testUrl3);
assert(res.startsWith("\r\n/* Eratosthenes Sieve prime number calculation. */"),
"get!FTP() returns unexpected content");
}
/** HTTP post content.
*
* Params:
* url = resource to post to
* putData = data to send as the body of the request. An array
* of an arbitrary type is accepted and will be cast to ubyte[]
* before sending it.
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
* The template parameter $(D T) specifies the type to return. Possible values
* are $(D char) and $(D ubyte) to return $(D char[]) or $(D ubyte[]).
*
* Example:
* ----
* import std.net.curl;
* string content = post("d-lang.appspot.com/testUrl2", [1,2,3,4]);
* ----
*
* Returns:
* A T[] range containing the content of the resource pointed to by the URL.
*
* See_Also: $(LREF HTTP.Method)
*/
T[] post(T = char, PostUnit)(const(char)[] url, const(PostUnit)[] postData, HTTP conn = HTTP())
if (is(T == char) || is(T == ubyte))
{
conn.method = HTTP.Method.post;
return _basicHTTP!(T)(url, postData, conn);
}
unittest
{
if (!netAllowed()) return;
auto res = post(testUrl2, "Hello world");
assert(res == "Hello world",
"put!HTTP() returns unexpected content " ~ res);
}
/** HTTP/FTP put content.
*
* Params:
* url = resource to put
* putData = data to send as the body of the request. An array
* of an arbitrary type is accepted and will be cast to ubyte[]
* before sending it.
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
* The template parameter $(D T) specifies the type to return. Possible values
* are $(D char) and $(D ubyte) to return $(D char[]) or $(D ubyte[]).
*
* Example:
* ----
* import std.net.curl;
* string content = put("d-lang.appspot.com/testUrl2",
* "Putting this data");
* ----
*
* Returns:
* A T[] range containing the content of the resource pointed to by the URL.
*
* See_Also: $(LREF HTTP.Method)
*/
T[] put(Conn = AutoProtocol, T = char, PutUnit)(const(char)[] url, const(PutUnit)[] putData,
Conn conn = Conn())
if ( isCurlConn!Conn && (is(T == char) || is(T == ubyte)) )
{
static if (is(Conn : HTTP))
{
conn.method = HTTP.Method.put;
return _basicHTTP!(T)(url, putData, conn);
}
else static if (is(Conn : FTP))
{
return _basicFTP!(T)(url, putData, conn);
}
else
{
if (isFTPUrl(url))
return put!(FTP,T)(url, putData, FTP());
else
return put!(HTTP,T)(url, putData, HTTP());
}
}
unittest
{
if (!netAllowed()) return;
auto res = put(testUrl2, "Hello world");
assert(res == "Hello world",
"put!HTTP() returns unexpected content " ~ res);
// TODO: need ftp server to test with
// res = get(testUrl3);
// assert(res.startsWith("\r\n/* Eratosthenes Sieve prime number calculation. */"),
// "get!FTP() returns unexpected content");
}
/** HTTP/FTP delete content.
*
* Params:
* url = resource to delete
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
* Example:
* ----
* import std.net.curl;
* del("d-lang.appspot.com/testUrl2");
* ----
*
* See_Also: $(LREF HTTP.Method)
*/
void del(Conn = AutoProtocol)(const(char)[] url, Conn conn = Conn())
if (isCurlConn!Conn)
{
static if (is(Conn : HTTP))
{
conn.method = HTTP.Method.del;
_basicHTTP!char(url, cast(void[]) null, conn);
}
else static if (is(Conn : FTP))
{
auto trimmed = url.findSplitAfter("ftp://")[1];
auto t = trimmed.findSplitAfter("/");
enum minDomainNameLength = 3;
enforceEx!CurlException(t[0].length > minDomainNameLength,
text("Invalid FTP URL for delete ", url));
conn.url = t[0];
enforceEx!CurlException(!t[1].empty,
text("No filename specified to delete for URL ", url));
conn.addCommand("DELE " ~ t[1]);
conn.perform();
}
else
{
if (isFTPUrl(url))
return del!FTP(url, FTP());
else
return del!HTTP(url, HTTP());
}
}
unittest
{
if (!netAllowed()) return;
del(testUrl1);
}
/** HTTP options request.
*
* Params:
* url = resource make a option call to
* optionsData = options data to send as the body of the request. An array
* of an arbitrary type is accepted and will be cast to ubyte[]
* before sending it.
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
* The template parameter $(D T) specifies the type to return. Possible values
* are $(D char) and $(D ubyte) to return $(D char[]) or $(D ubyte[]).
* Currently the HTTP RFC does not specify any usage of the optionsData and
* for this reason the example below does not send optionsData to the server.
*
* Example:
* ----
* import std.net.curl;
* auto http = HTTP();
* options("d-lang.appspot.com/testUrl2", null, http);
* writeln("Allow set to " ~ http.responseHeaders["Allow"]);
* ----
*
* Returns:
* A T[] range containing the options of the resource pointed to by the URL.
*
* See_Also: $(LREF HTTP.Method)
*/
T[] options(T = char, OptionsUnit)(const(char)[] url,
const(OptionsUnit)[] optionsData = null,
HTTP conn = HTTP())
if (is(T == char) || is(T == ubyte))
{
conn.method = HTTP.Method.options;
return _basicHTTP!(T)(url, optionsData, conn);
}
unittest
{
if (!netAllowed()) return;
auto res = options(testUrl2, "Hello world");
assert(res == "Hello world",
"options!HTTP() returns unexpected content " ~ res);
}
unittest
{
if (!netAllowed()) return;
auto res = options(testUrl1, []);
assert(res == "Hello world\n",
"options!HTTP() returns unexpected content " ~ res);
}
/** HTTP trace request.
*
* Params:
* url = resource make a trace call to
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
* The template parameter $(D T) specifies the type to return. Possible values
* are $(D char) and $(D ubyte) to return $(D char[]) or $(D ubyte[]).
*
* Example:
* ----
* import std.net.curl;
* trace("d-lang.appspot.com/testUrl1");
* ----
*
* Returns:
* A T[] range containing the trace info of the resource pointed to by the URL.
*
* See_Also: $(LREF HTTP.Method)
*/
T[] trace(T = char)(const(char)[] url, HTTP conn = HTTP())
if (is(T == char) || is(T == ubyte))
{
conn.method = HTTP.Method.trace;
return _basicHTTP!(T)(url, cast(void[]) null, conn);
}
unittest
{
if (!netAllowed()) return;
auto res = trace(testUrl1);
assert(res == "Hello world\n",
"trace!HTTP() returns unexpected content " ~ res);
}
/** HTTP connect request.
*
* Params:
* url = resource make a connect to
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
* The template parameter $(D T) specifies the type to return. Possible values
* are $(D char) and $(D ubyte) to return $(D char[]) or $(D ubyte[]).
*
* Example:
* ----
* import std.net.curl;
* connect("d-lang.appspot.com/testUrl1");
* ----
*
* Returns:
* A T[] range containing the connect info of the resource pointed to by the URL.
*
* See_Also: $(LREF HTTP.Method)
*/
T[] connect(T = char)(const(char)[] url, HTTP conn = HTTP())
if (is(T == char) || is(T == ubyte))
{
conn.method = HTTP.Method.connect;
return _basicHTTP!(T)(url, cast(void[]) null, conn);
}
unittest
{
// google appspot does not allow connect method.
// if (!netAllowed()) return;
// auto res = connect(testUrl1);
// assert(res == "Hello world\n",
// "connect!HTTP() returns unexpected content " ~ res);
}
/*
* Helper function for the high level interface.
*
* It performs an HTTP request using the client which must have
* been setup correctly before calling this function.
*/
private auto _basicHTTP(T)(const(char)[] url, const(void)[] sendData, HTTP client)
{
scope (exit)
{
client.onReceiveHeader = null;
client.onReceiveStatusLine = null;
client.onReceive = null;
}
client.url = url;
HTTP.StatusLine statusLine;
ubyte[] content;
string[string] headers;
client.onReceive = (ubyte[] data)
{
content ~= data;
return data.length;
};
if (sendData !is null &&
(client.method == HTTP.Method.post || client.method == HTTP.Method.put))
{
client.contentLength = sendData.length;
client.onSend = delegate size_t(void[] buf)
{
size_t minLen = min(buf.length, sendData.length);
if (minLen == 0) return 0;
buf[0..minLen] = sendData[0..minLen];
sendData = sendData[minLen..$];
return minLen;
};
}
client.onReceiveHeader = (in char[] key,
in char[] value)
{
if (auto v = key in headers)
{
*v ~= ", ";
*v ~= value;
}
else
headers[key] = value.idup;
};
client.onReceiveStatusLine = (HTTP.StatusLine l) { statusLine = l; };
client.perform();
enforceEx!CurlException(statusLine.code / 100 == 2,
format("HTTP request returned status code %s",
statusLine.code));
// Default charset defined in HTTP RFC
auto charset = "ISO-8859-1";
if (auto v = "content-type" in headers)
{
auto m = match(cast(char[]) (*v), regex("charset=([^;,]*)"));
if (!m.empty && m.captures.length > 1)
{
charset = m.captures[1].idup;
}
}
return _decodeContent!T(content, charset);
}
/*
* Helper function for the high level interface.
*
* It performs an FTP request using the client which must have
* been setup correctly before calling this function.
*/
private auto _basicFTP(T)(const(char)[] url, const(void)[] sendData, FTP client)
{
scope (exit) client.onReceive = null;
ubyte[] content;
if (client.encoding.empty)
client.encoding = "ISO-8859-1";
client.url = url;
client.onReceive = (ubyte[] data)
{
content ~= data;
return data.length;
};
if (!sendData.empty)
{
client.handle.set(CurlOption.upload, 1L);
client.onSend = delegate size_t(void[] buf)
{
size_t minLen = min(buf.length, sendData.length);
if (minLen == 0) return 0;
buf[0..minLen] = sendData[0..minLen];
sendData = sendData[minLen..$];
return minLen;
};
}
client.perform();
return _decodeContent!T(content, client.encoding);
}
/* Used by _basicHTTP() and _basicFTP() to decode ubyte[] to
* correct string format
*/
private auto _decodeContent(T)(ubyte[] content, string encoding)
{
static if (is(T == ubyte))
{
return content;
}
else
{
// Optimally just return the utf8 encoded content
if (encoding == "UTF-8")
return cast(char[])(content);
// The content has to be re-encoded to utf8
auto scheme = EncodingScheme.create(encoding);
enforceEx!CurlException(scheme !is null,
format("Unknown encoding '%s'", encoding));
auto strInfo = decodeString(content, scheme);
enforceEx!CurlException(strInfo[0] != size_t.max,
format("Invalid encoding sequence for enconding '%s'",
encoding));
return strInfo[1];
}
}
alias std.string.KeepTerminator KeepTerminator;
/++
struct ByLineBuffer(Char)
{
bool linePresent;
bool EOF;
Char[] buffer;
ubyte[] decodeRemainder;
bool append(const(ubyte)[] data)
{
byLineBuffer ~= data;
}
@property bool linePresent()
{
return byLinePresent;
}
Char[] get()
{
if (!linePresent)
{
// Decode ubyte[] into Char[] until a Terminator is found.
// If not Terminator is found and EOF is false then raise an
// exception.
}
return byLineBuffer;
}
}
++/
/** HTTP/FTP fetch content as a range of lines.
*
* A range of lines is returned when the request is complete. If the method or
* other request properties is to be customized then set the $(D conn) parameter
* with a HTTP/FTP instance that has these properties set.
*
* Example:
* ----
* import std.net.curl, std.stdio;
* foreach (line; byLine("dlang.org"))
* writeln(line);
* ----
*
* Params:
* url = The url to receive content from
* postData = Data to HTTP Post
* keepTerminator = KeepTerminator.yes signals that the line terminator should be
* returned as part of the lines in the range.
* terminator = The character that terminates a line
* conn = The connection to use e.g. HTTP or FTP.
*
* Returns:
* A range of Char[] with the content of the resource pointer to by the URL
*/
auto byLine(Conn = AutoProtocol, Terminator = char, Char = char)
(const(char)[] url, KeepTerminator keepTerminator = KeepTerminator.no,
Terminator terminator = '\n', Conn conn = Conn())
if (isCurlConn!Conn && isSomeChar!Char && isSomeChar!Terminator)
{
static struct SyncLineInputRange
{
private Char[] lines;
private Char[] current;
private bool currentValid;
private bool keepTerminator;
private Terminator terminator;
this(Char[] lines, bool kt, Terminator terminator)
{
this.lines = lines;
this.keepTerminator = kt;
this.terminator = terminator;
currentValid = true;
popFront();
}
@property @safe bool empty()
{
return !currentValid;
}
@property @safe Char[] front()
{
enforceEx!CurlException(currentValid, "Cannot call front() on empty range");
return current;
}
void popFront()
{
enforceEx!CurlException(currentValid, "Cannot call popFront() on empty range");
if (lines.empty)
{
currentValid = false;
return;
}
if (keepTerminator)
{
auto r = findSplitAfter(lines, [ terminator ]);
if (r[0].empty)
{
current = r[1];
lines = r[0];
}
else
{
current = r[0];
lines = r[1];
}
}
else
{
auto r = findSplit(lines, [ terminator ]);
current = r[0];
lines = r[2];
}
}
}
auto result = _getForRange!Char(url, conn);
return SyncLineInputRange(result, keepTerminator == KeepTerminator.yes, terminator);
}
unittest
{
if (!netAllowed()) return;
auto res = byLine(testUrl1);
auto line = res.front();
assert(line == "Hello world",
"byLine!HTTP() returns unexpected content: " ~ line);
}
/** HTTP/FTP fetch content as a range of chunks.
*
* A range of chunks is returned when the request is complete. If the method or
* other request properties is to be customized then set the $(D conn) parameter
* with a HTTP/FTP instance that has these properties set.
*
* Example:
* ----
* import std.net.curl, std.stdio;
* foreach (chunk; byChunk("dlang.org", 100))
* writeln(chunk); // chunk is ubyte[100]
* ----
*
* Params:
* url = The url to receive content from
* chunkSize = The size of each chunk
* conn = The connection to use e.g. HTTP or FTP.
*
* Returns:
* A range of ubyte[chunkSize] with the content of the resource pointer to by the URL
*/
auto byChunk(Conn = AutoProtocol)
(const(char)[] url, size_t chunkSize = 1024, Conn conn = Conn())
if (isCurlConn!(Conn))
{
static struct SyncChunkInputRange
{
private size_t chunkSize;
private ubyte[] _bytes;
private size_t offset;
this(ubyte[] bytes, size_t chunkSize)
{
this._bytes = bytes;
this.chunkSize = chunkSize;
}
@property @safe auto empty()
{
return offset == _bytes.length;
}
@property ubyte[] front()
{
size_t nextOffset = offset + chunkSize;
if (nextOffset > _bytes.length) nextOffset = _bytes.length;
return _bytes[offset..nextOffset];
}
@safe void popFront()
{
offset += chunkSize;
if (offset > _bytes.length) offset = _bytes.length;
}
}
auto result = _getForRange!ubyte(url, conn);
return SyncChunkInputRange(result, chunkSize);
}
private T[] _getForRange(T,Conn)(const(char)[] url, Conn conn)
{
static if (is(Conn : HTTP))
{
conn.method = conn.method == Method.undefined ? HTTP.Method.get : conn.method;
return _basicHTTP!(T)(url, null, conn);
}
else static if (is(Conn : FTP))
{
return _basicFTP!(T)(url, null, conn);
}
else
{
if (isFTPUrl(url))
return get!(FTP,T)(url, FTP());
else
return get!(HTTP,T)(url, HTTP());
}
}
/*
Main thread part of the message passing protocol used for all async
curl protocols.
*/
private mixin template WorkerThreadProtocol(Unit, alias units)
{
@property bool empty()
{
tryEnsureUnits();
return state == State.done;
}
@property Unit[] front()
{
tryEnsureUnits();
assert(state == State.gotUnits,
format("Expected %s but got $s",
State.gotUnits, state));
return units;
}
void popFront()
{
tryEnsureUnits();
assert(state == State.gotUnits,
format("Expected %s but got $s",
State.gotUnits, state));
state = State.needUnits;
// Send to worker thread for buffer reuse
workerTid.send(cast(immutable(Unit)[]) units);
units = null;
}
/** Wait for duration or until data is available and return true if data is
available
*/
bool wait(Duration d)
{
if (state == State.gotUnits)
return true;
enum noDur = dur!"hnsecs"(0);
StopWatch sw;
sw.start();
while (state != State.gotUnits && d > noDur)
{
final switch (state)
{
case State.needUnits:
receiveTimeout(d,
(Tid origin, CurlMessage!(immutable(Unit)[]) _data)
{
if (origin != workerTid)
return false;
units = cast(Unit[]) _data.data;
state = State.gotUnits;
return true;
},
(Tid origin, CurlMessage!bool f)
{
if (origin != workerTid)
return false;
state = state.done;
return true;
}
);
break;
case State.gotUnits: return true;
case State.done:
return false;
}
d -= sw.peek();
sw.reset();
}
return state == State.gotUnits;
}
enum State
{
needUnits,
gotUnits,
done
}
State state;
void tryEnsureUnits()
{
while (true)
{
final switch (state)
{
case State.needUnits:
receive(
(Tid origin, CurlMessage!(immutable(Unit)[]) _data)
{
if (origin != workerTid)
return false;
units = cast(Unit[]) _data.data;
state = State.gotUnits;
return true;
},
(Tid origin, CurlMessage!bool f)
{
if (origin != workerTid)
return false;
state = state.done;
return true;
}
);
break;
case State.gotUnits: return;
case State.done:
return;
}
}
}
}
// Workaround bug #2458
// It should really be defined inside the byLineAsync method.
// Do not create instances of this struct since it will be
// moved when the bug has been fixed.
// Range that reads one line at a time asynchronously.
static struct AsyncLineInputRange(Char)
{
private Char[] line;
mixin WorkerThreadProtocol!(Char, line);
private Tid workerTid;
private State running;
private this(Tid tid, size_t transmitBuffers, size_t bufferSize)
{
workerTid = tid;
state = State.needUnits;
// Send buffers to other thread for it to use. Since no mechanism is in
// place for moving ownership a cast to shared is done here and casted
// back to non-shared in the receiving end.
foreach (i ; 0..transmitBuffers)
{
auto arr = new Char[](bufferSize);
workerTid.send(cast(immutable(Char[]))arr);
}
}
}
/** HTTP/FTP fetch content as a range of lines asynchronously.
*
* A range of lines is returned immediately and the request that fetches the
* lines is performed in another thread. If the method or other request
* properties is to be customized then set the $(D conn) parameter with a
* HTTP/FTP instance that has these properties set.
*
* If $(D postData) is non-_null the method will be set to $(D post) for HTTP
* requests.
*
* The background thread will buffer up to transmitBuffers number of lines
* before it stops receiving data from network. When the main thread reads the
* lines from the range it frees up buffers and allows for the background thread
* to receive more data from the network.
*
* If no data is available and the main thread accesses the range it will block
* until data becomes available. An exception to this is the $(D wait(Duration)) method on
* the $(LREF AsyncLineInputRange). This method will wait at maximum for the
* specified duration and return true if data is available.
*
* Example:
* ----
* import std.net.curl, std.stdio;
* // Get some pages in the background
* auto range1 = byLineAsync("www.google.com");
* auto range2 = byLineAsync("www.wikipedia.org");
* foreach (line; byLineAsync("dlang.org"))
* writeln(line);
*
* // Lines already fetched in the background and ready
* foreach (line; range1) writeln(line);
* foreach (line; range2) writeln(line);
* ----
*
* ----
* import std.net.curl, std.stdio;
* // Get a line in a background thread and wait in
* // main thread for 2 seconds for it to arrive.
* auto range3 = byLineAsync("dlang.com");
* if (range.wait(dur!"seconds"(2)))
* writeln(range.front);
* else
* writeln("No line received after 2 seconds!");
* ----
*
* Params:
* url = The url to receive content from
* postData = Data to HTTP Post
* keepTerminator = KeepTerminator.yes signals that the line terminator should be
* returned as part of the lines in the range.
* terminator = The character that terminates a line
* transmitBuffers = The number of lines buffered asynchronously
* conn = The connection to use e.g. HTTP or FTP.
*
* Returns:
* A range of Char[] with the content of the resource pointer to by the
* URL.
*/
auto byLineAsync(Conn = AutoProtocol, Terminator = char, Char = char, PostUnit)
(const(char)[] url, const(PostUnit)[] postData,
KeepTerminator keepTerminator = KeepTerminator.no,
Terminator terminator = '\n',
size_t transmitBuffers = 10, Conn conn = Conn())
if (isCurlConn!Conn && isSomeChar!Char && isSomeChar!Terminator)
{
static if (is(Conn : AutoProtocol))
{
if (isFTPUrl(url))
return byLineAsync(url, postData, keepTerminator,
terminator, transmitBuffers, FTP());
else
return byLineAsync(url, postData, keepTerminator,
terminator, transmitBuffers, HTTP());
}
else
{
// 50 is just an arbitrary number for now
setMaxMailboxSize(thisTid, 50, OnCrowding.block);
auto tid = spawn(&(_spawnAsync!(Conn, Char, Terminator)));
tid.send(thisTid);
tid.send(terminator);
tid.send(keepTerminator == KeepTerminator.yes);
_asyncDuplicateConnection(url, conn, postData, tid);
return AsyncLineInputRange!Char(tid, transmitBuffers,
Conn.defaultAsyncStringBufferSize);
}
}
/// ditto
auto byLineAsync(Conn = AutoProtocol, Terminator = char, Char = char)
(const(char)[] url, KeepTerminator keepTerminator = KeepTerminator.no,
Terminator terminator = '\n',
size_t transmitBuffers = 10, Conn conn = Conn())
{
static if (is(Conn : AutoProtocol))
{
if (isFTPUrl(url))
return byLineAsync(url, cast(void[])null, keepTerminator,
terminator, transmitBuffers, FTP());
else
return byLineAsync(url, cast(void[])null, keepTerminator,
terminator, transmitBuffers, HTTP());
}
else
{
return byLineAsync(url, cast(void[])null, keepTerminator,
terminator, transmitBuffers, conn);
}
}
unittest
{
if (!netAllowed()) return;
auto res = byLineAsync(testUrl2, "Hello world");
auto line = res.front();
assert(line == "Hello world",
"byLineAsync!HTTP() returns unexpected content " ~ line);
res = byLineAsync(testUrl1);
line = res.front();
assert(line == "Hello world",
"byLineAsync!HTTP() returns unexpected content: " ~ line);
}
// Workaround bug #2458
// It should really be defined inside the byLineAsync method.
// Do not create instances of this struct since it will be
// moved when the bug has been fixed.
// Range that reads one chunk at a time asynchronously.
static struct AsyncChunkInputRange
{
private ubyte[] chunk;
mixin WorkerThreadProtocol!(ubyte, chunk);
private Tid workerTid;
private State running;
private this(Tid tid, size_t transmitBuffers, size_t chunkSize)
{
workerTid = tid;
state = State.needUnits;
// Send buffers to other thread for it to use. Since no mechanism is in
// place for moving ownership a cast to shared is done here and a cast
// back to non-shared in the receiving end.
foreach (i ; 0..transmitBuffers)
{
ubyte[] arr = new ubyte[](chunkSize);
workerTid.send(cast(immutable(ubyte[]))arr);
}
}
}
/** HTTP/FTP fetch content as a range of chunks asynchronously.
*
* A range of chunks is returned immediately and the request that fetches the
* chunks is performed in another thread. If the method or other request
* properties is to be customized then set the $(D conn) parameter with a
* HTTP/FTP instance that has these properties set.
*
* If $(D postData) is non-_null the method will be set to $(D post) for HTTP
* requests.
*
* The background thread will buffer up to transmitBuffers number of chunks
* before is stops receiving data from network. When the main thread reads the
* chunks from the range it frees up buffers and allows for the background
* thread to receive more data from the network.
*
* If no data is available and the main thread access the range it will block
* until data becomes available. An exception to this is the $(D wait(Duration))
* method on the $(LREF AsyncChunkInputRange). This method will wait at maximum for the specified
* duration and return true if data is available.
*
* Example:
* ----
* import std.net.curl, std.stdio;
* // Get some pages in the background
* auto range1 = byChunkAsync("www.google.com", 100);
* auto range2 = byChunkAsync("www.wikipedia.org");
* foreach (chunk; byChunkAsync("dlang.org"))
* writeln(chunk); // chunk is ubyte[100]
*
* // Chunks already fetched in the background and ready
* foreach (chunk; range1) writeln(chunk);
* foreach (chunk; range2) writeln(chunk);
* ----
*
* ----
* import std.net.curl, std.stdio;
* // Get a line in a background thread and wait in
* // main thread for 2 seconds for it to arrive.
* auto range3 = byChunkAsync("dlang.com", 10);
* if (range.wait(dur!"seconds"(2)))
* writeln(range.front);
* else
* writeln("No chunk received after 2 seconds!");
* ----
*
* Params:
* url = The url to receive content from
* postData = Data to HTTP Post
* terminator = The character that terminates a line
* chunkSize = The size of the chunks
* transmitBuffers = The number of chunks buffered asynchronously
* conn = The connection to use e.g. HTTP or FTP.
*
* Returns:
* A range of ubyte[chunkSize] with the content of the resource pointer to by
* the URL.
*/
auto byChunkAsync(Conn = AutoProtocol, PostUnit)
(const(char)[] url, const(PostUnit)[] postData,
size_t chunkSize = 1024, size_t transmitBuffers = 10,
Conn conn = Conn())
if (isCurlConn!(Conn))
{
static if (is(Conn : AutoProtocol))
{
if (isFTPUrl(url))
return byChunkAsync(url, postData, chunkSize,
transmitBuffers, FTP());
else
return byChunkAsync(url, postData, chunkSize,
transmitBuffers, HTTP());
}
else
{
// 50 is just an arbitrary number for now
setMaxMailboxSize(thisTid, 50, OnCrowding.block);
auto tid = spawn(&(_spawnAsync!(Conn, ubyte)));
tid.send(thisTid);
_asyncDuplicateConnection(url, conn, postData, tid);
return AsyncChunkInputRange(tid, transmitBuffers, chunkSize);
}
}
/// ditto
auto byChunkAsync(Conn = AutoProtocol)
(const(char)[] url,
size_t chunkSize = 1024, size_t transmitBuffers = 10,
Conn conn = Conn())
if (isCurlConn!(Conn))
{
static if (is(Conn : AutoProtocol))
{
if (isFTPUrl(url))
return byChunkAsync(url, cast(void[])null, chunkSize,
transmitBuffers, FTP());
else
return byChunkAsync(url, cast(void[])null, chunkSize,
transmitBuffers, HTTP());
}
else
{
return byChunkAsync(url, cast(void[])null, chunkSize,
transmitBuffers, conn);
}
}
unittest
{
if (!netAllowed()) return;
auto res = byChunkAsync(testUrl2, "Hello world");
auto line = res.front();
assert(line == cast(ubyte[])"Hello world",
"byLineAsync!HTTP() returns unexpected content " ~ to!string(line));
res = byChunkAsync(testUrl1);
line = res.front();
assert(line == cast(ubyte[])"Hello world\n",
"byLineAsync!HTTP() returns unexpected content: " ~ to!string(line));
}
/* Used by byLineAsync/byChunkAsync to duplicate an existing connection
* that can be used exclusively in a spawned thread.
*/
private void _asyncDuplicateConnection(Conn, PostData)
(const(char)[] url, Conn conn, PostData postData, Tid tid)
{
// no move semantic available in std.concurrency ie. must use casting.
auto connDup = conn.dup();
connDup.url = url;
static if ( is(Conn : HTTP) )
{
connDup.p.headersOut = null;
connDup.method = conn.method == HTTP.Method.undefined ?
HTTP.Method.get : conn.method;
if (postData !is null)
{
if (connDup.method == HTTP.Method.put)
{
connDup.handle.set(CurlOption.infilesize_large,
postData.length);
}
else
{
// post
connDup.method = HTTP.Method.post;
connDup.handle.set(CurlOption.postfieldsize_large,
postData.length);
}
connDup.handle.set(CurlOption.copypostfields,
cast(void*) postData.ptr);
}
tid.send(cast(ulong)connDup.handle.handle);
tid.send(connDup.method);
}
else
{
enforceEx!CurlException(postData is null,
"Cannot put ftp data using byLineAsync()");
tid.send(cast(ulong)connDup.handle.handle);
tid.send(HTTP.Method.undefined);
}
connDup.p.curl.handle = null; // make sure handle is not freed
}
/*
Mixin template for all supported curl protocols. This is the commom
functionallity such as timeouts and network interface settings. This should
really be in the HTTP/FTP/SMTP structs but the documentation tool does not
support a mixin to put its doc strings where a mixin is done. Therefore docs
in this template is copied into each of HTTP/FTP/SMTP below.
*/
private mixin template Protocol()
{
/// Value to return from $(D onSend)/$(D onReceive) delegates in order to
/// pause a request
alias CurlReadFunc.pause requestPause;
/// Value to return from onSend delegate in order to abort a request
alias CurlReadFunc.abort requestAbort;
static uint defaultAsyncStringBufferSize = 100;
/**
The curl handle used by this connection.
*/
@property ref Curl handle()
{
return p.curl;
}
/**
True if the instance is stopped. A stopped instance is not usable.
*/
@property bool isStopped()
{
return p.curl.stopped;
}
/// Stop and invalidate this instance.
void shutdown()
{
p.curl.shutdown();
}
/** Set verbose.
This will print request information to stderr.
*/
@property void verbose(bool on)
{
p.curl.set(CurlOption.verbose, on ? 1L : 0L);
}
// Connection settings
/// Set timeout for activity on connection.
@property void dataTimeout(Duration d)
{
p.curl.set(CurlOption.timeout_ms, d.total!"msecs"());
}
/// Set timeout for connecting.
@property void connectTimeout(Duration d)
{
p.curl.set(CurlOption.connecttimeout_ms, d.total!"msecs"());
}
// Network settings
/** Proxy
* See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXY, _proxy)
*/
@property void proxy(const(char)[] host)
{
p.curl.set(CurlOption.proxy, host);
}
/** Proxy port
* See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXYPORT, _proxy_port)
*/
@property void proxyPort(ushort port)
{
p.curl.set(CurlOption.proxyport, cast(long) port);
}
/// Type of proxy
alias etc.c.curl.CurlProxy CurlProxy;
/** Proxy type
* See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXY, _proxy_type)
*/
@property void proxyType(CurlProxy type)
{
p.curl.set(CurlOption.proxytype, cast(long) type);
}
/// DNS lookup timeout.
@property void dnsTimeout(Duration d)
{
p.curl.set(CurlOption.dns_cache_timeout, d.total!"msecs"());
}
/**
* The network interface to use in form of the the IP of the interface.
*
* Example:
* ----
* theprotocol.netInterface = "192.168.1.32";
* theprotocol.netInterface = [ 192, 168, 1, 32 ];
* ----
*
* See: $(XREF socket, InternetAddress)
*/
@property void netInterface(const(char)[] i)
{
p.curl.set(CurlOption.intrface, i);
}
/// ditto
@property void netInterface(const(ubyte)[4] i)
{
auto str = format("%d.%d.%d.%d", i[0], i[1], i[2], i[3]);
netInterface(str);
}
/// ditto
@property void netInterface(InternetAddress i)
{
netInterface(i.toAddrString());
}
/**
Set the local outgoing port to use.
Params:
port = the first outgoing port number to try and use
*/
@property void localPort(ushort port)
{
p.curl.set(CurlOption.localport, cast(long)port);
}
/**
Set the local outgoing port range to use.
This can be used together with the localPort property.
Params:
range = if the first port is occupied then try this many
port number forwards
*/
@property void localPortRange(ushort range)
{
p.curl.set(CurlOption.localportrange, cast(long)range);
}
/** Set the tcp no-delay socket option on or off.
See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTTCPNODELAY, nodelay)
*/
@property void tcpNoDelay(bool on)
{
p.curl.set(CurlOption.tcp_nodelay, cast(long) (on ? 1 : 0) );
}
// Authentication settings
/**
Set the user name, password and optionally domain for authentication
purposes.
Some protocols may need authentication in some cases. Use this
function to provide credentials.
Params:
username = the username
password = the password
domain = used for NTLM authentication only and is set to the NTLM domain
name
*/
void setAuthentication(const(char)[] username, const(char)[] password,
const(char)[] domain = "")
{
if (!domain.empty)
username = format("%s/%s", domain, username);
p.curl.set(CurlOption.userpwd, format("%s:%s", username, password));
}
unittest
{
if (!netAllowed()) return;
auto http = HTTP("http://www.protected.com");
http.onReceiveHeader =
(in char[] key,
in char[] value) { /* writeln(key ~ ": " ~ value); */ };
http.onReceive = (ubyte[] data) { return data.length; };
http.setAuthentication("myuser", "mypassword");
http.perform();
}
/**
* The event handler that gets called when data is needed for sending. The
* length of the $(D void[]) specifies the maximum number of bytes that can
* be sent.
*
* Returns:
* The callback returns the number of elements in the buffer that have been
* filled and are ready to send.
* The special value $(D .abortRequest) can be returned in order to abort the
* current request.
* The special value $(D .pauseRequest) can be returned in order to pause the
* current request.
*
* Example:
* ----
* import std.net.curl;
* string msg = "Hello world";
* auto client = HTTP("dlang.org");
* client.onSend = delegate size_t(void[] data)
* {
* auto m = cast(void[])msg;
* size_t length = m.length > data.length ? data.length : m.length;
* if (length == 0) return 0;
* data[0..length] = m[0..length];
* msg = msg[length..$];
* return length;
* };
* client.perform();
* ----
*/
@property void onSend(size_t delegate(void[]) callback)
{
p.curl.clear(CurlOption.postfields); // cannot specify data when using callback
p.curl.onSend(callback);
}
/**
* The event handler that receives incoming data. Be sure to copy the
* incoming ubyte[] since it is not guaranteed to be valid after the
* callback returns.
*
* Returns:
* The callback returns the incoming bytes read. If not the entire array is
* the request will abort.
* The special value .pauseRequest can be returned in order to pause the
* current request.
*
* Example:
* ----
* import std.net.curl, std.stdio;
* auto client = HTTP("dlang.org");
* client.onReceive = (ubyte[] data)
* {
* writeln("Got data", to!(const(char)[])(data));
* return data.length;
* };
* client.perform();
* ----
*/
@property void onReceive(size_t delegate(ubyte[]) callback)
{
p.curl.onReceive(callback);
}
/**
* The event handler that gets called to inform of upload/download progress.
*
* Params:
* dlTotal = total bytes to download
* dlNow = currently downloaded bytes
* ulTotal = total bytes to upload
* ulNow = currently uploaded bytes
*
* Returns:
* Return 0 from the callback to signal success, return non-zero to abort
* transfer
*
* Example:
* ----
* import std.net.curl, std.stdio;
* auto client = HTTP("dlang.org");
* client.onProgress = delegate int(size_t dl, size_t dln, size_t ul, size_t ult)
* {
* writeln("Progress: downloaded ", dln, " of ", dl);
* writeln("Progress: uploaded ", uln, " of ", ul);
* };
* client.perform();
* ----
*/
@property void onProgress(int delegate(size_t dlTotal, size_t dlNow,
size_t ulTotal, size_t ulNow) callback)
{
p.curl.onProgress(callback);
}
}
/*
Decode $(D ubyte[]) array using the provided EncodingScheme up to maxChars
Returns: Tuple of ubytes read and the $(D Char[]) characters decoded.
Not all ubytes are guaranteed to be read in case of decoding error.
*/
private Tuple!(size_t,Char[])
decodeString(Char = char)(const(ubyte)[] data,
EncodingScheme scheme,
size_t maxChars = size_t.max)
{
Char[] res;
auto startLen = data.length;
size_t charsDecoded = 0;
while (data.length && charsDecoded < maxChars)
{
dchar dc = scheme.safeDecode(data);
if (dc == INVALID_SEQUENCE)
{
return typeof(return)(size_t.max, cast(Char[])null);
}
charsDecoded++;
res ~= dc;
}
return typeof(return)(startLen-data.length, res);
}
/*
Decode $(D ubyte[]) array using the provided $(D EncodingScheme) until a the
line terminator specified is found. The basesrc parameter is effectively
prepended to src as the first thing.
This function is used for decoding as much of the src buffer as
possible until either the terminator is found or decoding fails. If
it fails as the last data in the src it may mean that the src buffer
were missing some bytes in order to represent a correct code
point. Upon the next call to this function more bytes have been
received from net and the failing bytes should be given as the
basesrc parameter. It is done this way to minimize data copying.
Returns: true if a terminator was found
Not all ubytes are guaranteed to be read in case of decoding error.
any decoded chars will be inserted into dst.
*/
private bool decodeLineInto(Terminator, Char = char)(ref const(ubyte)[] basesrc,
ref const(ubyte)[] src,
ref Char[] dst,
EncodingScheme scheme,
Terminator terminator)
{
auto startLen = src.length;
size_t charsDecoded = 0;
// if there is anything in the basesrc then try to decode that
// first.
if (basesrc.length != 0)
{
// Try to ensure 4 entries in the basesrc by copying from src.
auto blen = basesrc.length;
size_t len = (basesrc.length + src.length) >= 4 ?
4 : basesrc.length + src.length;
basesrc.length = len;
dchar dc = scheme.safeDecode(basesrc);
if (dc == INVALID_SEQUENCE)
{
enforceEx!CurlException(len != 4, "Invalid code sequence");
return false;
}
dst ~= dc;
src = src[len-basesrc.length-blen .. $]; // remove used ubytes from src
basesrc.length = 0;
}
while (src.length)
{
auto lsrc = src;
dchar dc = scheme.safeDecode(src);
if (dc == INVALID_SEQUENCE)
{
if (src.empty)
{
// The invalid sequence was in the end of the src. Maybe there
// just need to be more bytes available so these last bytes are
// put back to src for later use.
src = lsrc;
return false;
}
dc = '?';
}
dst ~= dc;
if (dst.endsWith(terminator))
return true;
}
return false; // no terminator found
}
/**
* HTTP client functionality.
*
* Example:
* ---
* import std.net.curl, std.stdio;
*
* // Get with custom data receivers
* auto http = HTTP("dlang.org");
* http.onReceiveHeader =
* (in char[] key, in char[] value) { writeln(key ~ ": " ~ value); };
* http.onReceive = (ubyte[] data) { /+ drop +/ return data.length; };
* http.perform();
*
* // Put with data senders
* auto msg = "Hello world";
* http.onSend = (void[] data)
* {
* auto m = cast(void[])msg;
* size_t length = m.length > data.length ? data.length : m.length;
* if (length == 0) return 0;
* data[0..length] = m[0..length];
* msg = msg[length..$];
* return length;
* };
* http.perform();
*
* // Track progress
* http.method = HTTP.Method.get;
* http.url = "http://upload.wikimedia.org/wikipedia/commons/"
* "5/53/Wikipedia-logo-en-big.png";
* http.onReceive = (ubyte[] data) { return data.length; };
* http.onProgress = (double dltotal, double dlnow,
* double ultotal, double ulnow)
* {
* writeln("Progress ", dltotal, ", ", dlnow, ", ", ultotal, ", ", ulnow);
* return 0;
* };
* http.perform();
* ---
*
* See_Also: $(WEB www.ietf.org/rfc/rfc2616.txt, RFC2616)
*
*/
struct HTTP
{
mixin Protocol;
/// Authentication method equal to $(ECXREF curl, CurlAuth)
alias CurlAuth AuthMethod;
static private uint defaultMaxRedirects = 10;
private struct Impl
{
~this()
{
if (headersOut !is null)
curl_slist_free_all(headersOut);
if (curl.handle !is null) // work around RefCounted/emplace bug
curl.shutdown();
}
Curl curl;
curl_slist* headersOut;
string[string] headersIn;
string charset;
/// The status line of the final sub-request in a request.
StatusLine status;
private void delegate(StatusLine) onReceiveStatusLine;
/// The HTTP method to use.
Method method = Method.undefined;
}
private RefCounted!Impl p;
/** Time condition enumeration as an alias of $(ECXREF curl, CurlTimeCond)
$(WEB www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.25, _RFC2616 Section 14.25)
*/
alias CurlTimeCond TimeCond;
/**
Constructor taking the url as parameter.
*/
this(const(char)[] url)
{
initialize();
this.url = url;
}
static HTTP opCall()
{
HTTP http;
http.initialize();
return http;
}
HTTP dup()
{
HTTP copy;
copy.initialize();
copy.p.method = p.method;
curl_slist* cur = p.headersOut;
curl_slist* newlist = null;
while (cur)
{
newlist = curl_slist_append(newlist, cur.data);
cur = cur.next;
}
copy.p.headersOut = newlist;
copy.p.curl.set(CurlOption.httpheader, copy.p.headersOut);
copy.p.curl = p.curl.dup();
copy.dataTimeout = _defaultDataTimeout;
copy.onReceiveHeader(null);
return copy;
}
private void initialize()
{
p.curl.initialize();
maxRedirects = HTTP.defaultMaxRedirects;
p.charset = "ISO-8859-1"; // Default charset defined in HTTP RFC
p.method = Method.undefined;
dataTimeout = _defaultDataTimeout;
onReceiveHeader(null);
version (unittest) verbose(true);
}
/**
Perform a http request.
After the HTTP client has been setup and possibly assigned callbacks the
$(D perform()) method will start performing the request towards the
specified server.
*/
void perform()
{
_perform();
}
private CurlCode _perform(bool throwOnError = true)
{
p.status.reset();
final switch (p.method)
{
case Method.head:
p.curl.set(CurlOption.nobody, 1L);
break;
case Method.undefined:
case Method.get:
p.curl.set(CurlOption.httpget, 1L);
break;
case Method.post:
p.curl.set(CurlOption.post, 1L);
break;
case Method.put:
p.curl.set(CurlOption.upload, 1L);
break;
case Method.del:
p.curl.set(CurlOption.customrequest, "DELETE");
break;
case Method.options:
p.curl.set(CurlOption.customrequest, "OPTIONS");
break;
case Method.trace:
p.curl.set(CurlOption.customrequest, "TRACE");
break;
case Method.connect:
p.curl.set(CurlOption.customrequest, "CONNECT");
break;
}
return p.curl.perform(throwOnError);
}
/// The URL to specify the location of the resource.
@property void url(const(char)[] url)
{
if (!startsWith(url.toLower(), "http://", "https://"))
url = "http://" ~ url;
p.curl.set(CurlOption.url, url);
}
// This is a workaround for mixed in content not having its
// docs mixed in.
version (StdDdoc)
{
/// Value to return from $(D onSend)/$(D onReceive) delegates in order to
/// pause a request
alias CurlReadFunc.pause requestPause;
/// Value to return from onSend delegate in order to abort a request
alias CurlReadFunc.abort requestAbort;
/**
True if the instance is stopped. A stopped instance is not usable.
*/
@property bool isStopped();
/// Stop and invalidate this instance.
void shutdown();
/** Set verbose.
This will print request information to stderr.
*/
@property void verbose(bool on);
// Connection settings
/// Set timeout for activity on connection.
@property void dataTimeout(Duration d);
/// Set timeout for connecting.
@property void connectTimeout(Duration d);
// Network settings
/** Proxy
* See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXY, _proxy)
*/
@property void proxy(const(char)[] host);
/** Proxy port
* See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXYPORT, _proxy_port)
*/
@property void proxyPort(ushort port);
/// Type of proxy
alias etc.c.curl.CurlProxy CurlProxy;
/** Proxy type
* See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXY, _proxy_type)
*/
@property void proxyType(CurlProxy type);
/// DNS lookup timeout.
@property void dnsTimeout(Duration d);
/**
* The network interface to use in form of the the IP of the interface.
*
* Example:
* ----
* theprotocol.netInterface = "192.168.1.32";
* theprotocol.netInterface = [ 192, 168, 1, 32 ];
* ----
*
* See: $(XREF socket, InternetAddress)
*/
@property void netInterface(const(char)[] i);
/// ditto
@property void netInterface(const(ubyte)[4] i);
/// ditto
@property void netInterface(InternetAddress i);
/**
Set the local outgoing port to use.
Params:
port = the first outgoing port number to try and use
*/
@property void localPort(ushort port);
/**
Set the local outgoing port range to use.
This can be used together with the localPort property.
Params:
range = if the first port is occupied then try this many
port number forwards
*/
@property void localPortRange(ushort range);
/** Set the tcp no-delay socket option on or off.
See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTTCPNODELAY, nodelay)
*/
@property void tcpNoDelay(bool on);
// Authentication settings
/**
Set the user name, password and optionally domain for authentication
purposes.
Some protocols may need authentication in some cases. Use this
function to provide credentials.
Params:
username = the username
password = the password
domain = used for NTLM authentication only and is set to the NTLM domain
name
*/
void setAuthentication(const(char)[] username, const(char)[] password,
const(char)[] domain = "");
/**
* The event handler that gets called when data is needed for sending. The
* length of the $(D void[]) specifies the maximum number of bytes that can
* be sent.
*
* Returns:
* The callback returns the number of elements in the buffer that have been
* filled and are ready to send.
* The special value $(D .abortRequest) can be returned in order to abort the
* current request.
* The special value $(D .pauseRequest) can be returned in order to pause the
* current request.
*
* Example:
* ----
* import std.net.curl;
* string msg = "Hello world";
* auto client = HTTP("dlang.org");
* client.onSend = delegate size_t(void[] data)
* {
* auto m = cast(void[])msg;
* size_t length = m.length > data.length ? data.length : m.length;
* if (length == 0) return 0;
* data[0..length] = m[0..length];
* msg = msg[length..$];
* return length;
* };
* client.perform();
* ----
*/
@property void onSend(size_t delegate(void[]) callback);
/**
* The event handler that receives incoming data. Be sure to copy the
* incoming ubyte[] since it is not guaranteed to be valid after the
* callback returns.
*
* Returns:
* The callback returns the incoming bytes read. If not the entire array is
* the request will abort.
* The special value .pauseRequest can be returned in order to pause the
* current request.
*
* Example:
* ----
* import std.net.curl, std.stdio;
* auto client = HTTP("dlang.org");
* client.onReceive = (ubyte[] data)
* {
* writeln("Got data", to!(const(char)[])(data));
* return data.length;
* };
* client.perform();
* ----
*/
@property void onReceive(size_t delegate(ubyte[]) callback);
/**
* The event handler that gets called to inform of upload/download progress.
*
* Params:
* dlTotal = total bytes to download
* dlNow = currently downloaded bytes
* ulTotal = total bytes to upload
* ulNow = currently uploaded bytes
*
* Returns:
* Return 0 from the callback to signal success, return non-zero to abort
* transfer
*
* Example:
* ----
* import std.net.curl, std.stdio;
* auto client = HTTP("dlang.org");
* client.onProgress = delegate int(size_t dl, size_t dln, size_t ul, size_t ult)
* {
* writeln("Progress: downloaded ", dln, " of ", dl);
* writeln("Progress: uploaded ", uln, " of ", ul);
* };
* client.perform();
* ----
*/
@property void onProgress(int delegate(size_t dlTotal, size_t dlNow,
size_t ulTotal, size_t ulNow) callback);
}
/** Clear all outgoing headers.
*/
void clearRequestHeaders()
{
if (p.headersOut !is null)
curl_slist_free_all(p.headersOut);
p.headersOut = null;
p.curl.clear(CurlOption.httpheader);
}
/** Add a header e.g. "X-CustomField: Something is fishy".
*
* There is no remove header functionality. Do a $(LREF clearRequestHeaders)
* and set the needed headers instead.
*
* Example:
* ---
* import std.net.curl;
* auto client = HTTP();
* client.addRequestHeader("X-Custom-ABC", "This is the custom value");
* string content = get("dlang.org", client);
* ---
*/
void addRequestHeader(const(char)[] name, const(char)[] value)
{
string nv = format("%s: %s", name, value);
p.headersOut = curl_slist_append(p.headersOut,
cast(char*) toStringz(nv));
p.curl.set(CurlOption.httpheader, p.headersOut);
}
/** The headers read from a successful response.
*
*/
@property string[string] responseHeaders()
{
return p.headersIn;
}
/// HTTP method used.
@property void method(Method m)
{
p.method = m;
}
/// ditto
@property Method method()
{
return p.method;
}
/**
HTTP status line of last response. One call to perform may
result in several requests because of redirection.
*/
@property StatusLine statusLine()
{
return p.status;
}
// Set the active cookie string e.g. "name1=value1;name2=value2"
void setCookie(const(char)[] cookie)
{
p.curl.set(CurlOption.cookie, cookie);
}
/// Set a file path to where a cookie jar should be read/stored.
void setCookieJar(const(char)[] path)
{
p.curl.set(CurlOption.cookiefile, path);
if (path.length)
p.curl.set(CurlOption.cookiejar, path);
}
/// Flush cookie jar to disk.
void flushCookieJar()
{
p.curl.set(CurlOption.cookielist, "FLUSH");
}
/// Clear session cookies.
void clearSessionCookies()
{
p.curl.set(CurlOption.cookielist, "SESS");
}
/// Clear all cookies.
void clearAllCookies()
{
p.curl.set(CurlOption.cookielist, "ALL");
}
/**
Set time condition on the request.
Params:
cond = $(D CurlTimeCond.{none,ifmodsince,ifunmodsince,lastmod})
timestamp = Timestamp for the condition
$(WEB www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.25, _RFC2616 Section 14.25)
*/
void setTimeCondition(HTTP.TimeCond cond, SysTime timestamp)
{
p.curl.set(CurlOption.timecondition, cond);
p.curl.set(CurlOption.timevalue, timestamp.toUnixTime());
}
/** Specifying data to post when not using the onSend callback.
*
* The data is NOT copied by the library. Content-Type will default to
* application/octet-stream. Data is not converted or encoded by this
* method.
*
* Example:
* ----
* import std.net.curl, std.stdio;
* auto http = HTTP("http://www.mydomain.com");
* http.onReceive = (ubyte[] data) { writeln(to!(const(char)[])(data)); return data.length; };
* http.postData = [1,2,3,4,5];
* http.perform();
* ----
*/
@property void postData(const(void)[] data)
{
_postData(cast(void*)data.ptr, "application/octet-stream");
}
/** Specifying data to post when not using the onSend callback.
*
* The data is NOT copied by the library. Content-Type will default to
* text/plain. Data is not converted or encoded by this method.
*
* Example:
* ----
* import std.net.curl, std.stdio;
* auto http = HTTP("http://www.mydomain.com");
* http.onReceive = (ubyte[] data) { writeln(to!(const(char)[])(data)); return data.length; };
* http.postData = "The quick....";
* http.perform();
* ----
*/
@property void postData(const(char)[] data)
{
_postData(cast(void*)data.ptr, "text/plain");
}
// Helper for postData property
private void _postData(void* data, string contentType)
{
// cannot use callback when specifying data directly so it is disabled here.
// here.
p.curl.clear(CurlOption.readfunction);
addRequestHeader("Content-Type", contentType);
p.curl.set(CurlOption.postfields, data);
if (method == Method.undefined)
method = Method.post;
}
/**
* Set the event handler that receives incoming headers.
*
* The callback will receive a header field key, value as parameter. The
* $(D const(char)[]) arrays are not valid after the delegate has returned.
*
* Example:
* ----
* import std.net.curl, std.stdio;
* auto http = HTTP("dlang.org");
* http.onReceive = (ubyte[] data) { writeln(to!(const(char)[])(data)); return data.length; };
* http.onReceiveHeader = (in char[] key, in char[] value) { writeln(key, " = ", value); };
* http.perform();
* ----
*/
@property void onReceiveHeader(void delegate(in char[] key,
in char[] value) callback)
{
// Wrap incoming callback in order to separate http status line from
// http headers. On redirected requests there may be several such
// status lines. The last one is the one recorded.
auto dg = (in char[] header)
{
if (header.empty)
{
// header delimiter
return;
}
if (header.startsWith("HTTP/"))
{
string[string] empty;
p.headersIn = empty; // clear
auto m = match(header, regex(r"^HTTP/(\d+)\.(\d+) (\d+) (.*)$"));
if (m.empty)
{
// Invalid status line
}
else
{
p.status.majorVersion = to!ushort(m.captures[1]);
p.status.minorVersion = to!ushort(m.captures[2]);
p.status.code = to!ushort(m.captures[3]);
p.status.reason = m.captures[4].idup;
if (p.onReceiveStatusLine != null)
p.onReceiveStatusLine(p.status);
}
return;
}
// Normal http header
auto m = match(cast(char[]) header, regex("(.*?): (.*)$"));
auto fieldName = m.captures[1].toLower().idup;
if (fieldName == "content-type")
{
auto mct = match(cast(char[]) m.captures[2],
regex("charset=([^;]*)"));
if (!mct.empty && mct.captures.length > 1)
p.charset = mct.captures[1].idup;
}
if (!m.empty && callback !is null)
callback(fieldName, m.captures[2]);
p.headersIn[fieldName] = m.captures[2].idup;
};
p.curl.onReceiveHeader(dg);
}
/**
Callback for each received StatusLine.
Notice that several callbacks can be done for each call to
$(D perform()) due to redirections.
See_Also: $(LREF StatusLine)
*/
@property void onReceiveStatusLine(void delegate(StatusLine) callback)
{
p.onReceiveStatusLine = callback;
}
/**
The content length in bytes when using request that has content
e.g. POST/PUT and not using chunked transfer. Is set as the
"Content-Length" header. Set to size_t.max to reset to chunked transfer.
*/
@property void contentLength(size_t len)
{
CurlOption lenOpt;
// Force post if necessary
if (p.method != Method.put && p.method != Method.post)
p.method = Method.post;
if (p.method == Method.put)
lenOpt = CurlOption.infilesize_large;
else
// post
lenOpt = CurlOption.postfieldsize_large;
if (len == size_t.max)
{
// HTTP 1.1 supports requests with no length header set.
addRequestHeader("Transfer-Encoding", "chunked");
addRequestHeader("Expect", "100-continue");
}
else
{
p.curl.set(lenOpt, len);
}
}
/**
Authentication method as specified in $(LREF AuthMethod).
*/
@property void authenticationMethod(AuthMethod authMethod)
{
p.curl.set(CurlOption.httpauth, cast(long) authMethod);
}
/**
Set max allowed redirections using the location header.
uint.max for infinite.
*/
@property void maxRedirects(uint maxRedirs)
{
if (maxRedirs == uint.max)
{
// Disable
p.curl.set(CurlOption.followlocation, 0);
}
else
{
p.curl.set(CurlOption.followlocation, 1);
p.curl.set(CurlOption.maxredirs, maxRedirs);
}
}
/** <a name="HTTP.Method"/ >The standard HTTP methods :
* $(WEB www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1, _RFC2616 Section 5.1.1)
*/
enum Method
{
undefined,
head, ///
get, ///
post, ///
put, ///
del, ///
options, ///
trace, ///
connect ///
}
/**
HTTP status line ie. the first line returned in an HTTP response.
If authentication or redirections are done then the status will be for
the last response received.
*/
struct StatusLine
{
ushort majorVersion; /// Major HTTP version ie. 1 in HTTP/1.0.
ushort minorVersion; /// Minor HTTP version ie. 0 in HTTP/1.0.
ushort code; /// HTTP status line code e.g. 200.
string reason; /// HTTP status line reason string.
/// Reset this status line
@safe void reset()
{
majorVersion = 0;
minorVersion = 0;
code = 0;
reason = "";
}
///
string toString()
{
return format("%s %s (%s.%s)",
code, reason, majorVersion, minorVersion);
}
}
} // HTTP
/**
FTP client functionality.
See_Also: $(WEB tools.ietf.org/html/rfc959, RFC959)
*/
struct FTP
{
mixin Protocol;
private struct Impl
{
~this()
{
if (commands !is null)
curl_slist_free_all(commands);
if (curl.handle !is null) // work around RefCounted/emplace bug
curl.shutdown();
}
curl_slist* commands;
Curl curl;
string encoding;
}
private RefCounted!Impl p;
/**
FTP access to the specified url.
*/
this(const(char)[] url)
{
initialize();
this.url = url;
}
static FTP opCall()
{
FTP ftp;
ftp.initialize();
return ftp;
}
FTP dup()
{
FTP copy = FTP();
copy.p.encoding = p.encoding;
copy.p.curl = p.curl.dup();
curl_slist* cur = p.commands;
curl_slist* newlist = null;
while (cur)
{
newlist = curl_slist_append(newlist, cur.data);
cur = cur.next;
}
copy.p.commands = newlist;
copy.p.curl.set(CurlOption.postquote, copy.p.commands);
copy.dataTimeout = _defaultDataTimeout;
return copy;
}
private void initialize()
{
p.curl.initialize();
p.encoding = "ISO-8859-1";
dataTimeout = _defaultDataTimeout;
version (unittest) verbose(true);
}
/**
Performs the ftp request as it has been configured.
After a FTP client has been setup and possibly assigned callbacks the $(D
perform()) method will start performing the actual communication with the
server.
*/
void perform()
{
_perform();
}
private CurlCode _perform(bool throwOnError = true)
{
return p.curl.perform(throwOnError);
}
/// The URL to specify the location of the resource.
@property void url(const(char)[] url)
{
if (!startsWith(url.toLower(), "ftp://", "ftps://"))
url = "ftp://" ~ url;
p.curl.set(CurlOption.url, url);
}
// This is a workaround for mixed in content not having its
// docs mixed in.
version (StdDdoc)
{
/// Value to return from $(D onSend)/$(D onReceive) delegates in order to
/// pause a request
alias CurlReadFunc.pause requestPause;
/// Value to return from onSend delegate in order to abort a request
alias CurlReadFunc.abort requestAbort;
/**
True if the instance is stopped. A stopped instance is not usable.
*/
@property bool isStopped();
/// Stop and invalidate this instance.
void shutdown();
/** Set verbose.
This will print request information to stderr.
*/
@property void verbose(bool on);
// Connection settings
/// Set timeout for activity on connection.
@property void dataTimeout(Duration d);
/// Set timeout for connecting.
@property void connectTimeout(Duration d);
// Network settings
/** Proxy
* See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXY, _proxy)
*/
@property void proxy(const(char)[] host);
/** Proxy port
* See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXYPORT, _proxy_port)
*/
@property void proxyPort(ushort port);
/// Type of proxy
alias etc.c.curl.CurlProxy CurlProxy;
/** Proxy type
* See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXY, _proxy_type)
*/
@property void proxyType(CurlProxy type);
/// DNS lookup timeout.
@property void dnsTimeout(Duration d);
/**
* The network interface to use in form of the the IP of the interface.
*
* Example:
* ----
* theprotocol.netInterface = "192.168.1.32";
* theprotocol.netInterface = [ 192, 168, 1, 32 ];
* ----
*
* See: $(XREF socket, InternetAddress)
*/
@property void netInterface(const(char)[] i);
/// ditto
@property void netInterface(const(ubyte)[4] i);
/// ditto
@property void netInterface(InternetAddress i);
/**
Set the local outgoing port to use.
Params:
port = the first outgoing port number to try and use
*/
@property void localPort(ushort port);
/**
Set the local outgoing port range to use.
This can be used together with the localPort property.
Params:
range = if the first port is occupied then try this many
port number forwards
*/
@property void localPortRange(ushort range);
/** Set the tcp no-delay socket option on or off.
See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTTCPNODELAY, nodelay)
*/
@property void tcpNoDelay(bool on);
// Authentication settings
/**
Set the user name, password and optionally domain for authentication
purposes.
Some protocols may need authentication in some cases. Use this
function to provide credentials.
Params:
username = the username
password = the password
domain = used for NTLM authentication only and is set to the NTLM domain
name
*/
void setAuthentication(const(char)[] username, const(char)[] password,
const(char)[] domain = "");
/**
* The event handler that gets called when data is needed for sending. The
* length of the $(D void[]) specifies the maximum number of bytes that can
* be sent.
*
* Returns:
* The callback returns the number of elements in the buffer that have been
* filled and are ready to send.
* The special value $(D .abortRequest) can be returned in order to abort the
* current request.
* The special value $(D .pauseRequest) can be returned in order to pause the
* current request.
*
*/
@property void onSend(size_t delegate(void[]) callback);
/**
* The event handler that receives incoming data. Be sure to copy the
* incoming ubyte[] since it is not guaranteed to be valid after the
* callback returns.
*
* Returns:
* The callback returns the incoming bytes read. If not the entire array is
* the request will abort.
* The special value .pauseRequest can be returned in order to pause the
* current request.
*
*/
@property void onReceive(size_t delegate(ubyte[]) callback);
/**
* The event handler that gets called to inform of upload/download progress.
*
* Params:
* dlTotal = total bytes to download
* dlNow = currently downloaded bytes
* ulTotal = total bytes to upload
* ulNow = currently uploaded bytes
*
* Returns:
* Return 0 from the callback to signal success, return non-zero to abort
* transfer
*/
@property void onProgress(int delegate(size_t dlTotal, size_t dlNow,
size_t ulTotal, size_t ulNow) callback);
}
/** Clear all commands send to ftp server.
*/
void clearCommands()
{
if (p.commands !is null)
curl_slist_free_all(p.commands);
p.commands = null;
p.curl.clear(CurlOption.postquote);
}
/** Add a command to send to ftp server.
*
* There is no remove command functionality. Do a $(LREF clearCommands) and
* set the needed commands instead.
*
* Example:
* ---
* import std.net.curl;
* auto client = FTP();
* client.addCommand("RNFR my_file.txt");
* client.addCommand("RNTO my_renamed_file.txt");
* upload("my_file.txt", "ftp.digitalmars.com", client);
* ---
*/
void addCommand(const(char)[] command)
{
p.commands = curl_slist_append(p.commands,
cast(char*) toStringz(command));
p.curl.set(CurlOption.postquote, p.commands);
}
@property void encoding(string name)
{
p.encoding = name;
}
@property string encoding()
{
return p.encoding;
}
/**
The content length in bytes of the ftp data.
*/
@property void contentLength(size_t len)
{
p.curl.set(CurlOption.infilesize_large, len);
}
}
/**
* Basic SMTP protocol support.
*
* Example:
* ---
* import std.net.curl;
*
* // Send an email with SMTPS
* auto smtp = SMTP("smtps://smtp.gmail.com");
* smtp.setAuthentication("from.addr@gmail.com", "password");
* smtp.mailTo = ["<to.addr@gmail.com>"];
* smtp.mailFrom = "<from.addr@gmail.com>";
* smtp.message = "Example Message";
* smtp.perform();
* ---
*
* See_Also: $(WEB www.ietf.org/rfc/rfc2821.txt, RFC2821)
*/
struct SMTP
{
mixin Protocol;
private struct Impl
{
~this()
{
if (curl.handle !is null) // work around RefCounted/emplace bug
curl.shutdown();
}
Curl curl;
}
private RefCounted!Impl p;
/**
Sets to the URL of the SMTP server.
*/
this(string url)
{
p.curl.initialize();
auto lowered = url.toLower();
if (lowered.startsWith("smtps://"))
{
p.curl.set(CurlOption.use_ssl, CurlUseSSL.all);
p.curl.set(CurlOption.ssl_verifypeer, false);
p.curl.set(CurlOption.ssl_verifyhost, 2);
}
else
{
enforceEx!CurlException(lowered.startsWith("smtp://"),
"The url must be for the smtp protocol.");
}
p.curl.set(CurlOption.url, url);
dataTimeout = _defaultDataTimeout;
}
/**
Performs the request as configured.
*/
void perform()
{
p.curl.perform();
}
/// The URL to specify the location of the resource.
@property void url(const(char)[] url)
{
if (!startsWith(url.toLower(), "smtp://", "smtps://"))
url = "smtp://" ~ url;
p.curl.set(CurlOption.url, url);
}
// This is a workaround for mixed in content not having its
// docs mixed in.
version (StdDdoc)
{
/// Value to return from $(D onSend)/$(D onReceive) delegates in order to
/// pause a request
alias CurlReadFunc.pause requestPause;
/// Value to return from onSend delegate in order to abort a request
alias CurlReadFunc.abort requestAbort;
/**
True if the instance is stopped. A stopped instance is not usable.
*/
@property bool isStopped();
/// Stop and invalidate this instance.
void shutdown();
/** Set verbose.
This will print request information to stderr.
*/
@property void verbose(bool on);
// Connection settings
/// Set timeout for activity on connection.
@property void dataTimeout(Duration d);
/// Set timeout for connecting.
@property void connectTimeout(Duration d);
// Network settings
/** Proxy
* See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXY, _proxy)
*/
@property void proxy(const(char)[] host);
/** Proxy port
* See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXYPORT, _proxy_port)
*/
@property void proxyPort(ushort port);
/// Type of proxy
alias etc.c.curl.CurlProxy CurlProxy;
/** Proxy type
* See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXY, _proxy_type)
*/
@property void proxyType(CurlProxy type);
/// DNS lookup timeout.
@property void dnsTimeout(Duration d);
/**
* The network interface to use in form of the the IP of the interface.
*
* Example:
* ----
* theprotocol.netInterface = "192.168.1.32";
* theprotocol.netInterface = [ 192, 168, 1, 32 ];
* ----
*
* See: $(XREF socket, InternetAddress)
*/
@property void netInterface(const(char)[] i);
/// ditto
@property void netInterface(const(ubyte)[4] i);
/// ditto
@property void netInterface(InternetAddress i);
/**
Set the local outgoing port to use.
Params:
port = the first outgoing port number to try and use
*/
@property void localPort(ushort port);
/**
Set the local outgoing port range to use.
This can be used together with the localPort property.
Params:
range = if the first port is occupied then try this many
port number forwards
*/
@property void localPortRange(ushort range);
/** Set the tcp no-delay socket option on or off.
See: $(WEB curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTTCPNODELAY, nodelay)
*/
@property void tcpNoDelay(bool on);
// Authentication settings
/**
Set the user name, password and optionally domain for authentication
purposes.
Some protocols may need authentication in some cases. Use this
function to provide credentials.
Params:
username = the username
password = the password
domain = used for NTLM authentication only and is set to the NTLM domain
name
*/
void setAuthentication(const(char)[] username, const(char)[] password,
const(char)[] domain = "");
/**
* The event handler that gets called when data is needed for sending. The
* length of the $(D void[]) specifies the maximum number of bytes that can
* be sent.
*
* Returns:
* The callback returns the number of elements in the buffer that have been
* filled and are ready to send.
* The special value $(D .abortRequest) can be returned in order to abort the
* current request.
* The special value $(D .pauseRequest) can be returned in order to pause the
* current request.
*/
@property void onSend(size_t delegate(void[]) callback);
/**
* The event handler that receives incoming data. Be sure to copy the
* incoming ubyte[] since it is not guaranteed to be valid after the
* callback returns.
*
* Returns:
* The callback returns the incoming bytes read. If not the entire array is
* the request will abort.
* The special value .pauseRequest can be returned in order to pause the
* current request.
*/
@property void onReceive(size_t delegate(ubyte[]) callback);
/**
* The event handler that gets called to inform of upload/download progress.
*
* Params:
* dlTotal = total bytes to download
* dlNow = currently downloaded bytes
* ulTotal = total bytes to upload
* ulNow = currently uploaded bytes
*
* Returns:
* Return 0 from the callback to signal success, return non-zero to abort
* transfer
*/
@property void onProgress(int delegate(size_t dlTotal, size_t dlNow,
size_t ulTotal, size_t ulNow) callback);
}
/**
Setter for the sender's email address.
*/
@property void mailFrom()(const(char)[] sender)
{
assert(!sender.empty, "Sender must not be empty");
p.curl.set(CurlOption.mail_from, sender);
}
/**
Setter for the recipient email addresses.
*/
void mailTo()(const(char)[][] recipients...)
{
assert(!recipients.empty, "Recipient must not be empty");
curl_slist* recipients_list = null;
foreach(recipient; recipients)
{
recipients_list =
curl_slist_append(recipients_list,
cast(char*)toStringz(recipient));
}
p.curl.set(CurlOption.mail_rcpt, recipients_list);
}
/**
Sets the message body text.
*/
@property void message(string msg)
{
auto _message = msg;
/**
This delegate reads the message text and copies it.
*/
p.curl.onSend = delegate size_t(void[] data)
{
if (!msg.length) return 0;
auto m = cast(void[])msg;
size_t to_copy = min(data.length, _message.length);
data[0..to_copy] = (cast(void[])_message)[0..to_copy];
_message = _message[to_copy..$];
return to_copy;
};
}
}
/++
Exception thrown on errors in std.net.curl functions.
+/
class CurlException : Exception
{
/++
Params:
msg = The message for the exception.
file = The file where the exception occurred.
line = The line number where the exception occurred.
next = The previous exception in the chain of exceptions, if any.
+/
this(string msg,
string file = __FILE__,
size_t line = __LINE__,
Throwable next = null)
{
super(msg, file, line, next);
}
}
/++
Exception thrown on timeout errors in std.net.curl functions.
+/
class CurlTimeoutException : CurlException
{
/++
Params:
msg = The message for the exception.
file = The file where the exception occurred.
line = The line number where the exception occurred.
next = The previous exception in the chain of exceptions, if any.
+/
this(string msg,
string file = __FILE__,
size_t line = __LINE__,
Throwable next = null)
{
super(msg, file, line, next);
}
}
/// Equal to $(ECXREF curl, CURLcode)
alias CURLcode CurlCode;
/**
Wrapper to provide a better interface to libcurl than using the plain C API.
It is recommended to use the $(D HTTP)/$(D FTP) etc. structs instead unless
raw access to libcurl is needed.
*/
struct Curl
{
shared static this()
{
// initialize early to prevent thread races
enforceEx!CurlException(!curl_global_init(CurlGlobal.all),
"Couldn't initialize libcurl");
}
shared static ~this()
{
curl_global_cleanup();
}
alias void[] OutData;
alias ubyte[] InData;
bool stopped;
// A handle should not be used by two threads simultaneously
private CURL* handle;
// May also return $(D CURL_READFUNC_ABORT) or $(D CURL_READFUNC_PAUSE)
private size_t delegate(OutData) _onSend;
private size_t delegate(InData) _onReceive;
private void delegate(in char[]) _onReceiveHeader;
private CurlSeek delegate(long,CurlSeekPos) _onSeek;
private int delegate(curl_socket_t,CurlSockType) _onSocketOption;
private int delegate(size_t dltotal, size_t dlnow,
size_t ultotal, size_t ulnow) _onProgress;
alias CurlReadFunc.pause requestPause;
alias CurlReadFunc.abort requestAbort;
/**
Initialize the instance by creating a working curl handle.
*/
void initialize()
{
enforceEx!CurlException(!handle, "Curl instance already initialized");
handle = curl_easy_init();
enforceEx!CurlException(handle, "Curl instance couldn't be initialized");
stopped = false;
set(CurlOption.nosignal, 1);
}
/**
Duplicate this handle.
The new handle will have all options set as the one it was duplicated
from. An exception to this is that all options that cannot be shared
across threads are reset thereby making it safe to use the duplicate
in a new thread.
*/
Curl dup()
{
Curl copy;
copy.handle = curl_easy_duphandle(handle);
copy.stopped = false;
with (CurlOption) {
auto tt = TypeTuple!(file, writefunction, writeheader,
headerfunction, infile,
readfunction, ioctldata, ioctlfunction,
seekdata, seekfunction, sockoptdata,
sockoptfunction, opensocketdata,
opensocketfunction, noprogress,
progressdata, progressfunction,
debugdata, debugfunction,
ssl_ctx_function, interleavedata,
interleavefunction, chunk_data,
chunk_bgn_function, chunk_end_function,
fnmatch_data, fnmatch_function,
ssh_keydata, cookiejar, postfields);
foreach(option; tt)
copy.clear(option);
}
// Enable for curl version > 7.21.7
static if (LIBCURL_VERSION_MAJOR >= 7 &&
LIBCURL_VERSION_MINOR >= 21 &&
LIBCURL_VERSION_PATCH >= 7)
{
copy.clear(CurlOption.closesocketdata);
copy.clear(CurlOption.closesocketfunction);
}
copy.set(CurlOption.nosignal, 1);
// copy.clear(CurlOption.ssl_ctx_data); Let ssl function be shared
// copy.clear(CurlOption.ssh_keyfunction); Let key function be shared
/*
Allow sharing of conv functions
copy.clear(CurlOption.conv_to_network_function);
copy.clear(CurlOption.conv_from_network_function);
copy.clear(CurlOption.conv_from_utf8_function);
*/
return copy;
}
private void _check(CurlCode code)
{
enforceEx!CurlTimeoutException(code != CurlError.operation_timedout,
errorString(code));
enforceEx!CurlException(code == CurlError.ok,
errorString(code));
}
private string errorString(CurlCode code)
{
auto msgZ = curl_easy_strerror(code);
// doing the following (instead of just using std.conv.to!string) avoids 1 allocation
return format("%s on handle %s", msgZ[0 .. core.stdc.string.strlen(msgZ)], handle);
}
private void throwOnStopped(string message = null)
{
auto def = "Curl instance called after being cleaned up";
enforceEx!CurlException(!stopped,
message == null ? def : message);
}
/**
Stop and invalidate this curl instance.
Warning: Do not call this from inside a callback handler e.g. $(D onReceive).
*/
void shutdown()
{
throwOnStopped();
stopped = true;
curl_easy_cleanup(this.handle);
this.handle = null;
}
/**
Pausing and continuing transfers.
*/
void pause(bool sendingPaused, bool receivingPaused)
{
throwOnStopped();
_check(curl_easy_pause(this.handle,
(sendingPaused ? CurlPause.send_cont : CurlPause.send) |
(receivingPaused ? CurlPause.recv_cont : CurlPause.recv)));
}
/**
Set a string curl option.
Params:
option = A $(ECXREF curl, CurlOption) as found in the curl documentation
value = The string
*/
void set(CurlOption option, const(char)[] value)
{
throwOnStopped();
_check(curl_easy_setopt(this.handle, option, toStringz(value)));
}
/**
Set a long curl option.
Params:
option = A $(ECXREF curl, CurlOption) as found in the curl documentation
value = The long
*/
void set(CurlOption option, long value)
{
throwOnStopped();
_check(curl_easy_setopt(this.handle, option, value));
}
/**
Set a void* curl option.
Params:
option = A $(ECXREF curl, CurlOption) as found in the curl documentation
value = The pointer
*/
void set(CurlOption option, void* value)
{
throwOnStopped();
_check(curl_easy_setopt(this.handle, option, value));
}
/**
Clear a pointer option.
Params:
option = A $(ECXREF curl, CurlOption) as found in the curl documentation
*/
void clear(CurlOption option)
{
throwOnStopped();
_check(curl_easy_setopt(this.handle, option, null));
}
/**
perform the curl request by doing the HTTP,FTP etc. as it has
been setup beforehand.
*/
CurlCode perform(bool throwOnError = true)
{
throwOnStopped();
CurlCode code = curl_easy_perform(this.handle);
if (throwOnError)
_check(code);
return code;
}
/**
* The event handler that receives incoming data.
*
* Params:
* callback = the callback that receives the $(D ubyte[]) data.
* Be sure to copy the incoming data and not store
* a slice.
*
* Returns:
* The callback returns the incoming bytes read. If not the entire array is
* the request will abort.
* The special value HTTP.pauseRequest can be returned in order to pause the
* current request.
*
* Example:
* ----
* import std.net.curl, std.stdio;
* Curl curl;
* curl.initialize();
* curl.set(CurlOption.url, "http://dlang.org");
* curl.onReceive = (ubyte[] data) { writeln("Got data", to!(const(char)[])(data)); return data.length;};
* curl.perform();
* ----
*/
@property void onReceive(size_t delegate(InData) callback)
{
_onReceive = (InData id)
{
throwOnStopped("Receive callback called on cleaned up Curl instance");
return callback(id);
};
set(CurlOption.file, cast(void*) &this);
set(CurlOption.writefunction, cast(void*) &Curl._receiveCallback);
}
/**
* The event handler that receives incoming headers for protocols
* that uses headers.
*
* Params:
* callback = the callback that receives the header string.
* Make sure the callback copies the incoming params if
* it needs to store it because they are references into
* the backend and may very likely change.
*
* Example:
* ----
* import std.net.curl, std.stdio;
* Curl curl;
* curl.initialize();
* curl.set(CurlOption.url, "http://dlang.org");
* curl.onReceiveHeader = (in char[] header) { writeln(header); };
* curl.perform();
* ----
*/
@property void onReceiveHeader(void delegate(in char[]) callback)
{
_onReceiveHeader = (in char[] od)
{
throwOnStopped("Receive header callback called on "
"cleaned up Curl instance");
callback(od);
};
set(CurlOption.writeheader, cast(void*) &this);
set(CurlOption.headerfunction,
cast(void*) &Curl._receiveHeaderCallback);
}
/**
* The event handler that gets called when data is needed for sending.
*
* Params:
* callback = the callback that has a $(D void[]) buffer to be filled
*
* Returns:
* The callback returns the number of elements in the buffer that have been
* filled and are ready to send.
* The special value $(D Curl.abortRequest) can be returned in
* order to abort the current request.
* The special value $(D Curl.pauseRequest) can be returned in order to
* pause the current request.
*
* Example:
* ----
* import std.net.curl;
* Curl curl;
* curl.initialize();
* curl.set(CurlOption.url, "http://dlang.org");
*
* string msg = "Hello world";
* curl.onSend = (void[] data)
* {
* auto m = cast(void[])msg;
* size_t length = m.length > data.length ? data.length : m.length;
* if (length == 0) return 0;
* data[0..length] = m[0..length];
* msg = msg[length..$];
* return length;
* };
* curl.perform();
* ----
*/
@property void onSend(size_t delegate(OutData) callback)
{
_onSend = (OutData od)
{
throwOnStopped("Send callback called on cleaned up Curl instance");
return callback(od);
};
set(CurlOption.infile, cast(void*) &this);
set(CurlOption.readfunction, cast(void*) &Curl._sendCallback);
}
/**
* The event handler that gets called when the curl backend needs to seek
* the data to be sent.
*
* Params:
* callback = the callback that receives a seek offset and a seek position
* $(ECXREF curl, CurlSeekPos)
*
* Returns:
* The callback returns the success state of the seeking
* $(ECXREF curl, CurlSeek)
*
* Example:
* ----
* import std.net.curl;
* Curl curl;
* curl.initialize();
* curl.set(CurlOption.url, "http://dlang.org");
* curl.onSeek = (long p, CurlSeekPos sp)
* {
* return CurlSeek.cantseek;
* };
* curl.perform();
* ----
*/
@property void onSeek(CurlSeek delegate(long, CurlSeekPos) callback)
{
_onSeek = (long ofs, CurlSeekPos sp)
{
throwOnStopped("Seek callback called on cleaned up Curl instance");
return callback(ofs, sp);
};
set(CurlOption.seekdata, cast(void*) &this);
set(CurlOption.seekfunction, cast(void*) &Curl._seekCallback);
}
/**
* The event handler that gets called when the net socket has been created
* but a $(D connect()) call has not yet been done. This makes it possible to set
* misc. socket options.
*
* Params:
* callback = the callback that receives the socket and socket type
* $(ECXREF curl, CurlSockType)
*
* Returns:
* Return 0 from the callback to signal success, return 1 to signal error
* and make curl close the socket
*
* Example:
* ----
* import std.net.curl;
* Curl curl;
* curl.initialize();
* curl.set(CurlOption.url, "http://dlang.org");
* curl.onSocketOption = delegate int(curl_socket_t s, CurlSockType t) { /+ do stuff +/ };
* curl.perform();
* ----
*/
@property void onSocketOption(int delegate(curl_socket_t,
CurlSockType) callback)
{
_onSocketOption = (curl_socket_t sock, CurlSockType st)
{
throwOnStopped("Socket option callback called on "
"cleaned up Curl instance");
return callback(sock, st);
};
set(CurlOption.sockoptdata, cast(void*) &this);
set(CurlOption.sockoptfunction,
cast(void*) &Curl._socketOptionCallback);
}
/**
* The event handler that gets called to inform of upload/download progress.
*
* Params:
* callback = the callback that receives the (total bytes to download,
* currently downloaded bytes, total bytes to upload, currently uploaded
* bytes).
*
* Returns:
* Return 0 from the callback to signal success, return non-zero to abort
* transfer
*
* Example:
* ----
* import std.net.curl;
* Curl curl;
* curl.initialize();
* curl.set(CurlOption.url, "http://dlang.org");
* curl.onProgress = delegate int(size_t dltotal, size_t dlnow, size_t ultotal, size_t uln)
* {
* writeln("Progress: downloaded bytes ", dlnow, " of ", dltotal);
* writeln("Progress: uploaded bytes ", ulnow, " of ", ultotal);
* curl.perform();
* };
* ----
*/
@property void onProgress(int delegate(size_t dlTotal,
size_t dlNow,
size_t ulTotal,
size_t ulNow) callback)
{
_onProgress = (size_t dlt, size_t dln, size_t ult, size_t uln)
{
throwOnStopped("Progress callback called on cleaned "
"up Curl instance");
return callback(dlt, dln, ult, uln);
};
set(CurlOption.noprogress, 0);
set(CurlOption.progressdata, cast(void*) &this);
set(CurlOption.progressfunction, cast(void*) &Curl._progressCallback);
}
// Internal C callbacks to register with libcurl
extern (C) private static
size_t _receiveCallback(const char* str,
size_t size, size_t nmemb, void* ptr)
{
auto b = cast(Curl*) ptr;
if (b._onReceive != null)
return b._onReceive(cast(InData)(str[0..size*nmemb]));
return size*nmemb;
}
extern (C) private static
size_t _receiveHeaderCallback(const char* str,
size_t size, size_t nmemb, void* ptr)
{
auto b = cast(Curl*) ptr;
auto s = str[0..size*nmemb].chomp();
if (b._onReceiveHeader != null)
b._onReceiveHeader(s);
return size*nmemb;
}
extern (C) private static
size_t _sendCallback(char *str, size_t size, size_t nmemb, void *ptr)
{
Curl* b = cast(Curl*) ptr;
auto a = cast(void[]) str[0..size*nmemb];
if (b._onSend == null)
return 0;
return b._onSend(a);
}
extern (C) private static
int _seekCallback(void *ptr, curl_off_t offset, int origin)
{
auto b = cast(Curl*) ptr;
if (b._onSeek == null)
return CurlSeek.cantseek;
// origin: CurlSeekPos.set/current/end
// return: CurlSeek.ok/fail/cantseek
return b._onSeek(cast(long) offset, cast(CurlSeekPos) origin);
}
extern (C) private static
int _socketOptionCallback(void *ptr,
curl_socket_t curlfd, curlsocktype purpose)
{
auto b = cast(Curl*) ptr;
if (b._onSocketOption == null)
return 0;
// return: 0 ok, 1 fail
return b._onSocketOption(curlfd, cast(CurlSockType) purpose);
}
extern (C) private static
int _progressCallback(void *ptr,
double dltotal, double dlnow,
double ultotal, double ulnow)
{
auto b = cast(Curl*) ptr;
if (b._onProgress == null)
return 0;
// return: 0 ok, 1 fail
return b._onProgress(cast(size_t)dltotal, cast(size_t)dlnow,
cast(size_t)ultotal, cast(size_t)ulnow);
}
}
// Internal messages send between threads.
// The data is wrapped in this struct in order to ensure that
// other std.concurrency.receive calls does not pick up our messages
// by accident.
private struct CurlMessage(T)
{
public T data;
}
private static CurlMessage!T curlMessage(T)(T data)
{
return CurlMessage!T(data);
}
// Pool of to be used for reusing buffers
private struct Pool(Data)
{
private struct Entry
{
Data data;
Entry* next;
};
private Entry* root;
private Entry* freeList;
@safe @property bool empty()
{
return root == null;
}
@safe nothrow void push(Data d)
{
if (freeList == null)
{
// Allocate new Entry since there is no one
// available in the freeList
freeList = new Entry;
}
freeList.data = d;
Entry* oldroot = root;
root = freeList;
freeList = freeList.next;
root.next = oldroot;
}
@safe Data pop()
{
enforceEx!Exception(root != null, "pop() called on empty pool");
auto d = root.data;
auto n = root.next;
root.next = freeList;
freeList = root;
root = n;
return d;
}
};
// Shared function for reading incoming chunks of data and
// sending the to a parent thread
private static size_t _receiveAsyncChunks(ubyte[] data, ref ubyte[] outdata,
Pool!(ubyte[]) freeBuffers,
ref ubyte[] buffer, Tid fromTid,
ref bool aborted)
{
immutable datalen = data.length;
// Copy data to fill active buffer
while (!data.empty)
{
// Make sure a buffer is present
while ( outdata.empty && freeBuffers.empty)
{
// Active buffer is invalid and there are no
// available buffers in the pool. Wait for buffers
// to return from main thread in order to reuse
// them.
receive((immutable(ubyte)[] buf)
{
buffer = cast(ubyte[])buf;
outdata = buffer[];
},
(bool flag) { aborted = true; }
);
if (aborted) return cast(size_t)0;
}
if (outdata.empty)
{
buffer = freeBuffers.pop();
outdata = buffer[];
}
// Copy data
auto copyBytes = outdata.length < data.length ?
outdata.length : data.length;
outdata[0..copyBytes] = data[0..copyBytes];
outdata = outdata[copyBytes..$];
data = data[copyBytes..$];
if (outdata.empty)
fromTid.send(thisTid(), curlMessage(cast(immutable(ubyte)[])buffer));
}
return datalen;
}
// ditto
private static void _finalizeAsyncChunks(ubyte[] outdata, ref ubyte[] buffer,
Tid fromTid)
{
if (!outdata.empty)
{
// Resize the last buffer
buffer.length = buffer.length - outdata.length;
fromTid.send(thisTid(), curlMessage(cast(immutable(ubyte)[])buffer));
}
}
// Shared function for reading incoming lines of data and sending the to a
// parent thread
private static size_t _receiveAsyncLines(Terminator, Unit)
(const(ubyte)[] data, ref EncodingScheme encodingScheme,
bool keepTerminator, Terminator terminator,
ref const(ubyte)[] leftOverBytes, ref bool bufferValid,
ref Pool!(Unit[]) freeBuffers, ref Unit[] buffer,
Tid fromTid, ref bool aborted)
{
immutable datalen = data.length;
// Terminator is specified and buffers should be resized as determined by
// the terminator
// Copy data to active buffer until terminator is found.
// Decode as many lines as possible
while (true)
{
// Make sure a buffer is present
while (!bufferValid && freeBuffers.empty)
{
// Active buffer is invalid and there are no available buffers in
// the pool. Wait for buffers to return from main thread in order to
// reuse them.
receive((immutable(Unit)[] buf)
{
buffer = cast(Unit[])buf;
buffer.length = 0;
buffer.assumeSafeAppend();
bufferValid = true;
},
(bool flag) { aborted = true; }
);
if (aborted) return cast(size_t)0;
}
if (!bufferValid)
{
buffer = freeBuffers.pop();
bufferValid = true;
}
// Try to read a line from left over bytes from last onReceive plus the
// newly received bytes.
try
{
if (decodeLineInto(leftOverBytes, data, buffer,
encodingScheme, terminator))
{
if (keepTerminator)
{
fromTid.send(thisTid(),
curlMessage(cast(immutable(Unit)[])buffer));
}
else
{
static if (isArray!Terminator)
fromTid.send(thisTid(),
curlMessage(cast(immutable(Unit)[])
buffer[0..$-terminator.length]));
else
fromTid.send(thisTid(),
curlMessage(cast(immutable(Unit)[])
buffer[0..$-1]));
}
bufferValid = false;
}
else
{
// Could not decode an entire line. Save
// bytes left in data for next call to
// onReceive. Can be up to a max of 4 bytes.
enforceEx!CurlException(data.length <= 4,
format(
"Too many bytes left not decoded %s"
" > 4. Maybe the charset specified in"
" headers does not match "
"the actual content downloaded?",
data.length));
leftOverBytes ~= data;
break;
}
}
catch (CurlException ex)
{
prioritySend(fromTid, cast(immutable(CurlException))ex);
return cast(size_t)0;
}
}
return datalen;
}
// ditto
private static
void _finalizeAsyncLines(Unit)(bool bufferValid, Unit[] buffer, Tid fromTid)
{
if (bufferValid && buffer.length != 0)
fromTid.send(thisTid(), curlMessage(cast(immutable(Unit)[])buffer[0..$]));
}
// Spawn a thread for handling the reading of incoming data in the
// background while the delegate is executing. This will optimize
// throughput by allowing simultaneous input (this struct) and
// output (e.g. AsyncHTTPLineOutputRange).
private static void _spawnAsync(Conn, Unit, Terminator = void)()
{
Tid fromTid = receiveOnly!Tid();
// Get buffer to read into
Pool!(Unit[]) freeBuffers; // Free list of buffer objects
// Number of bytes filled into active buffer
Unit[] buffer;
bool aborted = false;
EncodingScheme encodingScheme;
static if ( !is(Terminator == void))
{
// Only lines reading will receive a terminator
auto terminator = receiveOnly!Terminator();
auto keepTerminator = receiveOnly!bool();
// max number of bytes to carry over from an onReceive
// callback. This is 4 because it is the max code units to
// decode a code point in the supported encodings.
auto leftOverBytes = new const(ubyte)[4];
leftOverBytes.length = 0;
auto bufferValid = false;
}
else
{
Unit[] outdata;
}
// no move semantic available in std.concurrency ie. must use casting.
auto connDup = cast(CURL*)receiveOnly!ulong();
auto client = Conn();
client.p.curl.handle = connDup;
// receive a method for both ftp and http but just use it for http
auto method = receiveOnly!(HTTP.Method)();
client.onReceive = (ubyte[] data)
{
// If no terminator is specified the chunk size is fixed.
static if ( is(Terminator == void) )
return _receiveAsyncChunks(data, outdata, freeBuffers, buffer,
fromTid, aborted);
else
return _receiveAsyncLines(data, encodingScheme,
keepTerminator, terminator, leftOverBytes,
bufferValid, freeBuffers, buffer,
fromTid, aborted);
};
static if ( is(Conn == HTTP) )
{
client.method = method;
// register dummy header handler
client.onReceiveHeader = (in char[] key, in char[] value)
{
if (key == "content-type")
encodingScheme = EncodingScheme.create(client.p.charset);
};
}
else
{
encodingScheme = EncodingScheme.create(client.encoding);
}
// Start the request
CurlCode code;
try
{
code = client._perform(false);
}
catch (Exception ex)
{
prioritySend(fromTid, cast(immutable(Exception)) ex);
fromTid.send(thisTid(), curlMessage(true)); // signal done
return;
}
if (code != CurlError.ok)
{
if (aborted && (code == CurlError.aborted_by_callback ||
code == CurlError.write_error))
{
fromTid.send(thisTid(), curlMessage(true)); // signal done
return;
}
prioritySend(fromTid, cast(immutable(CurlException))
new CurlException(client.p.curl.errorString(code)));
fromTid.send(thisTid(), curlMessage(true)); // signal done
return;
}
// Send remaining data that is not a full chunk size
static if ( is(Terminator == void) )
_finalizeAsyncChunks(outdata, buffer, fromTid);
else
_finalizeAsyncLines(bufferValid, buffer, fromTid);
fromTid.send(thisTid(), curlMessage(true)); // signal done
}
version (unittest) private auto netAllowed()
{
return getenv("PHOBOS_TEST_ALLOW_NET") != null;
}
|
D
|
instance DIA_Ambient_NEWS(C_Info)
{
nr = 1;
condition = DIA_Ambient_NEWS_Condition;
information = DIA_Ambient_NEWS_Info;
permanent = TRUE;
important = TRUE;
};
func int DIA_Ambient_NEWS_Condition()
{
if(Npc_IsInState(self,ZS_Talk) && (B_GetPlayerCrime(self) != CRIME_NONE) && (self.aivar[AIV_ToughGuy] == FALSE))
{
return TRUE;
};
};
func void DIA_Ambient_NEWS_Info()
{
if(B_GetPlayerCrime(self) == CRIME_SHEEPKILLER)
{
B_Say(self,other,"$SHEEPKILLER_CRIME");
};
if(B_GetPlayerCrime(self) == CRIME_ATTACK)
{
B_Say(self,other,"$ATTACK_CRIME");
};
if(B_GetPlayerCrime(self) == CRIME_THEFT)
{
B_Say(self,other,"$THEFT_CRIME");
};
if(C_NpcBelongsToCity(self))
{
if((other.guild == GIL_PAL) && (Hagen_Schulden <= 0))
{
B_Say(self,other,"$PAL_CITY_CRIME");
}
else if((other.guild == GIL_MIL) && (Andre_Schulden <= 0))
{
B_Say(self,other,"$MIL_CITY_CRIME");
}
else if(Andre_Schulden <= 0)
{
B_Say(self,other,"$CITY_CRIME");
};
};
if(C_NpcBelongsToMonastery(self) && (Parlan_Schulden <= 0))
{
B_Say(self,other,"$MONA_CRIME");
};
if(C_NpcBelongsToFarm(self) && (Lee_Schulden <= 0))
{
B_Say(self,other,"$FARM_CRIME");
};
if(C_NpcBelongsToOldCamp(self) && (Garond_Schulden <= 0))
{
B_Say(self,other,"$OC_CRIME");
};
AI_StopProcessInfos(self);
};
func void B_AssignAmbientNEWS(var C_Npc slf)
{
DIA_Ambient_NEWS.npc = Hlp_GetInstanceID(slf);
};
|
D
|
module src.gui.ProjectTreeItem;
private {
import qt.core.QVariant;
import tango.text.Util : locatePattern;
}
class ProjectTreeItem {
private:
ProjectTreeItem[] childItems;
QVariant[] itemData;
ProjectTreeItem parentItem;
public:
this(QVariant[] data, ProjectTreeItem parent) {
parentItem = parent;
itemData = data;
}
void appendChild(ProjectTreeItem item) {
childItems ~= item;
}
ProjectTreeItem child(int row) {
return childItems[row];
}
int childCount() {
return childItems.length;
}
QVariant data(int column) {
return itemData[column];
}
ProjectTreeItem parent() {
return parentItem;
}
int row() {
if (parentItem)
return locatePattern(parentItem.childItems, this);
return 0;
}
}
|
D
|
/**
A static HTTP file server.
Copyright: © 2012 RejectedSoftware e.K.
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Authors: Sönke Ludwig
*/
module vibe.http.fileserver;
import vibe.core.file;
import vibe.core.log;
import vibe.http.server;
import vibe.inet.message;
import vibe.inet.mimetypes;
import vibe.inet.url;
import std.conv;
import std.datetime;
import std.digest.md;
import std.string;
/**
Returns a request handler that serves files from the specified directory.
See_Also: serveStaticFile
*/
HTTPServerRequestDelegate serveStaticFiles(Path local_path, HTTPFileServerSettings settings = null)
{
if (!settings) settings = new HTTPFileServerSettings;
if (!settings.serverPathPrefix.endsWith("/")) settings.serverPathPrefix ~= "/";
void callback(HTTPServerRequest req, HTTPServerResponse res)
{
string srv_path;
if (auto pp = "pathMatch" in req.params) srv_path = *pp;
else if (req.path.length > 0) srv_path = req.path;
else srv_path = req.requestURL;
if (!srv_path.startsWith(settings.serverPathPrefix)) {
logDebug("path '%s' not starting with '%s'", srv_path, settings.serverPathPrefix);
return;
}
auto rel_path = srv_path[settings.serverPathPrefix.length .. $];
auto rpath = Path(rel_path);
logTrace("Processing '%s'", srv_path);
rpath.normalize();
logDebug("Path '%s' -> '%s'", rel_path, rpath.toNativeString());
if (rpath.absolute) {
logDebug("Path is absolute, not responding");
return;
} else if (!rpath.empty && rpath[0] == "..")
return; // don't respond to relative paths outside of the root path
sendFile(req, res, local_path ~ rpath, settings);
}
return &callback;
}
/// ditto
HTTPServerRequestDelegate serveStaticFiles(string local_path, HTTPFileServerSettings settings = null)
{
return serveStaticFiles(Path(local_path), settings);
}
///
unittest {
import vibe.http.fileserver;
import vibe.http.router;
import vibe.http.server;
void setupServer()
{
auto router = new URLRouter;
// add other routes here
router.get("*", serveStaticFiles("public/"));
auto settings = new HTTPServerSettings;
listenHTTP(settings, router);
}
}
/** This example serves all files in the "public" sub directory
with an added prefix "static/" so that they don't interfere
with other registered routes.
*/
unittest {
import vibe.http.fileserver;
import vibe.http.router;
import vibe.http.server;
void setupRoutes()
{
auto router = new URLRouter;
// add other routes here
auto fsettings = new HTTPFileServerSettings;
fsettings.serverPathPrefix = "/static";
router.get("static/*", serveStaticFiles("public/", fsettings));
auto settings = new HTTPServerSettings;
listenHTTP(settings, router);
}
}
/**
Returns a request handler that serves a specific file on disk.
See_Also: serveStaticFiles
*/
HTTPServerRequestDelegate serveStaticFile(Path local_path, HTTPFileServerSettings settings = null)
{
if (!settings) settings = new HTTPFileServerSettings;
assert(settings.serverPathPrefix == "/", "serverPathPrefix is not supported for single file serving.");
void callback(HTTPServerRequest req, HTTPServerResponse res)
{
sendFile(req, res, local_path, settings);
}
return &callback;
}
/// ditto
HTTPServerRequestDelegate serveStaticFile(string local_path, HTTPFileServerSettings settings = null)
{
return serveStaticFile(Path(local_path), settings);
}
/**
Configuration options for the static file server.
*/
class HTTPFileServerSettings {
string serverPathPrefix = "/";
Duration maxAge;// = hours(24);
HTTPFileServerOption options = HTTPFileServerOption.defaults; /// additional options
string[string] encodingFileExtension;
/**
Called just before headers and data are sent.
Allows headers to be customized, or other custom processing to be performed.
Note: Any changes you make to the response, physicalPath, or anything
else during this function will NOT be verified by Vibe.d for correctness.
Make sure any alterations you make are complete and correct according to HTTP spec.
*/
void delegate(HTTPServerRequest req, HTTPServerResponse res, ref string physicalPath) preWriteCallback = null;
this()
{
// need to use the contructor because the Ubuntu 13.10 GDC cannot CTFE dur()
maxAge = 24.hours;
}
this(string path_prefix)
{
this();
serverPathPrefix = path_prefix;
}
deprecated("Use .options and HTTPFileServerOption.failIfNotFound instead.")
@property bool failIfNotFound() const { return options & HTTPFileServerOption.failIfNotFound; }
deprecated("Use .options and HTTPFileServerOption.failIfNotFound instead.")
@property void failIfNotFound(bool val) {
if (val)
options |= HTTPFileServerOption.failIfNotFound;
else
options &= ~HTTPFileServerOption.failIfNotFound;
}
}
/**
Additional options for the static file server.
*/
enum HTTPFileServerOption {
none = 0,
/// respond with 404 if a file was not found
failIfNotFound = 1 << 0,
/// serve index.html for directories
serveIndexHTML = 1 << 1,
/// default options are serveIndexHTML
defaults = serveIndexHTML,
}
private void sendFile(HTTPServerRequest req, HTTPServerResponse res, Path path, HTTPFileServerSettings settings)
{
auto pathstr = path.toNativeString();
// return if the file does not exist
if (!existsFile(pathstr)){
if (settings.options & HTTPFileServerOption.failIfNotFound)
throw new HTTPStatusException(HTTPStatus.NotFound);
return;
}
FileInfo dirent;
try dirent = getFileInfo(pathstr);
catch(Exception){
throw new HTTPStatusException(HTTPStatus.InternalServerError, "Failed to get information for the file due to a file system error.");
}
if (dirent.isDirectory) {
if (settings.options & HTTPFileServerOption.serveIndexHTML)
return sendFile(req, res, path ~ "index.html", settings);
logDebugV("Hit directory when serving files, ignoring: %s", pathstr);
if (settings.options & HTTPFileServerOption.failIfNotFound)
throw new HTTPStatusException(HTTPStatus.NotFound);
return;
}
auto lastModified = toRFC822DateTimeString(dirent.timeModified.toUTC());
// simple etag generation
auto etag = "\"" ~ hexDigest!MD5(pathstr ~ ":" ~ lastModified ~ ":" ~ to!string(dirent.size)).idup ~ "\"";
res.headers["Last-Modified"] = lastModified;
res.headers["Etag"] = etag;
if (settings.maxAge > seconds(0)) {
auto expireTime = Clock.currTime(UTC()) + settings.maxAge;
res.headers["Expires"] = toRFC822DateTimeString(expireTime);
res.headers["Cache-Control"] = "max-age="~to!string(settings.maxAge.total!"seconds");
}
if( auto pv = "If-Modified-Since" in req.headers ) {
if( *pv == lastModified ) {
res.statusCode = HTTPStatus.NotModified;
res.writeVoidBody();
return;
}
}
if( auto pv = "If-None-Match" in req.headers ) {
if ( *pv == etag ) {
res.statusCode = HTTPStatus.NotModified;
res.writeVoidBody();
return;
}
}
auto mimetype = getMimeTypeForFile(pathstr);
// avoid double-compression
if ("Content-Encoding" in res.headers && isCompressedFormat(mimetype))
res.headers.remove("Content-Encoding");
res.headers["Content-Type"] = mimetype;
res.headers["Content-Length"] = to!string(dirent.size);
// check for already encoded file if configured
string encodedFilepath;
auto pce = "Content-Encoding" in res.headers;
if (pce) {
if (auto pfe = *pce in settings.encodingFileExtension) {
assert((*pfe).length > 0);
auto p = pathstr ~ *pfe;
if (existsFile(p))
encodedFilepath = p;
}
}
if (encodedFilepath.length) {
auto origLastModified = dirent.timeModified.toUTC();
try dirent = getFileInfo(encodedFilepath);
catch(Exception){
throw new HTTPStatusException(HTTPStatus.InternalServerError, "Failed to get information for the file due to a file system error.");
}
// encoded file must be younger than original else warn
if (dirent.timeModified.toUTC() >= origLastModified){
logTrace("Using already encoded file '%s' -> '%s'", path, encodedFilepath);
path = Path(encodedFilepath);
res.headers["Content-Length"] = to!string(dirent.size);
} else {
logWarn("Encoded file '%s' is older than the original '%s'. Ignoring it.", encodedFilepath, path);
encodedFilepath = null;
}
}
if(settings.preWriteCallback)
settings.preWriteCallback(req, res, pathstr);
// for HEAD responses, stop here
if( res.isHeadResponse() ){
res.writeVoidBody();
assert(res.headerWritten);
logDebug("sent file header %d, %s!", dirent.size, res.headers["Content-Type"]);
return;
}
// else write out the file contents
//logTrace("Open file '%s' -> '%s'", srv_path, pathstr);
FileStream fil;
try {
fil = openFile(path);
} catch( Exception e ){
// TODO: handle non-existant files differently than locked files?
logDebug("Failed to open file %s: %s", pathstr, e.toString());
return;
}
scope(exit) fil.close();
if (pce && !encodedFilepath.length)
res.bodyWriter.write(fil);
else res.writeRawBody(fil);
logTrace("sent file %d, %s!", fil.size, res.headers["Content-Type"]);
}
|
D
|
/*
* $Id: boot.d,v 1.6 2006/03/18 02:42:09 kenta Exp $
*
* Copyright 2005 Kenta Cho. Some rights reserved.
*/
module abagames.gr.boot;
private import std.string;
//private import std.stream;
private import std.conv;
private import std.math;
private import std.c.stdlib;
private import abagames.util.logger;
private import abagames.util.tokenizer;
private import abagames.util.sdl.mainloop;
private import abagames.util.sdl.input;
private import abagames.util.sdl.pad;
private import abagames.util.sdl.twinstick;
private import abagames.util.sdl.recordableinput;
private import abagames.util.sdl.sound;
private import abagames.gr.screen;
private import abagames.gr.gamemanager;
private import abagames.gr.prefmanager;
private import abagames.gr.ship;
private import abagames.gr.mouse;
/**
* Boot the game.
*/
private:
Screen screen;
MultipleInputDevice input;
RecordablePad pad;
RecordableTwinStick twinStick;
RecordableMouse mouse;
GameManager gameManager;
PrefManager prefManager;
MainLoop mainLoop;
version (Win32_release) {
// Boot as the Windows executable.
private import std.c.windows.windows;
private import std.string;
extern (C) void gc_init();
extern (C) void gc_term();
extern (C) void _minit();
extern (C) void _moduleCtor();
extern (Windows)
public int WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow) {
int result;
gc_init();
_minit();
try {
_moduleCtor();
char exe[4096];
GetModuleFileNameA(null, exe, 4096);
string[1] prog;
prog[0] = to!string(exe);
result = boot(prog ~ std.string.split(to!string(lpCmdLine)));
} catch (Exception o) {
Logger.error("Exception: " ~ o.toString());
result = EXIT_FAILURE;
}
gc_term();
return result;
}
} else {
// Boot as the general executable.
public int main(string[] args) {
return boot(args);
}
}
public int boot(string[] args) {
screen = new Screen;
input = new MultipleInputDevice;
pad = new RecordablePad;
twinStick = new RecordableTwinStick;
mouse = new RecordableMouse(screen);
input.inputs ~= pad;
input.inputs ~= twinStick;
input.inputs ~= mouse;
gameManager = new GameManager;
prefManager = new PrefManager;
mainLoop = new MainLoop(screen, input, gameManager, prefManager);
try {
parseArgs(args);
} catch (Exception e) {
return EXIT_FAILURE;
}
try {
mainLoop.loop();
} catch (Exception o) {
Logger.info(o.toString());
try {
gameManager.saveErrorReplay();
} catch (Exception o1) {}
throw o;
}
return EXIT_SUCCESS;
}
private void parseArgs(string[] commandArgs) {
string[] args = readOptionsIniFile();
for (int i = 1; i < commandArgs.length; i++)
args ~= commandArgs[i];
string progName = commandArgs[0];
for (int i = 0; i < args.length; i++) {
switch (args[i]) {
case "-brightness":
if (i >= args.length - 1) {
usage(progName);
throw new Exception("Invalid options");
}
i++;
float b = cast(float) to!int(args[i]) / 100;
if (b < 0 || b > 1) {
usage(args[0]);
throw new Exception("Invalid options");
}
Screen.brightness = b;
break;
case "-luminosity":
case "-luminous":
if (i >= args.length - 1) {
usage(progName);
throw new Exception("Invalid options");
}
i++;
float l = cast(float) to!int(args[i]) / 100;
if (l < 0 || l > 1) {
usage(progName);
throw new Exception("Invalid options");
}
screen.luminosity = l;
break;
case "-window":
screen.windowMode = true;
break;
case "-res":
if (i >= args.length - 2) {
usage(progName);
throw new Exception("Invalid options");
}
i++;
int w = to!int(args[i]);
i++;
int h = to!int(args[i]);
screen.width = w;
screen.height = h;
break;
case "-nosound":
SoundManager.noSound = true;
break;
case "-exchange":
pad.buttonReversed = true;
break;
case "-nowait":
mainLoop.nowait = true;
break;
case "-accframe":
mainLoop.accframe = 1;
break;
case "-turnspeed":
if (i >= args.length - 1) {
usage(progName);
throw new Exception("Invalid options");
}
i++;
float s = cast(float) to!int(args[i]) / 100;
if (s < 0 || s > 5) {
usage(progName);
throw new Exception("Invalid options");
}
GameManager.shipTurnSpeed = s;
break;
case "-firerear":
GameManager.shipReverseFire = true;
break;
case "-rotatestick2":
case "-rotaterightstick":
if (i >= args.length - 1) {
usage(progName);
throw new Exception("Invalid options");
}
i++;
twinStick.rotate = cast(float) to!int(args[i]) * PI / 180.0f;
break;
case "-reversestick2":
case "-reverserightstick":
twinStick.reverse = -1;
break;
case "-enableaxis5":
twinStick.enableAxis5 = true;
break;
/*case "-mouseaccel":
if (i >= args.length - 1) {
usage(progName);
throw new Exception("Invalid options");
}
i++;
float s = cast(float) to!int(args[i]) / 100;
if (s < 0 || s > 5) {
usage(progName);
throw new Exception("Invalid options");
}
mouse.accel = s;
break;*/
default:
usage(progName);
throw new Exception("Invalid options");
}
}
}
private string OPTIONS_INI_FILE = "options.ini";
private string[] readOptionsIniFile() {
try {
return Tokenizer.readFile(OPTIONS_INI_FILE, " ");
} catch (Exception e) {
return null;
}
}
private void usage(string progName) {
Logger.error
("Usage: " ~ progName ~ " [-window] [-res x y] [-brightness [0-100]] [-luminosity [0-100]] [-nosound] [-exchange] [-turnspeed [0-500]] [-firerear] [-rotatestick2 deg] [-reversestick2] [-enableaxis5] [-nowait]");
}
|
D
|
module stk.fm;
import stk.stk;
import stk.instrument;
import stk.adsr;
import stk.fileloop;
import stk.sinewave;
import stk.twozero;
/***************************************************/
/*! \class FM
\brief STK abstract FM synthesis base class.
This class controls an arbitrary number of
waves and envelopes, determined via a
constructor argument.
Control Change Numbers:
- Control One = 2
- Control Two = 4
- LFO Speed = 11
- LFO Depth = 1
- ADSR 2 & 4 Target = 128
The basic Chowning/Stanford FM patent expired
in 1995, but there exist follow-on patents,
mostly assigned to Yamaha. If you are of the
type who should worry about this (making
money) worry away.
by Perry R. Cook and Gary P. Scavone, 1995--2016.
*/
/***************************************************/
abstract class FM : Instrmnt
{
public:
//! Class constructor, taking the number of wave/envelope operators to control.
/*!
An StkError will be thrown if the rawwave path is incorrectly set.
*/
this( uint operators = 4 ) {
}
//! Class destructor.
~this() {
}
//! Load the rawwave filenames in waves.
void loadWaves( const char **filenames ) {
}
//! Set instrument parameters for a particular frequency.
override void setFrequency( StkFloat frequency ) {
}
//! Set the frequency ratio for the specified wave.
void setRatio(uint waveIndex, StkFloat ratio) {
}
//! Set the gain for the specified wave.
void setGain( uint waveIndex, StkFloat gain ) {
}
//! Set the modulation speed in Hz.
void setModulationSpeed( StkFloat mSpeed ) { vibrato_.setFrequency( mSpeed ); };
//! Set the modulation depth.
void setModulationDepth( StkFloat mDepth ) { modDepth_ = mDepth; };
//! Set the value of control1.
void setControl1( StkFloat cVal ) { control1_ = cVal * 2.0; };
//! Set the value of control1.
void setControl2( StkFloat cVal ) { control2_ = cVal * 2.0; };
//! Start envelopes toward "on" targets.
void keyOn() {
}
//! Start envelopes toward "off" targets.
void keyOff() {
}
//! Stop a note with the given amplitude (speed of decay).
void noteOff( StkFloat amplitude ) {
}
//! Perform the control change specified by \e number and \e value (0.0 - 128.0).
override void controlChange( int number, StkFloat value ) {
}
//! Compute and return one output sample.
StkFloat tick( uint channel = 0) {
return 0;
}
//! Fill a channel of the StkFrames object with computed outputs.
/*!
The \c channel argument must be less than the number of
channels in the StkFrames argument (the first channel is specified
by 0). However, range checking is only performed if _STK_DEBUG_
is defined during compilation, in which case an out-of-range value
will trigger an StkError exception.
*/
//ref StkFrames tick( ref StkFrames frames, uint channel = 0 ) = 0;
protected:
ADSR[] adsr_;
FileLoop[] waves_;
SineWave vibrato_;
TwoZero twozero_;
uint nOperators_;
StkFloat baseFrequency_;
StkFloat[] ratios_;
StkFloat[] gains_;
StkFloat modDepth_;
StkFloat control1_;
StkFloat control2_;
StkFloat[100] fmGains_;
StkFloat[16] fmSusLevels_;
StkFloat[32] fmAttTimes_;
}
|
D
|
module server;
import hunt.net;
import hunt.logging;
import hunt.net.codec.textline;
import std.format;
enum Host = "0.0.0.0";
enum Port = 8080;
enum string ResponseContent = `HTTP/1.1 200 OK
Server: Example
Content-Length: 13
Date: Wed, 02 May 2018 14:31:50
Content-Type: text/plain
Hello, World!
`;
import hunt.io.IoError;
void main() {
NetServerOptions options = new NetServerOptions();
options.workerThreadSize = 3;
NetServer server = NetUtil.createNetServer(options);
server.setCodec(new TextLineCodec);
// dfmt off
server.setHandler(new class NetConnectionHandler {
override void connectionOpened(Connection connection) {
debug infof("Connection created: %s", connection.getRemoteAddress());
}
override void connectionClosed(Connection connection) {
debug infof("Connection closed: %s", connection.getRemoteAddress());
}
override DataHandleStatus messageReceived(Connection connection, Object message) {
// tracef("message type: %s", typeid(message).name);
// string str = format("data received: %s", message.toString());
// tracef(str);
try {
connection.write(ResponseContent);
// } catch (IoError err) {
// warningf("Code: %d, Message: %s", err.errorCode(). err.errorMsg);
} catch(Exception ex) {
error(ex.msg);
}
return DataHandleStatus.Done;
}
override void exceptionCaught(Connection connection, Throwable t) {
warning(t);
}
override void failedOpeningConnection(int connectionId, Throwable t) {
warning(t);
}
override void failedAcceptingConnection(int connectionId, Throwable t) {
warning(t);
}
}).listen(Host, Port);
// dmft on
}
|
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_22_banking-7183559851.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_22_banking-7183559851.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
|
D
|
// This file is part of Visual D
//
// Visual D integrates the D programming language into Visual Studio
// Copyright (c) 2010 by Rainer Schuetze, All Rights Reserved
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt
module visuald.completion;
import visuald.windows;
import std.ascii;
import std.string;
import std.utf;
import std.file;
import std.path;
import std.algorithm;
import std.array;
import std.conv;
import std.uni;
import stdext.array;
import stdext.file;
import stdext.ddocmacros;
import stdext.string;
import visuald.comutil;
import visuald.logutil;
import visuald.hierutil;
import visuald.fileutil;
import visuald.pkgutil;
import visuald.stringutil;
import visuald.dpackage;
import visuald.dproject;
import visuald.dlangsvc;
import visuald.dimagelist;
import visuald.dllmain;
import visuald.config;
import visuald.intellisense;
import vdc.lexer;
import sdk.port.vsi;
import sdk.win32.commctrl;
import sdk.vsi.textmgr;
import sdk.vsi.textmgr2;
import sdk.vsi.textmgr121;
import sdk.vsi.vsshell;
import sdk.win32.wtypes;
///////////////////////////////////////////////////////////////
const int kCompletionSearchLines = 5000;
class ImageList {};
struct Declaration
{
string name;
string type;
string description;
string text;
static Declaration split(string s)
{
Declaration decl;
auto pos1 = indexOf(s, ':');
if(pos1 >= 0)
{
decl.name = s[0 .. pos1];
auto pos2 = indexOf(s[pos1 + 1 .. $], ':');
if(pos2 >= 0)
{
decl.type = s[pos1 + 1 .. pos1 + 1 + pos2];
decl.description = s[pos1 + 1 + pos2 + 1 .. $];
}
else
decl.type = s[pos1 + 1 .. $];
}
else
decl.name = s;
auto pos3 = indexOf(decl.name, "|");
if(pos3 >= 0)
{
decl.text = decl.name[pos3 + 1 .. $];
decl.name = decl.name[0 .. pos3];
}
else
decl.text = decl.name;
return decl;
}
int compareByType(const ref Declaration other) const
{
int s1 = Type2Sorting(type);
int s2 = Type2Sorting(other.type);
if (s1 != s2)
return s1 - s2;
if (int res = icmp(name, other.name))
return res;
return 0;
}
int compareByName(const ref Declaration other) const
{
if (int res = icmp(name, other.name))
return res;
if (int res = icmp(type, other.type))
return res;
return 0;
}
static int Type2Glyph(string type)
{
switch(type)
{
case "KW": return CSIMG_KEYWORD;
case "SPRP": return CSIMG_KEYWORD;
case "ASKW": return CSIMG_KEYWORD;
case "ASOP": return CSIMG_KEYWORD;
case "PROP": return CSIMG_PROPERTY;
case "SNPT": return CSIMG_SNIPPET;
case "TEXT": return CSIMG_TEXT;
case "MOD": return CSIMG_DMODULE;
case "DIR": return CSIMG_DFOLDER;
case "PKG": return CSIMG_PACKAGE;
case "FUNC": return CSIMG_FUNCTION;
case "MTHD": return CSIMG_MEMBER;
case "STRU": return CSIMG_STRUCT;
case "UNIO": return CSIMG_UNION;
case "CLSS": return CSIMG_CLASS;
case "IFAC": return CSIMG_INTERFACE;
case "TMPL": return CSIMG_TEMPLATE;
case "ENUM": return CSIMG_ENUM;
case "EVAL": return CSIMG_ENUMMEMBER;
case "NMIX": return CSIMG_UNKNOWN2;
case "VAR": return CSIMG_FIELD;
case "ALIA": return CSIMG_ALIAS;
case "OVR": return CSIMG_UNKNOWN3;
default: return 0;
}
}
static int Type2Sorting(string type)
{
switch(type)
{
case "PROP": return 1;
case "VAR": return 1;
case "EVAL": return 1;
case "MTHD": return 2;
case "STRU": return 3;
case "UNIO": return 3;
case "CLSS": return 3;
case "IFAC": return 3;
case "ENUM": return 3;
case "KW": return 4;
case "SPRP": return 4; // static meta property
case "ASKW": return 4;
case "ASOP": return 4;
case "ALIA": return 4;
case "MOD": return 5;
case "DIR": return 5;
case "PKG": return 5;
case "NMIX": return 5; // named teplate mixin mixin
case "FUNC": return 6;
case "TMPL": return 6;
case "OVR": return 6;
case "TEXT": return 3;
case "SNPT": return 3;
default: return 7;
}
}
}
class Declarations
{
Declaration[] mDecls;
int mExpansionState = kStateInit;
enum
{
kStateInit,
kStateImport,
kStateSemantic,
kStateNearBy,
kStateSymbols,
kStateCaseInsensitive
}
this()
{
}
int GetCount()
{
return mDecls.length;
}
dchar OnAutoComplete(IVsTextView textView, string committedWord, dchar commitChar, int commitIndex)
{
return 0;
}
int GetGlyph(int index)
{
if(index < 0 || index >= mDecls.length)
return 0;
return Declaration.Type2Glyph(mDecls[index].type);
}
string GetDisplayText(int index)
{
return GetName(index);
}
string GetDescription(int index)
{
if(index < 0 || index >= mDecls.length)
return "";
string desc = mDecls[index].description;
desc = replace(desc, "\a", "\n");
string res = phobosDdocExpand(desc);
return res;
}
string GetName(int index)
{
if(index < 0 || index >= mDecls.length)
return "";
return mDecls[index].name;
}
string GetText(IVsTextView view, int index)
{
if(index < 0 || index >= mDecls.length)
return "";
string text = mDecls[index].text;
if(text.indexOf('\a') >= 0)
{
string nl = "\r\n";
if(view)
{
// copy indentation from current line
int line, idx;
if(view.GetCaretPos(&line, &idx) == S_OK)
{
IVsTextLines pBuffer;
if(view.GetBuffer(&pBuffer) == S_OK)
{
nl = GetLineBreakText(pBuffer, line);
BSTR btext;
if(pBuffer.GetLineText(line, 0, line, idx, &btext) == S_OK)
{
string txt = detachBSTR(btext);
size_t p = 0;
while(p < txt.length && std.ascii.isWhite(txt[p]))
p++;
nl ~= txt[0 .. p];
}
release(pBuffer);
}
}
}
text = text.replace("\a", nl);
}
return text;
}
bool GetInitialExtent(IVsTextView textView, int* line, int* startIdx, int* endIdx)
{
*line = 0;
*startIdx = *endIdx = 0;
return false;
}
void GetBestMatch(string textSoFar, int* index, bool *uniqueMatch)
{
*index = 0;
*uniqueMatch = false;
}
bool IsCommitChar(string textSoFar, int index, dchar ch)
{
return ch == '\n' || ch == '\r'; // !(isAlphaNum(ch) || ch == '_');
}
string OnCommit(IVsTextView textView, string textSoFar, dchar ch, int index, ref TextSpan initialExtent)
{
return GetText(textView, index); // textSoFar;
}
///////////////////////////////////////////////////////////////
bool ImportExpansions(string imp, string file)
{
string[] imports = GetImportPaths(file);
string dir;
int dpos = lastIndexOf(imp, '.');
if(dpos >= 0)
{
dir = replace(imp[0 .. dpos], ".", "\\");
imp = imp[dpos + 1 .. $];
}
int namesLength = mDecls.length;
foreach(string impdir; imports)
{
impdir = impdir ~ dir;
if(!isExistingDir(impdir))
continue;
foreach(string name; dirEntries(impdir, SpanMode.shallow))
{
string base = baseName(name);
string ext = toLower(extension(name));
bool canImport = false;
bool issubdir = isDir(name);
if(issubdir)
canImport = (ext.length == 0);
else if(ext == ".d" || ext == ".di")
{
base = base[0 .. $-ext.length];
canImport = true;
}
if(canImport && base.startsWith(imp))
{
Declaration decl;
decl.name = decl.text = base;
decl.type = (issubdir ? "DIR" : "MOD");
addunique(mDecls, decl);
}
}
}
return mDecls.length > namesLength;
}
bool ImportExpansions(IVsTextView textView, Source src)
{
int line, idx;
if(int hr = textView.GetCaretPos(&line, &idx))
return false;
wstring wimp = src.GetImportModule(line, idx, true);
if(wimp.empty)
return false;
string txt = to!string(wimp);
ImportExpansions(txt, src.GetFileName());
return true;
}
///////////////////////////////////////////////////////////////
string GetWordBeforeCaret(IVsTextView textView, Source src)
{
int line, idx;
int hr = textView.GetCaretPos(&line, &idx);
assert(hr == S_OK);
int startIdx, endIdx;
if(!src.GetWordExtent(line, idx, WORDEXT_FINDTOKEN, startIdx, endIdx))
return "";
wstring txt = src.GetText(line, startIdx, line, idx);
return toUTF8(txt);
}
bool NearbyExpansions(IVsTextView textView, Source src)
{
if(!Package.GetGlobalOptions().expandFromBuffer)
return false;
int line, idx;
if(int hr = textView.GetCaretPos(&line, &idx))
return false;
int lineCount;
src.mBuffer.GetLineCount(&lineCount);
//mNames.length = 0;
int start = max(0, line - kCompletionSearchLines);
int end = min(lineCount, line + kCompletionSearchLines);
string tok = GetWordBeforeCaret(textView, src);
if(tok.length && !dLex.isIdentifierCharOrDigit(tok.front))
tok = "";
int iState = src.mColorizer.GetLineState(start);
if(iState == -1)
return false;
int namesLength = mDecls.length;
for(int ln = start; ln < end; ln++)
{
wstring text = src.GetText(ln, 0, ln, -1);
uint pos = 0;
while(pos < text.length)
{
uint ppos = pos;
int type = dLex.scan(iState, text, pos);
if(ln != line || pos < idx || ppos > idx)
if(type == TokenCat.Identifier || type == TokenCat.Keyword)
{
string txt = toUTF8(text[ppos .. pos]);
if(txt.startsWith(tok))
{
Declaration decl;
decl.name = decl.text = txt;
addunique(mDecls, decl);
}
}
}
}
return mDecls.length > namesLength;
}
////////////////////////////////////////////////////////////////////////
bool SymbolExpansions(IVsTextView textView, Source src)
{
if(!Package.GetGlobalOptions().expandFromJSON)
return false;
string tok = GetWordBeforeCaret(textView, src);
if(tok.length && !dLex.isIdentifierCharOrDigit(tok.front))
tok = "";
if(!tok.length)
return false;
int namesLength = mDecls.length;
string[] completions = Package.GetLibInfos().findCompletions(tok, true);
foreach (c; completions)
{
Declaration decl;
decl.name = decl.text = c;
addunique(mDecls, decl);
}
return mDecls.length > namesLength;
}
////////////////////////////////////////////////////////////////////////
bool SnippetExpansions(IVsTextView textView, Source src)
{
int line, idx;
int hr = textView.GetCaretPos(&line, &idx);
assert(hr == S_OK);
wstring txt = src.GetText(line, 0, line, -1);
if(idx > txt.length)
idx = txt.length;
int endIdx = idx;
dchar ch;
for(size_t p = idx; p > 0 && dLex.isIdentifierCharOrDigit(ch = decodeBwd(txt, p)); idx = p) {}
int startIdx = idx;
for(size_t p = idx; p > 0 && std.uni.isWhite(ch = decodeBwd(txt, p)); idx = p) {}
if (ch == '.')
return false;
wstring tok = txt[startIdx .. endIdx];
IVsTextManager2 textmgr = queryService!(VsTextManager, IVsTextManager2);
if(!textmgr)
return false;
scope(exit) release(textmgr);
IVsExpansionManager exmgr;
textmgr.GetExpansionManager(&exmgr);
if (!exmgr)
return false;
scope(exit) release(exmgr);
int namesLength = mDecls.length;
IVsExpansionEnumeration enumExp;
hr = exmgr.EnumerateExpansions(g_languageCLSID, FALSE, null, 0, false, false, &enumExp);
if(hr == S_OK && enumExp)
{
DWORD fetched;
VsExpansion exp;
VsExpansion* pexp = &exp;
while(enumExp.Next(1, &pexp, &fetched) == S_OK && fetched == 1)
{
Declaration decl;
decl.name = detachBSTR(exp.title);
decl.description = detachBSTR(exp.description);
decl.text = detachBSTR(exp.shortcut);
decl.type = "SNPT";
freeBSTR(exp.path);
if(decl.text.startsWith(tok))
addunique(mDecls, decl);
}
}
return mDecls.length > namesLength;
}
///////////////////////////////////////////////////////////////////////////
bool SemanticExpansions(IVsTextView textView, Source src)
{
if(!Package.GetGlobalOptions().expandFromSemantics)
return false;
try
{
string tok = GetWordBeforeCaret(textView, src);
if(tok.length && !dLex.isIdentifierCharOrDigit(tok.front))
tok = "";
if (tok.length && !Package.GetGlobalOptions().exactExpMatch)
tok ~= "*";
int caretLine, caretIdx;
int hr = textView.GetCaretPos(&caretLine, &caretIdx);
src.ensureCurrentTextParsed(); // pass new text before expansion request
auto langsvc = Package.GetLanguageService();
mPendingSource = src;
mPendingView = textView;
mPendingRequest = langsvc.GetSemanticExpansions(src, tok, caretLine, caretIdx, &OnExpansions);
return true;
}
catch(Error e)
{
writeToBuildOutputPane(e.msg);
}
return false;
}
extern(D) void OnExpansions(uint request, string filename, string tok, int line, int idx, string[] symbols)
{
if(request != mPendingRequest)
return;
// without a match, keep existing items
bool hasMatch = GetCount() > 0 || symbols.length > 0;
if(hasMatch && mPendingSource && mPendingView)
{
auto activeView = GetActiveView();
scope(exit) release(activeView);
int caretLine, caretIdx;
int hr = mPendingView.GetCaretPos(&caretLine, &caretIdx);
if (activeView == mPendingView && line == caretLine && idx == caretIdx)
{
// split after second ':' to combine same name and type
static string splitName(string name, ref string desc)
{
auto pos = name.indexOf(':');
if(pos < 0)
return name;
pos = name.indexOf(':', pos + 1);
if(pos < 0)
return name;
desc = name[pos..$];
return name[0..pos];
}
// go through assoc array for faster uniqueness check
int[string] decls;
// add existing declarations
foreach(i, d; mDecls)
{
string desc;
string name = d.name ~ ":" ~ d.type;
decls[name] = i;
}
size_t num = mDecls.length;
mDecls.length = num + symbols.length;
foreach(s; symbols)
{
string desc;
string name = splitName(s, desc);
if(auto p = name in decls)
mDecls[*p].description ~= "\a\a" ~ desc[1..$]; // strip ":"
else
{
decls[name] = num;
mDecls[num++] = Declaration.split(s);
}
}
mDecls.length = num;
// mode 2 keeps order of semantic engine
if (Package.GetGlobalOptions().sortExpMode == 1)
sort!("a.compareByType(b) < 0", SwapStrategy.stable)(mDecls);
else if (Package.GetGlobalOptions().sortExpMode == 0)
sort!("a.compareByName(b) < 0", SwapStrategy.stable)(mDecls);
InitCompletionSet(mPendingView, mPendingSource);
}
}
mPendingRequest = 0;
mPendingView = null;
mPendingSource = null;
}
uint mPendingRequest;
IVsTextView mPendingView;
Source mPendingSource;
bool mAutoInsert;
////////////////////////////////////////////////////////////////////////
bool StartExpansions(IVsTextView textView, Source src, bool autoInsert)
{
mDecls = mDecls.init;
mExpansionState = kStateInit;
mAutoInsert = autoInsert;
if(!_MoreExpansions(textView, src))
return false;
if(mPendingView)
return false;
return InitCompletionSet(textView, src);
}
bool InitCompletionSet(IVsTextView textView, Source src)
{
if(mAutoInsert)
{
while(GetCount() == 1 && _MoreExpansions(textView, src)) {}
if(GetCount() == 1)
{
int line, idx, startIdx, endIdx;
textView.GetCaretPos(&line, &idx);
if(src.GetWordExtent(line, idx, WORDEXT_FINDTOKEN, startIdx, endIdx))
{
wstring txt = to!wstring(GetText(textView, 0));
TextSpan changedSpan;
src.mBuffer.ReplaceLines(line, startIdx, line, endIdx, txt.ptr, txt.length, &changedSpan);
if (GetGlyph(0) == CSIMG_SNIPPET)
if (auto view = Package.GetLanguageService().GetViewFilter(src, textView))
view.HandleSnippet();
return true;
}
}
}
src.GetCompletionSet().Init(textView, this, false);
return true;
}
bool _MoreExpansions(IVsTextView textView, Source src)
{
switch(mExpansionState)
{
case kStateInit:
if(ImportExpansions(textView, src))
{
mExpansionState = kStateSymbols; // do not try other symbols but file imports
return true;
}
goto case;
case kStateImport:
SnippetExpansions(textView, src);
if(SemanticExpansions(textView, src))
{
mExpansionState = kStateSemantic;
return true;
}
goto case;
case kStateSemantic:
if(NearbyExpansions(textView, src))
{
mExpansionState = kStateNearBy;
return true;
}
goto case;
case kStateNearBy:
if(SymbolExpansions(textView, src))
{
mExpansionState = kStateSymbols;
return true;
}
goto default;
default:
break;
}
return false;
}
bool MoreExpansions(IVsTextView textView, Source src)
{
mAutoInsert = false;
_MoreExpansions(textView, src);
if (!mPendingView)
src.GetCompletionSet().Init(textView, this, false);
return true;
}
void StopExpansions()
{
mPendingRequest = 0;
mPendingView = null;
mPendingSource = null;
}
}
class CompletionSet : DisposingComObject, IVsCompletionSet, IVsCompletionSet3, IVsCompletionSetEx
{
HIMAGELIST mImageList;
bool mDisplayed;
bool mCompleteWord;
bool mComittedShortcut;
string mCommittedWord;
dchar mCommitChar;
int mCommitIndex;
IVsTextView mTextView;
Declarations mDecls;
Source mSource;
TextSpan mInitialExtent;
bool mIsCommitted;
bool mWasUnique;
int mLastDeclCount;
this(ImageList imageList, Source source)
{
mImageList = LoadImageList(g_hInst, MAKEINTRESOURCEA(BMP_COMPLETION), 16, 16);
mSource = source;
}
override HRESULT QueryInterface(in IID* riid, void** pvObject)
{
if(queryInterface!(IVsCompletionSetEx) (this, riid, pvObject))
return S_OK;
if(queryInterface!(IVsCompletionSet) (this, riid, pvObject))
return S_OK;
version(none) if(*riid == uuid_IVsCompletionSet3)
{
*pvObject = cast(void*)cast(IVsCompletionSet3)this;
AddRef();
return S_OK;
}
if(*riid == uuid_IVsCoTaskMemFreeMyStrings) // avoid log message, implement?
return E_NOTIMPL;
return super.QueryInterface(riid, pvObject);
}
void Init(IVsTextView textView, Declarations declarations, bool completeWord)
{
if (mLastDeclCount < declarations.GetCount())
Close(); // without closing first, the box does not update its width
mTextView = textView;
mDecls = declarations;
mCompleteWord = completeWord;
//check if we have members
mLastDeclCount = mDecls.GetCount();
if (mLastDeclCount <= 0)
return;
//initialise and refresh
UpdateCompletionFlags flags = UCS_NAMESCHANGED;
if (mCompleteWord)
flags |= UCS_COMPLETEWORD;
mWasUnique = false;
int hr = textView.UpdateCompletionStatus(this, flags);
assert(hr == S_OK);
mDisplayed = (!mWasUnique || !completeWord);
}
bool isActive()
{
return mDisplayed || (mDecls && mDecls.mPendingSource);
}
override void Dispose()
{
Close();
//if (imageList != null) imageList.Dispose();
if(mImageList)
{
ImageList_Destroy(mImageList);
mImageList = null;
}
}
void Close()
{
if (mDisplayed && mTextView)
{
// Here we can't throw or exit because we need to call Dispose on
// the disposable membres.
try {
mTextView.UpdateCompletionStatus(null, 0);
} catch (Exception e) {
}
}
mDisplayed = false;
mComittedShortcut = false;
mTextView = null;
mDecls = null;
mLastDeclCount = 0;
}
dchar OnAutoComplete()
{
mIsCommitted = false;
if (mDecls)
return mDecls.OnAutoComplete(mTextView, mCommittedWord, mCommitChar, mCommitIndex);
return '\0';
}
//--------------------------------------------------------------------------
//IVsCompletionSet methods
//--------------------------------------------------------------------------
override int GetImageList(HANDLE *phImages)
{
mixin(LogCallMix);
*phImages = cast(HANDLE)mImageList;
return S_OK;
}
override int GetFlags()
{
mixin(LogCallMix);
return CSF_HAVEDESCRIPTIONS | CSF_CUSTOMCOMMIT | CSF_INITIALEXTENTKNOWN | CSF_CUSTOMMATCHING;
}
override int GetCount()
{
mixin(LogCallMix);
return mDecls.GetCount();
}
override int GetDisplayText(in int index, WCHAR** text, int* glyph)
{
//mixin(LogCallMix);
if (glyph)
*glyph = mDecls.GetGlyph(index);
*text = allocBSTR(mDecls.GetDisplayText(index));
return S_OK;
}
override int GetDescriptionText(in int index, BSTR* description)
{
mixin(LogCallMix2);
*description = allocBSTR(mDecls.GetDescription(index));
return S_OK;
}
override int GetInitialExtent(int* line, int* startIdx, int* endIdx)
{
mixin(LogCallMix);
int idx;
int hr = S_OK;
if (mDecls.GetInitialExtent(mTextView, line, startIdx, endIdx))
goto done;
hr = mTextView.GetCaretPos(line, &idx);
assert(hr == S_OK);
hr = GetTokenExtent(*line, idx, *startIdx, *endIdx);
done:
// Remember the initial extent so we can pass it along on the commit.
mInitialExtent.iStartLine = mInitialExtent.iEndLine = *line;
mInitialExtent.iStartIndex = *startIdx;
mInitialExtent.iEndIndex = *endIdx;
//assert(TextSpanHelper.ValidCoord(mSource, line, startIdx) &&
// TextSpanHelper.ValidCoord(mSource, line, endIdx));
return hr;
}
int GetTokenExtent(int line, int idx, out int startIdx, out int endIdx)
{
int hr = S_OK;
bool rc = mSource.GetWordExtent(line, idx, WORDEXT_FINDTOKEN, startIdx, endIdx);
if (!rc && idx > 0)
{
//rc = mSource.GetWordExtent(line, idx - 1, WORDEXT_FINDTOKEN, startIdx, endIdx);
if (!rc)
{
// Must stop core text editor from looking at startIdx and endIdx since they are likely
// invalid. So we must return a real failure here, not just S_FALSE.
startIdx = endIdx = idx;
hr = E_NOTIMPL;
}
}
// make sure the span is positive.
endIdx = max(endIdx, idx);
return hr;
}
override int GetBestMatch(in WCHAR* wtextSoFar, in int length, int* index, uint* flags)
{
mixin(LogCallMix);
*flags = 0;
*index = 0;
bool uniqueMatch = false;
string textSoFar = to_string(wtextSoFar);
if (textSoFar.length != 0)
{
mDecls.GetBestMatch(textSoFar, index, &uniqueMatch);
if (*index < 0 || *index >= mDecls.GetCount())
{
*index = 0;
uniqueMatch = false;
} else {
// Indicate that we want to select something in the list.
*flags = GBM_SELECT;
}
}
else if (mDecls.GetCount() == 1 && mCompleteWord)
{
// Only one entry, and user has invoked "word completion", then
// simply select this item.
*index = 0;
*flags = GBM_SELECT;
uniqueMatch = true;
}
if (uniqueMatch)
{
*flags |= GBM_UNIQUE;
mWasUnique = true;
}
return S_OK;
}
override int OnCommit(in WCHAR* wtextSoFar, in int index, in BOOL selected, in WCHAR commitChar, BSTR* completeWord)
{
mixin(LogCallMix);
dchar ch = commitChar;
bool isCommitChar = true;
int selIndex = (selected == 0) ? -1 : index;
string textSoFar = to_string(wtextSoFar);
if (commitChar != 0)
{
// if the char is in the list of given member names then obviously it
// is not a commit char.
int i = textSoFar.length;
for (int j = 0, n = mDecls.GetCount(); j < n; j++)
{
string name = mDecls.GetText(mTextView, j);
if (name.length > i && name[i] == commitChar)
{
if (i == 0 || name[0 .. i] == textSoFar)
goto nocommit; // cannot be a commit char if it is an expected char in a matching name
}
}
isCommitChar = mDecls.IsCommitChar(textSoFar, selIndex, ch);
}
if (isCommitChar)
{
mCommittedWord = mDecls.OnCommit(mTextView, textSoFar, ch, selIndex, mInitialExtent);
mComittedShortcut = (mDecls.GetGlyph(selIndex) == CSIMG_SNIPPET);
*completeWord = allocBSTR(mCommittedWord);
mCommitChar = ch;
mCommitIndex = index;
mIsCommitted = true;
return S_OK;
}
nocommit:
// S_FALSE return means the character is not a commit character.
*completeWord = allocBSTR(textSoFar);
return S_FALSE;
}
override int Dismiss()
{
mixin(LogCallMix);
mDisplayed = false;
if (mComittedShortcut)
if (auto view = Package.GetLanguageService().GetViewFilter(mSource, mTextView))
view.HandleSnippet();
mComittedShortcut = false;
return S_OK;
}
// IVsCompletionSetEx Members
override int CompareItems(in BSTR bstrSoFar, in BSTR bstrOther, in int lCharactersToCompare, int* plResult)
{
mixin(LogCallMix);
*plResult = 0;
return E_NOTIMPL;
}
override int IncreaseFilterLevel(in int iSelectedItem)
{
mixin(LogCallMix2);
return E_NOTIMPL;
}
override int DecreaseFilterLevel(in int iSelectedItem)
{
mixin(LogCallMix2);
return E_NOTIMPL;
}
override int GetCompletionItemColor(in int iIndex, COLORREF* dwFGColor, COLORREF* dwBGColor)
{
mixin(LogCallMix);
*dwFGColor = *dwBGColor = 0;
return E_NOTIMPL;
}
override int GetFilterLevel(int* iFilterLevel)
{
// if implementaed, adds tabs "Common" and "All"
mixin(LogCallMix2);
*iFilterLevel = 0;
return E_NOTIMPL;
}
override int OnCommitComplete()
{
mixin(LogCallMix);
/+
if(CodeWindowManager mgr = mSource.LanguageService.GetCodeWindowManagerForView(mTextView))
if (ViewFilter filter = mgr.GetFilter(mTextView))
filter.OnAutoComplete();
+/
return S_OK;
}
// IVsCompletionSet3 adds icons on the right side of the completion list
override HRESULT GetContextIcon(in int iIndex, int *piGlyph)
{
mixin(LogCallMix);
*piGlyph = CSIMG_MEMBER;
return S_OK;
}
override HRESULT GetContextImageList (HANDLE *phImageList)
{
mixin(LogCallMix);
*phImageList = cast(HANDLE)mImageList;
return S_OK;
}
}
//-------------------------------------------------------------------------------------
class MethodData : DisposingComObject, IVsMethodData
{
IServiceProvider mProvider;
IVsMethodTipWindow mMethodTipWindow;
Definition[] mMethods;
bool mTypePrefixed = true;
int mCurrentParameter;
int mCurrentMethod;
bool mDisplayed;
IVsTextView mTextView;
TextSpan mContext;
this()
{
auto uuid = uuid_coclass_VsMethodTipWindow;
mMethodTipWindow = VsLocalCreateInstance!IVsMethodTipWindow (&uuid, CLSCTX_INPROC_SERVER);
if (mMethodTipWindow)
mMethodTipWindow.SetMethodData(this);
}
override HRESULT QueryInterface(in IID* riid, void** pvObject)
{
if(queryInterface!(IVsMethodData) (this, riid, pvObject))
return S_OK;
return super.QueryInterface(riid, pvObject);
}
void Refresh(IVsTextView textView, Definition[] methods, int currentParameter, TextSpan context)
{
if (!mDisplayed)
mCurrentMethod = 0; // methods.DefaultMethod;
mContext = context;
mMethods = mMethods.init;
defLoop:
foreach(ref def; methods)
{
foreach(ref d; mMethods)
if(d.type == def.type)
{
if (!d.inScope.endsWith(" ..."))
d.inScope ~= " ...";
continue defLoop;
}
mMethods ~= def;
}
// Apparently this Refresh() method is called as a result of event notification
// after the currentMethod is changed, so we do not want to Dismiss anything or
// reset the currentMethod here.
//Dismiss();
mTextView = textView;
mCurrentParameter = currentParameter;
AdjustCurrentParameter(0);
}
void AdjustCurrentParameter(int increment)
{
mCurrentParameter += increment;
if (mCurrentParameter < 0)
mCurrentParameter = -1;
else if (mCurrentParameter >= GetParameterCount(mCurrentMethod))
mCurrentParameter = GetParameterCount(mCurrentMethod);
UpdateView();
}
void Close()
{
Dismiss();
mTextView = null;
mMethods = null;
}
void Dismiss()
{
if (mDisplayed && mTextView)
mTextView.UpdateTipWindow(mMethodTipWindow, UTW_DISMISS);
OnDismiss();
}
override void Dispose()
{
Close();
if (mMethodTipWindow)
mMethodTipWindow.SetMethodData(null);
mMethodTipWindow = release(mMethodTipWindow);
}
//IVsMethodData
override int GetOverloadCount()
{
if (!mTextView || mMethods.length == 0)
return 0;
return mMethods.length;
}
override int GetCurMethod()
{
return mCurrentMethod;
}
override int NextMethod()
{
if (mCurrentMethod < GetOverloadCount() - 1)
mCurrentMethod++;
return mCurrentMethod;
}
override int PrevMethod()
{
if (mCurrentMethod > 0)
mCurrentMethod--;
return mCurrentMethod;
}
override int GetParameterCount(in int method)
{
if (mMethods.length == 0)
return 0;
if (method < 0 || method >= GetOverloadCount())
return 0;
return mMethods[method].GetParameterCount();
}
override int GetCurrentParameter(in int method)
{
return mCurrentParameter;
}
override void OnDismiss()
{
mTextView = null;
mMethods = mMethods.init;
mCurrentMethod = 0;
mCurrentParameter = 0;
mDisplayed = false;
}
override void UpdateView()
{
if (mTextView && mMethodTipWindow)
{
mTextView.UpdateTipWindow(mMethodTipWindow, UTW_CONTENTCHANGED | UTW_CONTEXTCHANGED);
mDisplayed = true;
}
}
override int GetContextStream(int* pos, int* length)
{
*pos = 0;
*length = 0;
int line, idx, vspace, endpos;
if(HRESULT rc = mTextView.GetCaretPos(&line, &idx))
return rc;
line = max(line, mContext.iStartLine);
if(HRESULT rc = mTextView.GetNearestPosition(line, mContext.iStartIndex, pos, &vspace))
return rc;
line = max(line, mContext.iEndLine);
if(HRESULT rc = mTextView.GetNearestPosition(line, mContext.iEndIndex, &endpos, &vspace))
return rc;
*length = endpos - *pos;
return S_OK;
}
override WCHAR* GetMethodText(in int method, in MethodTextType type)
{
if (mMethods.length == 0)
return null;
if (method < 0 || method >= GetOverloadCount())
return null;
string result;
//a type
if ((type == MTT_TYPEPREFIX && mTypePrefixed) ||
(type == MTT_TYPEPOSTFIX && !mTypePrefixed))
{
string str = mMethods[method].GetReturnType();
if (str.length == 0)
return null;
result = str; // mMethods.TypePrefix + str + mMethods.TypePostfix;
}
else
{
//other
switch (type) {
case MTT_OPENBRACKET:
result = "("; // mMethods.OpenBracket;
break;
case MTT_CLOSEBRACKET:
result = ")"; // mMethods.CloseBracket;
break;
case MTT_DELIMITER:
result = ","; // mMethods.Delimiter;
break;
case MTT_NAME:
result = mMethods[method].name;
break;
case MTT_DESCRIPTION:
if(mMethods[method].help.length)
result = phobosDdocExpand(mMethods[method].help);
else if(mMethods[method].line > 0)
result = format("%s %s @ %s(%d)", mMethods[method].kind, mMethods[method].inScope, mMethods[method].filename, mMethods[method].line);
break;
case MTT_TYPEPREFIX:
case MTT_TYPEPOSTFIX:
default:
break;
}
}
return result.length == 0 ? null : allocBSTR(result); // produces leaks?
}
override WCHAR* GetParameterText(in int method, in int parameter, in ParameterTextType type)
{
if (mMethods.length == 0)
return null;
if (method < 0 || method >= GetOverloadCount())
return null;
if (parameter < 0 || parameter >= GetParameterCount(method))
return null;
string name;
string description;
string display;
mMethods[method].GetParameterInfo(parameter, name, display, description);
string result;
switch (type) {
case PTT_NAME:
result = name;
break;
case PTT_DESCRIPTION:
result = description;
break;
case PTT_DECLARATION:
result = display;
break;
default:
break;
}
return result.length == 0 ? null : allocBSTR(result); // produces leaks?
}
}
|
D
|
a native or inhabitant of Brazil
of or relating to or characteristic of Brazil or the people of Brazil
|
D
|
/Users/sijo/Desktop/test2/Build/Intermediates/ULCH.build/Debug-iphonesimulator/ULCH.build/Objects-normal/x86_64/ULChangePasswordViewController.o : /Users/sijo/Desktop/test2/ULCH/DashBoard/PresentedViewController.swift /Users/sijo/Desktop/test2/ULCH/CoreData/LocImageDetails+CoreDataClass.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULDashBoardTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/ViewController.swift /Users/sijo/Desktop/test2/ULCH/UserRegistration/ULSignUpViewController.swift /Users/sijo/Desktop/test2/ULCH/AppDelegate.swift /Users/sijo/Desktop/test2/ULCH/CountryView.swift /Users/sijo/Desktop/test2/ULCH/CoreData/SensorDetails+CoreDataProperties.swift /Users/sijo/Desktop/test2/ULCH/AlertDisplay/ULLoadingActivity.swift /Users/sijo/Desktop/test2/ULCH/UserRegistration/ULLoginViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULChangePasswordViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULHubSettingsTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULSensorListTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/CoreData/HubDetails+CoreDataClass.swift /Users/sijo/Desktop/test2/ULCH/CoreData/LocImageDetails+CoreDataProperties.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULLocListTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/Manager/ULUrlManager.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULHubListViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULDashBoardViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULUserListTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/Manager/ULConstants.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULSensorDetailsViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULProfileEditTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/CountryPicker.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/SideMenuTableView.swift /Users/sijo/Desktop/test2/ULCH/Manager/ULErrorManager.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULUpdateMobilePhoneViewController.swift /Users/sijo/Desktop/test2/ULCH/AlertDisplay/ULAlertDisplay.swift /Users/sijo/Desktop/test2/ULCH/CoreData/CoreDataStack.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULHubTextfieldTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/CoreData/SensorDetails+CoreDataClass.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULUserListViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULHubCollectionViewCell.swift /Users/sijo/Desktop/test2/ULCH/Manager/ULRequestManager.swift /Users/sijo/Desktop/test2/ULCH/ULHubSettingsViewController.swift /Users/sijo/Desktop/test2/ULCH/UserRegistration/ULOTPViewController.swift /Users/sijo/Desktop/test2/ULCH/API/ULCHManager.swift /Users/sijo/Desktop/test2/ULCH/CoreData/HubDetails+CoreDataProperties.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULSensorDetailTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/ULCommon.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULSensorListViewController.swift /Users/sijo/Desktop/test2/ULCH/ULForgotPasswordViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/sijo/Desktop/test2/ULCH-Bridging-Header.h /Users/sijo/Desktop/test2/ULCH/PhoneNumbers/NBPhoneNumberUtil.h /Users/sijo/Desktop/test2/Pods/Firebase/Core/Sources/module.modulemap /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/Darwin.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/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/sijo/Desktop/test2/ULCH/PhoneNumbers/NBPhoneNumberDefines.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFNetworking.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFURLRequestSerialization.h /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/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFURLResponseSerialization.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFSecurityPolicy.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFNetworkReachabilityManager.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFURLConnectionOperation.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFHTTPRequestOperation.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFHTTPRequestOperationManager.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFURLSessionManager.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFHTTPSessionManager.h /Users/sijo/Desktop/test2/ULCH/NetworkConnectivity/ULConnectivity.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Users/sijo/Desktop/test2/Pods/FirebaseInstanceID/Frameworks/frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/sijo/Desktop/test2/Pods/FirebaseInstanceID/Frameworks/frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/sijo/Desktop/test2/Pods/FirebaseInstanceID/Frameworks/frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/sijo/Desktop/test2/Pods/FirebaseMessaging/Frameworks/frameworks/FirebaseMessaging.framework/Headers/FIRMessaging.h /Users/sijo/Desktop/test2/Pods/FirebaseMessaging/Frameworks/frameworks/FirebaseMessaging.framework/Headers/FirebaseMessaging.h /Users/sijo/Desktop/test2/Pods/FirebaseMessaging/Frameworks/frameworks/FirebaseMessaging.framework/Modules/module.modulemap /Users/sijo/Desktop/test2/Pods/Firebase/Core/Sources/Firebase.h /Users/sijo/Desktop/test2/Build/Products/Debug-iphonesimulator/SideMenu/SideMenu.framework/Modules/SideMenu.swiftmodule/x86_64.swiftmodule /Users/sijo/Desktop/test2/Build/Products/Debug-iphonesimulator/SideMenu/SideMenu.framework/Headers/SideMenu-Swift.h /Users/sijo/Desktop/test2/Build/Products/Debug-iphonesimulator/SideMenu/SideMenu.framework/Headers/SideMenu-umbrella.h /Users/sijo/Desktop/test2/Build/Products/Debug-iphonesimulator/SideMenu/SideMenu.framework/Modules/module.modulemap
/Users/sijo/Desktop/test2/Build/Intermediates/ULCH.build/Debug-iphonesimulator/ULCH.build/Objects-normal/x86_64/ULChangePasswordViewController~partial.swiftmodule : /Users/sijo/Desktop/test2/ULCH/DashBoard/PresentedViewController.swift /Users/sijo/Desktop/test2/ULCH/CoreData/LocImageDetails+CoreDataClass.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULDashBoardTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/ViewController.swift /Users/sijo/Desktop/test2/ULCH/UserRegistration/ULSignUpViewController.swift /Users/sijo/Desktop/test2/ULCH/AppDelegate.swift /Users/sijo/Desktop/test2/ULCH/CountryView.swift /Users/sijo/Desktop/test2/ULCH/CoreData/SensorDetails+CoreDataProperties.swift /Users/sijo/Desktop/test2/ULCH/AlertDisplay/ULLoadingActivity.swift /Users/sijo/Desktop/test2/ULCH/UserRegistration/ULLoginViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULChangePasswordViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULHubSettingsTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULSensorListTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/CoreData/HubDetails+CoreDataClass.swift /Users/sijo/Desktop/test2/ULCH/CoreData/LocImageDetails+CoreDataProperties.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULLocListTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/Manager/ULUrlManager.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULHubListViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULDashBoardViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULUserListTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/Manager/ULConstants.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULSensorDetailsViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULProfileEditTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/CountryPicker.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/SideMenuTableView.swift /Users/sijo/Desktop/test2/ULCH/Manager/ULErrorManager.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULUpdateMobilePhoneViewController.swift /Users/sijo/Desktop/test2/ULCH/AlertDisplay/ULAlertDisplay.swift /Users/sijo/Desktop/test2/ULCH/CoreData/CoreDataStack.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULHubTextfieldTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/CoreData/SensorDetails+CoreDataClass.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULUserListViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULHubCollectionViewCell.swift /Users/sijo/Desktop/test2/ULCH/Manager/ULRequestManager.swift /Users/sijo/Desktop/test2/ULCH/ULHubSettingsViewController.swift /Users/sijo/Desktop/test2/ULCH/UserRegistration/ULOTPViewController.swift /Users/sijo/Desktop/test2/ULCH/API/ULCHManager.swift /Users/sijo/Desktop/test2/ULCH/CoreData/HubDetails+CoreDataProperties.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULSensorDetailTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/ULCommon.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULSensorListViewController.swift /Users/sijo/Desktop/test2/ULCH/ULForgotPasswordViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/sijo/Desktop/test2/ULCH-Bridging-Header.h /Users/sijo/Desktop/test2/ULCH/PhoneNumbers/NBPhoneNumberUtil.h /Users/sijo/Desktop/test2/Pods/Firebase/Core/Sources/module.modulemap /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/Darwin.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/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/sijo/Desktop/test2/ULCH/PhoneNumbers/NBPhoneNumberDefines.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFNetworking.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFURLRequestSerialization.h /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/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFURLResponseSerialization.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFSecurityPolicy.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFNetworkReachabilityManager.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFURLConnectionOperation.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFHTTPRequestOperation.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFHTTPRequestOperationManager.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFURLSessionManager.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFHTTPSessionManager.h /Users/sijo/Desktop/test2/ULCH/NetworkConnectivity/ULConnectivity.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Users/sijo/Desktop/test2/Pods/FirebaseInstanceID/Frameworks/frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/sijo/Desktop/test2/Pods/FirebaseInstanceID/Frameworks/frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/sijo/Desktop/test2/Pods/FirebaseInstanceID/Frameworks/frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/sijo/Desktop/test2/Pods/FirebaseMessaging/Frameworks/frameworks/FirebaseMessaging.framework/Headers/FIRMessaging.h /Users/sijo/Desktop/test2/Pods/FirebaseMessaging/Frameworks/frameworks/FirebaseMessaging.framework/Headers/FirebaseMessaging.h /Users/sijo/Desktop/test2/Pods/FirebaseMessaging/Frameworks/frameworks/FirebaseMessaging.framework/Modules/module.modulemap /Users/sijo/Desktop/test2/Pods/Firebase/Core/Sources/Firebase.h /Users/sijo/Desktop/test2/Build/Products/Debug-iphonesimulator/SideMenu/SideMenu.framework/Modules/SideMenu.swiftmodule/x86_64.swiftmodule /Users/sijo/Desktop/test2/Build/Products/Debug-iphonesimulator/SideMenu/SideMenu.framework/Headers/SideMenu-Swift.h /Users/sijo/Desktop/test2/Build/Products/Debug-iphonesimulator/SideMenu/SideMenu.framework/Headers/SideMenu-umbrella.h /Users/sijo/Desktop/test2/Build/Products/Debug-iphonesimulator/SideMenu/SideMenu.framework/Modules/module.modulemap
/Users/sijo/Desktop/test2/Build/Intermediates/ULCH.build/Debug-iphonesimulator/ULCH.build/Objects-normal/x86_64/ULChangePasswordViewController~partial.swiftdoc : /Users/sijo/Desktop/test2/ULCH/DashBoard/PresentedViewController.swift /Users/sijo/Desktop/test2/ULCH/CoreData/LocImageDetails+CoreDataClass.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULDashBoardTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/ViewController.swift /Users/sijo/Desktop/test2/ULCH/UserRegistration/ULSignUpViewController.swift /Users/sijo/Desktop/test2/ULCH/AppDelegate.swift /Users/sijo/Desktop/test2/ULCH/CountryView.swift /Users/sijo/Desktop/test2/ULCH/CoreData/SensorDetails+CoreDataProperties.swift /Users/sijo/Desktop/test2/ULCH/AlertDisplay/ULLoadingActivity.swift /Users/sijo/Desktop/test2/ULCH/UserRegistration/ULLoginViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULChangePasswordViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULHubSettingsTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULSensorListTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/CoreData/HubDetails+CoreDataClass.swift /Users/sijo/Desktop/test2/ULCH/CoreData/LocImageDetails+CoreDataProperties.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULLocListTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/Manager/ULUrlManager.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULHubListViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULDashBoardViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULUserListTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/Manager/ULConstants.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULSensorDetailsViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULProfileEditTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/CountryPicker.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/SideMenuTableView.swift /Users/sijo/Desktop/test2/ULCH/Manager/ULErrorManager.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULUpdateMobilePhoneViewController.swift /Users/sijo/Desktop/test2/ULCH/AlertDisplay/ULAlertDisplay.swift /Users/sijo/Desktop/test2/ULCH/CoreData/CoreDataStack.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULHubTextfieldTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/CoreData/SensorDetails+CoreDataClass.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULUserListViewController.swift /Users/sijo/Desktop/test2/ULCH/DashBoard/ULHubCollectionViewCell.swift /Users/sijo/Desktop/test2/ULCH/Manager/ULRequestManager.swift /Users/sijo/Desktop/test2/ULCH/ULHubSettingsViewController.swift /Users/sijo/Desktop/test2/ULCH/UserRegistration/ULOTPViewController.swift /Users/sijo/Desktop/test2/ULCH/API/ULCHManager.swift /Users/sijo/Desktop/test2/ULCH/CoreData/HubDetails+CoreDataProperties.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULSensorDetailTableViewCell.swift /Users/sijo/Desktop/test2/ULCH/ULCommon.swift /Users/sijo/Desktop/test2/ULCH/SensorDetails/ULSensorListViewController.swift /Users/sijo/Desktop/test2/ULCH/ULForgotPasswordViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/sijo/Desktop/test2/ULCH-Bridging-Header.h /Users/sijo/Desktop/test2/ULCH/PhoneNumbers/NBPhoneNumberUtil.h /Users/sijo/Desktop/test2/Pods/Firebase/Core/Sources/module.modulemap /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/Darwin.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/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/sijo/Desktop/test2/ULCH/PhoneNumbers/NBPhoneNumberDefines.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFNetworking.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFURLRequestSerialization.h /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/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFURLResponseSerialization.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFSecurityPolicy.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFNetworkReachabilityManager.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFURLConnectionOperation.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFHTTPRequestOperation.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFHTTPRequestOperationManager.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFURLSessionManager.h /Users/sijo/Desktop/test2/ULCH/Networks/AFNetworking/AFHTTPSessionManager.h /Users/sijo/Desktop/test2/ULCH/NetworkConnectivity/ULConnectivity.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/sijo/Desktop/test2/Pods/FirebaseCore/Frameworks/frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/sijo/Desktop/test2/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Users/sijo/Desktop/test2/Pods/FirebaseInstanceID/Frameworks/frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/sijo/Desktop/test2/Pods/FirebaseInstanceID/Frameworks/frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/sijo/Desktop/test2/Pods/FirebaseInstanceID/Frameworks/frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/sijo/Desktop/test2/Pods/FirebaseMessaging/Frameworks/frameworks/FirebaseMessaging.framework/Headers/FIRMessaging.h /Users/sijo/Desktop/test2/Pods/FirebaseMessaging/Frameworks/frameworks/FirebaseMessaging.framework/Headers/FirebaseMessaging.h /Users/sijo/Desktop/test2/Pods/FirebaseMessaging/Frameworks/frameworks/FirebaseMessaging.framework/Modules/module.modulemap /Users/sijo/Desktop/test2/Pods/Firebase/Core/Sources/Firebase.h /Users/sijo/Desktop/test2/Build/Products/Debug-iphonesimulator/SideMenu/SideMenu.framework/Modules/SideMenu.swiftmodule/x86_64.swiftmodule /Users/sijo/Desktop/test2/Build/Products/Debug-iphonesimulator/SideMenu/SideMenu.framework/Headers/SideMenu-Swift.h /Users/sijo/Desktop/test2/Build/Products/Debug-iphonesimulator/SideMenu/SideMenu.framework/Headers/SideMenu-umbrella.h /Users/sijo/Desktop/test2/Build/Products/Debug-iphonesimulator/SideMenu/SideMenu.framework/Modules/module.modulemap
|
D
|
void main() { runSolver(); }
void problem() {
auto N = scan!real;
auto solve() {
return N/100;
}
outputForAtCoder(&solve);
}
// ----------------------------------------------
import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons, std.numeric, std.traits, std.functional, std.bigint, std.datetime.stopwatch, core.time, core.bitop;
T[][] combinations(T)(T[] s, in long 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)(long n){ return n.iota.map!(i => scan!T()).array; }
void deb(T ...)(T t){ debug writeln(t); }
alias Point = Tuple!(long, "x", long, "y");
Point invert(Point p) { return Point(p.y, p.x); }
long[] divisors(long n) { long[] ret; for (long i = 1; i * i <= n; i++) { if (n % i == 0) { ret ~= i; if (i * i != n) ret ~= n / i; } } return ret.sort.array; }
bool chmin(T)(ref T a, T b) { if (b < a) { a = b; return true; } else return false; }
bool chmax(T)(ref T a, T b) { if (b > a) { a = b; return true; } else return false; }
string charSort(alias S = "a < b")(string s) { return (cast(char[])((cast(byte[])s).sort!S.array)).to!string; }
ulong comb(ulong a, ulong b) { if (b == 0) {return 1;}else{return comb(a - 1, b - 1) * a / b;}}
string toAnswerString(R)(R r) { return r.map!"a.to!string".joiner(" ").array.to!string; }
struct ModInt(uint MD) if (MD < int.max) {ulong v;this(string v) {this(v.to!long);}this(int v) {this(long(v));}this(long v) {this.v = (v%MD+MD)%MD;}void opAssign(long t) {v = (t%MD+MD)%MD;}static auto normS(ulong x) {return (x<MD)?x:x-MD;}static auto make(ulong x) {ModInt m; m.v = x; return m;}auto opBinary(string op:"+")(ModInt r) const {return make(normS(v+r.v));}auto opBinary(string op:"-")(ModInt r) const {return make(normS(v+MD-r.v));}auto opBinary(string op:"*")(ModInt r) const {return make((ulong(v)*r.v%MD).to!ulong);}auto opBinary(string op:"^^", T)(T r) const {long x=v;long y=1;while(r){if(r%2==1)y=(y*x)%MD;x=x^^2%MD;r/=2;} return make(y);}auto opBinary(string op:"/")(ModInt r) const {return this*memoize!inv(r);}static ModInt inv(ModInt x) {return x^^(MD-2);}string toString() const {return v.to!string;}auto opOpAssign(string op)(ModInt r) {return mixin ("this=this"~op~"r");}}
alias MInt1 = ModInt!(10^^9 + 7);
alias MInt9 = ModInt!(998_244_353);
void outputForAtCoder(T)(T delegate() fn) {
static if (is(T == float) || is(T == double) || is(T == real)) "%.16f".writefln(fn());
else static if (is(T == void)) fn();
else static if (is(T == string)) fn().writeln;
else static if (isInputRange!T) {
static if (!is(string == ElementType!T) && isInputRange!(ElementType!T)) foreach(r; fn()) r.toAnswerString.writeln;
else foreach(r; fn()) r.writeln;
}
else fn().writeln;
}
void runSolver() {
enum BORDER = "==================================";
debug { BORDER.writeln; while(!stdin.eof) { "<<< Process time: %s >>>".writefln(benchmark!problem(1)); BORDER.writeln; } }
else problem();
}
enum YESNO = [true: "Yes", false: "No"];
// -----------------------------------------------
|
D
|
/Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/CollectionKit.build/Objects-normal/x86_64/ClosureDataSource.o : /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/Deprecated.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/DataSource/DataSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/DataSource/ClosureDataSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/DataSource/ArrayDataSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/SizeSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/ViewSource/ViewSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/ViewSource/ComposedViewSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/ViewSource/ClosureViewSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/ViewSource/AnyViewSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/CollectionReloadable.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Extensions/Util.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Protocol/Provider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/BasicProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/FlattenedProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/ComposedProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Addon/SpaceProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Protocol/LayoutableProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Addon/EmptyStateProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Protocol/ItemProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Protocol/SectionProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/EmptyCollectionProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/ComposedHeaderProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Addon/SimpleViewProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/CollectionReuseViewManager.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/LayoutHelper.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Animator/Animator.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Animator/FadeAnimator.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Animator/ScaleAnimator.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Animator/SimpleAnimator.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Extensions/UIView+CollectionKit.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Extensions/UIScrollView+CollectionKit.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/Layout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/SimpleLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/ClosureLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/TransposeLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/WaterfallLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/WrapperLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/InsetLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/VisibleFrameInsetLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/RowLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/FlowLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/OverlayLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/StickyLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/LayoutContext.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/CollectionView.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/radibarq/developer/NasaInArabic/Pods/Target\ Support\ Files/CollectionKit/CollectionKit-umbrella.h /Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/CollectionKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/CollectionKit.build/Objects-normal/x86_64/ClosureDataSource~partial.swiftmodule : /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/Deprecated.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/DataSource/DataSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/DataSource/ClosureDataSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/DataSource/ArrayDataSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/SizeSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/ViewSource/ViewSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/ViewSource/ComposedViewSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/ViewSource/ClosureViewSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/ViewSource/AnyViewSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/CollectionReloadable.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Extensions/Util.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Protocol/Provider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/BasicProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/FlattenedProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/ComposedProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Addon/SpaceProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Protocol/LayoutableProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Addon/EmptyStateProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Protocol/ItemProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Protocol/SectionProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/EmptyCollectionProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/ComposedHeaderProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Addon/SimpleViewProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/CollectionReuseViewManager.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/LayoutHelper.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Animator/Animator.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Animator/FadeAnimator.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Animator/ScaleAnimator.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Animator/SimpleAnimator.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Extensions/UIView+CollectionKit.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Extensions/UIScrollView+CollectionKit.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/Layout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/SimpleLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/ClosureLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/TransposeLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/WaterfallLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/WrapperLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/InsetLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/VisibleFrameInsetLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/RowLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/FlowLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/OverlayLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/StickyLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/LayoutContext.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/CollectionView.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/radibarq/developer/NasaInArabic/Pods/Target\ Support\ Files/CollectionKit/CollectionKit-umbrella.h /Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/CollectionKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/CollectionKit.build/Objects-normal/x86_64/ClosureDataSource~partial.swiftdoc : /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/Deprecated.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/DataSource/DataSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/DataSource/ClosureDataSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/DataSource/ArrayDataSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/SizeSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/ViewSource/ViewSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/ViewSource/ComposedViewSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/ViewSource/ClosureViewSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/ViewSource/AnyViewSource.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/CollectionReloadable.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Extensions/Util.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Protocol/Provider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/BasicProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/FlattenedProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/ComposedProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Addon/SpaceProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Protocol/LayoutableProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Addon/EmptyStateProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Protocol/ItemProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Protocol/SectionProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/EmptyCollectionProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Provider/ComposedHeaderProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Addon/SimpleViewProvider.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/CollectionReuseViewManager.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Other/LayoutHelper.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Animator/Animator.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Animator/FadeAnimator.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Animator/ScaleAnimator.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Animator/SimpleAnimator.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Extensions/UIView+CollectionKit.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Extensions/UIScrollView+CollectionKit.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/Layout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/SimpleLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/ClosureLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/TransposeLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/WaterfallLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/WrapperLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/InsetLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/VisibleFrameInsetLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/RowLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/FlowLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/OverlayLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/StickyLayout.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/Layout/LayoutContext.swift /Users/radibarq/developer/NasaInArabic/Pods/CollectionKit/Sources/CollectionView.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/radibarq/developer/NasaInArabic/Pods/Target\ Support\ Files/CollectionKit/CollectionKit-umbrella.h /Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/CollectionKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
void main() {
debug {
"==================================".writeln;
while(true) {
auto bench = benchmark!problem(1);
"<<< Process time: %s >>>".writefln(bench[0]);
"==================================".writeln;
}
} else {
problem();
}
}
void problem() {
enum UNSOLVABLE = "UNSOLVABLE";
auto S = scan!string(3);
auto solve() {
bool[char] charMap;
foreach(c; S[0]~S[1]~S[2]) charMap[c] = true;
if (charMap.length > 10) {
UNSOLVABLE.writeln;
return;
}
auto chars = charMap.keys;
auto l = chars.length.to!int;
auto NUMS = 10.iota.array;
long[char] charTable;
foreach(i, c; chars) charTable[c] = i;
foreach(combBase; NUMS.combinations(l)) {
foreach(comb; combBase.permutations) {
if (S.any!(s => comb[charTable[s[0]]] == 0)) continue;
long numMap(string s) {
long ret;
foreach(c; s) ret = ret*10 + comb[charTable[c]];
return ret;
}
auto n = S.map!(numMap);
if (n[0] + n[1] == n[2]) {
"%s %s %s".writefln(n[0], n[1], n[2]);
return;
}
}
}
UNSOLVABLE.writeln;
return;
}
static if (is(ReturnType!(solve) == void)) solve(); else solve().writeln;
}
// ----------------------------------------------
import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons, std.numeric, std.traits, std.functional, std.bigint, std.datetime.stopwatch, core.time;
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)(long n){ return n.iota.map!(i => scan!T()).array; }
void deb(T ...)(T t){ debug writeln(t); }
alias Point = Tuple!(long, "x", long, "y");
Point invert(Point p) { return Point(p.y, p.x); }
ulong MOD = 10^^9 + 7;
long[] divisors(long n) { long[] ret; for (long i = 1; i * i <= n; i++) { if (n % i == 0) { ret ~= i; if (i * i != n) ret ~= n / i; } } return ret.sort.array; }
bool chmin(T)(ref T a, T b) { if (b < a) { a = b; return true; } else return false; }
bool chmax(T)(ref T a, T b) { if (b > a) { a = b; return true; } else return false; }
string charSort(alias S = "a < b")(string s) { return (cast(char[])((cast(byte[])s).sort!S.array)).to!string; }
enum YESNO = [true: "Yes", false: "No"];
// -----------------------------------------------
struct CombinationRange(T) {
private {
int combinationSize;
int elementSize;
int pointer;
int[] cursor;
T[] elements;
T[] current;
}
public:
this(T[] t, int combinationSize) {
this.combinationSize = combinationSize;
this.elementSize = cast(int)t.length;
pointer = combinationSize - 1;
cursor = new int[combinationSize];
current = new T[combinationSize];
elements = t.dup;
foreach(i; 0..combinationSize) {
cursor[i] = i;
current[i] = elements[i];
}
}
@property T[] front() {
return current;
}
void popFront() {
if (pointer == -1) return;
if (cursor[pointer] == elementSize + pointer - combinationSize) {
pointer--;
popFront();
if (pointer < 0) return;
pointer++;
cursor[pointer] = cursor[pointer - 1];
current[pointer] = elements[cursor[pointer]];
}
cursor[pointer]++;
current[pointer] = elements[cursor[pointer]];
}
bool empty() {
return pointer == -1;
}
}
CombinationRange!T combinations(T)(T[] t, int size) { return CombinationRange!T(t, size); }
|
D
|
module engine.renderer.opengl_backend.glutils;
import derelict.opengl3.gl3;
import engine.utils.math;
import std.format: format;
public string glGetMessage (GLenum err) {
switch (err) {
case GL_INVALID_OPERATION: return "GL_INVALID_OPERATION";
case GL_INVALID_ENUM: return "GL_INVALID_ENUM";
case GL_INVALID_VALUE: return "GL_INVALID_VALUE";
case GL_INVALID_FRAMEBUFFER_OPERATION: return "GL_INVALID_FRAMEBUFFER_OPERATION";
case GL_OUT_OF_MEMORY: return "GL_OUT_OF_MEMORY";
default: assert(0, format("Invalid GLenum error value: %d", err));
}
}
public uint glCreateBuffer () {
uint buffer; glGenBuffers(1, &buffer); return buffer;
}
public uint glCreateVertexArray () {
uint vao; glGenVertexArrays(1, &vao); return vao;
}
public uint glCreateTexture () {
uint tex; glGenTextures(1, &tex); return tex;
}
public void glDeleteBuffer (ref uint buffer) {
glDeleteBuffers(1, &buffer); buffer = 0;
}
public void glDeleteVertexArray (ref uint vao ) {
glDeleteVertexArrays(1, &vao); vao = 0;
}
public void glDeleteTexture (ref uint tex) {
glDeleteTextures(1, &tex); tex = 0;
}
public void glSetUniform (uint l, float v) { glUniform1f(l, v); }
public void glSetUniform (uint l, vec2 v) { glUniform2fv(l, 1, v.value_ptr); }
public void glSetUniform (uint l, vec3 v) { glUniform3fv(l, 1, v.value_ptr); }
public void glSetUniform (uint l, vec4 v) { glUniform4fv(l, 1, v.value_ptr); }
public void glSetUniform (uint l, mat2 v) { glUniformMatrix2fv(l, 1, true, v.value_ptr); }
public void glSetUniform (uint l, mat3 v) { glUniformMatrix3fv(l, 1, true, v.value_ptr); }
public void glSetUniform (uint l, mat4 v) { glUniformMatrix4fv(l, 1, true, v.value_ptr); }
public void glSetUniform (uint l, int v) { glUniform1i(l, v); }
public void glSetUniform (uint l, vec2i v) { glUniform2iv(l, 1, v.value_ptr); }
public void glSetUniform (uint l, vec3i v) { glUniform3iv(l, 1, v.value_ptr); }
public void glSetUniform (uint l, vec4i v) { glUniform4iv(l, 1, v.value_ptr); }
public void glSetUniform (uint l, float[] v) { glUniform1fv(l, cast(int)v.length, &v[0]); }
public void glSetUniform (uint l, vec2[] v) { glUniform2fv(l, cast(int)v.length, v[0].value_ptr); }
public void glSetUniform (uint l, vec3[] v) { glUniform3fv(l, cast(int)v.length, v[0].value_ptr); }
public void glSetUniform (uint l, vec4[] v) { glUniform4fv(l, cast(int)v.length, v[0].value_ptr); }
public void glSetUniform (uint l, mat2[] v) { glUniformMatrix2fv(l, cast(int)v.length, true, v[0].value_ptr); }
public void glSetUniform (uint l, mat3[] v) { glUniformMatrix3fv(l, cast(int)v.length, true, v[0].value_ptr); }
public void glSetUniform (uint l, mat4[] v) { glUniformMatrix4fv(l, cast(int)v.length, true, v[0].value_ptr); }
public void glSetUniform (uint l, int[] v) { glUniform1iv(l, cast(int)v.length, &v[0]); }
public void glSetUniform (uint l, vec2i[] v) { glUniform2iv(l, cast(int)v.length, v[0].value_ptr); }
public void glSetUniform (uint l, vec3i[] v) { glUniform3iv(l, cast(int)v.length, v[0].value_ptr); }
public void glSetUniform (uint l, vec4i[] v) { glUniform4iv(l, cast(int)v.length, v[0].value_ptr); }
|
D
|
module android.java.java.net.InterfaceAddress_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import0 = android.java.java.net.InetAddress_d_interface;
import import1 = android.java.java.lang.Class_d_interface;
final class InterfaceAddress : IJavaObject {
static immutable string[] _d_canCastTo = [
];
@Import import0.InetAddress getAddress();
@Import import0.InetAddress getBroadcast();
@Import short getNetworkPrefixLength();
@Import bool equals(IJavaObject);
@Import int hashCode();
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import import1.Class getClass();
@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 = "Ljava/net/InterfaceAddress;";
}
|
D
|
module Windows.Devices.Gpio.Provider;
import dwinrt;
@uuid("ad11cec7-19ea-4b21-874f-b91aed4a25db")
interface IGpioControllerProvider : IInspectable
{
extern(Windows):
HRESULT get_PinCount(INT32* return_value);
HRESULT abi_OpenPinProvider(INT32 pin, Windows.Devices.Gpio.Provider.ProviderGpioSharingMode sharingMode, Windows.Devices.Gpio.Provider.IGpioPinProvider* return_gpioPinProvider);
}
@uuid("42344cb7-6abc-40ff-9ce7-73b85301b900")
interface IGpioPinProvider : IInspectable
{
extern(Windows):
HRESULT add_ValueChanged(Windows.Foundation.TypedEventHandler!(Windows.Devices.Gpio.Provider.IGpioPinProvider, Windows.Devices.Gpio.Provider.GpioPinProviderValueChangedEventArgs) handler, EventRegistrationToken* return_token);
HRESULT remove_ValueChanged(EventRegistrationToken token);
HRESULT get_DebounceTimeout(Windows.Foundation.TimeSpan* return_value);
HRESULT set_DebounceTimeout(Windows.Foundation.TimeSpan value);
HRESULT get_PinNumber(INT32* return_value);
HRESULT get_SharingMode(Windows.Devices.Gpio.Provider.ProviderGpioSharingMode* return_value);
HRESULT abi_IsDriveModeSupported(Windows.Devices.Gpio.Provider.ProviderGpioPinDriveMode driveMode, bool* return_supported);
HRESULT abi_GetDriveMode(Windows.Devices.Gpio.Provider.ProviderGpioPinDriveMode* return_value);
HRESULT abi_SetDriveMode(Windows.Devices.Gpio.Provider.ProviderGpioPinDriveMode value);
HRESULT abi_Write(Windows.Devices.Gpio.Provider.ProviderGpioPinValue value);
HRESULT abi_Read(Windows.Devices.Gpio.Provider.ProviderGpioPinValue* return_value);
}
@uuid("32a6d6f2-3d5b-44cd-8fbe-13a69f2edb24")
@WinrtFactory("Windows.Devices.Gpio.Provider.GpioPinProviderValueChangedEventArgs")
interface IGpioPinProviderValueChangedEventArgs : IInspectable
{
extern(Windows):
HRESULT get_Edge(Windows.Devices.Gpio.Provider.ProviderGpioPinEdge* return_value);
}
@uuid("3ecb0b59-568c-4392-b24a-8a59a902b1f1")
@WinrtFactory("Windows.Devices.Gpio.Provider.GpioPinProviderValueChangedEventArgs")
interface IGpioPinProviderValueChangedEventArgsFactory : IInspectable
{
extern(Windows):
HRESULT abi_Create(Windows.Devices.Gpio.Provider.ProviderGpioPinEdge edge, Windows.Devices.Gpio.Provider.GpioPinProviderValueChangedEventArgs* return_value);
}
@uuid("44e82707-08ca-434a-afe0-d61580446f7e")
interface IGpioProvider : IInspectable
{
extern(Windows):
HRESULT abi_GetControllers(Windows.Foundation.Collections.IVectorView!(Windows.Devices.Gpio.Provider.IGpioControllerProvider)* return_result);
}
interface GpioPinProviderValueChangedEventArgs : Windows.Devices.Gpio.Provider.IGpioPinProviderValueChangedEventArgs
{
extern(Windows):
final Windows.Devices.Gpio.Provider.ProviderGpioPinEdge Edge()
{
Windows.Devices.Gpio.Provider.ProviderGpioPinEdge _ret;
Debug.OK((cast(Windows.Devices.Gpio.Provider.IGpioPinProviderValueChangedEventArgs)this.asInterface(uuid("32a6d6f2-3d5b-44cd-8fbe-13a69f2edb24"))).get_Edge(&_ret));
return _ret;
}
static Windows.Devices.Gpio.Provider.GpioPinProviderValueChangedEventArgs New(Windows.Devices.Gpio.Provider.ProviderGpioPinEdge edge)
{
auto factory = factory!(Windows.Devices.Gpio.Provider.IGpioPinProviderValueChangedEventArgsFactory);
Windows.Devices.Gpio.Provider.GpioPinProviderValueChangedEventArgs _ret;
Debug.OK((cast(Windows.Devices.Gpio.Provider.IGpioPinProviderValueChangedEventArgsFactory)factory.asInterface(uuid("3ecb0b59-568c-4392-b24a-8a59a902b1f1"))).abi_Create(edge, &_ret));
return _ret;
}
}
enum ProviderGpioPinDriveMode
{
Input = 0,
Output = 1,
InputPullUp = 2,
InputPullDown = 3,
OutputOpenDrain = 4,
OutputOpenDrainPullUp = 5,
OutputOpenSource = 6,
OutputOpenSourcePullDown = 7
}
enum ProviderGpioPinEdge
{
FallingEdge = 0,
RisingEdge = 1
}
enum ProviderGpioPinValue
{
Low = 0,
High = 1
}
enum ProviderGpioSharingMode
{
Exclusive = 0,
SharedReadOnly = 1
}
|
D
|
module webkit2.CookieManager;
private import gio.AsyncResultIF;
private import gio.Cancellable;
private import glib.ErrorG;
private import glib.GException;
private import glib.ListG;
private import glib.Str;
private import gobject.ObjectG;
private import gobject.Signals;
private import soup.Cookie;
private import std.algorithm;
private import webkit2.c.functions;
public import webkit2.c.types;
/**
* The WebKitCookieManager defines how to set up and handle cookies.
* You can get it from a #WebKitWebsiteDataManager with
* webkit_website_data_manager_get_cookie_manager(), and use it to set where to
* store cookies with webkit_cookie_manager_set_persistent_storage(),
* or to set the acceptance policy, with webkit_cookie_manager_get_accept_policy().
*/
public class CookieManager : ObjectG
{
/** the main Gtk struct */
protected WebKitCookieManager* webKitCookieManager;
/** Get the main Gtk struct */
public WebKitCookieManager* getCookieManagerStruct(bool transferOwnership = false)
{
if (transferOwnership)
ownedRef = false;
return webKitCookieManager;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)webKitCookieManager;
}
/**
* Sets our main struct and passes it to the parent class.
*/
public this (WebKitCookieManager* webKitCookieManager, bool ownedRef = false)
{
this.webKitCookieManager = webKitCookieManager;
super(cast(GObject*)webKitCookieManager, ownedRef);
}
/** */
public static GType getType()
{
return webkit_cookie_manager_get_type();
}
/**
* Asynchronously add a #SoupCookie to the underlying storage.
*
* When the operation is finished, @callback will be called. You can then call
* webkit_cookie_manager_add_cookie_finish() to get the result of the operation.
*
* Params:
* cookie = the #SoupCookie to be added
* cancellable = a #GCancellable or %NULL to ignore
* callback = a #GAsyncReadyCallback to call when the request is satisfied
* userData = the data to pass to callback function
*
* Since: 2.20
*/
public void addCookie(Cookie cookie, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
{
webkit_cookie_manager_add_cookie(webKitCookieManager, (cookie is null) ? null : cookie.getCookieStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
}
/**
* Finish an asynchronous operation started with webkit_cookie_manager_add_cookie().
*
* Params:
* result = a #GAsyncResult
*
* Returns: %TRUE if the cookie was added or %FALSE in case of error.
*
* Since: 2.20
*
* Throws: GException on failure.
*/
public bool addCookieFinish(AsyncResultIF result)
{
GError* err = null;
auto __p = webkit_cookie_manager_add_cookie_finish(webKitCookieManager, (result is null) ? null : result.getAsyncResultStruct(), &err) != 0;
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
return __p;
}
/**
* Delete all cookies of @cookie_manager
*
* Deprecated: Use webkit_website_data_manager_clear() instead.
*/
public void deleteAllCookies()
{
webkit_cookie_manager_delete_all_cookies(webKitCookieManager);
}
/**
* Asynchronously delete a #SoupCookie from the current session.
*
* When the operation is finished, @callback will be called. You can then call
* webkit_cookie_manager_delete_cookie_finish() to get the result of the operation.
*
* Params:
* cookie = the #SoupCookie to be deleted
* cancellable = a #GCancellable or %NULL to ignore
* callback = a #GAsyncReadyCallback to call when the request is satisfied
* userData = the data to pass to callback function
*
* Since: 2.20
*/
public void deleteCookie(Cookie cookie, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
{
webkit_cookie_manager_delete_cookie(webKitCookieManager, (cookie is null) ? null : cookie.getCookieStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
}
/**
* Finish an asynchronous operation started with webkit_cookie_manager_delete_cookie().
*
* Params:
* result = a #GAsyncResult
*
* Returns: %TRUE if the cookie was deleted or %FALSE in case of error.
*
* Since: 2.20
*
* Throws: GException on failure.
*/
public bool deleteCookieFinish(AsyncResultIF result)
{
GError* err = null;
auto __p = webkit_cookie_manager_delete_cookie_finish(webKitCookieManager, (result is null) ? null : result.getAsyncResultStruct(), &err) != 0;
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
return __p;
}
/**
* Remove all cookies of @cookie_manager for the given @domain.
*
* Deprecated: Use webkit_website_data_manager_remove() instead.
*
* Params:
* domain = a domain name
*/
public void deleteCookiesForDomain(string domain)
{
webkit_cookie_manager_delete_cookies_for_domain(webKitCookieManager, Str.toStringz(domain));
}
/**
* Asynchronously get the cookie acceptance policy of @cookie_manager.
* Note that when policy was set to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY and
* ITP is enabled, this will return %WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS.
* See also webkit_website_data_manager_set_itp_enabled().
*
* When the operation is finished, @callback will be called. You can then call
* webkit_cookie_manager_get_accept_policy_finish() to get the result of the operation.
*
* Params:
* cancellable = a #GCancellable or %NULL to ignore
* callback = a #GAsyncReadyCallback to call when the request is satisfied
* userData = the data to pass to callback function
*/
public void getAcceptPolicy(Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
{
webkit_cookie_manager_get_accept_policy(webKitCookieManager, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
}
/**
* Finish an asynchronous operation started with webkit_cookie_manager_get_accept_policy().
*
* Params:
* result = a #GAsyncResult
*
* Returns: the cookie acceptance policy of @cookie_manager as a #WebKitCookieAcceptPolicy.
*
* Throws: GException on failure.
*/
public WebKitCookieAcceptPolicy getAcceptPolicyFinish(AsyncResultIF result)
{
GError* err = null;
auto __p = webkit_cookie_manager_get_accept_policy_finish(webKitCookieManager, (result is null) ? null : result.getAsyncResultStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
return __p;
}
/**
* Asynchronously get a list of #SoupCookie from @cookie_manager associated with @uri, which
* must be either an HTTP or an HTTPS URL.
*
* When the operation is finished, @callback will be called. You can then call
* webkit_cookie_manager_get_cookies_finish() to get the result of the operation.
*
* Params:
* uri = the URI associated to the cookies to be retrieved
* cancellable = a #GCancellable or %NULL to ignore
* callback = a #GAsyncReadyCallback to call when the request is satisfied
* userData = the data to pass to callback function
*
* Since: 2.20
*/
public void getCookies(string uri, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
{
webkit_cookie_manager_get_cookies(webKitCookieManager, Str.toStringz(uri), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
}
/**
* Finish an asynchronous operation started with webkit_cookie_manager_get_cookies().
* The return value is a #GSList of #SoupCookie instances which should be released
* with g_list_free_full() and soup_cookie_free().
*
* Params:
* result = a #GAsyncResult
*
* Returns: A #GList of #SoupCookie instances.
*
* Since: 2.20
*
* Throws: GException on failure.
*/
public ListG getCookiesFinish(AsyncResultIF result)
{
GError* err = null;
auto __p = webkit_cookie_manager_get_cookies_finish(webKitCookieManager, (result is null) ? null : result.getAsyncResultStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(__p is null)
{
return null;
}
return new ListG(cast(GList*) __p, true);
}
/**
* Asynchronously get the list of domains for which @cookie_manager contains cookies.
*
* When the operation is finished, @callback will be called. You can then call
* webkit_cookie_manager_get_domains_with_cookies_finish() to get the result of the operation.
*
* Deprecated: Use webkit_website_data_manager_fetch() instead.
*
* Params:
* cancellable = a #GCancellable or %NULL to ignore
* callback = a #GAsyncReadyCallback to call when the request is satisfied
* userData = the data to pass to callback function
*/
public void getDomainsWithCookies(Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
{
webkit_cookie_manager_get_domains_with_cookies(webKitCookieManager, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
}
/**
* Finish an asynchronous operation started with webkit_cookie_manager_get_domains_with_cookies().
* The return value is a %NULL terminated list of strings which should
* be released with g_strfreev().
*
* Deprecated: Use webkit_website_data_manager_fetch_finish() instead.
*
* Params:
* result = a #GAsyncResult
*
* Returns: A %NULL terminated array of domain names
* or %NULL in case of error.
*
* Throws: GException on failure.
*/
public string[] getDomainsWithCookiesFinish(AsyncResultIF result)
{
GError* err = null;
auto retStr = webkit_cookie_manager_get_domains_with_cookies_finish(webKitCookieManager, (result is null) ? null : result.getAsyncResultStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
scope(exit) Str.freeStringArray(retStr);
return Str.toStringArray(retStr);
}
/**
* Set the cookie acceptance policy of @cookie_manager as @policy.
* Note that ITP has its own way to handle third-party cookies, so when it's enabled,
* and @policy is set to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY, %WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS
* will be used instead. Once disabled, the policy will be set back to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY.
* See also webkit_website_data_manager_set_itp_enabled().
*
* Params:
* policy = a #WebKitCookieAcceptPolicy
*/
public void setAcceptPolicy(WebKitCookieAcceptPolicy policy)
{
webkit_cookie_manager_set_accept_policy(webKitCookieManager, policy);
}
/**
* Set the @filename where non-session cookies are stored persistently using
* @storage as the format to read/write the cookies.
* Cookies are initially read from @filename to create an initial set of cookies.
* Then, non-session cookies will be written to @filename when the WebKitCookieManager::changed
* signal is emitted.
* By default, @cookie_manager doesn't store the cookies persistently, so you need to call this
* method to keep cookies saved across sessions.
*
* This method should never be called on a #WebKitCookieManager associated to an ephemeral #WebKitWebsiteDataManager.
*
* Params:
* filename = the filename to read to/write from
* storage = a #WebKitCookiePersistentStorage
*/
public void setPersistentStorage(string filename, WebKitCookiePersistentStorage storage)
{
webkit_cookie_manager_set_persistent_storage(webKitCookieManager, Str.toStringz(filename), storage);
}
/**
* This signal is emitted when cookies are added, removed or modified.
*/
gulong addOnChanged(void delegate(CookieManager) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
return Signals.connect(this, "changed", dlg, connectFlags ^ ConnectFlags.SWAPPED);
}
}
|
D
|
/Users/baidu/Desktop/PullServer/.build/debug/MySQL.build/MySQL.swift.o : /Users/baidu/Desktop/PullServer/Packages/MySQL-2.0.4/Sources/MySQL/MySQL.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/Darwin.swiftmodule /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql/psi/psi_base.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql/psi/psi_memory.h /usr/local/Cellar/mysql/5.7.17/include/mysql/my_alloc.h /usr/local/Cellar/mysql/5.7.17/include/mysql/typelib.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql/plugin_auth_common.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql/client_plugin.h /usr/local/Cellar/mysql/5.7.17/include/mysql/my_list.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql_time.h /usr/local/Cellar/mysql/5.7.17/include/mysql/my_command.h /usr/local/Cellar/mysql/5.7.17/include/mysql/binary_log_types.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql_com.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql_version.h /usr/local/include/mysql/mysql.h /Users/baidu/Desktop/PullServer/Packages/mysqlclient-2.0.0/module.modulemap
/Users/baidu/Desktop/PullServer/.build/debug/MySQL.build/MySQL~partial.swiftmodule : /Users/baidu/Desktop/PullServer/Packages/MySQL-2.0.4/Sources/MySQL/MySQL.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/Darwin.swiftmodule /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql/psi/psi_base.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql/psi/psi_memory.h /usr/local/Cellar/mysql/5.7.17/include/mysql/my_alloc.h /usr/local/Cellar/mysql/5.7.17/include/mysql/typelib.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql/plugin_auth_common.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql/client_plugin.h /usr/local/Cellar/mysql/5.7.17/include/mysql/my_list.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql_time.h /usr/local/Cellar/mysql/5.7.17/include/mysql/my_command.h /usr/local/Cellar/mysql/5.7.17/include/mysql/binary_log_types.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql_com.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql_version.h /usr/local/include/mysql/mysql.h /Users/baidu/Desktop/PullServer/Packages/mysqlclient-2.0.0/module.modulemap
/Users/baidu/Desktop/PullServer/.build/debug/MySQL.build/MySQL~partial.swiftdoc : /Users/baidu/Desktop/PullServer/Packages/MySQL-2.0.4/Sources/MySQL/MySQL.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/Darwin.swiftmodule /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql/psi/psi_base.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql/psi/psi_memory.h /usr/local/Cellar/mysql/5.7.17/include/mysql/my_alloc.h /usr/local/Cellar/mysql/5.7.17/include/mysql/typelib.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql/plugin_auth_common.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql/client_plugin.h /usr/local/Cellar/mysql/5.7.17/include/mysql/my_list.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql_time.h /usr/local/Cellar/mysql/5.7.17/include/mysql/my_command.h /usr/local/Cellar/mysql/5.7.17/include/mysql/binary_log_types.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql_com.h /usr/local/Cellar/mysql/5.7.17/include/mysql/mysql_version.h /usr/local/include/mysql/mysql.h /Users/baidu/Desktop/PullServer/Packages/mysqlclient-2.0.0/module.modulemap
|
D
|
/Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Configs.build/KeyAccessible+Merge.swift.o : /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Source.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Node+Merge.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/KeyAccessible+Merge.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/ConfigInitializable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/KeyAccessible.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Config.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/ConfigError.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Config+Arguments.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Environment.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Env/Node+Env.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Env/String+Env.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Env/Env.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Config+Directory.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/JSON.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Node.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/PathIndexable.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.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 /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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Bits.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CSQLite.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Configs.build/KeyAccessible+Merge~partial.swiftmodule : /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Source.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Node+Merge.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/KeyAccessible+Merge.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/ConfigInitializable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/KeyAccessible.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Config.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/ConfigError.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Config+Arguments.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Environment.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Env/Node+Env.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Env/String+Env.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Env/Env.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Config+Directory.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/JSON.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Node.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/PathIndexable.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.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 /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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Bits.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CSQLite.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Configs.build/KeyAccessible+Merge~partial.swiftdoc : /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Source.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Node+Merge.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/KeyAccessible+Merge.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/ConfigInitializable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/KeyAccessible.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Config.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/ConfigError.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Config+Arguments.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Environment.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Env/Node+Env.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Env/String+Env.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Env/Env.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/vapor.git-5492988889259800272/Sources/Configs/Config+Directory.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/JSON.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Node.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/PathIndexable.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.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 /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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Bits.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CSQLite.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
|
/**
Directly parses D source code using libdparse.
Copyright: © 2014 RejectedSoftware e.K.
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Authors: Sönke Ludwig
*/
module ddox.parsers.dparse;
version (Have_libdparse):
import ddox.ddox;
import ddox.entities;
import dparse = std.d.parser;
import dlex = std.d.lexer;
import dformat = std.d.formatter;
import std.algorithm;
import std.conv;
import std.exception;
import std.range;
import std.stdio;
import std.string;
import std.typecons;
import core.demangle;
import vibe.core.log;
import vibe.data.json;
// random dparser notes:
// Declaration.declarations[] ?
// Strings should be const(char)[] instead of string if transient
// how to get token name by token
// convenience functions for Formatter and unDecorateComment
// ambiguous representation of mutually exclusive values (maybe use subclassing? or enums for disambiguation?)
// InterfaceDecl.baseClassList <-> baseInterfaceList
// start/end line/column values for every AST node
// doc comments for alias this
// Declaration.attributeDeclaration vs. .attributes and .declarations?
// AliasDeclaration direct fields vs. initializers?
// Alias to non-type declarations is a type?
Package parseD(string[] d_files, Package root = null)
{
if (!root) root = new Package(null, null);
DParser p;
foreach (file; d_files)
p.parseModule(file, root);
p.resolveTypes(root);
return root;
}
private struct DParser
{
private Tuple!(Type, Entity)[] m_primTypes;
private Declaration[string] m_typeMap;
void resolveTypes(Package root)
{
bool isTypeDecl(Declaration a)
{
switch(a.kind){
default: return false;
case DeclarationKind.Struct:
case DeclarationKind.Union:
case DeclarationKind.Class:
case DeclarationKind.Interface:
case DeclarationKind.Enum:
return true;
case DeclarationKind.Alias:
return (cast(AliasDeclaration)a).targetType !is null;
case DeclarationKind.TemplateParameter:
return true;
case DeclarationKind.Template:
// support eponymous template types
auto td = cast(TemplateDeclaration)a;
// be optimistic for templates without content that they are in fact types
if (!td.members.length) return true;
// otherwise require an actual eponymous type member
auto mi = td.members.countUntil!(m => m.name == a.name);
return mi >= 0 && isTypeDecl(td.members[mi]);
}
}
foreach (t; m_primTypes) {
auto decl = t[1].lookup!Declaration(t[0].typeName);
if (!decl || !isTypeDecl(decl)) {
auto pd = t[0].typeName in m_typeMap;
if (pd) decl = *pd;
}
if (decl && isTypeDecl(decl))
t[0].typeDecl = decl;
}
// fixup class bases
root.visit!ClassDeclaration((decl){
if (decl.baseClass && decl.baseClass.typeDecl && !cast(ClassDeclaration)decl.baseClass.typeDecl)
decl.baseClass.typeDecl = null;
foreach (ref i; decl.derivedInterfaces) {
if (i.typeDecl && !decl.baseClass && cast(ClassDeclaration)i.typeDecl) {
decl.baseClass = i;
i = null;
} else if (i.typeDecl && !cast(InterfaceDeclaration)i.typeDecl) {
i.typeDecl = null;
}
}
decl.derivedInterfaces = decl.derivedInterfaces.filter!(i => i !is null).array;
assert(decl);
});
// fixup interface bases
root.visit!InterfaceDeclaration((decl){
foreach( i; decl.derivedInterfaces )
if( i.typeDecl && !cast(InterfaceDeclaration)i.typeDecl )
i.typeDecl = null;
assert(decl);
});
}
void parseModule(string filename, Package root_package)
{
import std.file;
dlex.LexerConfig config;
config.fileName = filename;
config.stringBehavior = dlex.StringBehavior.source;
dlex.StringCache cache = dlex.StringCache(1024 * 4);
auto tokens = dlex.getTokensForParser(cast(ubyte[])std.file.read(filename), config, &cache).array;
auto dmod = dparse.parseModule(tokens, filename);
Module mod;
if (!dmod.moduleDeclaration) {
logError("No module declaration in module %s - ignoring", filename);
return;
}
auto path = dmod.moduleDeclaration.moduleName.identifiers.map!(a => a.text.idup).array;
logInfo("MOD %s", path);
Package p = root_package;
foreach (i, pe; path) {
if (i+1 < path.length) p = p.getOrAddPackage(pe);
else mod = p.createModule(pe);
}
mod.file = filename;
mod.docGroup = new DocGroup(mod, dmod.moduleDeclaration.comment.undecorateComment());
mod.members = parseDeclList(dmod.declarations, mod);
}
Declaration[] parseDeclList(dparse.Declaration[] decls, Entity parent)
{
DocGroup lastdoc;
Declaration[] ret;
foreach (mem; decls) {
foreach (decl; parseDecl(mem, parent)) {
auto doc = decl.docGroup;
if (lastdoc && (doc.text == lastdoc.text && doc.text.length || doc.comment.isDitto)) {
lastdoc.members ~= decl;
decl.docGroup = lastdoc;
} else if (doc.comment.isPrivate) {
decl.protection = Protection.Private;
lastdoc = null;
} else lastdoc = decl.docGroup;
ret ~= decl;
}
}
return ret;
}
Declaration[] parseDecl(dparse.Declaration decl, Entity parent, dparse.Attribute[] additional_attribs = null)
{
if (auto ad = decl.attributeDeclaration) {
additional_attribs ~= decl.attributes;
additional_attribs ~= ad.attribute;
return decl.declarations.map!(d => parseDecl(d, parent, additional_attribs)).join();
}
if (decl.declarations.length) {
additional_attribs ~= decl.attributes;
return decl.declarations.map!(d => parseDecl(d, parent, additional_attribs)).join();
}
Declaration[] ret;
string comment;
int line;
if (auto fd = decl.functionDeclaration) {
comment = fd.comment.undecorateComment();
line = fd.name.line;
auto fdr = new FunctionDeclaration(parent, fd.name.text.idup);
fdr.returnType = parseType(fd.returnType, parent);
fdr.parameters = parseParameters(fd.parameters, fdr);
fdr.type = new Type;
fdr.type.kind = TypeKind.Function;
//fdr.type.attributes = ...; // TODO!
//fdr.type.modifiers = ...; // TODO!
fdr.type.returnType = fdr.returnType;
fdr.type.parameterTypes = fdr.parameters.map!(p => p.type).array;
addAttributes(fdr, fd.attributes);
addTemplateInfo(fdr, fd);
ret ~= fdr;
} else if (auto vd = decl.variableDeclaration) {
comment = vd.comment.undecorateComment();
line = vd.declarators[0].name.line;
auto tp = parseType(vd.type, parent);
foreach (d; vd.declarators) {
auto v = new VariableDeclaration(parent, d.name.text.idup);
v.type = tp;
if (d.initializer) v.initializer = new Value(tp, formatNode(d.initializer));
ret ~= v;
}
} else if (auto at = decl.aliasThisDeclaration) {
// TODO comment?
line = at.identifier.line;
auto adr = new AliasDeclaration(parent, "this");
adr.targetString = at.identifier.text.idup;
ret ~= adr;
} else if (auto sd = decl.structDeclaration) {
comment = sd.comment.undecorateComment();
line = sd.name.line;
auto sdr = new StructDeclaration(parent, sd.name.text.idup);
sdr.members = parseDeclList(sd.structBody.declarations, sdr);
addTemplateInfo(sdr, sd);
ret ~= sdr;
insertIntoTypeMap(sdr);
} else if (auto cd = decl.classDeclaration) {
comment = cd.comment.undecorateComment();
line = cd.name.line;
auto cdr = new ClassDeclaration(parent, cd.name.text.idup);
if (cd.baseClassList) foreach (bc; cd.baseClassList.items) {
auto t = new Type;
t.kind = TypeKind.Primitive;
t.typeName = formatNode(bc);
cdr.derivedInterfaces ~= t;
m_primTypes ~= tuple(t, parent);
}
cdr.members = parseDeclList(cd.structBody.declarations, cdr);
addTemplateInfo(cdr, cd);
ret ~= cdr;
insertIntoTypeMap(cdr);
} else if (auto id = decl.interfaceDeclaration) {
comment = id.comment.undecorateComment();
line = id.name.line;
auto idr = new InterfaceDeclaration(parent, id.name.text.idup);
if (id.baseClassList) foreach (bc; id.baseClassList.items) {
auto t = new Type;
t.kind = TypeKind.Primitive;
t.typeName = formatNode(bc);
idr.derivedInterfaces ~= t;
m_primTypes ~= tuple(t, parent);
}
idr.members = parseDeclList(id.structBody.declarations, idr);
addTemplateInfo(idr, id);
ret ~= idr;
insertIntoTypeMap(idr);
} else if (auto ud = decl.unionDeclaration) {
comment = ud.comment.undecorateComment();
line = ud.name.line;
auto udr = new UnionDeclaration(parent, ud.name.text.idup);
udr.members = parseDeclList(ud.structBody.declarations, udr);
addTemplateInfo(udr, ud);
ret ~= udr;
insertIntoTypeMap(udr);
} else if (auto ed = decl.enumDeclaration) {
logInfo("TODO: enum %s.%s", parent.qualifiedName, ed.name.text);
// TODO
return null;
} else if (auto ad = decl.aliasDeclaration) {
comment = ad.comment.undecorateComment();
line = ad.name.line;
foreach (ai; ad.initializers) {
auto adr = new AliasDeclaration(parent, ai.name.text.idup);
adr.targetType = parseType(ai.type, parent);
adr.targetString = formatNode(ai.type);
ret ~= adr;
}
} else if (auto td = decl.templateDeclaration) {
logInfo("TODO: template %s.%s", parent.qualifiedName, td.name.text);
// TODO
return null;
} else if (auto cd = decl.constructor) {
comment = cd.comment.undecorateComment();
line = cd.line;
auto cdr = new FunctionDeclaration(parent, "this");
cdr.parameters = parseParameters(cd.parameters, cdr);
cdr.type = new Type;
cdr.type.kind = TypeKind.Function;
cdr.type.parameterTypes = cdr.parameters.map!(p => p.type).array;
//addAttributes(cdr, cd.memberFunctionAttributes); // TODO!
addTemplateInfo(cdr, cd);
ret ~= cdr;
} else if (auto dd = decl.destructor) {
// destructors don't get documented for now
return null;
} else if (auto scd = decl.staticConstructor) {
logInfo("TODO: %s.static this()", parent.qualifiedName);
// TODO
return null;
} else if (auto sdd = decl.staticDestructor) {
logInfo("TODO: %s.static ~this()", parent.qualifiedName);
// TODO
return null;
} else if (auto pbd = decl.postblit) {
// postblit doesn't get documented for now
return null;
} else if (auto id = decl.importDeclaration) {
// TODO: use for type resolution
return null;
} else if (auto id = decl.unittest_) {
// TODO: use for unit test examples!
logInfo("TODO: %s.unittest", parent.qualifiedName);
return null;
} else {
logInfo("Unknown declaration in %s: %s", parent.qualifiedName, formatNode(decl));
return null;
}
if (!ret) return null;
foreach (d; ret) {
addAttributes(d, additional_attribs);
addAttributes(d, decl.attributes);
d.docGroup = new DocGroup(d, comment);
d.line = line;
}
return ret;
}
void addAttributes(Declaration decl, dparse.Attribute[] attrs)
{
return addAttributes(decl, attrs.map!(att => formatNode(att)).array);
}
void addAttributes(Declaration decl, string[] attrs)
{
foreach (as; attrs) {
switch (as) {
default:
if (!decl.attributes.canFind(as))
decl.attributes ~= as;
break;
case "private": decl.protection = Protection.Private; break;
case "package": decl.protection = Protection.Package; break;
case "protected": decl.protection = Protection.Protected; break;
case "public": decl.protection = Protection.Public; break;
}
}
}
VariableDeclaration[] parseParameters(dparse.Parameters dparams, FunctionDeclaration parent)
{
VariableDeclaration[] ret;
foreach (p; dparams.parameters) {
ret ~= parseParameter(p, parent);
if (p.vararg) ret[$-1].name ~= "...";
}
if (dparams.hasVarargs)
ret ~= new VariableDeclaration(parent, "...");
return ret;
}
VariableDeclaration parseParameter(dparse.Parameter dparam, FunctionDeclaration parent)
{
auto ret = new VariableDeclaration(parent, dparam.name.text.idup);
ret.type = parseType(dparam.type, parent);
if (dparam.default_) {
ret.initializer = new Value;
ret.initializer.type = ret.type;
ret.initializer.valueString = formatNode(dparam.default_);
}
addAttributes(ret, dparam.parameterAttributes.map!(a => dlex.str(a)).array);
return ret;
}
Type parseType(dparse.Type type, Entity scope_)
{
auto ret = parseType(type.type2, scope_);
foreach (tc; type.typeConstructors)
ret.modifiers ~= dlex.str(tc);
foreach (sf; type.typeSuffixes) {
if (sf.delegateOrFunction.text) {
if (sf.delegateOrFunction.text == "function")
ret = Type.makeFunction(ret, parseParameters(sf.parameters, null).map!(p => p.type).array);
else ret = Type.makeDelegate(ret, parseParameters(sf.parameters, null).map!(p => p.type).array);
}
else if (sf.star) ret = Type.makePointer(ret);
else if (sf.array) {
if (sf.type) ret = ret.makeAssociativeArray(ret, parseType(sf.type, scope_));
else if (sf.low) ret = ret.makeStaticArray(ret, formatNode(sf.low));
else ret = Type.makeArray(ret);
}
}
ret.text = formatNode(type);
return ret;
}
Type parseType(dparse.Type2 type, Entity scope_)
{
auto ret = new Type;
if (type.builtinType) {
ret.kind = TypeKind.Primitive;
ret.typeName = dlex.str(type.builtinType);
} else if (type.symbol) {
ret.kind = TypeKind.Primitive;
ret.typeName = formatNode(type.symbol);
m_primTypes ~= tuple(ret, scope_);
} else if (auto te = type.typeofExpression) {
ret.kind = TypeKind.Primitive;
ret.typeName = formatNode(te.expression);
// te.return_?
} else if (auto itc = type.identifierOrTemplateChain) {
ret.kind = TypeKind.Primitive;
ret.typeName = itc.identifiersOrTemplateInstances
.map!(it => it.templateInstance ? formatNode(it.templateInstance) : it.identifier.text.idup)
.join(".");
m_primTypes ~= tuple(ret, scope_);
} else if (auto tc = type.typeConstructor) {
ret = parseType(type.type, scope_);
ret.modifiers = dlex.str(tc) ~ ret.modifiers;
} else if (auto tp = type.type) {
return parseType(tp, scope_);
} else {
ret.kind = TypeKind.Primitive;
ret.typeName = "(invalid)";
}
return ret;
}
void insertIntoTypeMap(Declaration decl)
{
string[] parts = split(decl.qualifiedName, ".");
foreach( i; 0 .. parts.length ){
auto partial_name = join(parts[i .. $], ".");
m_typeMap[partial_name] = decl;
}
}
}
private string undecorateComment(string str)
{
if (!str.length) return "";
auto app = appender!string();
dlex.unDecorateComment(str, app);
return app.data;
}
private string formatNode(T)(const T t)
{
import std.array;
auto writer = appender!string();
auto formatter = new dformat.Formatter!(typeof(writer))(writer);
formatter.format(t);
return writer.data;
}
private void addTemplateInfo(T)(Declaration decl, T ddecl)
{
if (ddecl.templateParameters) {
decl.isTemplate = true;
if (auto tpl = ddecl.templateParameters.templateParameterList)
decl.templateArgs = tpl.items.map!(tp => new TemplateParameterDeclaration(decl, formatNode(tp))).array;
if (ddecl.constraint)
decl.templateConstraint = formatNode(ddecl.constraint.expression);
}
}
|
D
|
/Users/techmaster/Downloads/animationWithQueue-master/Build/Intermediates/DemoAnimation.build/Debug-iphonesimulator/DemoAnimation.build/Objects-normal/x86_64/Miller.o : /Users/techmaster/Downloads/animationWithQueue-master/Queue.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/Dynamic.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/AniView.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/Miller.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/ViewController.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/AnimateItem.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/AppDelegate.swift /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/SwiftOnoneSupport.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/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Darwin.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/ObjectiveC.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/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /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/CoreImage.swiftmodule
/Users/techmaster/Downloads/animationWithQueue-master/Build/Intermediates/DemoAnimation.build/Debug-iphonesimulator/DemoAnimation.build/Objects-normal/x86_64/Miller~partial.swiftmodule : /Users/techmaster/Downloads/animationWithQueue-master/Queue.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/Dynamic.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/AniView.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/Miller.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/ViewController.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/AnimateItem.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/AppDelegate.swift /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/SwiftOnoneSupport.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/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Darwin.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/ObjectiveC.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/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /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/CoreImage.swiftmodule
/Users/techmaster/Downloads/animationWithQueue-master/Build/Intermediates/DemoAnimation.build/Debug-iphonesimulator/DemoAnimation.build/Objects-normal/x86_64/Miller~partial.swiftdoc : /Users/techmaster/Downloads/animationWithQueue-master/Queue.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/Dynamic.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/AniView.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/Miller.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/ViewController.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/AnimateItem.swift /Users/techmaster/Downloads/animationWithQueue-master/DemoAnimation/AppDelegate.swift /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/SwiftOnoneSupport.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/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Darwin.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/ObjectiveC.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/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /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/CoreImage.swiftmodule
|
D
|
obscene terms for feces
obscene words for unacceptable behavior
a small worthless amount
a coarse term for defecation
insulting terms of address for people who are stupid or irritating or ridiculous
something of little value
give away information about somebody
have a bowel movement
|
D
|
/*********************************************************
Copyright: (C) 2008 by Steven Schveighoffer.
All rights reserved
License: $(LICENSE)
**********************************************************/
module dcollections.model.Map;
public import dcollections.model.Collection,
dcollections.model.Keyed,
dcollections.model.Multi;
/**
* A Map collection uses keys to map to values. This can only have one
* instance of a particular key at a time.
*/
interface Map(K, V) : Keyed!(K, V), Collection!(V), Multi!(V)
{
/**
* set all the elements from the given keyed iterator in the map. Any key
* that already exists will be overridden.
*
* Returns this.
*/
Map!(K, V) set(KeyedIterator!(K, V) source);
/**
* set all the elements from the given keyed iterator in the map. Any key
* that already exists will be overridden.
*
* Returns this.
*
* numAdded is set to the number of elements that were added.
*/
Map!(K, V) set(KeyedIterator!(K, V) source, ref uint numAdded);
/**
* set all the elements from the given associative array in the map. Any
* key that already exists wil be overridden.
*
* Returns this.
*/
Map!(K, V) set(V[K] source);
/**
* set all the elements from the given associative array in the map. Any
* key that already exists wil be overridden.
*
* Returns this.
*
* numAdded is set to the number of elements added.
*/
Map!(K, V) set(V[K] source, ref uint numAdded);
/**
* Remove all the given keys from the map.
*
* return this.
*/
Map!(K, V) remove(Iterator!(K) subset);
/**
* Remove all the given keys from the map.
*
* return this.
*
* numRemoved is set to the number of elements removed.
*/
Map!(K, V) remove(Iterator!(K) subset, ref uint numRemoved);
/**
* Remove all the given keys from the map.
*
* return this.
*/
Map!(K, V) remove(K[] subset);
/**
* Remove all the given keys from the map.
*
* return this.
*
* numRemoved is set to the number of elements removed.
*/
Map!(K, V) remove(K[] subset, ref uint numRemoved);
/**
* Remove all the keys that are not in the given iterator.
*
* returns this.
*/
Map!(K, V) intersect(Iterator!(K) subset);
/**
* Remove all the keys that are not in the given iterator.
*
* sets numRemoved to the number of elements removed.
*
* returns this.
*/
Map!(K, V) intersect(Iterator!(K) subset, ref uint numRemoved);
/**
* Remove all the keys that are not in the given array.
*
* returns this.
*/
Map!(K, V) intersect(K[] subset);
/**
* Remove all the keys that are not in the given array.
*
* sets numRemoved to the number of elements removed.
*
* returns this.
*/
Map!(K, V) intersect(K[] subset, ref uint numRemoved);
/**
* Get a set of the keys that the map contains. This is not a copy of the
* keys, but an actual "window" into the keys of the map. If you add
* values to the map, they will show up in the keys iterator.
*
* This is not in Keyed, because some Keyed containers do not have user
* defined keys, and so this would be not quite that useful there.
*/
Iterator!(K) keys();
/**
* covariant clear (from Collection)
*/
Map!(K, V) clear();
/**
* covariant dup (from Collection)
*/
Map!(K, V) dup();
/**
* covariant remove (from Collection)
*/
Map!(K, V) remove(V v);
/**
* covariant remove (from Collection)
*/
Map!(K, V) remove(V v, ref bool wasRemoved);
/**
* covariant removeAll (from Multi)
*/
Map!(K, V) removeAll(V v);
/**
* covariant removeAll (from Multi)
*/
Map!(K, V) removeAll(V v, ref uint numRemoved);
/**
* covariant removeAt (from Keyed)
*/
Map!(K, V) removeAt(K key);
/**
* covariant removeAt (from Keyed)
*/
Map!(K, V) removeAt(K key, ref bool wasRemoved);
/**
* covariant set (from Keyed)
*/
Map!(K, V) set(K key, V value);
/**
* covariant set (from Keyed)
*/
Map!(K, V) set(K key, V value, ref bool wasAdded);
/**
* compare two maps. Returns true if both maps have the same number of
* elements, and both maps have elements whose keys and values are equal.
*
* If o is not a map, then 0 is returned.
*/
int opEquals(Object o);
}
|
D
|
/* MinWin Dialog class
*
* A general dialog class and utility helper dialogs
*
* Written by Ben Hinkle and released to the public domain, as
* explained at http://creativecommons.org/licenses/publicdomain
* Report comments and bugs at dsource: http://www.dsource.org/projects/minwin
*/
module minwin.dialog;
private {
import std.string;
import std.c.string;
import minwin.peerimpl;
import minwin.font;
import minwin.event;
import minwin.component;
import minwin.menu;
import minwin.app;
import minwin.logging;
import minwin.icon;
import minwin.image;
}
version (MinWin32) {
private import minwin.mswindows;
class Dialog : AbstractWindow {
AbstractWindow owner;
bool modal_data;
bool visible_data;
this(AbstractWindow owner, char[] title = "", bool modal = true, char[] name = "") {
Rect r;
owner.getBounds(r);
DWORD style = WS_TABSTOP | WS_POPUP | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU;
peer = CreateWindowX("MinWinDialog", title,
style & ~WS_MAXIMIZEBOX & ~WS_MINIMIZEBOX,
r.left, r.top,
DefaultWindowWidth, DefaultWindowHeight,
owner.peer,
cast(HMENU) null, gApp.hInstance, null);
sysAssert(peer !is null, "Failed to create peer Dialog");
setWindowPeer(this,peer,OWNS_PEER);
backgroundPeer = CreateSolidBrush(systemBackgroundColor().native);
this.name = name;
this.owner = owner;
modal_data = modal;
WindowList[this] = this; // prevent garbage collection
}
this(WindowPeer peer) {
setWindowPeer(this,peer,FOREIGN_PEER);
WindowList[this] = this; // prevent garbage collection
}
AbstractWindow[] originalWindows;
int[] originalEnabledState;
void visible(bool vis) {
if (modal_data && !vis && visible_data) {
// make sure original states are restored before hiding
foreach(int n, AbstractWindow w; originalWindows) {
if (IsWindow(w.peer)) {
EnableWindow(w.peer,originalEnabledState[n]);
}
}
originalWindows = null;
originalEnabledState = null;
}
version (LOG) log.writefln("setting dialog visible %d",cast(int)vis);
super.visible(vis);
version (LOG) log.writefln("done with super vis");
visible_data = vis;
if (modal_data && vis) {
cancelCloseDelegate ~= delegate bool(Component c) {
Dialog dlg = cast(Dialog)c;
if (!dlg || !dlg.owner) return false;
EnableWindow(dlg.owner.peer,1);
return false;
};
version (LOG) log.writefln("disabling windows dialog");
originalWindows = WindowList.values;
originalEnabledState.length = originalWindows.length;
foreach(int n, AbstractWindow w; originalWindows) {
originalEnabledState[n] = IsWindowEnabled(w.peer) != 0;
version (LOG) log.writefln("disable %d %p for dialog",n,w);
if (originalEnabledState[n] != 0 && (w !is this)) {
EnableWindow(w.peer,0);
}
}
while (visible_data && IsWindow(peer)) {
version (LOG) log.writefln("in modal loop for %p",this);
if (!GetMessageA(&gApp.event.native, cast(HWND) null, 0, 0)) {
PostQuitMessage(0); // quit out of next event loop
break;
}
if (!IsDialogMessageA(peer, &gApp.event.native)) {
TranslateMessage(&gApp.event.native);
DispatchMessageA(&gApp.event.native);
}
}
visible_data = false;
foreach(int n, AbstractWindow w; originalWindows) {
if (IsWindow(w.peer)) {
EnableWindow(w.peer,originalEnabledState[n]);
}
}
}
}
int WindowProc(HWND hWnd, uint uMsg, WPARAM wParam, LPARAM lParam) {
bool doDefault = true;
if (uMsg <= WM_KEYLAST && uMsg >= WM_KEYFIRST) {
keyDelegate(this,cast(KeyEvent*)&gApp.event);
} else if (uMsg <= WM_MOUSELAST && uMsg >= WM_MOUSEFIRST) {
mouseDelegate(this,cast(MouseEvent*)&gApp.event);
} else {
doDefault = super.WindowProc(hWnd,uMsg,wParam,lParam) != 0;
}
return doDefault;
}
// also handle tab key by calling GetNextDlgTabItem
}
static this() {
if (DefaultWindowIcon is null) {
IconPeer ip = LoadIconA(cast(HINSTANCE) null, IDI_APPLICATION);
DefaultWindowIcon = DefaultWindowSmallIcon = new Icon(ip);
}
HINSTANCE hInst = GetModuleHandleA(null);
WNDCLASSA wc;
wc.lpszClassName = "MinWinDialog";
wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = &MinWinWindowProc;
wc.hInstance = hInst;
wc.hIcon = DefaultWindowIcon.peer;
wc.hCursor = LoadCursorA(cast(HINSTANCE) null, IDC_ARROW);
wc.hbrBackground = null;
// wc.hbrBackground = cast(HBRUSH) (COLOR_WINDOW); // not +1 for default
wc.lpszMenuName = null;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
RegisterClassA(&wc);
}
} else version (GTK) {
private import minwin.gtk;
private import minwin.gtk_peers;
class Dialog : AbstractWindow {
AbstractWindow owner;
this(AbstractWindow owner, char[] title = "", bool modal = true, char[] name = "") {
char* str = toStringz(title);
this.owner = owner;
// TODO: application name vs window name??
peer = cast(GtkWindow*)gtk_window_new(GtkWindowType.GTK_WINDOW_TOPLEVEL);
if (modal) {
gtk_window_set_modal(peer,modal);
gtk_window_set_transient_for(peer,owner.peer);
}
gtk_window_set_title(peer,str);
gtk_window_set_resizable(peer,0);
gtk_window_set_default_size(peer,DefaultWindowWidth,DefaultWindowHeight);
this.name = name;
g_signal_connect_data(peer,"destroy",
cast(GCallback)&mw_destroy_callback,
cast(gpointer)this,
null,cast(GConnectFlags)0);
g_signal_connect_data(peer,"delete-event",
cast(GCallback)&mw_dialog_close_callback,
cast(gpointer)this,
null,cast(GConnectFlags)0);
setWindowPeer(this,peer,OWNS_PEER);
WindowList[this] = this; // prevent garbage collection
content = cast(MinWinGtkPeer*)MinWinGtkPeer_new();
GtkWidget* wcontent = cast(GtkWidget*)content;
gtk_widget_set_sensitive(wcontent,true);
content.sizeRequest = >kRequest;
content.sizeAllocate = >kAllocate;
gtk_container_add(cast(GtkContainer*)peer,wcontent);
g_signal_connect_data(peer,"expose-event",
cast(GCallback)&mw_expose_callback,
cast(gpointer)this,
null,GConnectFlags.G_CONNECT_AFTER);
gtk_widget_realize(wcontent);
gtk_widget_show(wcontent);
}
this(AbstractWindow owner, WindowPeer peer) {
setWindowPeer(this,peer,FOREIGN_PEER);
this.owner = owner;
WindowList[this] = this; // prevent garbage collection
}
GMainLoop* loop;
void visible(bool vis) {
version(LOG)log.writefln("calling super.visible %d",vis);
version(LOG)log.flush();
super.visible(vis);
version(LOG)log.writefln("done calling super.visible %d",vis);
version(LOG)log.flush();
if (!gtk_window_get_modal(peer)) return;
if (vis) {
version(LOG)log.writefln("making event loop");
version(LOG)log.flush();
loop = g_main_loop_new(null, false);
g_main_loop_run(loop);
g_main_loop_unref(loop);
version(LOG)log.writefln("exiting event loop");
version(LOG)log.flush();
// that's it?
} else {
if (g_main_loop_is_running(loop))
g_main_loop_quit(loop);
version(LOG)log.writefln("visible off quit loop event loop");
version(LOG)log.flush();
}
}
}
extern (C) void mw_dialog_close_callback(GtkWidget* w, GdkEvent* ev, gpointer ud) {
AbstractWindow win = cast(AbstractWindow) ud;
version(LOG)log.printf("mw_dialog_close_callback\n");
if (win) {
win.visible = false;
// win.close(); // destroys dialog so dont do this
}
}
}
/***************************************
Helper dialogs
***************************************/
// used in open and save file dialogs for filtering
struct FileFilter {
char[] description;
char[][] extensions;
}
version (GTK) {
version = SharedFileDialogData;
}
version (SharedFileDialogData) {
struct FileDialogData {
char[] title;
FileFilter[] filter;
char[] initialDir;
char[] initialFile;
char[] result;
int filterIndex;
int done;
// can get the requested buffer length...
bool isBufferTooShort() {
return false; // TODO
}
}
}
version (MinWin32) {
private {
import minwin.mswindows;
import std.c.stdlib;
}
void informationDialog(AbstractWindow owner, char[] text, char[] title) {
//version(LOG) log.writefln("info dialog peer is %x",cast(uint)owner.peer);
MessageBoxX(owner.peer, text, title, MB_OK | MB_ICONINFORMATION);
}
void warningDialog(AbstractWindow owner, char[] text, char[] title) {
MessageBoxX(owner.peer, text, title, MB_OK | MB_ICONWARNING);
}
void errorDialog(AbstractWindow owner, char[] text, char[] title) {
MessageBoxX(owner.peer, text, title, MB_OK | MB_ICONERROR);
}
void messageDialog(AbstractWindow owner, char[] text, char[] title,...) {
MessageBoxX(owner.peer, text, title, MB_OK | MB_ICONINFORMATION);
}
alias OPENFILENAMEA FileDialogNative;
struct FileDialogData {
FileDialogNative native;
void title(char[] title) {
native.lpstrTitle = toStringz(title);
}
char[] title() {
return native.lpstrTitle[0 .. strlen(native.lpstrTitle)];
}
void filter(FileFilter[] filters) {
char[] total;
foreach (FileFilter f; filters) {
total ~= f.description;
total ~= 0;
if (f.extensions.length > 0) {
foreach (char[] ext; f.extensions) {
total ~= "*.";
total ~= ext;
total ~= ";";
}
total.length = total.length - 1; // remove last ;
}
total ~= 0;
}
total ~= 0;
total ~= 0;
native.lpstrFilter = total.ptr;
}
void initialDir(char[] initialDir) {
native.lpstrInitialDir = toStringz(initialDir);
}
void initialFile(char[] f) {
if (native.lpstrFile is null) {
native.lpstrFile = (new char[MAX_PATH]).ptr;
native.nMaxFile = MAX_PATH;
}
int len = f.length < native.nMaxFile-1 ? f.length : native.nMaxFile-1;
native.lpstrFile[0 .. len] = f[0 .. len];
native.lpstrFile[len] = 0;
}
char[] result() {
return native.lpstrFile[0 .. strlen(native.lpstrFile)];
}
// can get the requested buffer length...
bool isBufferTooShort() {
// bool res = CommDlgExtendedError() == FNERR_BUFFERTOOSMALL;
return false;
}
int filterIndex() {
return native.nFilterIndex;
}
}
bool openFileDialog(AbstractWindow owner, inout FileDialogData data) {
data.native.hwndOwner = owner.peer;
data.native.lStructSize = OPENFILENAMEA.sizeof;
// data.flags = OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST;
data.native.Flags = OFN_PATHMUSTEXIST;
if (data.native.lpstrFile is null) {
data.native.lpstrFile = (new char[MAX_PATH]).ptr;
data.native.nMaxFile = MAX_PATH;
data.native.lpstrFile[0] = 0;
}
bool res = GetOpenFileNameA(&data.native) != 0;
/* if (!res)
check if the name was too long for the buffer
*/
return res;
}
bool saveFileDialog(AbstractWindow owner, inout FileDialogData data) {
data.native.hwndOwner = owner.peer;
data.native.lStructSize = OPENFILENAMEA.sizeof;
data.native.Flags = OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST;
if (data.native.lpstrFile is null) {
data.native.lpstrFile = (new char[MAX_PATH]).ptr;
data.native.nMaxFile = MAX_PATH;
data.native.lpstrFile[0] = 0;
}
bool res = GetSaveFileNameA(&data.native) != 0;
/* if (!res)
check if the name was too long for the buffer
*/
return res;
}
} else version(GTK) {
private import minwin.gtk;
private import minwin.window;
void informationDialog(AbstractWindow owner, char* text, char[]
title) {
msgDialog(owner,text,title,GtkMessageType.GTK_MESSAGE_INFO,
GtkButtonsType.GTK_BUTTONS_OK);
}
void warningDialog(AbstractWindow owner, char* text, char[] title) {
msgDialog(owner,text,title,GtkMessageType.GTK_MESSAGE_WARNING,
GtkButtonsType.GTK_BUTTONS_OK);
}
void errorDialog(AbstractWindow owner, char* text, char[] title) {
msgDialog(owner,text,title,GtkMessageType.GTK_MESSAGE_ERROR,
GtkButtonsType.GTK_BUTTONS_OK);
}
alias informationDialog messageDialog;
void msgDialog(AbstractWindow owner, char* text, char[] title,
GtkMessageType type, GtkButtonsType buttons) {
// TODO: title?
GtkWidget* d = gtk_message_dialog_new(owner.peer,
GtkDialogFlags.GTK_DIALOG_DESTROY_WITH_PARENT,
type,buttons,text);
gtk_dialog_run(cast(GtkDialog*)d);
gtk_widget_destroy(d);
}
bool openFileDialog(AbstractWindow owner, inout FileDialogData data) {
bool result;
GtkWidget* peer =
gtk_file_chooser_dialog_new(toStringz(data.title),owner.peer,
GtkFileChooserAction.GTK_FILE_CHOOSER_ACTION_OPEN,
cast(char*)"gtk-cancel", cast(uint)GtkResponseType.GTK_RESPONSE_CANCEL,
cast(char*)"gtk-open", cast(uint)GtkResponseType.GTK_RESPONSE_ACCEPT,
null);
GtkFileChooser* fc = cast(GtkFileChooser*)peer;
return opensaveFileDialog(data,peer,fc);
}
bool saveFileDialog(AbstractWindow owner, inout FileDialogData data) {
GtkWidget* peer =
gtk_file_chooser_dialog_new(toStringz(data.title),owner.peer,
GtkFileChooserAction.GTK_FILE_CHOOSER_ACTION_SAVE,
cast(char*)"gtk-cancel", cast(uint)GtkResponseType.GTK_RESPONSE_CANCEL,
cast(char*)"gtk-save", cast(uint)GtkResponseType.GTK_RESPONSE_ACCEPT,
null);
GtkFileChooser* fc = cast(GtkFileChooser*)peer;
if (data.initialFile.length > 0)
gtk_file_chooser_set_current_name(fc,toStringz(data.initialFile));
return opensaveFileDialog(data,peer,fc);
}
bool opensaveFileDialog(inout FileDialogData data,
GtkWidget* peer,
GtkFileChooser* fc) {
bool result;
if (data.initialDir.length > 0)
gtk_file_chooser_set_current_folder(fc,toStringz(data.initialDir));
foreach( FileFilter filt ; data.filter) {
GtkFileFilter* f = gtk_file_filter_new();
gtk_file_filter_set_name(f,toStringz(filt.description));
foreach( char[] ext; filt.extensions) {
gtk_file_filter_add_pattern(f,cast(char*)("*."~ext));
}
gtk_file_chooser_add_filter(fc,f);
}
// TODO: assertion local_full_path[0] = /
result = gtk_dialog_run(cast(GtkDialog*)peer) == GtkResponseType.GTK_RESPONSE_ACCEPT;
if (result) {
char* name = gtk_file_chooser_get_filename(fc);
int len = strlen(name);
data.result = name[0..len].dup;
g_free(name);
}
gtk_widget_destroy(peer);
return result;
}
}
// utility dialogs:
// query dialog
// file chooser dialog
// color chooser?
// print dialog?
|
D
|
// Written in the D programming language.
/**
* This module defines an Abstract Syntax Tree for the D language
*
* Examples:
* ---
* // TODO
* ---
*
* Copyright: Brian Schott 2013
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt Boost, License 1.0)
* Authors: Brian Schott
*/
module dparse.ast;
import dparse.lexer;
import std.traits;
import std.algorithm;
import std.array;
import std.string;
private immutable uint[TypeInfo] typeMap;
shared static this()
{
typeMap[typeid(AddExpression)] = 1;
typeMap[typeid(AndAndExpression)] = 2;
typeMap[typeid(AndExpression)] = 3;
typeMap[typeid(AsmAddExp)] = 4;
typeMap[typeid(AsmAndExp)] = 5;
typeMap[typeid(AsmBrExp)] = 6;
typeMap[typeid(AsmExp)] = 7;
typeMap[typeid(AsmEqualExp)] = 8;
typeMap[typeid(AsmLogAndExp)] = 9;
typeMap[typeid(AsmLogOrExp)] = 10;
typeMap[typeid(AsmMulExp)] = 11;
typeMap[typeid(AsmOrExp)] = 12;
typeMap[typeid(AsmRelExp)] = 13;
typeMap[typeid(AsmUnaExp)] = 14;
typeMap[typeid(AsmShiftExp)] = 15;
typeMap[typeid(AsmXorExp)] = 16;
typeMap[typeid(AssertExpression)] = 17;
typeMap[typeid(AssignExpression)] = 18;
typeMap[typeid(CmpExpression)] = 19;
typeMap[typeid(DeleteExpression)] = 20;
typeMap[typeid(EqualExpression)] = 21;
typeMap[typeid(Expression)] = 22;
typeMap[typeid(FunctionCallExpression)] = 23;
typeMap[typeid(FunctionLiteralExpression)] = 24;
typeMap[typeid(IdentityExpression)] = 25;
typeMap[typeid(ImportExpression)] = 26;
typeMap[typeid(IndexExpression)] = 27;
typeMap[typeid(InExpression)] = 28;
typeMap[typeid(IsExpression)] = 29;
typeMap[typeid(MixinExpression)] = 30;
typeMap[typeid(MulExpression)] = 31;
typeMap[typeid(NewAnonClassExpression)] = 32;
typeMap[typeid(NewExpression)] = 33;
typeMap[typeid(OrExpression)] = 34;
typeMap[typeid(OrOrExpression)] = 35;
typeMap[typeid(PowExpression)] = 36;
typeMap[typeid(PragmaExpression)] = 37;
typeMap[typeid(PrimaryExpression)] = 38;
typeMap[typeid(RelExpression)] = 39;
typeMap[typeid(ShiftExpression)] = 40;
typeMap[typeid(Index)] = 41;
typeMap[typeid(TemplateMixinExpression)] = 42;
typeMap[typeid(TernaryExpression)] = 43;
typeMap[typeid(TraitsExpression)] = 44;
typeMap[typeid(TypeidExpression)] = 45;
typeMap[typeid(TypeofExpression)] = 46;
typeMap[typeid(UnaryExpression)] = 47;
typeMap[typeid(XorExpression)] = 48;
}
/// Describes which syntax was used in a list of declarations in the containing AST node
enum DeclarationListStyle : ubyte
{
/// A declaration directly after the containing AST node making it the only child
single,
/// A colon (`:`) was used in the containing AST node meaning all following declarations are part here.
colon,
/// The declarations have been specified in a block denoted by starting `{` and ending `}` tokens.
block
}
/**
* Implements the $(LINK2 http://en.wikipedia.org/wiki/Visitor_pattern, Visitor Pattern)
* for the various AST classes
*/
abstract class ASTVisitor
{
/** */
void visit(const ExpressionNode n)
{
switch (typeMap[typeid(n)])
{
case 1: visit(cast(AddExpression) n); break;
case 2: visit(cast(AndAndExpression) n); break;
case 3: visit(cast(AndExpression) n); break;
case 4: visit(cast(AsmAddExp) n); break;
case 5: visit(cast(AsmAndExp) n); break;
case 6: visit(cast(AsmBrExp) n); break;
case 7: visit(cast(AsmExp) n); break;
case 8: visit(cast(AsmEqualExp) n); break;
case 9: visit(cast(AsmLogAndExp) n); break;
case 10: visit(cast(AsmLogOrExp) n); break;
case 11: visit(cast(AsmMulExp) n); break;
case 12: visit(cast(AsmOrExp) n); break;
case 13: visit(cast(AsmRelExp) n); break;
case 14: visit(cast(AsmUnaExp) n); break;
case 15: visit(cast(AsmShiftExp) n); break;
case 16: visit(cast(AsmXorExp) n); break;
case 17: visit(cast(AssertExpression) n); break;
case 18: visit(cast(AssignExpression) n); break;
case 19: visit(cast(CmpExpression) n); break;
case 20: visit(cast(DeleteExpression) n); break;
case 21: visit(cast(EqualExpression) n); break;
case 22: visit(cast(Expression) n); break;
case 23: visit(cast(FunctionCallExpression) n); break;
case 24: visit(cast(FunctionLiteralExpression) n); break;
case 25: visit(cast(IdentityExpression) n); break;
case 26: visit(cast(ImportExpression) n); break;
case 27: visit(cast(IndexExpression) n); break;
case 28: visit(cast(InExpression) n); break;
case 29: visit(cast(IsExpression) n); break;
case 30: visit(cast(MixinExpression) n); break;
case 31: visit(cast(MulExpression) n); break;
case 32: visit(cast(NewAnonClassExpression) n); break;
case 33: visit(cast(NewExpression) n); break;
case 34: visit(cast(OrExpression) n); break;
case 35: visit(cast(OrOrExpression) n); break;
case 36: visit(cast(PowExpression) n); break;
case 37: visit(cast(PragmaExpression) n); break;
case 38: visit(cast(PrimaryExpression) n); break;
case 39: visit(cast(RelExpression) n); break;
case 40: visit(cast(ShiftExpression) n); break;
case 41: visit(cast(Index) n); break;
case 42: visit(cast(TemplateMixinExpression) n); break;
case 43: visit(cast(TernaryExpression) n); break;
case 44: visit(cast(TraitsExpression) n); break;
case 45: visit(cast(TypeidExpression) n); break;
case 46: visit(cast(TypeofExpression) n); break;
case 47: visit(cast(UnaryExpression) n); break;
case 48: visit(cast(XorExpression) n); break;
default: assert(false, __MODULE__ ~ " has a bug");
}
}
/** */ void visit(const AddExpression addExpression) { addExpression.accept(this); }
/** */ void visit(const AliasDeclaration aliasDeclaration) { aliasDeclaration.accept(this); }
/** */ void visit(const AliasInitializer aliasInitializer) { aliasInitializer.accept(this); }
/** */ void visit(const AliasThisDeclaration aliasThisDeclaration) { aliasThisDeclaration.accept(this); }
/** */ void visit(const AlignAttribute alignAttribute) { alignAttribute.accept(this); }
/** */ void visit(const AndAndExpression andAndExpression) { andAndExpression.accept(this); }
/** */ void visit(const AndExpression andExpression) { andExpression.accept(this); }
/** */ void visit(const AnonymousEnumDeclaration anonymousEnumDeclaration) { anonymousEnumDeclaration.accept(this); }
/** */ void visit(const AnonymousEnumMember anonymousEnumMember) { anonymousEnumMember.accept(this); }
/** */ void visit(const ArgumentList argumentList) { argumentList.accept(this); }
/** */ void visit(const Arguments arguments) { arguments.accept(this); }
/** */ void visit(const ArrayInitializer arrayInitializer) { arrayInitializer.accept(this); }
/** */ void visit(const ArrayLiteral arrayLiteral) { arrayLiteral.accept(this); }
/** */ void visit(const ArrayMemberInitialization arrayMemberInitialization) { arrayMemberInitialization.accept(this); }
/** */ void visit(const AsmAddExp asmAddExp) { asmAddExp.accept(this); }
/** */ void visit(const AsmAndExp asmAndExp) { asmAndExp.accept(this); }
/** */ void visit(const AsmBrExp asmBrExp) { asmBrExp.accept(this); }
/** */ void visit(const AsmEqualExp asmEqualExp) { asmEqualExp.accept(this); }
/** */ void visit(const AsmExp asmExp) { asmExp.accept(this); }
/** */ void visit(const AsmInstruction asmInstruction) { asmInstruction.accept(this); }
/** */ void visit(const AsmLogAndExp asmLogAndExp) { asmLogAndExp.accept(this); }
/** */ void visit(const AsmLogOrExp asmLogOrExp) { asmLogOrExp.accept(this); }
/** */ void visit(const AsmMulExp asmMulExp) { asmMulExp.accept(this); }
/** */ void visit(const AsmOrExp asmOrExp) { asmOrExp.accept(this); }
/** */ void visit(const AsmPrimaryExp asmPrimaryExp) { asmPrimaryExp.accept(this); }
/** */ void visit(const AsmRelExp asmRelExp) { asmRelExp.accept(this); }
/** */ void visit(const AsmShiftExp asmShiftExp) { asmShiftExp.accept(this); }
/** */ void visit(const AsmStatement asmStatement) { asmStatement.accept(this); }
/** */ void visit(const AsmTypePrefix asmTypePrefix) { asmTypePrefix.accept(this); }
/** */ void visit(const AsmUnaExp asmUnaExp) { asmUnaExp.accept(this); }
/** */ void visit(const AsmXorExp asmXorExp) { asmXorExp.accept(this); }
/** */ void visit(const AssertArguments assertArguments) { assertArguments.accept(this); }
/** */ void visit(const AssertExpression assertExpression) { assertExpression.accept(this); }
/** */ void visit(const AssignExpression assignExpression) { assignExpression.accept(this); }
/** */ void visit(const AssocArrayLiteral assocArrayLiteral) { assocArrayLiteral.accept(this); }
/** */ void visit(const AtAttribute atAttribute) { atAttribute.accept(this); }
/** */ void visit(const Attribute attribute) { attribute.accept(this); }
/** */ void visit(const AttributeDeclaration attributeDeclaration) { attributeDeclaration.accept(this); }
/** */ void visit(const AutoDeclaration autoDeclaration) { autoDeclaration.accept(this); }
/** */ void visit(const AutoDeclarationPart autoDeclarationPart) { autoDeclarationPart.accept(this); }
/** */ void visit(const BlockStatement blockStatement) { blockStatement.accept(this); }
/** */ void visit(const BreakStatement breakStatement) { breakStatement.accept(this); }
/** */ void visit(const BaseClass baseClass) { baseClass.accept(this); }
/** */ void visit(const BaseClassList baseClassList) { baseClassList.accept(this); }
/** */ void visit(const CaseRangeStatement caseRangeStatement) { caseRangeStatement.accept(this); }
/** */ void visit(const CaseStatement caseStatement) { caseStatement.accept(this); }
/** */ void visit(const CastExpression castExpression) { castExpression.accept(this); }
/** */ void visit(const CastQualifier castQualifier) { castQualifier.accept(this); }
/** */ void visit(const Catch catch_) { catch_.accept(this); }
/** */ void visit(const Catches catches) { catches.accept(this); }
/** */ void visit(const ClassDeclaration classDeclaration) { classDeclaration.accept(this); }
/** */ void visit(const CmpExpression cmpExpression) { cmpExpression.accept(this); }
/** */ void visit(const CompileCondition compileCondition) { compileCondition.accept(this); }
/** */ void visit(const ConditionalDeclaration conditionalDeclaration) { conditionalDeclaration.accept(this); }
/** */ void visit(const ConditionalStatement conditionalStatement) { conditionalStatement.accept(this); }
/** */ void visit(const Constraint constraint) { constraint.accept(this); }
/** */ void visit(const Constructor constructor) { constructor.accept(this); }
/** */ void visit(const ContinueStatement continueStatement) { continueStatement.accept(this); }
/** */ void visit(const DebugCondition debugCondition) { debugCondition.accept(this); }
/** */ void visit(const DebugSpecification debugSpecification) { debugSpecification.accept(this); }
/** */ void visit(const Declaration declaration) { declaration.accept(this); }
/** */ void visit(const DeclarationOrStatement declarationsOrStatement) { declarationsOrStatement.accept(this); }
/** */ void visit(const DeclarationsAndStatements declarationsAndStatements) { declarationsAndStatements.accept(this); }
/** */ void visit(const Declarator declarator) { declarator.accept(this); }
/** */ void visit(const DefaultStatement defaultStatement) { defaultStatement.accept(this); }
/** */ void visit(const DeleteExpression deleteExpression) { deleteExpression.accept(this); }
/** */ void visit(const DeleteStatement deleteStatement) { deleteStatement.accept(this); }
/** */ void visit(const Deprecated deprecated_) { deprecated_.accept(this); }
/** */ void visit(const Destructor destructor) { destructor.accept(this); }
/** */ void visit(const DoStatement doStatement) { doStatement.accept(this); }
/** */ void visit(const EnumBody enumBody) { enumBody.accept(this); }
/** */ void visit(const EnumDeclaration enumDeclaration) { enumDeclaration.accept(this); }
/** */ void visit(const EnumMember enumMember) { enumMember.accept(this); }
/** */ void visit(const EnumMemberAttribute enumMemberAttribute) { enumMemberAttribute.accept(this); }
/** */ void visit(const EponymousTemplateDeclaration eponymousTemplateDeclaration) { eponymousTemplateDeclaration.accept(this); }
/** */ void visit(const EqualExpression equalExpression) { equalExpression.accept(this); }
/** */ void visit(const Expression expression) { expression.accept(this); }
/** */ void visit(const ExpressionStatement expressionStatement) { expressionStatement.accept(this); }
/** */ void visit(const FinalSwitchStatement finalSwitchStatement) { finalSwitchStatement.accept(this); }
/** */ void visit(const Finally finally_) { finally_.accept(this); }
/** */ void visit(const ForStatement forStatement) { forStatement.accept(this); }
/** */ void visit(const ForeachStatement foreachStatement) { foreachStatement.accept(this); }
/** */ void visit(const StaticForeachDeclaration staticForeachDeclaration) { staticForeachDeclaration.accept(this); }
/** */ void visit(const StaticForeachStatement staticForeachStatement) { staticForeachStatement.accept(this); }
/** */ void visit(const ForeachType foreachType) { foreachType.accept(this); }
/** */ void visit(const ForeachTypeList foreachTypeList) { foreachTypeList.accept(this); }
/** */ void visit(const FunctionAttribute functionAttribute) { functionAttribute.accept(this); }
/** */ void visit(const FunctionBody functionBody) { functionBody.accept(this); }
/** */ void visit(const FunctionCallExpression functionCallExpression) { functionCallExpression.accept(this); }
/** */ void visit(const FunctionContract functionContract) { functionContract.accept(this); }
/** */ void visit(const FunctionDeclaration functionDeclaration) { functionDeclaration.accept(this); }
/** */ void visit(const FunctionLiteralExpression functionLiteralExpression) { functionLiteralExpression.accept(this); }
/** */ void visit(const GotoStatement gotoStatement) { gotoStatement.accept(this); }
/** */ void visit(const IdentifierChain identifierChain) { identifierChain.accept(this); }
/** */ void visit(const DeclaratorIdentifierList identifierList) { identifierList.accept(this); }
/** */ void visit(const IdentifierOrTemplateChain identifierOrTemplateChain) { identifierOrTemplateChain.accept(this); }
/** */ void visit(const IdentifierOrTemplateInstance identifierOrTemplateInstance) { identifierOrTemplateInstance.accept(this); }
/** */ void visit(const IdentityExpression identityExpression) { identityExpression.accept(this); }
/** */ void visit(const IfStatement ifStatement) { ifStatement.accept(this); }
/** */ void visit(const ImportBind importBind) { importBind.accept(this); }
/** */ void visit(const ImportBindings importBindings) { importBindings.accept(this); }
/** */ void visit(const ImportDeclaration importDeclaration) { importDeclaration.accept(this); }
/** */ void visit(const ImportExpression importExpression) { importExpression.accept(this); }
/** */ void visit(const IndexExpression indexExpression) { indexExpression.accept(this); }
/** */ void visit(const InContractExpression inContractExpression) { inContractExpression.accept(this); }
/** */ void visit(const InExpression inExpression) { inExpression.accept(this); }
/** */ void visit(const InOutContractExpression inOutContractExpression) { inOutContractExpression.accept(this); }
/** */ void visit(const InOutStatement inOutStatement) { inOutStatement.accept(this); }
/** */ void visit(const InStatement inStatement) { inStatement.accept(this); }
/** */ void visit(const Initialize initialize) { initialize.accept(this); }
/** */ void visit(const Initializer initializer) { initializer.accept(this); }
/** */ void visit(const InterfaceDeclaration interfaceDeclaration) { interfaceDeclaration.accept(this); }
/** */ void visit(const Invariant invariant_) { invariant_.accept(this); }
/** */ void visit(const IsExpression isExpression) { isExpression.accept(this); }
/** */ void visit(const KeyValuePair keyValuePair) { keyValuePair.accept(this); }
/** */ void visit(const KeyValuePairs keyValuePairs) { keyValuePairs.accept(this); }
/** */ void visit(const LabeledStatement labeledStatement) { labeledStatement.accept(this); }
/** */ void visit(const LastCatch lastCatch) { lastCatch.accept(this); }
/** */ void visit(const LinkageAttribute linkageAttribute) { linkageAttribute.accept(this); }
/** */ void visit(const MemberFunctionAttribute memberFunctionAttribute) { memberFunctionAttribute.accept(this); }
/** */ void visit(const MissingFunctionBody missingFunctionBody) { missingFunctionBody.accept(this); }
/** */ void visit(const MixinDeclaration mixinDeclaration) { mixinDeclaration.accept(this); }
/** */ void visit(const MixinExpression mixinExpression) { mixinExpression.accept(this); }
/** */ void visit(const MixinTemplateDeclaration mixinTemplateDeclaration) { mixinTemplateDeclaration.accept(this); }
/** */ void visit(const MixinTemplateName mixinTemplateName) { mixinTemplateName.accept(this); }
/** */ void visit(const Module module_) { module_.accept(this); }
/** */ void visit(const ModuleDeclaration moduleDeclaration) { moduleDeclaration.accept(this); }
/** */ void visit(const MulExpression mulExpression) { mulExpression.accept(this); }
/** */ void visit(const NewAnonClassExpression newAnonClassExpression) { newAnonClassExpression.accept(this); }
/** */ void visit(const NewExpression newExpression) { newExpression.accept(this); }
/** */ void visit(const NonVoidInitializer nonVoidInitializer) { nonVoidInitializer.accept(this); }
/** */ void visit(const Operands operands) { operands.accept(this); }
/** */ void visit(const OrExpression orExpression) { orExpression.accept(this); }
/** */ void visit(const OrOrExpression orOrExpression) { orOrExpression.accept(this); }
/** */ void visit(const OutContractExpression outContractExpression) { outContractExpression.accept(this); }
/** */ void visit(const OutStatement outStatement) { outStatement.accept(this); }
/** */ void visit(const ParameterAttribute parameterAttribute) { parameterAttribute.accept(this); }
/** */ void visit(const Parameter parameter) { parameter.accept(this); }
/** */ void visit(const Parameters parameters) { parameters.accept(this); }
/** */ void visit(const Postblit postblit) { postblit.accept(this); }
/** */ void visit(const PowExpression powExpression) { powExpression.accept(this); }
/** */ void visit(const PragmaDeclaration pragmaDeclaration) { pragmaDeclaration.accept(this); }
/** */ void visit(const PragmaStatement pragmaStatement) { pragmaStatement.accept(this); }
/** */ void visit(const PragmaExpression pragmaExpression) { pragmaExpression.accept(this); }
/** */ void visit(const PrimaryExpression primaryExpression) { primaryExpression.accept(this); }
/** */ void visit(const Register register) { register.accept(this); }
/** */ void visit(const RelExpression relExpression) { relExpression.accept(this); }
/** */ void visit(const ReturnStatement returnStatement) { returnStatement.accept(this); }
/** */ void visit(const ScopeGuardStatement scopeGuardStatement) { scopeGuardStatement.accept(this); }
/** */ void visit(const SharedStaticConstructor sharedStaticConstructor) { sharedStaticConstructor.accept(this); }
/** */ void visit(const SharedStaticDestructor sharedStaticDestructor) { sharedStaticDestructor.accept(this); }
/** */ void visit(const ShiftExpression shiftExpression) { shiftExpression.accept(this); }
/** */ void visit(const SingleImport singleImport) { singleImport.accept(this); }
/** */ void visit(const Index index) { index.accept(this); }
/** */ void visit(const SpecifiedFunctionBody specifiedFunctionBody) { specifiedFunctionBody.accept(this); }
/** */ void visit(const Statement statement) { statement.accept(this); }
/** */ void visit(const StatementNoCaseNoDefault statementNoCaseNoDefault) { statementNoCaseNoDefault.accept(this); }
/** */ void visit(const StaticAssertDeclaration staticAssertDeclaration) { staticAssertDeclaration.accept(this); }
/** */ void visit(const StaticAssertStatement staticAssertStatement) { staticAssertStatement.accept(this); }
/** */ void visit(const StaticConstructor staticConstructor) { staticConstructor.accept(this); }
/** */ void visit(const StaticDestructor staticDestructor) { staticDestructor.accept(this); }
/** */ void visit(const StaticIfCondition staticIfCondition) { staticIfCondition.accept(this); }
/** */ void visit(const StorageClass storageClass) { storageClass.accept(this); }
/** */ void visit(const StructBody structBody) { structBody.accept(this); }
/** */ void visit(const StructDeclaration structDeclaration) { structDeclaration.accept(this); }
/** */ void visit(const StructInitializer structInitializer) { structInitializer.accept(this); }
/** */ void visit(const StructMemberInitializer structMemberInitializer) { structMemberInitializer.accept(this); }
/** */ void visit(const StructMemberInitializers structMemberInitializers) { structMemberInitializers.accept(this); }
/** */ void visit(const SwitchStatement switchStatement) { switchStatement.accept(this); }
/** */ void visit(const Symbol symbol) { symbol.accept(this); }
/** */ void visit(const SynchronizedStatement synchronizedStatement) { synchronizedStatement.accept(this); }
/** */ void visit(const TemplateAliasParameter templateAliasParameter) { templateAliasParameter.accept(this); }
/** */ void visit(const TemplateArgument templateArgument) { templateArgument.accept(this); }
/** */ void visit(const TemplateArgumentList templateArgumentList) { templateArgumentList.accept(this); }
/** */ void visit(const TemplateArguments templateArguments) { templateArguments.accept(this); }
/** */ void visit(const TemplateDeclaration templateDeclaration) { templateDeclaration.accept(this); }
/** */ void visit(const TemplateInstance templateInstance) { templateInstance.accept(this); }
/** */ void visit(const TemplateMixinExpression templateMixinExpression) { templateMixinExpression.accept(this); }
/** */ void visit(const TemplateParameter templateParameter) { templateParameter.accept(this); }
/** */ void visit(const TemplateParameterList templateParameterList) { templateParameterList.accept(this); }
/** */ void visit(const TemplateParameters templateParameters) { templateParameters.accept(this); }
/** */ void visit(const TemplateSingleArgument templateSingleArgument) { templateSingleArgument.accept(this); }
/** */ void visit(const TemplateThisParameter templateThisParameter) { templateThisParameter.accept(this); }
/** */ void visit(const TemplateTupleParameter templateTupleParameter) { templateTupleParameter.accept(this); }
/** */ void visit(const TemplateTypeParameter templateTypeParameter) { templateTypeParameter.accept(this); }
/** */ void visit(const TemplateValueParameter templateValueParameter) { templateValueParameter.accept(this); }
/** */ void visit(const TemplateValueParameterDefault templateValueParameterDefault) { templateValueParameterDefault.accept(this); }
/** */ void visit(const TernaryExpression ternaryExpression) { ternaryExpression.accept(this); }
/** */ void visit(const ThrowStatement throwStatement) { throwStatement.accept(this); }
/** */ void visit(const Token) { }
/** */ void visit(const TraitsExpression traitsExpression) { traitsExpression.accept(this); }
/** */ void visit(const TryStatement tryStatement) { tryStatement.accept(this); }
/** */ void visit(const Type type) { type.accept(this); }
/** */ void visit(const TypeIdentifierPart typeIdentChain) { typeIdentChain.accept(this); }
/** */ void visit(const Type2 type2) { type2.accept(this); }
/** */ void visit(const TypeSpecialization typeSpecialization) { typeSpecialization.accept(this); }
/** */ void visit(const TypeSuffix typeSuffix) { typeSuffix.accept(this); }
/** */ void visit(const TypeidExpression typeidExpression) { typeidExpression.accept(this); }
/** */ void visit(const TypeofExpression typeofExpression) { typeofExpression.accept(this); }
/** */ void visit(const UnaryExpression unaryExpression) { unaryExpression.accept(this); }
/** */ void visit(const UnionDeclaration unionDeclaration) { unionDeclaration.accept(this); }
/** */ void visit(const Unittest unittest_) { unittest_.accept(this); }
/** */ void visit(const VariableDeclaration variableDeclaration) { variableDeclaration.accept(this); }
/** */ void visit(const Vector vector) { vector.accept(this); }
/** */ void visit(const VersionCondition versionCondition) { versionCondition.accept(this); }
/** */ void visit(const VersionSpecification versionSpecification) { versionSpecification.accept(this); }
/** */ void visit(const WhileStatement whileStatement) { whileStatement.accept(this); }
/** */ void visit(const WithStatement withStatement) { withStatement.accept(this); }
/** */ void visit(const XorExpression xorExpression) { xorExpression.accept(this); }
}
interface ASTNode
{
/** */ void accept(ASTVisitor visitor) const;
}
template visitIfNotNull(fields ...)
{
static if (fields.length > 1)
immutable visitIfNotNull = visitIfNotNull!(fields[0]) ~ visitIfNotNull!(fields[1..$]);
else
{
static if (typeof(fields[0]).stringof[$ - 2 .. $] == "[]")
{
static if (__traits(hasMember, typeof(fields[0][0]), "classinfo"))
immutable visitIfNotNull = "foreach (i; " ~ fields[0].stringof ~ ") if (i !is null) visitor.visit(i);\n";
else
immutable visitIfNotNull = "foreach (i; " ~ fields[0].stringof ~ ") visitor.visit(i);\n";
}
else static if (__traits(hasMember, typeof(fields[0]), "classinfo"))
immutable visitIfNotNull = "if (" ~ fields[0].stringof ~ " !is null) visitor.visit(" ~ fields[0].stringof ~ ");\n";
else static if (is(Unqual!(typeof(fields[0])) == Token))
immutable visitIfNotNull = "if (" ~ fields[0].stringof ~ ` != tok!""` ~ ") visitor.visit(" ~ fields[0].stringof ~ ");\n";
else
immutable visitIfNotNull = "visitor.visit(" ~ fields[0].stringof ~ ");\n";
}
}
mixin template OpEquals(bool print = false)
{
override bool opEquals(Object other) const
{
static if (print)
pragma(msg, generateOpEquals!(typeof(this)));
mixin (generateOpEquals!(typeof(this)));
}
}
template generateOpEquals(T)
{
template opEqualsPart(p ...)
{
import std.traits : isSomeFunction, isDynamicArray;
import std.algorithm : among;
static if (p.length > 1)
{
enum opEqualsPart = opEqualsPart!(p[0 .. $/2]) ~ opEqualsPart!(p[$/2 .. $]);
}
else static if (p.length && !isSomeFunction!(typeof(__traits(getMember, T, p[0])))
&& !p[0].among("comment", "line", "column", "endLocation", "startLocation", "index", "dotLocation"))
{
static if (isDynamicArray!(typeof(__traits(getMember, T, p[0]))))
{
enum opEqualsPart = "\tif (obj." ~ p[0] ~ ".length != " ~ p[0] ~ ".length) return false;\n"
~ "\tforeach (i; 0 .. " ~ p[0] ~ ".length)\n"
~ "\t\tif (" ~ p[0] ~ "[i] != obj." ~ p[0] ~ "[i]) return false;\n";
}
else
enum opEqualsPart = "\tif (obj." ~ p[0] ~ " != " ~ p[0] ~ ") return false;\n";
}
else
enum opEqualsPart = "";
}
enum generateOpEquals = "if (auto obj = cast(" ~ T.stringof ~ ") other){\n"
~ opEqualsPart!(__traits(derivedMembers, T))
~ "\treturn true;\n}\nreturn false;";
}
abstract class BaseNode : ASTNode
{
/** List of tokens consumed by this AST node */ const(Token)[] tokens;
abstract void accept(ASTVisitor visitor) const;
}
abstract class ExpressionNode : BaseNode
{
override void accept(ASTVisitor visitor) const
{
assert (false);
}
}
mixin template BinaryExpressionBody()
{
ExpressionNode left;
ExpressionNode right;
size_t line;
size_t column;
}
///
final class AddExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin OpEquals;
/** */ IdType operator;
mixin BinaryExpressionBody;
}
///
final class AliasDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(storageClasses, type, declaratorIdentifierList,
initializers, parameters, memberFunctionAttributes));
}
mixin OpEquals;
/** */ StorageClass[] storageClasses;
/** */ Type type;
/** */ DeclaratorIdentifierList declaratorIdentifierList;
/** */ AliasInitializer[] initializers;
/** */ string comment;
/** */ Parameters parameters;
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
}
///
final class AliasInitializer : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(name, templateParameters, storageClasses, type,
functionLiteralExpression));
}
mixin OpEquals;
/** */ Token name;
/** */ StorageClass[] storageClasses;
/** */ TemplateParameters templateParameters;
/** */ Type type;
/** */ FunctionLiteralExpression functionLiteralExpression;
/** */ Parameters parameters;
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
}
///
final class AliasThisDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier));
}
mixin OpEquals;
/** */ Token identifier;
/** */ string comment;
}
///
final class AlignAttribute : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assignExpression));
}
mixin OpEquals;
/** */ ExpressionNode assignExpression;
}
///
final class AndAndExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin OpEquals;
mixin BinaryExpressionBody;
}
///
final class AndExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin OpEquals;
mixin BinaryExpressionBody;
}
///
final class AnonymousEnumDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(baseType, members));
}
mixin OpEquals;
/** */ Type baseType;
/** */ AnonymousEnumMember[] members;
}
///
final class AnonymousEnumMember : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, name, assignExpression));
}
/** */ Type type;
/** */ Token name;
/** */ ExpressionNode assignExpression;
/** */ string comment;
}
///
final class ArgumentList : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(items));
}
mixin OpEquals;
/** */ ExpressionNode[] items;
/** */ size_t startLocation;
/** */ size_t endLocation;
}
///
final class Arguments : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(argumentList));
}
mixin OpEquals;
/** */ ArgumentList argumentList;
}
///
final class ArrayInitializer : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(arrayMemberInitializations));
}
mixin OpEquals;
/** */ size_t startLocation;
/** */ size_t endLocation;
/** */ ArrayMemberInitialization[] arrayMemberInitializations;
}
///
final class ArrayLiteral : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(argumentList));
}
mixin OpEquals;
/** */ ArgumentList argumentList;
}
///
final class ArrayMemberInitialization : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assignExpression, nonVoidInitializer));
}
mixin OpEquals;
/** */ ExpressionNode assignExpression;
/** */ NonVoidInitializer nonVoidInitializer;
}
///
final class AsmAddExp : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin OpEquals;
/** */ IdType operator;
mixin BinaryExpressionBody;
}
///
final class AsmAndExp : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin OpEquals;
mixin BinaryExpressionBody;
}
///
final class AsmBrExp : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(asmBrExp, asmExp, asmUnaExp));
}
mixin OpEquals;
size_t line;
size_t column;
/** */ AsmBrExp asmBrExp;
/** */ ExpressionNode asmExp;
/** */ AsmUnaExp asmUnaExp;
}
///
final class AsmEqualExp : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
/** */ IdType operator;
}
///
final class AsmExp : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, middle, right));
}
mixin OpEquals;
/** */ ExpressionNode left;
/** */ ExpressionNode middle;
/** */ ExpressionNode right;
}
///
final class AsmInstruction : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifierOrIntegerOrOpcode, asmInstruction, operands));
}
mixin OpEquals;
/** */ Token identifierOrIntegerOrOpcode;
/** */ bool hasAlign;
/** */ bool isLabel;
/** */ AsmInstruction asmInstruction;
/** */ Operands operands;
}
///
final class AsmLogAndExp : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class AsmLogOrExp : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class AsmMulExp : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ IdType operator;
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class AsmOrExp : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class AsmPrimaryExp : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token, register, asmExp, identifierChain,
segmentOverrideSuffix));
}
/** */ ExpressionNode asmExp;
/** */ IdentifierChain identifierChain;
/** */ Register register;
/** */ ExpressionNode segmentOverrideSuffix;
/** */ Token token;
mixin OpEquals;
}
///
final class AsmRelExp : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
/** */ IdType operator;
mixin OpEquals;
}
///
final class AsmShiftExp : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
/** */ IdType operator;
mixin OpEquals;
}
///
final class AsmStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!asmInstructions);
}
/** */ AsmInstruction[] asmInstructions;
/** */ FunctionAttribute[] functionAttributes;
mixin OpEquals;
}
///
final class AsmTypePrefix : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ Token left;
/** */ Token right;
mixin OpEquals;
}
///
final class AsmUnaExp : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(prefix, asmTypePrefix, asmExp, asmPrimaryExp, asmUnaExp));
}
/** */ AsmTypePrefix asmTypePrefix;
/** */ ExpressionNode asmExp;
/** */ Token prefix;
/** */ AsmPrimaryExp asmPrimaryExp;
/** */ AsmUnaExp asmUnaExp;
mixin OpEquals;
}
///
final class AsmXorExp : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class AssertArguments : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assertion, message));
}
/** */ ExpressionNode assertion;
/** */ ExpressionNode message;
mixin OpEquals;
}
///
final class AssertExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assertArguments));
}
/** */ size_t line;
/** */ size_t column;
/** */ AssertArguments assertArguments;
mixin OpEquals;
}
///
final class AssignExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(ternaryExpression, expression));
}
/** */ ExpressionNode ternaryExpression;
/** */ ExpressionNode expression;
/** */ IdType operator;
/** */ size_t line;
/** */ size_t column;
mixin OpEquals;
}
///
final class AssocArrayLiteral : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(keyValuePairs));
}
/** */ KeyValuePairs keyValuePairs;
mixin OpEquals;
}
///
final class AtAttribute : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateInstance, argumentList));
}
/** */ ArgumentList argumentList;
/** */ TemplateInstance templateInstance;
/** */ Token identifier;
/** */ bool useParen;
/** */ size_t startLocation;
/** */ size_t endLocation;
mixin OpEquals;
}
///
final class Attribute : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(pragmaExpression, deprecated_, atAttribute,
alignAttribute, identifierChain, linkageAttribute));
}
/** */ PragmaExpression pragmaExpression;
/** */ Deprecated deprecated_;
/** */ AtAttribute atAttribute;
/** */ AlignAttribute alignAttribute;
/** */ LinkageAttribute linkageAttribute;
/** */ Token attribute;
/** */ IdentifierChain identifierChain;
mixin OpEquals;
}
///
final class AttributeDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(attribute));
}
/** */ Attribute attribute;
/** */ size_t line;
mixin OpEquals;
}
///
final class AutoDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
foreach (sc; storageClasses)
visitor.visit(sc);
foreach (part; parts)
visitor.visit(part);
}
/** */ AutoDeclarationPart[] parts;
/** */ StorageClass[] storageClasses;
/** */ string comment;
mixin OpEquals;
}
final class AutoDeclarationPart : BaseNode
{
override void accept(ASTVisitor visitor) const
{
if (templateParameters !is null)
visitor.visit(templateParameters);
visitor.visit(initializer);
}
/** */ Token identifier;
/** */ Initializer initializer;
/** */ TemplateParameters templateParameters;
}
///
final class BlockStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(declarationsAndStatements));
}
/**
* Byte position of the opening brace
*/
size_t startLocation;
/**
* Byte position of the closing brace
*/
size_t endLocation;
/** */ DeclarationsAndStatements declarationsAndStatements;
mixin OpEquals;
}
///
final class BreakStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(label));
}
/** */ Token label;
mixin OpEquals;
}
///
final class BaseClass : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type2));
}
/** */ Type2 type2;
mixin OpEquals;
}
///
final class BaseClassList : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(items));
}
/** */ BaseClass[] items;
mixin OpEquals;
}
///
final class CaseRangeStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(low, high, declarationsAndStatements));
}
/** */ ExpressionNode low;
/** */ ExpressionNode high;
/** */ DeclarationsAndStatements declarationsAndStatements;
/** */ size_t colonLocation;
mixin OpEquals;
}
///
final class CaseStatement: BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(argumentList, declarationsAndStatements));
}
/** */ ArgumentList argumentList;
/** */ DeclarationsAndStatements declarationsAndStatements;
/** */ size_t colonLocation;
mixin OpEquals;
}
///
final class CastExpression: BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, castQualifier, unaryExpression));
}
/** */ Type type;
/** */ CastQualifier castQualifier;
/** */ UnaryExpression unaryExpression;
mixin OpEquals;
}
///
final class CastQualifier: BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(first, second));
}
/** */ Token first;
/** */ Token second;
mixin OpEquals;
}
///
final class Catches: BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(catches, lastCatch));
}
/** */ Catch[] catches;
/** */ LastCatch lastCatch;
mixin OpEquals;
}
///
final class Catch: BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, identifier, declarationOrStatement));
}
/** */ Type type;
/** */ Token identifier;
/** */ DeclarationOrStatement declarationOrStatement;
mixin OpEquals;
}
///
final class ClassDeclaration: BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateParameters, constraint, baseClassList,
structBody));
}
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ Constraint constraint;
/** */ BaseClassList baseClassList;
/** */ StructBody structBody;
/** */ string comment;
mixin OpEquals;
}
///
final class CmpExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(shiftExpression, equalExpression,
identityExpression, relExpression, inExpression));
}
/** */ ExpressionNode shiftExpression;
/** */ ExpressionNode equalExpression;
/** */ ExpressionNode identityExpression;
/** */ ExpressionNode relExpression;
/** */ ExpressionNode inExpression;
mixin OpEquals;
}
///
final class CompileCondition : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(versionCondition, debugCondition, staticIfCondition));
}
/** */ VersionCondition versionCondition;
/** */ DebugCondition debugCondition;
/** */ StaticIfCondition staticIfCondition;
mixin OpEquals;
}
///
final class ConditionalDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(compileCondition, trueDeclarations, falseDeclarations));
}
/** */ CompileCondition compileCondition;
/** */ Declaration[] trueDeclarations;
/** */ Declaration[] falseDeclarations;
/** */ bool hasElse;
/** */ DeclarationListStyle trueStyle;
/** */ DeclarationListStyle falseStyle;
mixin OpEquals;
}
///
final class ConditionalStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(compileCondition, trueStatement, falseStatement));
}
/** */ CompileCondition compileCondition;
/** */ DeclarationOrStatement trueStatement;
/** */ DeclarationOrStatement falseStatement;
mixin OpEquals;
}
///
final class Constraint : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression));
}
/** */ Expression expression;
/** */ size_t location;
mixin OpEquals;
}
///
final class Constructor : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(parameters, templateParameters, constraint,
memberFunctionAttributes, functionBody));
}
/** */ Parameters parameters;
/** */ FunctionBody functionBody;
/** */ Constraint constraint;
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ TemplateParameters templateParameters;
/** */ size_t location;
/** */ size_t line;
/** */ size_t column;
/** */ string comment;
mixin OpEquals;
}
///
final class ContinueStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(label));
}
/** */ Token label;
mixin OpEquals;
}
///
final class DebugCondition : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifierOrInteger));
}
/** */ size_t debugIndex;
/** */ Token identifierOrInteger;
mixin OpEquals;
}
///
final class DebugSpecification : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifierOrInteger));
}
/** */ Token identifierOrInteger;
mixin OpEquals;
}
///
final class Declaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
foreach (attr; attributes)
visitor.visit(attr);
foreach (dec; declarations)
visitor.visit(dec);
foreach (Type; DeclarationTypes)
{
const(Type)* value = storage.peek!Type;
if (value !is null)
{
static if (isArray!Type)
foreach (item; *(cast(Type*) value))
visitor.visit(item);
else if (*value !is null)
visitor.visit(*(cast(Type*) value));
}
}
}
private import std.variant:Algebraic;
private import std.typetuple:TypeTuple;
alias DeclarationTypes = TypeTuple!(AliasDeclaration, AliasThisDeclaration,
AnonymousEnumDeclaration, AttributeDeclaration,
ClassDeclaration, ConditionalDeclaration, Constructor, DebugSpecification,
Destructor, EnumDeclaration, EponymousTemplateDeclaration,
FunctionDeclaration, ImportDeclaration, InterfaceDeclaration, Invariant,
MixinDeclaration, MixinTemplateDeclaration, Postblit, PragmaDeclaration,
SharedStaticConstructor, SharedStaticDestructor, StaticAssertDeclaration,
StaticConstructor, StaticDestructor, StructDeclaration,
TemplateDeclaration, UnionDeclaration, Unittest, VariableDeclaration,
VersionSpecification, StaticForeachDeclaration);
private Algebraic!(DeclarationTypes) storage;
private static string generateProperty(string type, string name)
{
return "const(" ~ type ~ ") " ~ name ~ "() const @property { auto p = storage.peek!" ~ type ~ "; return p is null? null : *p;}\n"
~ "const(" ~ type ~ ") " ~ name ~ "(" ~ type ~ " node) @property { storage = node; return node; }";
}
/** */ Attribute[] attributes;
/** */ Declaration[] declarations;
mixin(generateProperty("AliasDeclaration", "aliasDeclaration"));
mixin(generateProperty("AliasThisDeclaration", "aliasThisDeclaration"));
mixin(generateProperty("AnonymousEnumDeclaration", "anonymousEnumDeclaration"));
mixin(generateProperty("AttributeDeclaration", "attributeDeclaration"));
mixin(generateProperty("ClassDeclaration", "classDeclaration"));
mixin(generateProperty("ConditionalDeclaration", "conditionalDeclaration"));
mixin(generateProperty("Constructor", "constructor"));
mixin(generateProperty("DebugSpecification", "debugSpecification"));
mixin(generateProperty("Destructor", "destructor"));
mixin(generateProperty("EnumDeclaration", "enumDeclaration"));
mixin(generateProperty("EponymousTemplateDeclaration", "eponymousTemplateDeclaration"));
mixin(generateProperty("FunctionDeclaration", "functionDeclaration"));
mixin(generateProperty("ImportDeclaration", "importDeclaration"));
mixin(generateProperty("InterfaceDeclaration", "interfaceDeclaration"));
mixin(generateProperty("Invariant", "invariant_"));
mixin(generateProperty("MixinDeclaration", "mixinDeclaration"));
mixin(generateProperty("MixinTemplateDeclaration", "mixinTemplateDeclaration"));
mixin(generateProperty("Postblit", "postblit"));
mixin(generateProperty("PragmaDeclaration", "pragmaDeclaration"));
mixin(generateProperty("SharedStaticConstructor", "sharedStaticConstructor"));
mixin(generateProperty("SharedStaticDestructor", "sharedStaticDestructor"));
mixin(generateProperty("StaticAssertDeclaration", "staticAssertDeclaration"));
mixin(generateProperty("StaticConstructor", "staticConstructor"));
mixin(generateProperty("StaticDestructor", "staticDestructor"));
mixin(generateProperty("StructDeclaration", "structDeclaration"));
mixin(generateProperty("TemplateDeclaration", "templateDeclaration"));
mixin(generateProperty("UnionDeclaration", "unionDeclaration"));
mixin(generateProperty("Unittest", "unittest_"));
mixin(generateProperty("VariableDeclaration", "variableDeclaration"));
mixin(generateProperty("VersionSpecification", "versionSpecification"));
mixin(generateProperty("StaticForeachDeclaration", "staticForeachDeclaration"));
override bool opEquals(Object other) const
{
auto otherDeclaration = cast(Declaration) other;
if (otherDeclaration is null)
return false;
return attributes == otherDeclaration.attributes
&& declarations == otherDeclaration.declarations
&& storage == otherDeclaration.storage;
}
}
///
final class DeclarationsAndStatements : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(declarationsAndStatements));
}
/** */ DeclarationOrStatement[] declarationsAndStatements;
mixin OpEquals;
}
///
final class DeclarationOrStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(declaration, statement));
}
/** */ Declaration declaration;
/** */ Statement statement;
/** */ size_t startLocation;
/** */ size_t endLocation;
mixin OpEquals;
}
///
final class Declarator : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateParameters, initializer));
}
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ Initializer initializer;
/** */ TypeSuffix[] cstyle;
/** */ string comment;
mixin OpEquals;
}
///
final class DeclaratorIdentifierList : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifiers));
}
/** */ Token[] identifiers;
mixin OpEquals;
}
///
final class DefaultStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(declarationsAndStatements));
}
/** */ DeclarationsAndStatements declarationsAndStatements;
/** */ size_t colonLocation;
mixin OpEquals;
}
///
final class DeleteExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(unaryExpression));
}
/** */ UnaryExpression unaryExpression;
/** */ size_t line;
/** */ size_t column;
mixin OpEquals;
}
///
final class DeleteStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(deleteExpression));
}
/** */ DeleteExpression deleteExpression;
mixin OpEquals;
}
///
final class Deprecated : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assignExpression));
}
/** */ ExpressionNode assignExpression;
mixin OpEquals;
}
///
final class Destructor : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(memberFunctionAttributes, functionBody));
}
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ FunctionBody functionBody;
/** */ size_t line;
/** */ size_t column;
/** */ size_t index;
/** */ string comment;
mixin OpEquals;
}
///
final class DoStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression, statementNoCaseNoDefault));
}
/** */ StatementNoCaseNoDefault statementNoCaseNoDefault;
/** */ Expression expression;
mixin OpEquals;
}
///
final class EnumBody : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(enumMembers));
}
/** */ EnumMember[] enumMembers;
/**
* Byte position of the opening brace
*/
size_t startLocation;
/**
* Byte position of the closing brace
*/
size_t endLocation;
mixin OpEquals;
}
///
final class EnumDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, enumBody));
}
/** */ Token name;
/** */ Type type;
/** */ EnumBody enumBody;
/** */ string comment;
mixin OpEquals;
}
final class EnumMemberAttribute : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(deprecated_, atAttribute));
}
/** */ Deprecated deprecated_;
/** */ AtAttribute atAttribute;
mixin OpEquals;
}
///
final class EnumMember : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(enumMemberAttributes, name, type, assignExpression));
}
/** */ EnumMemberAttribute[] enumMemberAttributes;
/** */ Token name;
/** */ Type type;
/** */ ExpressionNode assignExpression;
/** */ string comment;
mixin OpEquals;
}
///
final class EponymousTemplateDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(name, templateParameters, assignExpression));
}
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ ExpressionNode assignExpression;
/** */ Type type;
/** */ string comment;
mixin OpEquals;
}
///
final class EqualExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ IdType operator;
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class Expression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(items));
}
/** */ ExpressionNode[] items;
/** */ size_t line;
/** */ size_t column;
mixin OpEquals;
}
///
final class ExpressionStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression));
}
/** */ Expression expression;
mixin OpEquals;
}
///
final class FinalSwitchStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(switchStatement));
}
/** */ SwitchStatement switchStatement;
mixin OpEquals;
}
///
final class Finally : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(declarationOrStatement));
}
/** */ DeclarationOrStatement declarationOrStatement;
mixin OpEquals;
}
///
final class ForStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(initialization, test, increment,
declarationOrStatement));
}
/** */ DeclarationOrStatement initialization;
/** */ Expression test;
/** */ Expression increment;
/** */ DeclarationOrStatement declarationOrStatement;
/** */ size_t startIndex;
mixin OpEquals;
}
///
final class Foreach(bool declOnly) : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(foreachType, foreachTypeList, low, high));
static if (declOnly)
mixin (visitIfNotNull!(declarations));
else
mixin (visitIfNotNull!(declarationOrStatement));
}
/** */ IdType type;
/** */ ForeachTypeList foreachTypeList;
/** */ ForeachType foreachType;
/** */ Expression low;
/** */ Expression high;
/** */ size_t startIndex;
static if (declOnly)
{
/** */ Declaration[] declarations;
/** */ DeclarationListStyle style;
}
else
{
/** */ DeclarationOrStatement declarationOrStatement;
}
mixin OpEquals;
}
///
alias StaticForeachDeclaration = Foreach!true;
///
alias ForeachStatement = Foreach!false;
///
final class StaticForeachStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(foreachStatement));
}
/** */ ForeachStatement foreachStatement;
mixin OpEquals;
}
///
final class ForeachType : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, identifier));
}
/** */ bool isAlias;
/** */ bool isEnum;
/** */ bool isRef;
/** */ IdType[] typeConstructors;
/** */ Type type;
/** */ Token identifier;
mixin OpEquals;
}
///
final class ForeachTypeList : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(items));
}
/** */ ForeachType[] items;
mixin OpEquals;
}
///
final class FunctionAttribute : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token, atAttribute));
}
/** */ Token token;
/** */ AtAttribute atAttribute;
mixin OpEquals;
}
///
final class FunctionBody : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(specifiedFunctionBody, missingFunctionBody));
}
/** */ size_t endLocation;
/** */ SpecifiedFunctionBody specifiedFunctionBody;
/** */ MissingFunctionBody missingFunctionBody;
mixin OpEquals;
}
///
final class FunctionCallExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, unaryExpression, templateArguments, arguments));
}
/** */ Type type;
/** */ UnaryExpression unaryExpression;
/** */ TemplateArguments templateArguments;
/** */ Arguments arguments;
mixin OpEquals;
}
///
final class FunctionContract : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(inOutContractExpression, inOutStatement));
}
/** */ InOutContractExpression inOutContractExpression;
/** */ InOutStatement inOutStatement;
mixin OpEquals;
}
///
final class FunctionDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(attributes, storageClasses, returnType, parameters,
templateParameters, constraint, memberFunctionAttributes,
functionBody));
}
/** */ bool hasAuto;
/** */ bool hasRef;
/** */ Type returnType;
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ Parameters parameters;
/** */ Constraint constraint;
/** */ FunctionBody functionBody;
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ string comment;
/** */ Attribute[] attributes;
/** */ StorageClass[] storageClasses;
mixin OpEquals;
}
///
final class FunctionLiteralExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(returnType, parameters, functionAttributes,
memberFunctionAttributes, specifiedFunctionBody, assignExpression));
}
/** */ ExpressionNode assignExpression;
/** */ FunctionAttribute[] functionAttributes;
/** */ SpecifiedFunctionBody specifiedFunctionBody;
/** */ IdType functionOrDelegate;
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ Parameters parameters;
/** */ Token identifier;
/** */ Type returnType;
/** */ bool isReturnRef;
/** */ size_t line;
/** */ size_t column;
mixin OpEquals;
}
///
final class GotoStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(label, expression));
}
/** */ Expression expression;
/** */ Token label;
mixin OpEquals;
}
///
final class IdentifierChain : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifiers));
}
/** */ Token[] identifiers;
mixin OpEquals;
}
///
final class TypeIdentifierPart : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifierOrTemplateInstance, typeIdentifierPart,
indexer));
}
/** */ bool dot;
/** */ IdentifierOrTemplateInstance identifierOrTemplateInstance;
/** */ TypeIdentifierPart typeIdentifierPart ;
/** */ ExpressionNode indexer;
mixin OpEquals;
}
///
final class IdentifierOrTemplateChain : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifiersOrTemplateInstances));
}
/** */ IdentifierOrTemplateInstance[] identifiersOrTemplateInstances;
mixin OpEquals;
}
///
final class IdentifierOrTemplateInstance : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, templateInstance));
}
/** */ Token identifier;
/** */ TemplateInstance templateInstance;
mixin OpEquals;
}
///
final class IdentityExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ bool negated;
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class IfStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, type, expression, thenStatement,
elseStatement));
}
/** */ IdType[] typeCtors;
/** */ Type type;
/** */ Token identifier;
/** */ Expression expression;
/** */ DeclarationOrStatement thenStatement;
/** */ DeclarationOrStatement elseStatement;
/** */ size_t startIndex;
/** */ size_t line;
/** */ size_t column;
mixin OpEquals;
}
///
final class ImportBind : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ Token left;
/** */ Token right;
mixin OpEquals;
}
///
final class ImportBindings : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(singleImport, importBinds));
}
/** */ SingleImport singleImport;
/** */ ImportBind[] importBinds;
mixin OpEquals;
}
///
final class ImportDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(singleImports, importBindings));
}
/** */ SingleImport[] singleImports;
/** */ ImportBindings importBindings;
/** */ size_t startIndex;
/** */ size_t endIndex;
mixin OpEquals;
}
///
final class ImportExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assignExpression));
}
/** */ ExpressionNode assignExpression;
mixin OpEquals;
}
///
final class Index : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(low, high));
}
/** */ ExpressionNode low;
/** */ ExpressionNode high;
mixin OpEquals;
}
///
final class IndexExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(unaryExpression, indexes));
}
/** */ UnaryExpression unaryExpression;
/** */ Index[] indexes;
mixin OpEquals;
}
///
final class InContractExpression : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assertArguments));
}
/** */ size_t inTokenLocation;
/** */ AssertArguments assertArguments;
mixin OpEquals;
}
///
final class InExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
bool negated;
mixin OpEquals;
}
///
final class InOutContractExpression : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(inContractExpression, outContractExpression));
}
/** */ InContractExpression inContractExpression;
/** */ OutContractExpression outContractExpression;
mixin OpEquals;
}
///
final class InOutStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(inStatement, outStatement));
}
/** */ InStatement inStatement;
/** */ OutStatement outStatement;
mixin OpEquals;
}
///
final class InStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(blockStatement));
}
/** */ size_t inTokenLocation;
/** */ BlockStatement blockStatement;
mixin OpEquals;
}
///
final class Initialize : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(statementNoCaseNoDefault));
}
/** */ StatementNoCaseNoDefault statementNoCaseNoDefault;
mixin OpEquals;
}
///
final class Initializer : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(nonVoidInitializer));
}
/** */ NonVoidInitializer nonVoidInitializer;
mixin OpEquals;
}
///
final class InterfaceDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateParameters, constraint, baseClassList,
structBody));
}
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ Constraint constraint;
/** */ BaseClassList baseClassList;
/** */ StructBody structBody;
/** */ string comment;
mixin OpEquals;
}
///
final class Invariant : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(blockStatement, assertArguments));
}
/** */ BlockStatement blockStatement;
/** */ AssertArguments assertArguments;
/** */ bool useParen;
/** */ string comment;
size_t line;
size_t index;
mixin OpEquals;
}
///
final class IsExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, identifier, typeSpecialization,
templateParameterList));
}
/** */ Type type;
/** */ Token identifier;
/** */ TypeSpecialization typeSpecialization;
/** */ TemplateParameterList templateParameterList;
/** */ IdType equalsOrColon;
mixin OpEquals;
}
///
final class KeyValuePair : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(key, value));
}
/** */ ExpressionNode key;
/** */ ExpressionNode value;
mixin OpEquals;
}
///
final class KeyValuePairs : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(keyValuePairs));
}
/** */ KeyValuePair[] keyValuePairs;
mixin OpEquals;
}
///
final class LabeledStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, declarationOrStatement));
}
/** */ Token identifier;
/** */ DeclarationOrStatement declarationOrStatement;
mixin OpEquals;
}
///
final class LastCatch : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(statementNoCaseNoDefault));
}
/** */ StatementNoCaseNoDefault statementNoCaseNoDefault;
size_t line;
size_t column;
mixin OpEquals;
}
///
final class LinkageAttribute : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, typeIdentifierPart));
}
/** */ Token identifier;
/** */ bool hasPlusPlus;
/** */ TypeIdentifierPart typeIdentifierPart;
/** */ IdType classOrStruct;
mixin OpEquals;
}
///
final class MemberFunctionAttribute : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(atAttribute));
}
/** */ IdType tokenType;
/** */ AtAttribute atAttribute;
mixin OpEquals;
}
///
final class MissingFunctionBody : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(functionContracts));
}
/** */ FunctionContract[] functionContracts;
mixin OpEquals;
}
///
final class MixinDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(mixinExpression, templateMixinExpression));
}
/** */ MixinExpression mixinExpression;
/** */ TemplateMixinExpression templateMixinExpression;
mixin OpEquals;
}
///
final class MixinExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(argumentList));
}
/** */ ArgumentList argumentList;
mixin OpEquals;
}
///
final class MixinTemplateDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateDeclaration));
}
/** */ TemplateDeclaration templateDeclaration;
mixin OpEquals;
}
///
final class MixinTemplateName : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(symbol, typeofExpression, identifierOrTemplateChain));
}
/** */ Symbol symbol;
/** */ IdentifierOrTemplateChain identifierOrTemplateChain;
/** */ TypeofExpression typeofExpression;
mixin OpEquals;
}
///
final class Module : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(scriptLine, moduleDeclaration, declarations));
}
/** */ Token scriptLine;
/** */ ModuleDeclaration moduleDeclaration;
/** */ Declaration[] declarations;
mixin OpEquals;
}
///
final class ModuleDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(moduleName, deprecated_));
}
/** */ Deprecated deprecated_;
/** */ IdentifierChain moduleName;
/** */ size_t startLocation;
/** */ size_t endLocation;
/** */ string comment;
mixin OpEquals;
}
///
final class MulExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ IdType operator;
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class NewAnonClassExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(allocatorArguments, constructorArguments,
baseClassList, structBody));
}
/** */ Arguments allocatorArguments;
/** */ Arguments constructorArguments;
/** */ BaseClassList baseClassList;
/** */ StructBody structBody;
mixin OpEquals;
}
///
final class NewExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(newAnonClassExpression, type, arguments,
assignExpression));
}
/** */ Type type;
/** */ NewAnonClassExpression newAnonClassExpression;
/** */ Arguments arguments;
/** */ ExpressionNode assignExpression;
mixin OpEquals;
}
///
final class StatementNoCaseNoDefault : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(labeledStatement, blockStatement, ifStatement,
whileStatement, doStatement, forStatement, foreachStatement,
switchStatement, finalSwitchStatement, continueStatement,
breakStatement, returnStatement, gotoStatement, withStatement,
synchronizedStatement, tryStatement, throwStatement,
scopeGuardStatement, asmStatement, pragmaStatement,
conditionalStatement, staticAssertStatement, versionSpecification,
debugSpecification, expressionStatement, staticForeachStatement));
}
/** */ LabeledStatement labeledStatement;
/** */ BlockStatement blockStatement;
/** */ IfStatement ifStatement;
/** */ WhileStatement whileStatement;
/** */ DoStatement doStatement;
/** */ ForStatement forStatement;
/** */ ForeachStatement foreachStatement;
/** */ StaticForeachStatement staticForeachStatement;
/** */ SwitchStatement switchStatement;
/** */ FinalSwitchStatement finalSwitchStatement;
/** */ ContinueStatement continueStatement;
/** */ BreakStatement breakStatement;
/** */ ReturnStatement returnStatement;
/** */ GotoStatement gotoStatement;
/** */ WithStatement withStatement;
/** */ SynchronizedStatement synchronizedStatement;
/** */ TryStatement tryStatement;
/** */ ThrowStatement throwStatement;
/** */ ScopeGuardStatement scopeGuardStatement;
/** */ AsmStatement asmStatement;
/** */ PragmaStatement pragmaStatement;
/** */ ConditionalStatement conditionalStatement;
/** */ StaticAssertStatement staticAssertStatement;
/** */ VersionSpecification versionSpecification;
/** */ DebugSpecification debugSpecification;
/** */ ExpressionStatement expressionStatement;
/** */ size_t startLocation;
/** */ size_t endLocation;
mixin OpEquals;
}
///
final class NonVoidInitializer : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assignExpression, arrayInitializer,
structInitializer));
}
/** */ ExpressionNode assignExpression;
/** */ ArrayInitializer arrayInitializer;
/** */ StructInitializer structInitializer;
mixin OpEquals;
}
///
final class Operands : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(operands));
}
/** */ ExpressionNode[] operands;
mixin OpEquals;
}
///
final class OrExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class OrOrExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class OutContractExpression : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(parameter, assertArguments));
}
/** */ size_t outTokenLocation;
/** */ Token parameter;
/** */ AssertArguments assertArguments;
mixin OpEquals;
}
///
final class OutStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(parameter, blockStatement));
}
/** */ size_t outTokenLocation;
/** */ Token parameter;
/** */ BlockStatement blockStatement;
mixin OpEquals;
}
final class ParameterAttribute : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(atAttribute));
}
/** */ IdType idType;
/** */ AtAttribute atAttribute;
}
///
final class Parameter : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, name, default_));
}
/** */ ParameterAttribute[] parameterAttributes;
/** */ Type type;
/** */ Token name;
/** */ bool vararg;
/** */ ExpressionNode default_;
/** */ TypeSuffix[] cstyle;
mixin OpEquals;
}
///
final class Parameters : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(parameters));
}
/** */ Parameter[] parameters;
/** */ bool hasVarargs;
mixin OpEquals;
}
///
final class Postblit : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(functionBody));
}
/** */ FunctionBody functionBody;
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ size_t location;
/** */ size_t line;
/** */ size_t column;
mixin OpEquals;
}
///
final class PowExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class PragmaDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(pragmaExpression));
}
/** */ PragmaExpression pragmaExpression;
mixin OpEquals;
}
///
final class PragmaExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, argumentList));
}
/** */ Token identifier;
/** */ ArgumentList argumentList;
mixin OpEquals;
}
///
final class PragmaStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(pragmaExpression, statement, blockStatement));
}
/** */ PragmaExpression pragmaExpression;
/** */ Statement statement;
/** */ BlockStatement blockStatement;
mixin OpEquals;
}
///
final class PrimaryExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin(visitIfNotNull!(basicType, typeConstructor, type, primary,
typeofExpression, typeidExpression, arrayLiteral, assocArrayLiteral,
expression, dot, identifierOrTemplateInstance, isExpression,
functionLiteralExpression,traitsExpression, mixinExpression,
importExpression, vector, arguments));
}
/** */ Token dot;
/** */ Token primary;
/** */ IdentifierOrTemplateInstance identifierOrTemplateInstance;
/** */ Token basicType;
/** */ TypeofExpression typeofExpression;
/** */ TypeidExpression typeidExpression;
/** */ ArrayLiteral arrayLiteral;
/** */ AssocArrayLiteral assocArrayLiteral;
/** */ Expression expression;
/** */ IsExpression isExpression;
/** */ FunctionLiteralExpression functionLiteralExpression;
/** */ TraitsExpression traitsExpression;
/** */ MixinExpression mixinExpression;
/** */ ImportExpression importExpression;
/** */ Vector vector;
/** */ Type type;
/** */ Token typeConstructor;
/** */ Arguments arguments;
mixin OpEquals;
}
///
final class Register : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, intLiteral));
}
/** */ Token identifier;
/** */ Token intLiteral;
/** */ bool hasIntegerLiteral;
mixin OpEquals;
}
///
final class RelExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ IdType operator;
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class ReturnStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression));
}
/** */ Expression expression;
/** */ size_t startLocation;
/** */ size_t endLocation;
mixin OpEquals;
}
///
final class ScopeGuardStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, statementNoCaseNoDefault));
}
/** */ Token identifier;
/** */ StatementNoCaseNoDefault statementNoCaseNoDefault;
mixin OpEquals;
}
///
final class SharedStaticConstructor : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(memberFunctionAttributes, functionBody));
}
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ FunctionBody functionBody;
/** */ size_t location;
/** */ size_t line;
/** */ size_t column;
/** */ string comment;
mixin OpEquals;
}
///
final class SharedStaticDestructor : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(memberFunctionAttributes, functionBody));
}
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ FunctionBody functionBody;
/** */ size_t location;
/** */ size_t line;
/** */ size_t column;
/** */ string comment;
mixin OpEquals;
}
///
final class ShiftExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
/** */ IdType operator;
mixin BinaryExpressionBody;
mixin OpEquals;
}
///
final class SingleImport : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(rename, identifierChain));
}
/** */ Token rename;
/** */ IdentifierChain identifierChain;
mixin OpEquals;
}
///
final class SpecifiedFunctionBody : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(functionContracts, blockStatement));
}
/** */ FunctionContract[] functionContracts;
/** */ BlockStatement blockStatement;
/** */ bool hasDo;
mixin OpEquals;
}
///
final class Statement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(statementNoCaseNoDefault, caseStatement,
caseRangeStatement, defaultStatement));
}
/** */ StatementNoCaseNoDefault statementNoCaseNoDefault;
/** */ CaseStatement caseStatement;
/** */ CaseRangeStatement caseRangeStatement;
/** */ DefaultStatement defaultStatement;
mixin OpEquals;
}
///
final class StaticAssertDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(staticAssertStatement));
}
/** */ StaticAssertStatement staticAssertStatement;
mixin OpEquals;
}
///
final class StaticAssertStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assertExpression));
}
/** */ AssertExpression assertExpression;
mixin OpEquals;
}
///
final class StaticConstructor : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(memberFunctionAttributes, functionBody));
}
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ FunctionBody functionBody;
/** */ size_t location;
/** */ size_t line;
/** */ size_t column;
/** */ string comment;
mixin OpEquals;
}
///
final class StaticDestructor : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(memberFunctionAttributes, functionBody));
}
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
/** */ FunctionBody functionBody;
/** */ size_t location;
/** */ size_t line;
/** */ size_t column;
/** */ string comment;
mixin OpEquals;
}
///
final class StaticIfCondition : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(assignExpression));
}
/** */ ExpressionNode assignExpression;
mixin OpEquals;
}
///
final class StorageClass : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token, alignAttribute, linkageAttribute,
atAttribute, deprecated_));
}
/** */ AlignAttribute alignAttribute;
/** */ LinkageAttribute linkageAttribute;
/** */ AtAttribute atAttribute;
/** */ Deprecated deprecated_;
/** */ Token token;
mixin OpEquals;
}
///
final class StructBody : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(declarations));
}
/**
* Byte position of the opening brace
*/
size_t startLocation;
/**
* Byte position of the closing brace
*/
size_t endLocation;
/** */ Declaration[] declarations;
mixin OpEquals;
}
///
final class StructDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateParameters, constraint, structBody));
}
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ Constraint constraint;
/** */ StructBody structBody;
/** */ string comment;
mixin OpEquals;
}
///
final class StructInitializer : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(structMemberInitializers));
}
/** */ StructMemberInitializers structMemberInitializers;
/** */ size_t startLocation;
/** */ size_t endLocation;
mixin OpEquals;
}
///
final class StructMemberInitializer : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, nonVoidInitializer));
}
/** */ Token identifier;
/** */ NonVoidInitializer nonVoidInitializer;
mixin OpEquals;
}
///
final class StructMemberInitializers : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(structMemberInitializers));
}
/** */ StructMemberInitializer[] structMemberInitializers;
mixin OpEquals;
}
///
final class SwitchStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression, statement));
}
/** */ Expression expression;
/** */ Statement statement;
mixin OpEquals;
}
///
final class Symbol : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifierOrTemplateChain));
}
/** */ IdentifierOrTemplateChain identifierOrTemplateChain;
/** */ bool dot;
mixin OpEquals;
}
///
final class SynchronizedStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression, statementNoCaseNoDefault));
}
/** */ Expression expression;
/** */ StatementNoCaseNoDefault statementNoCaseNoDefault;
mixin OpEquals;
}
///
final class TemplateAliasParameter : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, identifier, colonType, colonExpression,
assignType, assignExpression));
}
/** */ Type type;
/** */ Token identifier;
/** */ Type colonType;
/** */ ExpressionNode colonExpression;
/** */ Type assignType;
/** */ ExpressionNode assignExpression;
mixin OpEquals;
}
///
final class TemplateArgument : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, assignExpression));
}
/** */ Type type;
/** */ ExpressionNode assignExpression;
mixin OpEquals;
}
///
final class TemplateArgumentList : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(items));
}
/** */ TemplateArgument[] items;
mixin OpEquals;
}
///
final class TemplateArguments : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateArgumentList, templateSingleArgument));
}
/** */ TemplateArgumentList templateArgumentList;
/** */ TemplateSingleArgument templateSingleArgument;
mixin OpEquals;
}
///
final class TemplateDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(name, templateParameters, constraint,
declarations));
}
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ Constraint constraint;
/** */ Declaration[] declarations;
/** */ string comment;
/**
* Byte position of the opening brace
*/
size_t startLocation;
/**
* Byte position of the closing brace
*/
size_t endLocation;
mixin OpEquals;
}
///
final class TemplateInstance : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, templateArguments));
}
/** */ Token identifier;
/** */ TemplateArguments templateArguments;
mixin OpEquals;
}
///
final class TemplateMixinExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, templateArguments, mixinTemplateName));
}
/** */ Token identifier;
/** */ TemplateArguments templateArguments;
/** */ MixinTemplateName mixinTemplateName;
mixin OpEquals;
}
///
final class TemplateParameter : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateTypeParameter, templateValueParameter,
templateAliasParameter, templateTupleParameter,
templateThisParameter));
}
/** */ TemplateTypeParameter templateTypeParameter;
/** */ TemplateValueParameter templateValueParameter;
/** */ TemplateAliasParameter templateAliasParameter;
/** */ TemplateTupleParameter templateTupleParameter;
/** */ TemplateThisParameter templateThisParameter;
mixin OpEquals;
}
///
final class TemplateParameterList : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(items));
}
/** */ TemplateParameter[] items;
mixin OpEquals;
}
///
final class TemplateParameters : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateParameterList));
}
/** */ TemplateParameterList templateParameterList;
mixin OpEquals;
}
///
final class TemplateSingleArgument : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token));
}
/** */ Token token;
mixin OpEquals;
}
///
final class TemplateThisParameter : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(templateTypeParameter));
}
/** */ TemplateTypeParameter templateTypeParameter;
mixin OpEquals;
}
///
final class TemplateTupleParameter : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier));
}
/** */ Token identifier;
mixin OpEquals;
}
///
final class TemplateTypeParameter : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, colonType, assignType));
}
/** */ Token identifier;
/** */ Type colonType;
/** */ Type assignType;
mixin OpEquals;
}
///
final class TemplateValueParameter : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, identifier, assignExpression,
templateValueParameterDefault));
}
/** */ Type type;
/** */ Token identifier;
/** */ ExpressionNode assignExpression;
/** */ TemplateValueParameterDefault templateValueParameterDefault;
mixin OpEquals;
}
///
final class TemplateValueParameterDefault : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token, assignExpression));
}
/** */ ExpressionNode assignExpression;
/** */ Token token;
mixin OpEquals;
}
///
final class TernaryExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(orOrExpression, expression, ternaryExpression));
}
/** */ ExpressionNode orOrExpression;
/** */ ExpressionNode expression;
/** */ ExpressionNode ternaryExpression;
/// Store this so that we know where the ':' is
Token colon;
mixin OpEquals;
}
///
final class ThrowStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression));
}
/** */ Expression expression;
mixin OpEquals;
}
///
final class TraitsExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier, templateArgumentList));
}
/** */ Token identifier;
/** */ TemplateArgumentList templateArgumentList;
mixin OpEquals;
}
///
final class TryStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(declarationOrStatement, catches, finally_));
}
/** */ DeclarationOrStatement declarationOrStatement;
/** */ Catches catches;
/** */ Finally finally_;
mixin OpEquals;
}
///
final class Type : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type2, typeSuffixes));
}
/** */ IdType[] typeConstructors;
/** */ TypeSuffix[] typeSuffixes;
/** */ Type2 type2;
mixin OpEquals;
}
///
final class Type2 : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(typeofExpression, typeIdentifierPart, type,
traitsExpression, vector, mixinExpression));
}
/** */ IdType builtinType;
/** */ alias superOrThis = builtinType;
/** */ TypeofExpression typeofExpression;
/** */ TypeIdentifierPart typeIdentifierPart;
/** */ IdType typeConstructor;
/** */ Type type;
/** */ TraitsExpression traitsExpression;
/** */ Vector vector;
/** */ MixinExpression mixinExpression;
mixin OpEquals;
}
///
final class TypeSpecialization : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token, type));
}
/** */ Token token;
/** */ Type type;
mixin OpEquals;
}
///
final class TypeSuffix : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, low, high, delegateOrFunction, parameters,
memberFunctionAttributes));
}
/** */ Token delegateOrFunction;
/** */ Token star;
/** */ bool array;
/** */ Type type;
/** */ ExpressionNode low;
/** */ ExpressionNode high;
/** */ Parameters parameters;
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
mixin OpEquals;
}
///
final class TypeidExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type, expression));
}
/** */ Type type;
/** */ Expression expression;
mixin OpEquals;
}
///
final class TypeofExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression, return_));
}
/** */ Expression expression;
/** */ Token return_;
mixin OpEquals;
}
///
final class UnaryExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
// TODO prefix, postfix, unary
mixin (visitIfNotNull!(primaryExpression, newExpression, deleteExpression,
castExpression, functionCallExpression, argumentList, unaryExpression,
type, identifierOrTemplateInstance, assertExpression, indexExpression));
}
/** */ Type type;
/** */ PrimaryExpression primaryExpression;
/** */ Token prefix;
/** */ Token suffix;
/** */ UnaryExpression unaryExpression;
/** */ NewExpression newExpression;
/** */ DeleteExpression deleteExpression;
/** */ CastExpression castExpression;
/** */ FunctionCallExpression functionCallExpression;
/** */ ArgumentList argumentList;
/** */ IdentifierOrTemplateInstance identifierOrTemplateInstance;
/** */ AssertExpression assertExpression;
/** */ IndexExpression indexExpression;
/** */ size_t dotLocation;
mixin OpEquals;
}
///
final class UnionDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(name, templateParameters, constraint, structBody));
}
/** */ Token name;
/** */ TemplateParameters templateParameters;
/** */ Constraint constraint;
/** */ StructBody structBody;
/** */ string comment;
mixin OpEquals;
}
///
final class Unittest : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(blockStatement));
}
/** */ BlockStatement blockStatement;
/** */ string comment;
/** */ size_t location;
/** */ size_t line;
/** */ size_t column;
mixin OpEquals;
}
///
final class VariableDeclaration : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(storageClasses, type, declarators, autoDeclaration));
}
/** */ Type type;
/** */ Declarator[] declarators;
/** */ StorageClass[] storageClasses;
/** */ AutoDeclaration autoDeclaration;
/** */ string comment;
mixin OpEquals;
}
///
final class Vector : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(type));
}
/** */ Type type;
mixin OpEquals;
}
///
final class VersionCondition : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token));
}
/** */ size_t versionIndex;
/** */ Token token;
mixin OpEquals;
}
///
final class VersionSpecification : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(token));
}
/** */ Token token;
mixin OpEquals;
}
///
final class WhileStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression, declarationOrStatement));
}
/** */ Expression expression;
/** */ DeclarationOrStatement declarationOrStatement;
/** */ size_t startIndex;
mixin OpEquals;
}
///
final class WithStatement : BaseNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(expression, declarationOrStatement));
}
/** */ Expression expression;
/** */ DeclarationOrStatement declarationOrStatement;
mixin OpEquals;
}
///
final class XorExpression : ExpressionNode
{
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(left, right));
}
mixin BinaryExpressionBody;
mixin OpEquals;
}
unittest // issue #133
{
import dparse.lexer, dparse.parser, dparse.rollback_allocator;
string src = q{module test133; void main(){}};
final class TkTest : ASTVisitor
{
alias visit = ASTVisitor.visit;
override void visit(const Token t){assert(t.text.length);}
}
RollbackAllocator ra;
LexerConfig cf = LexerConfig("", StringBehavior.source);
StringCache ca = StringCache(16);
Module m = ParserConfig(getTokensForParser(src, cf, &ca), "", &ra).parseModule();
TkTest t = new TkTest;
t.visit(m);
}
unittest // issue #165
{
import dparse.lexer, dparse.parser, dparse.rollback_allocator;
string src = q{module test165; enum foo(T) = bar!T;};
final class EpoTest : ASTVisitor
{
bool visited;
alias visit = ASTVisitor.visit;
override void visit(const EponymousTemplateDeclaration){visited = true;}
}
RollbackAllocator ra;
LexerConfig cf = LexerConfig("", StringBehavior.source);
StringCache ca = StringCache(16);
Module m = ParserConfig(getTokensForParser(src, cf, &ca), "", &ra).parseModule();
EpoTest et = new EpoTest;
et.visit(m);
assert(et.visited);
}
unittest // issue #156
{
import dparse.lexer, dparse.parser, dparse.rollback_allocator;
final class Test : ASTVisitor
{
bool arrIndex, arrValue, arrValueOnly, aaLiteral;
alias visit = ASTVisitor.visit;
override void visit(const ArrayInitializer ai)
{
if (ai.arrayMemberInitializations.length == 1)
{
arrIndex = ai.arrayMemberInitializations[0].assignExpression !is null;
arrValue = ai.arrayMemberInitializations[0].nonVoidInitializer !is null;
arrValueOnly = arrValue && !arrIndex;
}
}
override void visit(const AssocArrayLiteral aal)
{
aaLiteral = true;
}
}
RollbackAllocator ra;
LexerConfig cf = LexerConfig("", StringBehavior.source);
StringCache ca = StringCache(16);
{
// no colon so array.
string src1 = q{void main(){const arr = [[0]];}};
Module m = parseModule(ParserConfig(getTokensForParser(src1, cf, &ca), "", &ra));
Test t = new Test;
t.visit(m);
assert(t.arrValueOnly);
}
{
// simple primary before colon, assume array.
string src2 = q{void main(){const arr = [0:0];}};
Module m = ParserConfig(getTokensForParser(src2, cf, &ca), "", &ra).parseModule();
Test t = new Test;
t.visit(m);
assert(t.arrIndex);
assert(t.arrValue);
assert(!t.aaLiteral);
}
{
// more complex exp before colon, assume AA.
string src3 = q{void main(){const arr = [[0]:0];}};
Module m = ParserConfig(getTokensForParser(src3, cf, &ca), "", &ra).parseModule();
Test t = new Test;
t.visit(m);
assert(!t.arrIndex);
assert(!t.arrValue);
assert(t.aaLiteral);
}
}
unittest // issue #170, issue #316
{
import dparse.lexer, dparse.parser, dparse.rollback_allocator;
abstract class TestCase : ASTVisitor
{
string src;
bool visited;
this()
{
RollbackAllocator ra;
LexerConfig cf = LexerConfig("", StringBehavior.source);
StringCache ca = StringCache(16);
Module m = ParserConfig(getTokensForParser(src, cf, &ca), "", &ra).parseModule();
visit(m);
assert(visited);
}
}
class FunctionLiteralExpressionTestCase : TestCase
{
alias visit = ASTVisitor.visit;
override void visit(const FunctionLiteralExpression){visited = true;}
}
class StructInitializerTestCase : TestCase
{
alias visit = ASTVisitor.visit;
override void visit(const StructInitializer){visited = true;}
}
new class FunctionLiteralExpressionTestCase
{this(){ TestCase.src = q{ void function() a = {call();};}; super(); }};
new class FunctionLiteralExpressionTestCase
{this(){ TestCase.src = q{ const a = {int i;};}; super(); }};
new class FunctionLiteralExpressionTestCase
{this(){ TestCase.src = q{ const a = {};}; super(); }};
new class StructInitializerTestCase
{this(){ TestCase.src = q{A a = {member : call()};}; super(); }};
new class StructInitializerTestCase
{this(){ TestCase.src = q{A a = {0};}; super(); }};
}
unittest // issue #193
{
import dparse.lexer, dparse.parser, dparse.rollback_allocator;
final class Test193 : ASTVisitor
{
static string src = q{const(Type1[immutable(Type2)]) qualAarray;};
size_t tc;
alias visit = ASTVisitor.visit;
override void visit(const TypeIdentifierPart tip)
{
tip.accept(this);
assert(tip.indexer is null);
}
override void visit(const Type type)
{
tc++;
if (tc == 1) //const(
{
assert(type.type2.typeConstructor == tok!"const");
assert(type.type2.typeIdentifierPart is null);
}
else if (tc == 2) //const(Type1
{
assert(type.typeConstructors.length == 0);
assert(type.type2.typeIdentifierPart.identifierOrTemplateInstance
.identifier.text == "Type1");
assert(type.typeSuffixes.length == 1);
}
else if (tc == 3) // immutable(
{
assert(type.type2.typeConstructor == tok!"immutable");
assert(type.type2.typeIdentifierPart is null);
}
else if (tc == 4) // immutable(Type2
{
assert(type.typeConstructors.length == 0);
assert(type.type2.typeIdentifierPart.identifierOrTemplateInstance
.identifier.text == "Type2");
assert(type.typeSuffixes.length == 0);
}
type.accept(this);
}
}
RollbackAllocator ra;
LexerConfig cf = LexerConfig("", StringBehavior.source);
StringCache ca = StringCache(16);
Module m = ParserConfig(getTokensForParser(Test193.src, cf, &ca), "", &ra).parseModule();
Test193 t193 = new Test193;
t193.visit(m);
}
unittest // there used to be a small regression when adding the ParserConfig
{
import dparse.lexer, dparse.parser, dparse.rollback_allocator;
auto src = q{module m;};
RollbackAllocator ra;
LexerConfig cf = LexerConfig("", StringBehavior.source);
StringCache ca = StringCache(16);
Module m1 = parseModule(getTokensForParser(src, cf, &ca), "", &ra , null);
Module m2 = parseModule(getTokensForParser(src, cf, &ca), "", &ra);
}
unittest //#318 : used to segfault
{
import dparse.lexer, dparse.parser, dparse.rollback_allocator;
auto src = q{ auto a = new TestClass( };
RollbackAllocator ra;
LexerConfig cf = LexerConfig("", StringBehavior.source);
StringCache ca = StringCache(16);
static void shut(string, size_t, size_t, string ,bool){}
Module m1 = parseModule(getTokensForParser(src, cf, &ca), "", &ra , &shut);
}
unittest //#365 : used to segfault
{
import dparse.lexer, dparse.parser, dparse.rollback_allocator;
auto src = " o[{scope(x ";
RollbackAllocator ra;
LexerConfig cf = LexerConfig("", StringBehavior.source);
StringCache ca = StringCache(16);
static void shut(string, size_t, size_t, string ,bool){}
Module m1 = parseModule(getTokensForParser(src, cf, &ca), "", &ra , &shut);
}
|
D
|
import std.stdio, std.string, std.conv;
/*******************************************************************************
* FizzBuzzをCTFE(コンパイル時実行)する
*/
/*******************************************************************************
* fizzbuzz.dのロジックベタ写し
* 違う点はstringで返している所
*/
string FizzBuzzCTFE()
{
string str;
foreach(i; 1..101)
{
if(i % 3)
{
if(i % 5)
{
str ~= text(i) ~ "\n";
}
else
{
str ~= "Buzz\n";
}
}
else if(i % 5)
{
str ~= "Fizz\n";
}
else
{
str ~= "FizzBuzz\n";
}
}
return str;
}
// pragma(msg でコンパイル時にメッセージ表示
// CTFEable関数を入れるとコンパイル時に実行される
pragma(msg, FizzBuzzCTFE());
// void = 虚無
void main()
{}
|
D
|
module bylines;
/** Type of NewLine Encoding.
*/
enum Newline
{
any, // Any of win, mac or unix
win, // Windows: "\r\n"
mac, // Mac OS: '\r'
unix, // UNIX/Linux: '\n'
native, // Current OS decides: '\n'
}
import std.range: hasSlicing, hasLength, isNarrowString;
/** Split Input by line.
See also: http://forum.dlang.org/thread/fjqpdfzmitcxxzpwlbgb@forum.dlang.org#post-rwxrytxqqurrazifugje:40forum.dlang.org
TODO Restrict using isSomeString!Range?
// TODO This should fail with better error message:
// assert(equal((cast(ubyte[])"a\nb").byLine!(Newline.any), ["a", "b"]));
*/
auto byLine(Newline nl = Newline.any,
Range)(Range input) if ((hasSlicing!Range &&
hasLength!Range) ||
isNarrowString!Range)
{
static if (nl == Newline.native)
{
import std.ascii: newline;
import std.algorithm: splitter;
static if (newline.length == 1)
{
import std.range: front;
return input.splitter(newline.front);
}
else
{
return input.splitter(newline);
}
}
else
{
static if (nl == Newline.any)
{
// TODO Use ctRegex instead?
import std.regex: splitter, regex;
return input.splitter(regex("\n|\r\n|\r"));
}
else
{
import std.algorithm: splitter;
static if (nl == Newline.win)
{
return input.splitter("\r\n");
}
else static if (nl == Newline.mac)
{
return input.splitter('\r');
}
else static if (nl == Newline.unix)
{
return input.splitter('\n');
}
}
}
}
unittest
{
import std.algorithm: equal;
assert(equal("a\nb".byLine!(Newline.any), ["a", "b"]));
assert(equal("a\r\nb".byLine!(Newline.win), ["a", "b"]));
assert(equal("a\rb".byLine!(Newline.mac), ["a", "b"]));
assert(equal("a\nb".byLine!(Newline.unix), ["a", "b"]));
}
|
D
|
/**
* Anchor module.
*
* License:
* MIT. See LICENSE for full details.
*/
module tkd.widget.common.anchor;
/**
* These are common commands that apply to all widgets that have them injected.
*
* Params:
* anchorCommand = The widget command that handles the anchor.
*/
mixin template Anchor(string anchorCommand = "-anchor")
{
/**
* Specifies how text in the widget is positioned relative to the inner margins.
*
* Params:
* position = The position of the anchor.
*
* Returns:
* This widget to aid method chaining.
*
* See_Also:
* $(LINK2 ../anchorposition.html, tkd.widget.anchorposition) $(BR)
*/
public auto setTextAnchor(this T)(string position)
{
this._tk.eval("%s configure " ~ anchorCommand ~ " %s", this.id, position);
return cast(T) this;
}
}
|
D
|
/Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ConsoleKit.build/Output/ConsoleColor.swift.o : /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Terminal/ANSI.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Command.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/GenerateAutocompleteCommand.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/AnyCommand.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/String+LevenshteinDistance.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Console.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleStyle.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandSignature.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Choose.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityIndicatorState.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Flag.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Ask.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Terminal/Terminal.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Clear/Console+Ephemeral.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Confirm.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Completion.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Option.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Console+Run.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandGroup.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/LoadingBar.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ProgressBar.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityBar.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Clear/Console+Clear.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Clear/ConsoleClear.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/ConsoleLogger.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityIndicatorRenderer.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/Console+Center.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleColor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandError.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/ConsoleError.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityIndicator.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Commands.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Utilities.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/Console+Wait.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleTextFragment.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Argument.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Input.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandInput.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/Console+Output.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleText.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandContext.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Terminal/readpassphrase_linux.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/CustomActivity.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.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/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.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/IOKit.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 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP2.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_Vapor3.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHPACK.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/GraphQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CJWTKitBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FCM.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/BSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FineJSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWT.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOExtrasZlib.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Backtrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CBacktrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolConformance.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Runtime.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombine.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolType.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKittenCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketInfrastructure.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ApodiniDatabase.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtobufferCoding.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Casting.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineDispatch.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Apodini.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKitBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKitten.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTPCompression.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineFoundation.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SwifCron.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_MongoKittenCrypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CURLParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RichJSONParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CMultipartParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMySQLDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQLiteDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMongoDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentPostgresDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTVapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AssociatedTypeRequirementsVisitor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOExtras.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Jobs.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Metrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CoreMetrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTransportServices.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTestUtils.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Yams.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_NIO1APIShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Notifications.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COpenCombineHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ValuePointers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNSwift.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenAPIKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWTKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ConsoleKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RoutingKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MultipartKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncHTTPClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/DNSClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTFluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CContext.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Meow.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.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.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ConsoleKit.build/Output/ConsoleColor~partial.swiftmodule : /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Terminal/ANSI.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Command.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/GenerateAutocompleteCommand.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/AnyCommand.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/String+LevenshteinDistance.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Console.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleStyle.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandSignature.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Choose.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityIndicatorState.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Flag.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Ask.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Terminal/Terminal.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Clear/Console+Ephemeral.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Confirm.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Completion.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Option.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Console+Run.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandGroup.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/LoadingBar.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ProgressBar.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityBar.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Clear/Console+Clear.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Clear/ConsoleClear.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/ConsoleLogger.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityIndicatorRenderer.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/Console+Center.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleColor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandError.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/ConsoleError.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityIndicator.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Commands.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Utilities.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/Console+Wait.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleTextFragment.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Argument.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Input.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandInput.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/Console+Output.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleText.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandContext.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Terminal/readpassphrase_linux.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/CustomActivity.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.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/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.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/IOKit.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 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP2.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_Vapor3.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHPACK.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/GraphQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CJWTKitBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FCM.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/BSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FineJSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWT.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOExtrasZlib.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Backtrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CBacktrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolConformance.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Runtime.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombine.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolType.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKittenCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketInfrastructure.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ApodiniDatabase.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtobufferCoding.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Casting.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineDispatch.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Apodini.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKitBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKitten.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTPCompression.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineFoundation.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SwifCron.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_MongoKittenCrypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CURLParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RichJSONParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CMultipartParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMySQLDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQLiteDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMongoDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentPostgresDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTVapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AssociatedTypeRequirementsVisitor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOExtras.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Jobs.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Metrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CoreMetrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTransportServices.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTestUtils.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Yams.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_NIO1APIShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Notifications.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COpenCombineHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ValuePointers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNSwift.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenAPIKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWTKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ConsoleKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RoutingKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MultipartKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncHTTPClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/DNSClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTFluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CContext.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Meow.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.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.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ConsoleKit.build/Output/ConsoleColor~partial.swiftdoc : /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Terminal/ANSI.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Command.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/GenerateAutocompleteCommand.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/AnyCommand.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/String+LevenshteinDistance.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Console.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleStyle.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandSignature.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Choose.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityIndicatorState.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Flag.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Ask.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Terminal/Terminal.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Clear/Console+Ephemeral.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Confirm.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Completion.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Option.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Console+Run.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandGroup.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/LoadingBar.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ProgressBar.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityBar.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Clear/Console+Clear.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Clear/ConsoleClear.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/ConsoleLogger.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityIndicatorRenderer.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/Console+Center.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleColor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandError.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/ConsoleError.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityIndicator.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Commands.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Utilities.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/Console+Wait.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleTextFragment.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Argument.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Input.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandInput.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/Console+Output.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleText.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandContext.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Terminal/readpassphrase_linux.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/CustomActivity.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.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/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.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/IOKit.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 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP2.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_Vapor3.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHPACK.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/GraphQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CJWTKitBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FCM.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/BSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FineJSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWT.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOExtrasZlib.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Backtrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CBacktrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolConformance.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Runtime.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombine.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolType.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKittenCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketInfrastructure.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ApodiniDatabase.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtobufferCoding.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Casting.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineDispatch.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Apodini.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKitBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKitten.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTPCompression.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineFoundation.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SwifCron.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_MongoKittenCrypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CURLParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RichJSONParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CMultipartParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMySQLDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQLiteDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMongoDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentPostgresDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTVapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AssociatedTypeRequirementsVisitor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOExtras.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Jobs.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Metrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CoreMetrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTransportServices.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTestUtils.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Yams.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_NIO1APIShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Notifications.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COpenCombineHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ValuePointers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNSwift.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenAPIKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWTKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ConsoleKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RoutingKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MultipartKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncHTTPClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/DNSClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTFluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CContext.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Meow.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.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.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ConsoleKit.build/Output/ConsoleColor~partial.swiftsourceinfo : /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Terminal/ANSI.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Command.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/GenerateAutocompleteCommand.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/AnyCommand.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/String+LevenshteinDistance.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Console.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleStyle.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandSignature.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Choose.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityIndicatorState.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Flag.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Ask.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Terminal/Terminal.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Clear/Console+Ephemeral.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Confirm.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Completion.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Option.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Console+Run.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandGroup.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/LoadingBar.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ProgressBar.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityBar.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Clear/Console+Clear.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Clear/ConsoleClear.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/ConsoleLogger.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityIndicatorRenderer.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/Console+Center.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleColor.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandError.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Utilities/ConsoleError.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/ActivityIndicator.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Commands.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Utilities.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/Console+Wait.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleTextFragment.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/Argument.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Input/Console+Input.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandInput.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/Console+Output.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Output/ConsoleText.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandContext.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Terminal/readpassphrase_linux.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/checkouts/console-kit/Sources/ConsoleKit/Activity/CustomActivity.swift /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.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/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.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/IOKit.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 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTP2.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_Vapor3.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHPACK.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/GraphQL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CJWTKitBoringSSL.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FCM.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/BSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FineJSON.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresNIO.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNS.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWT.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOExtrasZlib.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Backtrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CBacktrace.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolConformance.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Runtime.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombine.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtocolType.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKittenCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoCore.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketInfrastructure.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ApodiniDatabase.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ProtobufferCoding.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Casting.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineDispatch.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Apodini.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKitBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoKitten.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOHTTPCompression.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenCombineFoundation.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SwifCron.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_MongoKittenCrypto.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CURLParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RichJSONParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CMultipartParser.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMySQLDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentSQLiteDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentMongoDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentPostgresDriver.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTVapor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AssociatedTypeRequirementsVisitor.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOExtras.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Jobs.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Metrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CoreMetrics.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTransportServices.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOTestUtils.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Yams.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/_NIO1APIShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CCryptoBoringSSLShims.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Notifications.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/COpenCombineHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ValuePointers.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/APNSwift.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/OpenAPIKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MySQLKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/JWTKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/ConsoleKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/SQLiteKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/RoutingKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/PostgresKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/WebSocketKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/FluentKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MultipartKit.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/AsyncHTTPClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/DNSClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/MongoClient.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/XCTFluent.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CContext.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/Meow.build/module.modulemap /Users/sadikekinozbay/Documents/TUM/WS-2/Swift/Apodini-Example-Project/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.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.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
import std.stdio;
import std.range;
import std.math;
import std.conv;
import std.string;
bool isPrime(int x)
{
if (x == 2)
return(true);
else if (x % 2 == 0 || x < 2)
return(false);
else
{
foreach(i; 3..sqrt(cast(float)x) + 1)
{
if (x % i == 0)
return(false);
}
return(true);
}
}
void main()
{
string line = stdin.readln();
if (isPrime(to!int(chomp(line))))
writeln("Yes");
else
writeln("No");
}
|
D
|
E: c51, c17, c66, c4, c11, c63, c37, c69, c77, c43, c2, c13, c28, c39, c30, c60, c40, c24, c31, c27, c68, c49, c74, c56, c84, c58, c23, c7, c26, c35, c0, c44, c19, c59, c12, c72, c42, c38, c67, c14, c33, c29, c83, c55, c76, c36, c20.
p7(E,E)
c51,c17
c11,c63
c2,c13
c63,c30
c31,c51
c28,c39
c66,c4
c26,c26
c44,c19
c84,c30
c60,c40
c74,c49
c42,c28
c7,c28
c17,c56
c83,c55
c43,c77
c68,c27
c23,c58
c43,c38
.
p0(E,E)
c66,c4
c43,c77
c28,c39
c60,c40
c24,c37
c84,c30
c59,c12
c66,c72
c23,c58
c14,c33
c44,c19
.
p5(E,E)
c37,c69
c27,c68
c49,c74
c28,c7
c63,c11
c31,c0
c51,c31
c17,c51
c13,c2
c63,c43
c26,c26
c28,c42
.
p9(E,E)
c77,c43
c37,c69
c58,c23
c63,c11
c4,c66
c31,c0
c56,c17
c13,c2
c51,c31
c38,c67
c38,c43
c72,c66
c28,c7
c30,c63
c39,c28
c28,c42
c63,c43
c49,c74
c17,c51
c33,c14
c12,c59
c55,c83
.
p4(E,E)
c66,c56
c66,c35
c84,c66
c23,c29
c28,c63
c44,c76
c24,c44
c14,c19
c60,c36
c43,c14
c59,c20
.
|
D
|
PLONG PLAT ED95 KD LOMAGAGE HIMAGAGE SLAT SLONG RESULTNO DP DM ROCKTYPE
309 80 2 0 35 56 72 -112 1699 3.79999995 3.9000001 intrusives, diabase
217 85 16 60 35 56 72 -112 1697 31 31 extrusives, basalt
177.399994 83.5 8.39999962 14.6999998 44 49 44.5 -110 2014 10.1000004 10.1000004 extrusives
|
D
|
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/MDK/Templates/Inc/stm32f4xx_hal_conf.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/Development\ Studio\ Workspace/BaseProject_2020_08_04/RTE/RTE_Components.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/Core/Include/core_cm4.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/Core/Include/cmsis_version.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/Core/Include/cmsis_compiler.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/Core/Include/cmsis_armcc.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/Core/Include/mpu_armv7.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c_ex.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s_ex.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h
RTE/Device/STM32F407VGTx/stm32f4xx_hal_dma.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_usart.h
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2006 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 dwtx.jface.dialogs.ControlEnableState;
import dwt.widgets.Composite;
import dwt.widgets.Control;
import dwt.dwthelper.utils;
import dwtx.dwtxhelper.Collection;
/**
* Helper class to save the enable/disable state of a control including all its
* descendent controls.
*/
public class ControlEnableState {
/**
* List of exception controls (element type: <code>Control</code>);
* <code>null</code> if none.
*/
private List exceptions = null;
/**
* List of saved states (element type: <code>ItemState</code>).
*/
private List states;
/**
* Internal class for recording the enable/disable state of a single
* control.
*/
private class ItemState {
/** the control */
protected Control item;
/** the state */
protected bool state;
/**
* Create a new instance of the receiver.
*
* @param item
* @param state
*/
public this(Control item, bool state) {
this.item = item;
this.state = state;
}
/**
* Restore the enabled state to the original value.
*
*/
public void restore() {
if (item is null || item.isDisposed()) {
return;
}
item.setEnabled(state);
}
}
/**
* Creates a new object and saves in it the current enable/disable state of
* the given control and its descendents; the controls that are saved are
* also disabled.
*
* @param w
* the control
*/
protected this(Control w) {
this(w, null);
}
/**
* Creates a new object and saves in it the current enable/disable state of
* the given control and its descendents except for the given list of
* exception cases; the controls that are saved are also disabled.
*
* @param w
* the control
* @param exceptions
* the list of controls to not disable (element type:
* <code>Control</code>), or <code>null</code> if none
*/
protected this(Control w, List exceptions) {
// super();
states = new ArrayList();
this.exceptions = exceptions;
readStateForAndDisable(w);
}
/**
* Saves the current enable/disable state of the given control and its
* descendents in the returned object; the controls are all disabled.
*
* @param w
* the control
* @return an object capturing the enable/disable state
*/
public static ControlEnableState disable(Control w) {
return new ControlEnableState(w);
}
/**
* Saves the current enable/disable state of the given control and its
* descendents in the returned object except for the given list of exception
* cases; the controls that are saved are also disabled.
*
* @param w
* the control
* @param exceptions
* the list of controls to not disable (element type:
* <code>Control</code>)
* @return an object capturing the enable/disable state
*/
public static ControlEnableState disable(Control w, List exceptions) {
return new ControlEnableState(w, exceptions);
}
/**
* Recursively reads the enable/disable state for the given window and
* disables all controls.
* @param control Control
*/
private void readStateForAndDisable(Control control) {
if ((exceptions !is null && exceptions.contains(control))) {
return;
}
if (auto c = cast(Composite)control ) {
Control[] children = c.getChildren();
for (int i = 0; i < children.length; i++) {
readStateForAndDisable(children[i]);
}
}
// XXX: Workaround for 1G2Q8SS: ITPUI:Linux - Combo box is not enabled
// in "File->New->Solution"
states.add(new ItemState(control, control.getEnabled()));
control.setEnabled(false);
}
/**
* Restores the window enable state saved in this object.
*/
public void restore() {
int size = states.size();
for (int i = 0; i < size; i++) {
(cast(ItemState) states.get(i)).restore();
}
}
}
|
D
|
/Users/brunodaluz/Desktop/project/Build/Intermediates/project.build/Debug/Async.build/Objects-normal/x86_64/AsyncError.o : /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Async+NIO.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Variadic.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Deprecated.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Void.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/FutureType.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Collection+Future.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+DoCatch.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Global.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Transform.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Flatten.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Map.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Worker.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/QueueHandler.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/AsyncError.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Exports.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /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/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/cpp_magic.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIODarwin/include/c_nio_darwin.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/c-atomics.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOLinux/include/c_nio_linux.h /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOSHA1/module.modulemap /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio-zlib-support.git-4597058737275259177/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIODarwin/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOAtomics/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOLinux/module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
/Users/brunodaluz/Desktop/project/Build/Intermediates/project.build/Debug/Async.build/Objects-normal/x86_64/AsyncError~partial.swiftmodule : /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Async+NIO.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Variadic.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Deprecated.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Void.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/FutureType.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Collection+Future.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+DoCatch.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Global.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Transform.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Flatten.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Map.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Worker.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/QueueHandler.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/AsyncError.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Exports.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /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/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/cpp_magic.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIODarwin/include/c_nio_darwin.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/c-atomics.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOLinux/include/c_nio_linux.h /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOSHA1/module.modulemap /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio-zlib-support.git-4597058737275259177/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIODarwin/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOAtomics/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOLinux/module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
/Users/brunodaluz/Desktop/project/Build/Intermediates/project.build/Debug/Async.build/Objects-normal/x86_64/AsyncError~partial.swiftdoc : /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Async+NIO.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Variadic.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Deprecated.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Void.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/FutureType.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Collection+Future.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+DoCatch.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Global.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Transform.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Flatten.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Future+Map.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Worker.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/QueueHandler.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/AsyncError.swift /Users/brunodaluz/Desktop/project/.build/checkouts/core.git-3993699855654508100/Sources/Async/Exports.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /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/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/cpp_magic.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIODarwin/include/c_nio_darwin.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/c-atomics.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOLinux/include/c_nio_linux.h /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOSHA1/module.modulemap /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio-zlib-support.git-4597058737275259177/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIODarwin/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOAtomics/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOLinux/module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
|
D
|
.hd ctor "character to real conversion" 03/23/80
real function ctor (str, i)
character str (ARB)
integer i
.sp
Library: vswtlb (standard Subsystem library)
.fs
'Ctor' is similar in function to 'ctoi', except that it
converts floating point numbers as well as integers.
The character
string in 'str' is examined starting in position 'i'.
Conversion stops when a character is encountered
that cannot correctly appear in the number.
'I' is updated to point to the first character not
included in the converted number.
The value returned by the function is the real (single precision)
value of the character string.
.sp
The number in 'str' may contain a leading sign, a
decimal point, and an exponent. A decimal point
is not required.
.im
'Ctod' is called to convert the character string into
a double precision value. This value is converted to
single precision format and returned as
the value of 'ctor'.
.am
i
.ca
ctod
.sa
input (2), other conversion routines ('cto?*' and '?*toc') (2)
|
D
|
module raytracing.surfaces.sphere;
import std.stdio;
import std.math;
import raytracing.surfaces.surface;
import raytracing.ray;
import raytracing.box;
import raytracing.vector;
import raytracing.material;
import raytracing.scene;
class Sphere : Surface
{
Material material;
Vector3!double center;
double radius;
this()
{
}
this(ref Vector3!double _center, double _radius)
{
center = _center;
radius = _radius;
}
this(Vector3!double _center, double _radius)
{
center = _center;
radius = _radius;
}
this(double cX, double cY, double cZ, double _radius)
{
center.x = cX;
center.y = cY;
center.z = cZ;
radius = _radius;
}
override bool hit(const ref Ray r, double p0, double p1, ref HitInfo hitInfo)
{
Vector3!double eMinusC = r.e - center;
double dot_d_eMinusC = dot(r.d, eMinusC);
auto discriminant = dot_d_eMinusC * dot_d_eMinusC - dot(r.d, r.d) * (dot(eMinusC, eMinusC) - radius * radius);
if( discriminant >= 0 )
{
//double t1 = (dot(-d, e-c) + sqrt(discriminant)) / dot(d, d);
double t2 = (dot(-r.d, eMinusC) - sqrt(discriminant)) / dot(r.d, r.d);
// TODO: don't forget to change this if needed
if( t2 < p0 || t2 > p1 )
return false;
hitInfo.t = t2;
hitInfo.hitPoint = r.e + r.d * t2;
hitInfo.ray = r.d;
hitInfo.surfaceNormal = (hitInfo.hitPoint - center) * 2;
hitInfo.hitSurface = this;
}
return discriminant >= 0;
}
override Box boundingBox() const
{
auto min = Vector3!double(center.x - radius, center.y - radius, center.z - radius);
auto max = Vector3!double(center.x + radius, center.y + radius, center.z + radius);
Box b = {min, max};
return b;
}
override Vector3!float shade(const ref HitInfo hitInfo, ref Scene scene) const
{
return material.shade(hitInfo, scene);
}
/// returns true when this Sphere intersects with the Sphere s
bool intersects(const ref Sphere s)
{
double distance = sqrt( (center.x - s.center.x) * (center.x - s.center.x) +
(center.y - s.center.y) * (center.y - s.center.y) +
(center.z - s.center.z) * (center.z - s.center.z));
return distance <= radius + s.radius;
}
}
|
D
|
/Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/Hero.build/Objects-normal/x86_64/HeroPlugin.o : /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroModifier+Advanced.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroCompatible.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroModifier+HeroStringConvertible.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/HeroStringConvertible.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+UIViewControllerTransitioningDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+UINavigationControllerDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+UITabBarControllerDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroViewControllerDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+Animate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransitionState.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroTargetState.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+Complete.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+Interactive.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Debug\ Plugin/HeroDebugPlugin.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroPlugin.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+CustomTransition.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/CG+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/DispatchQueue+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/CAMediaTimingFunction+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/UIViewController+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/CALayer+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/UIKit+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/UIView+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/Array+HeroModifier.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroModifier.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroProgressRunner.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/Parser.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/Lexer.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/SourcePreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/CascadePreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/BasePreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/MatchPreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/ConditionalPreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/DefaultAnimationPreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/IgnoreSubviewModifiersPreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Animator/HeroDefaultAnimator.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/Nodes.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroTypes.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+Start.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/SwiftSupport.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroContext.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Animator/HeroCoreAnimationViewContext.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Animator/HeroAnimatorViewContext.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Animator/HeroViewPropertyViewContext.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Debug\ Plugin/HeroDebugView.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/Regex.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/ModelIO.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/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/MetalKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/radibarq/developer/NasaInArabic/Pods/Target\ Support\ Files/Hero/Hero-umbrella.h /Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/Hero.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/ModelIO.framework/Headers/ModelIO.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MetalKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/Hero.build/Objects-normal/x86_64/HeroPlugin~partial.swiftmodule : /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroModifier+Advanced.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroCompatible.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroModifier+HeroStringConvertible.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/HeroStringConvertible.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+UIViewControllerTransitioningDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+UINavigationControllerDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+UITabBarControllerDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroViewControllerDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+Animate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransitionState.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroTargetState.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+Complete.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+Interactive.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Debug\ Plugin/HeroDebugPlugin.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroPlugin.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+CustomTransition.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/CG+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/DispatchQueue+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/CAMediaTimingFunction+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/UIViewController+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/CALayer+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/UIKit+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/UIView+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/Array+HeroModifier.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroModifier.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroProgressRunner.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/Parser.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/Lexer.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/SourcePreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/CascadePreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/BasePreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/MatchPreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/ConditionalPreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/DefaultAnimationPreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/IgnoreSubviewModifiersPreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Animator/HeroDefaultAnimator.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/Nodes.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroTypes.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+Start.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/SwiftSupport.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroContext.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Animator/HeroCoreAnimationViewContext.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Animator/HeroAnimatorViewContext.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Animator/HeroViewPropertyViewContext.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Debug\ Plugin/HeroDebugView.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/Regex.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/ModelIO.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/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/MetalKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/radibarq/developer/NasaInArabic/Pods/Target\ Support\ Files/Hero/Hero-umbrella.h /Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/Hero.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/ModelIO.framework/Headers/ModelIO.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MetalKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/Hero.build/Objects-normal/x86_64/HeroPlugin~partial.swiftdoc : /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroModifier+Advanced.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroCompatible.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroModifier+HeroStringConvertible.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/HeroStringConvertible.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+UIViewControllerTransitioningDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+UINavigationControllerDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+UITabBarControllerDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroViewControllerDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+Animate.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransitionState.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroTargetState.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+Complete.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+Interactive.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Debug\ Plugin/HeroDebugPlugin.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroPlugin.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+CustomTransition.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/CG+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/DispatchQueue+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/CAMediaTimingFunction+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/UIViewController+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/CALayer+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/UIKit+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/UIView+Hero.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Extensions/Array+HeroModifier.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroModifier.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroProgressRunner.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/Parser.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/Lexer.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/SourcePreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/CascadePreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/BasePreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/MatchPreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/ConditionalPreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/DefaultAnimationPreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Preprocessors/IgnoreSubviewModifiersPreprocessor.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Animator/HeroDefaultAnimator.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/Nodes.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroTypes.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Transition/HeroTransition+Start.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/SwiftSupport.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/HeroContext.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Animator/HeroCoreAnimationViewContext.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Animator/HeroAnimatorViewContext.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Animator/HeroViewPropertyViewContext.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Debug\ Plugin/HeroDebugView.swift /Users/radibarq/developer/NasaInArabic/Pods/Hero/Sources/Parser/Regex.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/ModelIO.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/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/MetalKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/radibarq/developer/NasaInArabic/Pods/Target\ Support\ Files/Hero/Hero-umbrella.h /Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/Hero.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/ModelIO.framework/Headers/ModelIO.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MetalKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.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.bpmn.model.MapExceptionEntry;
class MapExceptionEntry {
protected string errorCode;
protected string className;
protected bool andChildren;
protected string rootCause;
this(){
}
this(string errorCode, string className, bool andChildren, string rootCause) {
this.errorCode = errorCode;
this.className = className;
this.andChildren = andChildren;
this.rootCause = rootCause;
}
public string getErrorCode() {
return errorCode;
}
public void setErrorCode(string errorCode) {
this.errorCode = errorCode;
}
public string getClassName() {
return className;
}
public void setClassName(string className) {
this.className = className;
}
public bool isAndChildren() {
return andChildren;
}
public void setAndChildren(bool andChildren) {
this.andChildren = andChildren;
}
public string getRootCause() {
return rootCause;
}
public void setRootCause(string rootCause) {
this.rootCause = rootCause;
}
}
|
D
|
module s2.util.container.rbtree_map;
import std.container.rbtree;
import std.algorithm : map;
import std.functional : binaryFun;
import std.meta : allSatisfy;
import std.range : ElementType, isInputRange;
import std.traits : isDynamicArray, isImplicitlyConvertible;
/**
* A dictionary or associative array backed by a Red-Black tree.
*/
final class RBTreeMap(KeyT, ValueT, alias KeyLessF = "a < b", bool allowDuplicates = false) {
public:
static struct Pair {
KeyT key;
ValueT value;
}
alias keyLess = binaryFun!KeyLessF;
alias RedBlackTreeT =
RedBlackTree!(Pair, (pair1, pair2) => keyLess(pair1.key, pair2.key), allowDuplicates);
RedBlackTreeT rbTree;
// Forward compatible methods like: empty(), length(), opSlice(), etc.
alias rbTree this;
this() {
rbTree = new RedBlackTreeT();
}
this(Pair[] elems...) {
rbTree = new RedBlackTreeT(elems);
}
this(PairRange)(PairRange pairRange)
if (isInputRange!PairRange && isImplicitlyConvertible!(ElementType!PairRange, Pair)) {
rbTree = new RedBlackTreeT(pairRange);
}
override
bool opEquals(Object rhs) {
RBTreeMap that = cast(RBTreeMap) rhs;
if (that is null) return false;
return rbTree == that.rbTree;
}
/// Insertion
size_t stableInsert(K, V)(K key, V value)
if (isImplicitlyConvertible!(K, KeyT) && isImplicitlyConvertible!(V, ValueT)) {
return rbTree.stableInsert(Pair(key, value));
}
alias insert = stableInsert;
ValueT opIndexAssign(ValueT value, KeyT key) {
rbTree.stableInsert(Pair(key, value));
return value;
}
/// Membership
bool opBinaryRight(string op)(KeyT key) const
if (op == "in") {
return Pair(key) in rbTree;
}
/// Removal
size_t removeKey(K...)(K keys)
if (allSatisfy!(isImplicitlyConvertibleToKey, K)) {
KeyT[K.length] toRemove = [keys];
return removeKey(toRemove[]);
}
//Helper for removeKey.
private template isImplicitlyConvertibleToKey(K)
{
enum isImplicitlyConvertibleToKey = isImplicitlyConvertible!(K, KeyT);
}
size_t removeKey(K)(K[] keys)
if (isImplicitlyConvertible!(K, KeyT)) {
auto keyPairs = keys.map!(key => Pair(key));
return rbTree.removeKey(keyPairs);
}
size_t removeKey(KeyRange)(KeyRange keyRange)
if (isInputRange!KeyRange
&& isImplicitlyConvertible!(ElementType!KeyRange, KeyT)
&& !isDynamicArray!KeyRange) {
auto keyPairs = keys.map(key => Pair(key));
return rbTree.removeKey(keyPairs);
}
/// Ranges
RedBlackTreeT.Range upperBound(KeyT key) {
return rbTree.upperBound(Pair(key));
}
RedBlackTreeT.ConstRange upperBound(KeyT key) const {
return rbTree.upperBound(Pair(key));
}
RedBlackTreeT.ImmutableRange upperBound(KeyT key) immutable {
return rbTree.upperBound(Pair(key));
}
RedBlackTreeT.Range lowerBound(KeyT key) {
return rbTree.lowerBound(Pair(key));
}
RedBlackTreeT.ConstRange lowerBound(KeyT key) const {
return rbTree.lowerBound(Pair(key));
}
RedBlackTreeT.ImmutableRange lowerBound(KeyT key) immutable {
return rbTree.lowerBound(Pair(key));
}
auto equalRange(KeyT key) {
return rbTree.equalRange(Pair(key));
}
}
|
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_21_agm-9315994127.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_21_agm-9315994127.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
|
D
|
module dbal.defined;
import dbal;
enum JoinMethod : string {
InnerJoin = " INNER JOIN ",
LeftJoin = " LEFT JOIN ",
RightJoin = " RIGHT JOIN ",
FullJoin = " FULL JOIN ",
CrossJoin = " CROSS JOIN ",
}
enum Method : string {
Select = " SELECT ",
Insert = " INSERT ",
Update = " UPDATE ",
Delete = " DELETE FROM",
Count = " SELECT count(*) FROM "
}
enum Relation : string {
And = " AND ",
Or = " OR "
}
enum CompareType : string {
eq = " = ",
ne = " != ",
gt = " > ",
lt = " < ",
ge = " >= ",
le = " <= ",
eqnull = " is ",
nenull = " is not ",
like = " like "
}
|
D
|
/*
* Copyright (c) 2004-2008 Derelict Developers
* 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 names 'Derelict', 'DerelictGL', 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.
*/
module derelict.opengl.glext;
public
{
// ARB
import derelict.opengl.extension.arb.color_buffer_float;
import derelict.opengl.extension.arb.depth_texture;
import derelict.opengl.extension.arb.draw_buffers;
import derelict.opengl.extension.arb.pixel_buffer_object;
import derelict.opengl.extension.arb.fragment_program;
import derelict.opengl.extension.arb.fragment_program_shadow;
import derelict.opengl.extension.arb.fragment_shader;
import derelict.opengl.extension.arb.half_float_pixel;
import derelict.opengl.extension.arb.matrix_palette;
import derelict.opengl.extension.arb.multisample;
import derelict.opengl.extension.arb.multitexture;
import derelict.opengl.extension.arb.occlusion_query;
import derelict.opengl.extension.arb.pixel_buffer_object;
import derelict.opengl.extension.arb.point_parameters;
import derelict.opengl.extension.arb.point_sprite;
import derelict.opengl.extension.arb.shader_objects;
import derelict.opengl.extension.arb.shading_language_100;
import derelict.opengl.extension.arb.shadow;
import derelict.opengl.extension.arb.shadow_ambient;
import derelict.opengl.extension.arb.texture_border_clamp;
import derelict.opengl.extension.arb.texture_compression;
import derelict.opengl.extension.arb.texture_cube_map;
import derelict.opengl.extension.arb.texture_env_add;
import derelict.opengl.extension.arb.texture_env_combine;
import derelict.opengl.extension.arb.texture_env_crossbar;
import derelict.opengl.extension.arb.texture_env_dot3;
import derelict.opengl.extension.arb.texture_float;
import derelict.opengl.extension.arb.texture_mirrored_repeat;
import derelict.opengl.extension.arb.texture_non_power_of_two;
import derelict.opengl.extension.arb.texture_rectangle;
import derelict.opengl.extension.arb.transpose_matrix;
import derelict.opengl.extension.arb.vertex_blend;
import derelict.opengl.extension.arb.vertex_buffer_object;
import derelict.opengl.extension.arb.vertex_program;
import derelict.opengl.extension.arb.vertex_shader;
import derelict.opengl.extension.arb.window_pos;
// EXT
import derelict.opengl.extension.ext.Cg_shader;
import derelict.opengl.extension.ext.abgr;
import derelict.opengl.extension.ext.bgra;
import derelict.opengl.extension.ext.blend_color;
import derelict.opengl.extension.ext.blend_equation_separate;
import derelict.opengl.extension.ext.blend_func_separate;
import derelict.opengl.extension.ext.blend_minmax;
import derelict.opengl.extension.ext.blend_subtract;
import derelict.opengl.extension.ext.clip_volume_hint;
import derelict.opengl.extension.ext.cmyka;
import derelict.opengl.extension.ext.color_subtable;
import derelict.opengl.extension.ext.compiled_vertex_array;
import derelict.opengl.extension.ext.convolution;
import derelict.opengl.extension.ext.coordinate_frame;
import derelict.opengl.extension.ext.cull_vertex;
import derelict.opengl.extension.ext.depth_bounds_test;
import derelict.opengl.extension.ext.draw_buffers2;
import derelict.opengl.extension.ext.draw_instanced;
import derelict.opengl.extension.ext.draw_range_elements;
import derelict.opengl.extension.ext.fog_coord;
import derelict.opengl.extension.ext.four22_pixels;
import derelict.opengl.extension.ext.fragment_lighting;
import derelict.opengl.extension.ext.framebuffer_blit;
import derelict.opengl.extension.ext.framebuffer_multisample;
import derelict.opengl.extension.ext.framebuffer_object;
import derelict.opengl.extension.ext.framebuffer_sRGB;
import derelict.opengl.extension.ext.geometry_shader4;
import derelict.opengl.extension.ext.gpu_program_parameters;
import derelict.opengl.extension.ext.gpu_shader4;
import derelict.opengl.extension.ext.histogram;
import derelict.opengl.extension.ext.light_texture;
import derelict.opengl.extension.ext.misc_attribute;
import derelict.opengl.extension.ext.multi_draw_arrays;
import derelict.opengl.extension.ext.multisample;
import derelict.opengl.extension.ext.packed_depth_stencil;
import derelict.opengl.extension.ext.packed_float;
import derelict.opengl.extension.ext.packed_pixels;
import derelict.opengl.extension.ext.paletted_texture;
import derelict.opengl.extension.ext.pixel_buffer_object;
import derelict.opengl.extension.ext.pixel_transform;
import derelict.opengl.extension.ext.pixel_transform_color_table;
import derelict.opengl.extension.ext.point_parameters;
import derelict.opengl.extension.ext.rescale_normal;
import derelict.opengl.extension.ext.scene_marker;
import derelict.opengl.extension.ext.secondary_color;
import derelict.opengl.extension.ext.separate_specular_color;
import derelict.opengl.extension.ext.shadow_funcs;
import derelict.opengl.extension.ext.shared_texture_palette;
import derelict.opengl.extension.ext.stencil_clear_tag;
import derelict.opengl.extension.ext.stencil_two_side;
import derelict.opengl.extension.ext.stencil_wrap;
import derelict.opengl.extension.ext.texture3D;
import derelict.opengl.extension.ext.texture_array;
import derelict.opengl.extension.ext.texture_buffer_object;
import derelict.opengl.extension.ext.texture_compression_dxt1;
import derelict.opengl.extension.ext.texture_compression_latc;
import derelict.opengl.extension.ext.texture_compression_rgtc;
import derelict.opengl.extension.ext.texture_compression_s3tc;
import derelict.opengl.extension.ext.texture_cube_map;
import derelict.opengl.extension.ext.texture_edge_clamp;
import derelict.opengl.extension.ext.texture_env_add;
import derelict.opengl.extension.ext.texture_env_combine;
import derelict.opengl.extension.ext.texture_env_dot3;
import derelict.opengl.extension.ext.texture_filter_anisotropic;
import derelict.opengl.extension.ext.texture_integer;
import derelict.opengl.extension.ext.texture_lod_bias;
import derelict.opengl.extension.ext.texture_mirror_clamp;
import derelict.opengl.extension.ext.texture_perturb_normal;
import derelict.opengl.extension.ext.texture_rectangle;
import derelict.opengl.extension.ext.texture_sRGB;
import derelict.opengl.extension.ext.timer_query;
import derelict.opengl.extension.ext.vertex_shader;
import derelict.opengl.extension.ext.vertex_weighting;
// ATI
import derelict.opengl.extension.ati.draw_buffers;
import derelict.opengl.extension.ati.element_array;
import derelict.opengl.extension.ati.envmap_bumpmap;
import derelict.opengl.extension.ati.fragment_shader;
import derelict.opengl.extension.ati.map_object_buffer;
import derelict.opengl.extension.ati.pn_triangles;
import derelict.opengl.extension.ati.separate_stencil;
import derelict.opengl.extension.ati.shader_texture_lod;
import derelict.opengl.extension.ati.text_fragment_shader;
import derelict.opengl.extension.ati.texture_compression_3dc;
import derelict.opengl.extension.ati.texture_env_combine3;
import derelict.opengl.extension.ati.texture_float;
import derelict.opengl.extension.ati.texture_mirror_once;
import derelict.opengl.extension.ati.vertex_array_object;
import derelict.opengl.extension.ati.vertex_attrib_array_object;
import derelict.opengl.extension.ati.vertex_streams;
// NV
import derelict.opengl.extension.nv.blend_square;
import derelict.opengl.extension.nv.copy_depth_to_color;
import derelict.opengl.extension.nv.depth_buffer_float;
import derelict.opengl.extension.nv.depth_clamp;
import derelict.opengl.extension.nv.evaluators;
import derelict.opengl.extension.nv.fence;
import derelict.opengl.extension.nv.float_buffer;
import derelict.opengl.extension.nv.fog_distance;
import derelict.opengl.extension.nv.fragment_program;
import derelict.opengl.extension.nv.fragment_program2;
import derelict.opengl.extension.nv.fragment_program4;
import derelict.opengl.extension.nv.fragment_program_option;
import derelict.opengl.extension.nv.framebuffer_multisample_coverage;
import derelict.opengl.extension.nv.geometry_program4;
import derelict.opengl.extension.nv.geometry_shader4;
import derelict.opengl.extension.nv.gpu_program4;
import derelict.opengl.extension.nv.half_float;
import derelict.opengl.extension.nv.light_max_exponent;
import derelict.opengl.extension.nv.multisample_filter_hint;
import derelict.opengl.extension.nv.occlusion_query;
import derelict.opengl.extension.nv.packed_depth_stencil;
import derelict.opengl.extension.nv.parameter_buffer_object;
import derelict.opengl.extension.nv.pixel_data_range;
import derelict.opengl.extension.nv.point_sprite;
import derelict.opengl.extension.nv.primitive_restart;
import derelict.opengl.extension.nv.register_combiners;
import derelict.opengl.extension.nv.register_combiners2;
import derelict.opengl.extension.nv.texgen_emboss;
import derelict.opengl.extension.nv.texgen_reflection;
import derelict.opengl.extension.nv.texture_compression_vtc;
import derelict.opengl.extension.nv.texture_env_combine4;
import derelict.opengl.extension.nv.texture_expand_normal;
import derelict.opengl.extension.nv.texture_rectangle;
import derelict.opengl.extension.nv.texture_shader;
import derelict.opengl.extension.nv.texture_shader2;
import derelict.opengl.extension.nv.texture_shader3;
import derelict.opengl.extension.nv.transform_feedback;
import derelict.opengl.extension.nv.vertex_array_range;
import derelict.opengl.extension.nv.vertex_array_range2;
import derelict.opengl.extension.nv.vertex_program;
import derelict.opengl.extension.nv.vertex_program1_1;
import derelict.opengl.extension.nv.vertex_program2;
import derelict.opengl.extension.nv.vertex_program2_option;
import derelict.opengl.extension.nv.vertex_program3;
import derelict.opengl.extension.nv.vertex_program4;
// HP
import derelict.opengl.extension.hp.convolution_border_modes;
// SGI
import derelict.opengl.extension.sgi.color_matrix;
// SGIS
import derelict.opengl.extension.sgis.generate_mipmap;
} // public
|
D
|
instance GRD_268_Gardist(Npc_Default)
{
name[0] = NAME_Gardist;
npcType = NpcType_MINE_Guard;
guild = GIL_GRD;
level = 15;
voice = 13;
id = 268;
attribute[ATR_STRENGTH] = 80;
attribute[ATR_DEXTERITY] = 60;
attribute[ATR_MANA_MAX] = 0;
attribute[ATR_MANA] = 0;
attribute[ATR_HITPOINTS_MAX] = 250;
attribute[ATR_HITPOINTS] = 250;
Mdl_SetVisual(self,"HUMANS.MDS");
Mdl_ApplyOverlayMds(self,"Humans_Militia.mds");
Mdl_SetVisualBody(self,"hum_body_Naked0",0,1,"Hum_Head_Pony",13,1,grd_armor_m);
B_Scale(self);
Mdl_SetModelFatness(self,0);
fight_tactic = FAI_HUMAN_Strong;
Npc_SetTalentSkill(self,NPC_TALENT_1H,2);
Npc_SetTalentSkill(self,NPC_TALENT_2H,1);
Npc_SetTalentSkill(self,NPC_TALENT_CROSSBOW,1);
EquipItem(self,ItMw_1H_Sword_02);
EquipItem(self,ItRw_Crossbow_01);
CreateInvItems(self,ItAmBolt,30);
CreateInvItem(self,ItFoCheese);
CreateInvItem(self,ItFoApple);
CreateInvItems(self,ItMiNugget,10);
CreateInvItem(self,ItLsTorch);
daily_routine = Rtn_start_268;
};
func void Rtn_start_268()
{
TA_Guard(6,0,23,0,"OM_CAVE1_66");
TA_Guard(23,0,6,0,"OM_CAVE1_66");
};
|
D
|
/*
* Copyright 2008 Google Inc. All Rights Reserved.
* Copyright 2013-2014 Jan Krüger. All Rights Reserved.
* Author: fraser@google.com (Neil Fraser)
* Author: anteru@developer.shelter13.net (Matthaeus G. Chajdas)
* Author: jan@jandoe.de (Jan Krüger)
*
* 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.
*
* Diff Match and Patch
* http://code.google.com/p/google-diff-match-patch/
*/
module app;
import ddmp.diff;
import ddmp.patch;
import ddmp.match;
import core.time;
import std.exception;
import std.stdio;
void testDiffCommonPrefix() {
// Detect any common prefix.
// Null case.
assert(0 == commonPrefix("abc", "xyz"));
// Non-null case.
assert(4 == commonPrefix("1234abcdef", "1234xyz"));
// Whole case.
assert(4 == commonPrefix("1234", "1234xyz"));
}
void testDiffCommonSuffix() {
// Detect any common suffix.
// Null case.
assert(0 == commonSuffix("abc", "xyz"));
// Non-null case.
assert(4 == commonSuffix("abcdef1234", "xyz1234"));
// Whole case.
assert(4 == commonSuffix("1234", "xyz1234"));
}
void testDiffCommonOverlap() {
// Detect any suffix/prefix overlap.
// Null case.
assert(0 == commonOverlap("", "abcd"));
// Whole case.
assert(3 == commonOverlap("abc", "abcd"));
// No overlap.
assert(0 == commonOverlap("123456", "abcd"));
// Overlap.
assert(3 == commonOverlap("123456xxx", "xxxabcd"));
// Unicode.
// Some overly clever languages (C#) may treat ligatures as equal to their
// component letters. E.g. U+FB01 == "fi"
assert(0 == commonOverlap("fi", "\ufb01i"));
}
void testDiffHalfMatch() {
// No match.
{
HalfMatch hm_cmp, hm;
assert(!halfMatch("1234567890", "abcdef", hm_cmp));
}
{
HalfMatch hm_cmp, hm;
assert(!halfMatch("12345", "23", hm_cmp));
}
// Single Match.
{
HalfMatch hm_cmp, hm;
hm.prefix1 = "12"; hm.suffix1 = "90"; hm.prefix2 ="a"; hm.suffix2 = "z"; hm.commonMiddle = "345678";
halfMatch("1234567890", "a345678z", hm_cmp);
assert(hm == hm_cmp);
}
{
HalfMatch hm_cmp, hm;
hm.prefix1 = "a"; hm.suffix1 = "z"; hm.prefix2 ="12"; hm.suffix2 = "90"; hm.commonMiddle = "345678";
halfMatch("a345678z", "1234567890", hm_cmp);
assert(hm == hm_cmp);
}
{
HalfMatch hm_cmp, hm;
hm.prefix1 = "abc"; hm.suffix1 = "z"; hm.prefix2 ="1234"; hm.suffix2 = "0"; hm.commonMiddle = "56789";
assert(halfMatch("abc56789z", "1234567890", hm_cmp));
assert(hm == hm_cmp);
}
{
HalfMatch hm_cmp, hm;
hm.prefix1 = "a"; hm.suffix1 = "xyz"; hm.prefix2 ="1"; hm.suffix2 = "7890"; hm.commonMiddle = "23456";
assert(halfMatch("a23456xyz", "1234567890", hm_cmp));
assert(hm == hm_cmp);
}
// Multiple Matches.
{
HalfMatch hm_cmp, hm;
hm.prefix1 = "12123"; hm.suffix1 = "123121"; hm.prefix2 ="a"; hm.suffix2 = "z"; hm.commonMiddle = "1234123451234";
assert(halfMatch("121231234123451234123121", "a1234123451234z", hm_cmp));
assert(hm == hm_cmp);
}
{
HalfMatch hm_cmp, hm;
hm.prefix1 = ""; hm.suffix1 = "-=-=-=-=-="; hm.prefix2 ="x"; hm.suffix2 = ""; hm.commonMiddle = "x-=-=-=-=-=-=-=";
assert(halfMatch("x-=-=-=-=-=-=-=-=-=-=-=-=", "xx-=-=-=-=-=-=-=", hm_cmp));
assert(hm == hm_cmp);
}
{
HalfMatch hm_cmp, hm;
hm.prefix1 = "-=-=-=-=-="; hm.suffix1 = ""; hm.prefix2 = ""; hm.suffix2 = "y"; hm.commonMiddle = "-=-=-=-=-=-=-=y";
assert(halfMatch("-=-=-=-=-=-=-=-=-=-=-=-=y", "-=-=-=-=-=-=-=yy", hm_cmp));
assert(hm == hm_cmp);
}
}
void testDiffLinesToChars() {
{
LinesToCharsResult result;
result.text1 = "\x01\x02\x01";
result.text2 = "\x02\x01\x02";
result.uniqueStrings = ["", "alpha\n", "beta\n"];
assert(result == linesToChars("alpha\nbeta\nalpha\n", "beta\nalpha\nbeta\n"));
}
{
LinesToCharsResult result;
result.text1 = "";
result.text2 = "\x01\x02\x03\x03";
result.uniqueStrings = ["", "alpha\r\n", "beta\r\n", "\r\n"];
assert(result == linesToChars("", "alpha\r\nbeta\r\n\r\n\r\n"));
}
{
LinesToCharsResult result;
result.text1 = "\x01";
result.text2 = "\x02";
result.uniqueStrings = ["", "a", "b"];
assert(result == linesToChars("a", "b"));
}
}
void testDiffCleanupMerge() {
{
//Null case
Diff[] diffs = [];
cleanupMerge(diffs);
assert([] == diffs);
}
{
// No change case.
Diff[] diffs = [Diff(Operation.EQUAL, "a"), Diff(Operation.DELETE, "b"), Diff(Operation.INSERT, "c")];
cleanupMerge(diffs);
assert([Diff(Operation.EQUAL, "a"), Diff(Operation.DELETE, "b"), Diff(Operation.INSERT, "c")] == diffs);
}
{
// Merge equalities.
Diff[] diffs = [Diff(Operation.EQUAL, "a"), Diff(Operation.EQUAL, "b"), Diff(Operation.EQUAL, "c")];
cleanupMerge(diffs);
assert([Diff(Operation.EQUAL, "abc")] == diffs);
}
{
// Merge deletions.
Diff[] diffs = [Diff(Operation.DELETE, "a"), Diff(Operation.DELETE, "b"), Diff(Operation.DELETE, "c")];
cleanupMerge(diffs);
assert([Diff(Operation.DELETE, "abc")] == diffs);
}
{
// Merge insertions.
Diff[] diffs = [Diff(Operation.INSERT, "a"), Diff(Operation.INSERT, "b"), Diff(Operation.INSERT, "c")];
cleanupMerge(diffs);
assert([Diff(Operation.INSERT, "abc")] == diffs);
}
{
// Merge interweave.
Diff[] diffs = [Diff(Operation.DELETE, "a"), Diff(Operation.INSERT, "b"), Diff(Operation.DELETE, "c"), Diff(Operation.INSERT, "d"), Diff(Operation.EQUAL, "e"), Diff(Operation.EQUAL, "f")];
cleanupMerge(diffs);
assert([Diff(Operation.DELETE, "ac"), Diff(Operation.INSERT, "bd"), Diff(Operation.EQUAL, "ef")] == diffs);
}
{
// Prefix and suffix detection.
Diff[] diffs = [Diff(Operation.DELETE, "a"), Diff(Operation.INSERT, "abc"), Diff(Operation.DELETE, "dc")];
cleanupMerge(diffs);
assert([Diff(Operation.EQUAL, "a"), Diff(Operation.DELETE, "d"), Diff(Operation.INSERT, "b"), Diff(Operation.EQUAL, "c")] == diffs);
}
{
// Prefix and suffix detection with equalities.
Diff[] diffs = [Diff(Operation.EQUAL, "x"), Diff(Operation.DELETE, "a"), Diff(Operation.INSERT, "abc"), Diff(Operation.DELETE, "dc"), Diff(Operation.EQUAL, "y")];
cleanupMerge(diffs);
assert([Diff(Operation.EQUAL, "xa"), Diff(Operation.DELETE, "d"), Diff(Operation.INSERT, "b"), Diff(Operation.EQUAL, "cy")] == diffs);
}
{
// Slide edit left.
Diff[] diffs = [Diff(Operation.EQUAL, "a"), Diff(Operation.INSERT, "ba"), Diff(Operation.EQUAL, "c")];
cleanupMerge(diffs);
assert([Diff(Operation.INSERT, "ab"), Diff(Operation.EQUAL, "ac")] == diffs);
}
{
// Slide edit right.
Diff[] diffs = [Diff(Operation.EQUAL, "c"), Diff(Operation.INSERT, "ab"), Diff(Operation.EQUAL, "a")];
cleanupMerge(diffs);
assert([Diff(Operation.EQUAL, "ca"), Diff(Operation.INSERT, "ba")] == diffs);
}
{
// Slide edit left recursive.
Diff[] diffs = [Diff(Operation.EQUAL, "a"), Diff(Operation.DELETE, "b"), Diff(Operation.EQUAL, "c"), Diff(Operation.DELETE, "ac"), Diff(Operation.EQUAL, "x")];
cleanupMerge(diffs);
assert([Diff(Operation.DELETE, "abc"), Diff(Operation.EQUAL, "acx")] == diffs);
}
{
// Slide edit right recursive.
Diff[] diffs = [Diff(Operation.EQUAL, "x"), Diff(Operation.DELETE, "ca"), Diff(Operation.EQUAL, "c"), Diff(Operation.DELETE, "b"), Diff(Operation.EQUAL, "a")];
cleanupMerge(diffs);
assert([Diff(Operation.EQUAL, "xca"), Diff(Operation.DELETE, "cba")] == diffs);
}
}
void testDiffCleanupSemanticLossless() {
// Slide diffs to match logical boundaries.
{
// Null case.
Diff[] diffs = [];
cleanupSemanticLossless(diffs);
assert([] == diffs);
}
/*{
// Blank lines.
Diff[] diffs = [Diff(Operation.EQUAL, "AAA\r\n\r\nBBB"), Diff(Operation.INSERT, "\r\nDDD\r\n\r\nBBB"), Diff(Operation.EQUAL, "\r\nEEE")];
assert([Diff(Operation.EQUAL, "AAA\r\n\r\n"), Diff(Operation.INSERT, "BBB\r\nDDD\r\n\r\n"), Diff(Operation.EQUAL, "BBB\r\nEEE")] == diffs);
}
*/
{
// Line boundaries.
Diff[] diffs = [Diff(Operation.EQUAL, "AAA\r\nBBB"), Diff(Operation.INSERT, " DDD\r\nBBB"), Diff(Operation.EQUAL, " EEE")];
cleanupSemanticLossless(diffs);
assert([Diff(Operation.EQUAL, "AAA\r\n"), Diff(Operation.INSERT, "BBB DDD\r\n"), Diff(Operation.EQUAL, "BBB EEE")] == diffs);
}
{
// Word boundaries.
Diff[] diffs = [Diff(Operation.EQUAL, "The c"), Diff(Operation.INSERT, "ow and the c"), Diff(Operation.EQUAL, "at.")];
cleanupSemanticLossless(diffs);
assert([Diff(Operation.EQUAL, "The "), Diff(Operation.INSERT, "cow and the "), Diff(Operation.EQUAL, "cat.")] == diffs);
}
{
// Alphanumeric boundaries.
Diff[] diffs = [Diff(Operation.EQUAL, "The-c"), Diff(Operation.INSERT, "ow-and-the-c"), Diff(Operation.EQUAL, "at.")];
cleanupSemanticLossless(diffs);
assert([Diff(Operation.EQUAL, "The-"), Diff(Operation.INSERT, "cow-and-the-"), Diff(Operation.EQUAL, "cat.")] == diffs);
}
{
// Hitting the start.
Diff[] diffs = [Diff(Operation.EQUAL, "a"), Diff(Operation.DELETE, "a"), Diff(Operation.EQUAL, "ax")];
cleanupSemanticLossless(diffs);
assert([Diff(Operation.DELETE, "a"), Diff(Operation.EQUAL, "aax")] == diffs);
}
{
// Hitting the end.
Diff[] diffs = [Diff(Operation.EQUAL, "xa"), Diff(Operation.DELETE, "a"), Diff(Operation.EQUAL, "a")];
cleanupSemanticLossless(diffs);
assert([Diff(Operation.EQUAL, "xaa"), Diff(Operation.DELETE, "a")] == diffs);
}
{
// Sentence boundaries.
Diff[] diffs = [Diff(Operation.EQUAL, "The xxx. The "), Diff(Operation.INSERT, "zzz. The "), Diff(Operation.EQUAL, "yyy.")];
cleanupSemanticLossless(diffs);
assert([Diff(Operation.EQUAL, "The xxx."), Diff(Operation.INSERT, " The zzz."), Diff(Operation.EQUAL, " The yyy.")] == diffs);
}
}
void testDiffCleanupSemantic() {
// Cleanup semantically trivial equalities.
// Null case.
Diff[] diffs;
cleanupSemantic(diffs);
assertEquals([], diffs);
// No elimination #1.
diffs = [Diff(Operation.DELETE, "ab"), Diff(Operation.INSERT, "cd"), Diff(Operation.EQUAL, "12"), Diff(Operation.DELETE, "e")];
cleanupSemantic(diffs);
assertEquals([Diff(Operation.DELETE, "ab"), Diff(Operation.INSERT, "cd"), Diff(Operation.EQUAL, "12"), Diff(Operation.DELETE, "e")], diffs);
// No elimination #2.
diffs = [Diff(Operation.DELETE, "abc"), Diff(Operation.INSERT, "ABC"), Diff(Operation.EQUAL, "1234"), Diff(Operation.DELETE, "wxyz")];
cleanupSemantic(diffs);
assertEquals([Diff(Operation.DELETE, "abc"), Diff(Operation.INSERT, "ABC"), Diff(Operation.EQUAL, "1234"), Diff(Operation.DELETE, "wxyz")], diffs);
// Simple elimination.
diffs = [Diff(Operation.DELETE, "a"), Diff(Operation.EQUAL, "b"), Diff(Operation.DELETE, "c")];
cleanupSemantic(diffs);
assertEquals([Diff(Operation.DELETE, "abc"), Diff(Operation.INSERT, "b")], diffs);
// Backpass elimination.
diffs = [Diff(Operation.DELETE, "ab"), Diff(Operation.EQUAL, "cd"), Diff(Operation.DELETE, "e"), Diff(Operation.EQUAL, "f"), Diff(Operation.INSERT, "g")];
cleanupSemantic(diffs);
assertEquals([Diff(Operation.DELETE, "abcdef"), Diff(Operation.INSERT, "cdfg")], diffs);
// Multiple eliminations.
diffs = [Diff(Operation.INSERT, "1"), Diff(Operation.EQUAL, "A"), Diff(Operation.DELETE, "B"), Diff(Operation.INSERT, "2"), Diff(Operation.EQUAL, "_"), Diff(Operation.INSERT, "1"), Diff(Operation.EQUAL, "A"), Diff(Operation.DELETE, "B"), Diff(Operation.INSERT, "2")];
cleanupSemantic(diffs);
assertEquals([Diff(Operation.DELETE, "AB_AB"), Diff(Operation.INSERT, "1A2_1A2")], diffs);
// Word boundaries.
diffs = [Diff(Operation.EQUAL, "The c"), Diff(Operation.DELETE, "ow and the c"), Diff(Operation.EQUAL, "at.")];
cleanupSemantic(diffs);
assertEquals([Diff(Operation.EQUAL, "The "), Diff(Operation.DELETE, "cow and the "), Diff(Operation.EQUAL, "cat.")], diffs);
// No overlap elimination.
diffs = [Diff(Operation.DELETE, "abcxx"), Diff(Operation.INSERT, "xxdef")];
cleanupSemantic(diffs);
assertEquals([Diff(Operation.DELETE, "abcxx"), Diff(Operation.INSERT, "xxdef")], diffs);
// Overlap elimination.
diffs = [Diff(Operation.DELETE, "abcxxx"), Diff(Operation.INSERT, "xxxdef")];
cleanupSemantic(diffs);
assertEquals([Diff(Operation.DELETE, "abc"), Diff(Operation.EQUAL, "xxx"), Diff(Operation.INSERT, "def")], diffs);
// Reverse overlap elimination.
diffs = [Diff(Operation.DELETE, "xxxabc"), Diff(Operation.INSERT, "defxxx")];
cleanupSemantic(diffs);
assertEquals([Diff(Operation.INSERT, "def"), Diff(Operation.EQUAL, "xxx"), Diff(Operation.DELETE, "abc")], diffs);
// Two overlap eliminations.
diffs = [Diff(Operation.DELETE, "abcd1212"), Diff(Operation.INSERT, "1212efghi"), Diff(Operation.EQUAL, "----"), Diff(Operation.DELETE, "A3"), Diff(Operation.INSERT, "3BC")];
cleanupSemantic(diffs);
assertEquals([Diff(Operation.DELETE, "abcd"), Diff(Operation.EQUAL, "1212"), Diff(Operation.INSERT, "efghi"), Diff(Operation.EQUAL, "----"), Diff(Operation.DELETE, "A"), Diff(Operation.EQUAL, "3"), Diff(Operation.INSERT, "BC")], diffs);
}
void testDiffCleanupEfficiency() {
// Cleanup operationally trivial equalities.
DIFF_EDIT_COST = 4;
// Null case.
Diff[] diffs;
cleanupEfficiency(diffs);
assertEquals([], diffs);
// No elimination.
diffs = [Diff(Operation.DELETE, "ab"), Diff(Operation.INSERT, "12"), Diff(Operation.EQUAL, "wxyz"), Diff(Operation.DELETE, "cd"), Diff(Operation.INSERT, "34")];
cleanupEfficiency(diffs);
assertEquals([Diff(Operation.DELETE, "ab"), Diff(Operation.INSERT, "12"), Diff(Operation.EQUAL, "wxyz"), Diff(Operation.DELETE, "cd"), Diff(Operation.INSERT, "34")], diffs);
// Four-edit elimination.
diffs = [Diff(Operation.DELETE, "ab"), Diff(Operation.INSERT, "12"), Diff(Operation.EQUAL, "xyz"), Diff(Operation.DELETE, "cd"), Diff(Operation.INSERT, "34")];
cleanupEfficiency(diffs);
assertEquals([Diff(Operation.DELETE, "abxyzcd"), Diff(Operation.INSERT, "12xyz34")], diffs);
// Three-edit elimination.
diffs = [Diff(Operation.INSERT, "12"), Diff(Operation.EQUAL, "x"), Diff(Operation.DELETE, "cd"), Diff(Operation.INSERT, "34")];
cleanupEfficiency(diffs);
assertEquals([Diff(Operation.DELETE, "xcd"), Diff(Operation.INSERT, "12x34")], diffs);
// Backpass elimination.
diffs = [Diff(Operation.DELETE, "ab"), Diff(Operation.INSERT, "12"), Diff(Operation.EQUAL, "xy"), Diff(Operation.INSERT, "34"), Diff(Operation.EQUAL, "z"), Diff(Operation.DELETE, "cd"), Diff(Operation.INSERT, "56")];
cleanupEfficiency(diffs);
assertEquals([Diff(Operation.DELETE, "abxyzcd"), Diff(Operation.INSERT, "12xy34z56")], diffs);
// High cost elimination.
DIFF_EDIT_COST = 5;
diffs = [Diff(Operation.DELETE, "ab"), Diff(Operation.INSERT, "12"), Diff(Operation.EQUAL, "wxyz"), Diff(Operation.DELETE, "cd"), Diff(Operation.INSERT, "34")];
cleanupEfficiency(diffs);
assertEquals([Diff(Operation.DELETE, "abwxyzcd"), Diff(Operation.INSERT, "12wxyz34")], diffs);
DIFF_EDIT_COST = 4;
}
/*void testDiffPrettyHtml() {
// Pretty print.
auto diffs = [Diff(Operation.EQUAL, "a\n"), Diff(Operation.DELETE, "<B>b</B>"), Diff(Operation.INSERT, "c&d")];
assertEquals(`<span>a¶<br></span><del style="background:#ffe6e6;"><B>b</B></del><ins style="background:#e6ffe6;">c&d</ins>`, prettyHtml(diffs));
}*/
void testDiffText() {
// Compute the source and destination texts.
auto diffs = [Diff(Operation.EQUAL, "jump"), Diff(Operation.DELETE, "s"), Diff(Operation.INSERT, "ed"), Diff(Operation.EQUAL, " over "), Diff(Operation.DELETE, "the"), Diff(Operation.INSERT, "a"), Diff(Operation.EQUAL, " lazy")];
assertEquals(`jumps over the lazy`, diff_text1(diffs));
assertEquals(`jumped over a lazy`, diff_text2(diffs));
}
void testDiffDelta() {
// Convert a diff into delta string.
auto diffs = [Diff(Operation.EQUAL, "jump"), Diff(Operation.DELETE, "s"), Diff(Operation.INSERT, "ed"), Diff(Operation.EQUAL, " over "), Diff(Operation.DELETE, "the"), Diff(Operation.INSERT, "a"), Diff(Operation.EQUAL, " lazy"), Diff(Operation.INSERT, "old dog")];
auto text1 = diff_text1(diffs);
assertEquals(`jumps over the lazy`, text1);
auto delta = toDelta(diffs);
assertEquals(`=4\t-1\t+ed\t=6\t-3\t+a\t=5\t+old dog`, delta);
// Convert delta string into a diff.
assertEquals(diffs, fromDelta(text1, delta));
// Generates error (19 != 20)
assertThrown(fromDelta(text1 ~ `x`, delta));
// Generates error (19 != 18).
assertThrown(fromDelta(text1[1 .. $], delta));
// Generates error (%c3%xy invalid Unicode).
assertThrown(fromDelta(``, `+%c3%xy`));
// Test deltas with special characters.
diffs = [Diff(Operation.EQUAL, "\u0680 \x00 \t %"), Diff(Operation.DELETE, "\u0681 \x01 \n ^"), Diff(Operation.INSERT, "\u0682 \x02 \\ |")];
text1 = diff_text1(diffs);
assertEquals(`\u0680 \x00 \t %\u0681 \x01 \n ^`, text1);
delta = toDelta(diffs);
assertEquals(`=7\t-7\t+%DA%82 %02 %5C %7C`, delta);
// Convert delta string into a diff.
assertEquals(diffs, fromDelta(text1, delta));
// Verify pool of unchanged characters.
diffs = [Diff(Operation.INSERT, "A-Z a-z 0-9 - _ . ! ~ * \' ( ) ; / ? : @ & = + $ , # ")];
auto text2 = diff_text2(diffs);
assertEquals(`A-Z a-z 0-9 - _ . ! ~ * \' ( ) ; / ? : @ & = + $ , # `, text2);
delta = toDelta(diffs);
assertEquals(`+A-Z a-z 0-9 - _ . ! ~ * \' ( ) ; / ? : @ & = + $ , # `, delta);
// Convert delta string into a diff.
assertEquals(diffs, fromDelta("", delta));
}
void testDiffXIndex() {
// Translate a location in text1 to text2.
// Translation on equality.
assertEquals(5, xIndex([Diff(Operation.DELETE, "a"), Diff(Operation.INSERT, "1234"), Diff(Operation.EQUAL, "xyz")], 2));
// Translation on deletion.
assertEquals(1, xIndex([Diff(Operation.EQUAL, "a"), Diff(Operation.DELETE, "1234"), Diff(Operation.EQUAL, "xyz")], 3));
}
void testDiffLevenshtein() {
// Levenshtein with trailing equality.
assertEquals(4, levenshtein([Diff(Operation.DELETE, "abc"), Diff(Operation.INSERT, "1234"), Diff(Operation.EQUAL, "xyz")]));
// Levenshtein with leading equality.
assertEquals(4, levenshtein([Diff(Operation.EQUAL, "xyz"), Diff(Operation.DELETE, "abc"), Diff(Operation.INSERT, "1234")]));
// Levenshtein with middle equality.
assertEquals(7, levenshtein([Diff(Operation.DELETE, "abc"), Diff(Operation.EQUAL, "xyz"), Diff(Operation.INSERT, "1234")]));
}
void testDiffBisect() {
// Normal.
auto a = "cat";
auto b = "map";
// Since the resulting diff hasn't been normalized, it would be ok if
// the insertion and deletion pairs are swapped.
// If the order changes, tweak this test as required.
assertEquals([Diff(Operation.DELETE, "c"), Diff(Operation.INSERT, "m"), Diff(Operation.EQUAL, "a"), Diff(Operation.DELETE, "t"), Diff(Operation.INSERT, "p")], bisect(a, b, SysTime.max));
// Timeout.
assertEquals([Diff(Operation.DELETE, "cat"), Diff(Operation.INSERT, "map")], bisect(a, b, SysTime(0)));
}
void testDiffMain() {
// Perform a trivial diff.
// Null case.
assertEquals([], diff_main("", "", false));
// Equality.
assertEquals([Diff(Operation.EQUAL, "abc")], diff_main("abc", "abc", false));
// Simple insertion.
assertEquals([Diff(Operation.EQUAL, "ab"), Diff(Operation.INSERT, "123"), Diff(Operation.EQUAL, "c")], diff_main("abc", "ab123c", false));
// Simple deletion.
assertEquals([Diff(Operation.EQUAL, "a"), Diff(Operation.DELETE, "123"), Diff(Operation.EQUAL, "bc")], diff_main("a123bc", "abc", false));
// Two insertions.
assertEquals([Diff(Operation.EQUAL, "a"), Diff(Operation.INSERT, "123"), Diff(Operation.EQUAL, "b"), Diff(Operation.INSERT, "456"), Diff(Operation.EQUAL, "c")], diff_main("abc", "a123b456c", false));
// Two deletions.
assertEquals([Diff(Operation.EQUAL, "a"), Diff(Operation.DELETE, "123"), Diff(Operation.EQUAL, "b"), Diff(Operation.DELETE, "456"), Diff(Operation.EQUAL, "c")], diff_main("a123b456c", "abc", false));
// Perform a real diff.
// Switch off the timeout.
diffTimeout = 0.seconds;
// Simple cases.
assertEquals([Diff(Operation.DELETE, "a"), Diff(Operation.INSERT, "b")], diff_main("a", "b", false));
assertEquals([Diff(Operation.DELETE, "Apple"), Diff(Operation.INSERT, "Banana"), Diff(Operation.EQUAL, "s are a"), Diff(Operation.INSERT, "lso"), Diff(Operation.EQUAL, " fruit.")], diff_main("Apples are a fruit.", "Bananas are also fruit.", false));
assertEquals([Diff(Operation.DELETE, "a"), Diff(Operation.INSERT, "\u0680"), Diff(Operation.EQUAL, "x"), Diff(Operation.DELETE, "\t"), Diff(Operation.INSERT, "\0")], diff_main("ax\t", "\u0680x\0", false));
// Overlaps.
assertEquals([Diff(Operation.DELETE, "1"), Diff(Operation.EQUAL, "a"), Diff(Operation.DELETE, "y"), Diff(Operation.EQUAL, "b"), Diff(Operation.DELETE, "2"), Diff(Operation.INSERT, "xab")], diff_main("1ayb2", "abxab", false));
assertEquals([Diff(Operation.INSERT, "xaxcx"), Diff(Operation.EQUAL, "abc"), Diff(Operation.DELETE, "y")], diff_main("abcy", "xaxcxabc", false));
assertEquals([Diff(Operation.DELETE, "ABCD"), Diff(Operation.EQUAL, "a"), Diff(Operation.DELETE, "="), Diff(Operation.INSERT, "-"), Diff(Operation.EQUAL, "bcd"), Diff(Operation.DELETE, "="), Diff(Operation.INSERT, "-"), Diff(Operation.EQUAL, "efghijklmnopqrs"), Diff(Operation.DELETE, "EFGHIJKLMNOefg")], diff_main("ABCDa=bcd=efghijklmnopqrsEFGHIJKLMNOefg", "a-bcd-efghijklmnopqrs", false));
// Large equality.
assertEquals([Diff(Operation.INSERT, " "), Diff(Operation.EQUAL, "a"), Diff(Operation.INSERT, "nd"), Diff(Operation.EQUAL, " [[Pennsylvania]]"), Diff(Operation.DELETE, " and [[New")], diff_main("a [[Pennsylvania]] and [[New", " and [[Pennsylvania]]", false));
// Timeout.
diffTimeout = 100.msecs;
auto a = "`Twas brillig, and the slithy toves\nDid gyre and gimble in the wabe:\nAll mimsy were the borogoves,\nAnd the mome raths outgrabe.\n";
auto b = "I am the very model of a modern major general,\nI\'ve information vegetable, animal, and mineral,\nI know the kings of England, and I quote the fights historical,\nFrom Marathon to Waterloo, in order categorical.\n";
// Increase the text lengths by 1024 times to ensure a timeout.
foreach (x; 0 .. 10) {
a = a ~ a;
b = b ~ b;
}
auto startTime = Clock.currTime(UTC());
diff_main(a, b);
auto endTime = Clock.currTime(UTC());
// Test that we took at least the timeout period.
assert(diffTimeout <= endTime - startTime);
// Test that we didn't take forever (be forgiving).
// Theoretically this test could fail very occasionally if the
// OS task swaps or locks up for a second at the wrong moment.
// ****
// TODO(fraser): For unknown reasons this is taking 500 ms on Google's
// internal test system. Whereas browsers take 140 ms.
//assert(dmp.Diff_Timeout * 1000 * 2 > endTime - startTime);
// ****
diffTimeout = 0.seconds;
// Test the linemode speedup.
// Must be long to pass the 100 char cutoff.
// Simple line-mode.
a = "1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n";
b = "abcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\n";
assertEquals(diff_main(a, b, false), diff_main(a, b, true));
// Single line-mode.
a = "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
b = "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij";
assertEquals(diff_main(a, b, false), diff_main(a, b, true));
// Overlap line-mode.
a = "1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n";
b = "abcdefghij\n1234567890\n1234567890\n1234567890\nabcdefghij\n1234567890\n1234567890\n1234567890\nabcdefghij\n1234567890\n1234567890\n1234567890\nabcdefghij\n";
//auto texts_linemode = diff_rebuildtexts(diff_main(a, b, true));
//auto texts_textmode = diff_rebuildtexts(diff_main(a, b, false));
//assertEquals(texts_textmode, texts_linemode);
assert(a == b, "TODO"); // ^ unittest missing
// Test null inputs.
assertThrown(diff_main(null, null));
}
// MATCH TEST FUNCTIONS
void testMatchAlphabet() {
// Initialise the bitmasks for Bitap.
// Unique.
assertEquals(['a':4, 'b':2, 'c':1], initAlphabet("abc"));
// Duplicates.
assertEquals(['a':37, 'b':18, 'c':8], initAlphabet("abcaba"));
}
void testMatchBitap() {
// Bitap algorithm.
MATCH_DISTANCE = 100;
MATCH_THRESHOLD = 0.5;
// Exact matches.
assertEquals(5, bitap("abcdefghijk", "fgh", 5));
assertEquals(5, bitap("abcdefghijk", "fgh", 0));
// Fuzzy matches.
assertEquals(4, bitap("abcdefghijk", "efxhi", 0));
assertEquals(2, bitap("abcdefghijk", "cdefxyhijk", 5));
assertEquals(-1, bitap("abcdefghijk", "bxy", 1));
// Overflow.
assertEquals(2, bitap("123456789xx0", "3456789x0", 2));
// Threshold test.
MATCH_THRESHOLD = 0.4;
assertEquals(4, bitap("abcdefghijk", "efxyhi", 1));
MATCH_THRESHOLD = 0.3;
assertEquals(-1, bitap("abcdefghijk", "efxyhi", 1));
MATCH_THRESHOLD = 0.0;
assertEquals(1, bitap("abcdefghijk", "bcdef", 1));
MATCH_THRESHOLD = 0.5;
// Multiple select.
assertEquals(0, bitap("abcdexyzabcde", "abccde", 3));
assertEquals(8, bitap("abcdexyzabcde", "abccde", 5));
// Distance test.
MATCH_DISTANCE = 10; // Strict location.
assertEquals(-1, bitap("abcdefghijklmnopqrstuvwxyz", "abcdefg", 24));
assertEquals(0, bitap("abcdefghijklmnopqrstuvwxyz", "abcdxxefg", 1));
MATCH_DISTANCE = 1000; // Loose location.
assertEquals(0, bitap("abcdefghijklmnopqrstuvwxyz", "abcdefg", 24));
}
void testMatchMain() {
// Full match.
// Shortcut matches.
assertEquals(0, match_main("abcdef", "abcdef", 1000));
assertEquals(-1, match_main("", "abcdef", 1));
assertEquals(3, match_main("abcdef", "", 3));
assertEquals(3, match_main("abcdef", "de", 3));
// Beyond end match.
assertEquals(3, match_main("abcdef", "defy", 4));
// Oversized pattern.
assertEquals(0, match_main("abcdef", "abcdefy", 0));
// Complex match.
assertEquals(4, match_main("I am the very model of a modern major general.", " that berry ", 5));
// Test null inputs.
assertThrown(match_main(null, null, 0));
}
// PATCH TEST FUNCTIONS
void testPatchObj() {
// Patch Object.
Patch p;
p.start1 = 20;
p.start2 = 21;
p.length1 = 18;
p.length2 = 17;
p.diffs = [Diff(Operation.EQUAL, "jump"), Diff(Operation.DELETE, "s"), Diff(Operation.INSERT, "ed"), Diff(Operation.EQUAL, " over "), Diff(Operation.DELETE, "the"), Diff(Operation.INSERT, "a"), Diff(Operation.EQUAL, "\nlaz")];
auto strp = p.toString();
assertEquals("@@ -21,18 +22,17 @@\n jump\n-s\n+ed\n over \n-the\n+a\n %0Alaz\n", strp);
}
void testPatchFromText() {
string strp;
assertEquals([], patch_fromText(strp));
strp = "@@ -21,18 +22,17 @@\n jump\n-s\n+ed\n over \n-the\n+a\n %0Alaz\n";
assertEquals(strp, patch_fromText(strp)[0].toString());
assertEquals("@@ -1 +1 @@\n-a\n+b\n", patch_fromText("@@ -1 +1 @@\n-a\n+b\n")[0].toString());
assertEquals("@@ -1,3 +0,0 @@\n-abc\n", patch_fromText("@@ -1,3 +0,0 @@\n-abc\n")[0].toString());
assertEquals("@@ -0,0 +1,3 @@\n+abc\n", patch_fromText("@@ -0,0 +1,3 @@\n+abc\n")[0].toString());
// Generates error.
assertThrown(patch_fromText("Bad\nPatch\n"));
}
void testPatchToText() {
auto strp = "@@ -21,18 +22,17 @@\n jump\n-s\n+ed\n over \n-the\n+a\n laz\n";
auto p = patch_fromText(strp);
assertEquals(strp, patch_toText(p));
strp = "@@ -1,9 +1,9 @@\n-f\n+F\n oo+fooba\n@@ -7,9 +7,9 @@\n obar\n-,\n+.\n tes\n";
p = patch_fromText(strp);
assertEquals(strp, patch_toText(p));
}
void testPatchAddContext() {
PATCH_MARGIN = 4;
auto p = patch_fromText("@@ -21,4 +21,10 @@\n-jump\n+somersault\n")[0];
addContext(p, "The quick brown fox jumps over the lazy dog.");
assertEquals("@@ -17,12 +17,18 @@\n fox \n-jump\n+somersault\n s ov\n", p.toString());
// Same, but not enough trailing context.
p = patch_fromText("@@ -21,4 +21,10 @@\n-jump\n+somersault\n")[0];
addContext(p, "The quick brown fox jumps.");
assertEquals("@@ -17,10 +17,16 @@\n fox \n-jump\n+somersault\n s.\n", p.toString());
// Same, but not enough leading context.
p = patch_fromText("@@ -3 +3,2 @@\n-e\n+at\n")[0];
addContext(p, "The quick brown fox jumps.");
assertEquals("@@ -1,7 +1,8 @@\n Th\n-e\n+at\n qui\n", p.toString());
// Same, but with ambiguity.
p = patch_fromText("@@ -3 +3,2 @@\n-e\n+at\n")[0];
addContext(p, "The quick brown fox jumps. The quick brown fox crashes.");
assertEquals("@@ -1,27 +1,28 @@\n Th\n-e\n+at\n quick brown fox jumps. \n", p.toString());
}
void testPatchMake() {
// Null case.
auto patches = patch_make("", "");
assertEquals("", patch_toText(patches));
auto text1 = "The quick brown fox jumps over the lazy dog.";
auto text2 = "That quick brown fox jumped over a lazy dog.";
// Text2+Text1 inputs.
auto expectedPatch = "@@ -1,8 +1,7 @@\n Th\n-at\n+e\n qui\n@@ -21,17 +21,18 @@\n jump\n-ed\n+s\n over \n-a\n+the\n laz\n";
// The second patch must be "-21,17 +21,18", not "-22,17 +21,18" due to rolling context.
patches = patch_make(text2, text1);
assertEquals(expectedPatch, patch_toText(patches));
// Text1+Text2 inputs.
expectedPatch = "@@ -1,11 +1,12 @@\n Th\n-e\n+at\n quick b\n@@ -22,18 +22,17 @@\n jump\n-s\n+ed\n over \n-the\n+a\n laz\n";
patches = patch_make(text1, text2);
assertEquals(expectedPatch, patch_toText(patches));
// Diff input.
auto diffs = diff_main(text1, text2, false);
patches = patch_make(diffs);
assertEquals(expectedPatch, patch_toText(patches));
// Text1+Diff inputs.
patches = patch_make(text1, diffs);
assertEquals(expectedPatch, patch_toText(patches));
// Text1+Text2+Diff inputs (deprecated).
//patches = patch_make(text1, text2, diffs);
//assertEquals(expectedPatch, patch_toText(patches));
// Character encoding.
//patches = patch_make("`1234567890-=[]\\;',./', '~!@#$%^&*()_+{}|:\"<>?");
//assertEquals("@@ -1,21 +1,21 @@\n-%601234567890-=%5B%5D%5C;',./\n+~!@#$%25%5E&*()_+%7B%7D%7C:%22%3C%3E?\n", patch_toText(patches));
// FIXME: enable test ^
// Character decoding.
diffs = [Diff(Operation.DELETE, "`1234567890-=[]\\;\',./"), Diff(Operation.INSERT, "~!@#$%^&*()_+{}|:\"<>?")];
assertEquals(diffs, patch_fromText("@@ -1,21 +1,21 @@\n-%601234567890-=%5B%5D%5C;',./\n+~!@#$%25%5E&*()_+%7B%7D%7C:%22%3C%3E?\n")[0].diffs);
// Long string with repeats.
text1 = "";
foreach (x; 0 .. 100) {
text1 ~= "abcdef";
}
text2 = text1 ~ "123";
expectedPatch = "@@ -573,28 +573,31 @@\n cdefabcdefabcdefabcdefabcdef\n+123\n";
patches = patch_make(text1, text2);
assertEquals(expectedPatch, patch_toText(patches));
// Test null inputs.
assertThrown(patch_make(null));
}
void testPatchSplitMax() {
// Assumes that dmp.Match_MaxBits is 32.
auto patches = patch_make("abcdefghijklmnopqrstuvwxyz01234567890", "XabXcdXefXghXijXklXmnXopXqrXstXuvXwxXyzX01X23X45X67X89X0");
splitMax(patches);
assertEquals("@@ -1,32 +1,46 @@\n+X\n ab\n+X\n cd\n+X\n ef\n+X\n gh\n+X\n ij\n+X\n kl\n+X\n mn\n+X\n op\n+X\n qr\n+X\n st\n+X\n uv\n+X\n wx\n+X\n yz\n+X\n 012345\n@@ -25,13 +39,18 @@\n zX01\n+X\n 23\n+X\n 45\n+X\n 67\n+X\n 89\n+X\n 0\n", patch_toText(patches));
patches = patch_make("abcdef1234567890123456789012345678901234567890123456789012345678901234567890uvwxyz", "abcdefuvwxyz");
auto oldToText = patch_toText(patches);
splitMax(patches);
assertEquals(oldToText, patch_toText(patches));
patches = patch_make("1234567890123456789012345678901234567890123456789012345678901234567890", "abc");
splitMax(patches);
assertEquals("@@ -1,32 +1,4 @@\n-1234567890123456789012345678\n 9012\n@@ -29,32 +1,4 @@\n-9012345678901234567890123456\n 7890\n@@ -57,14 +1,3 @@\n-78901234567890\n+abc\n", patch_toText(patches));
//patches = patch_make("abcdefghij , h : 0 , t : 1 abcdefghij , h : 0 , t : 1 abcdefghij , h : 0 , t : 1', 'abcdefghij , h : 1 , t : 1 abcdefghij , h : 1 , t : 1 abcdefghij , h : 0 , t : 1");
//splitMax(patches);
//assertEquals("@@ -2,32 +2,32 @@\n bcdefghij , h : \n-0\n+1\n , t : 1 abcdef\n@@ -29,32 +29,32 @@\n bcdefghij , h : \n-0\n+1\n , t : 1 abcdef\n", patch_toText(patches));
// FIXME: enable test ^
}
void testPatchAddPadding() {
// Both edges full.
auto patches = patch_make("", "test");
assertEquals("@@ -0,0 +1,4 @@\n+test\n", patch_toText(patches));
addPadding(patches);
assertEquals("@@ -1,8 +1,12 @@\n %01%02%03%04\n+test\n %01%02%03%04\n", patch_toText(patches));
// Both edges partial.
patches = patch_make("XY", "XtestY");
assertEquals("@@ -1,2 +1,6 @@\n X\n+test\n Y\n", patch_toText(patches));
addPadding(patches);
assertEquals("@@ -2,8 +2,12 @@\n %02%03%04X\n+test\n Y%01%02%03\n", patch_toText(patches));
// Both edges none.
patches = patch_make("XXXXYYYY", "XXXXtestYYYY");
assertEquals("@@ -1,8 +1,12 @@\n XXXX\n+test\n YYYY\n", patch_toText(patches));
addPadding(patches);
assertEquals("@@ -5,8 +5,12 @@\n XXXX\n+test\n YYYY\n", patch_toText(patches));
}
void testPatchApply() {
MATCH_DISTANCE = 1000;
MATCH_THRESHOLD = 0.5;
PATCH_DELETE_THRESHOLD = 0.5;
// Null case.
auto patches = patch_make("", "");
auto results = apply(patches, "Hello world.");
assertEquals(PatchApplyResult("Hello world.", []), results);
// Exact match.
patches = patch_make("The quick brown fox jumps over the lazy dog.", "That quick brown fox jumped over a lazy dog.");
results = apply(patches, "The quick brown fox jumps over the lazy dog.");
assertEquals(PatchApplyResult("That quick brown fox jumped over a lazy dog.", [true, true]), results);
// Partial match.
results = apply(patches, "The quick red rabbit jumps over the tired tiger.");
assertEquals(PatchApplyResult("That quick red rabbit jumped over a tired tiger.", [true, true]), results);
// Failed match.
results = apply(patches, "I am the very model of a modern major general.");
assertEquals(PatchApplyResult("I am the very model of a modern major general.", [false, false]), results);
// Big delete, small change.
patches = patch_make("x1234567890123456789012345678901234567890123456789012345678901234567890y", "xabcy");
results = apply(patches, "x123456789012345678901234567890-----++++++++++-----123456789012345678901234567890y");
assertEquals(PatchApplyResult("xabcy", [true, true]), results);
// Big delete, big change 1.
patches = patch_make("x1234567890123456789012345678901234567890123456789012345678901234567890y", "xabcy");
results = apply(patches, "x12345678901234567890---------------++++++++++---------------12345678901234567890y");
assertEquals(PatchApplyResult("xabc12345678901234567890---------------++++++++++---------------12345678901234567890y", [false, true]), results);
// Big delete, big change 2.
PATCH_DELETE_THRESHOLD = 0.6;
patches = patch_make("x1234567890123456789012345678901234567890123456789012345678901234567890y", "xabcy");
results = apply(patches, "x12345678901234567890---------------++++++++++---------------12345678901234567890y");
assertEquals(PatchApplyResult("xabcy", [true, true]), results);
PATCH_DELETE_THRESHOLD = 0.5;
// Compensate for failed patch.
MATCH_THRESHOLD = 0.0;
MATCH_DISTANCE = 0;
patches = patch_make("abcdefghijklmnopqrstuvwxyz--------------------1234567890", "abcXXXXXXXXXXdefghijklmnopqrstuvwxyz--------------------1234567YYYYYYYYYY890");
results = apply(patches, "ABCDEFGHIJKLMNOPQRSTUVWXYZ--------------------1234567890");
assertEquals(PatchApplyResult("ABCDEFGHIJKLMNOPQRSTUVWXYZ--------------------1234567YYYYYYYYYY890", [false, true]), results);
MATCH_THRESHOLD = 0.5;
MATCH_DISTANCE = 1000;
// No side effects.
patches = patch_make("", "test");
auto patchstr = patch_toText(patches);
apply(patches, "");
assertEquals(patchstr, patch_toText(patches));
// No side effects with major delete.
patches = patch_make("The quick brown fox jumps over the lazy dog.", "Woof");
patchstr = patch_toText(patches);
apply(patches, "The quick brown fox jumps over the lazy dog.");
assertEquals(patchstr, patch_toText(patches));
// Edge exact match.
patches = patch_make("", "test");
results = apply(patches, "");
assertEquals(PatchApplyResult("test", [true]), results);
// Near edge exact match.
patches = patch_make("XY", "XtestY");
results = apply(patches, "XY");
assertEquals(PatchApplyResult("XtestY", [true]), results);
// Edge partial match.
patches = patch_make("y", "y123");
results = apply(patches, "x");
assertEquals(PatchApplyResult("x123", [true]), results);
}
void assertEquals(T, U)(T t, U u)
{
import std.string : format;
assert(t == u, format("FAIL: %s == %s", t, u));
}
void main()
{
testDiffCommonPrefix();
testDiffCommonSuffix();
testDiffCommonOverlap();
testDiffHalfMatch();
testDiffLinesToChars();
testDiffCleanupMerge();
testDiffCleanupSemanticLossless();
testDiffCleanupSemantic();
testDiffCleanupEfficiency();
//testDiffPrettyHtml(); // FIXME: implement HTML output
testDiffText();
testDiffDelta();
testDiffXIndex();
testDiffLevenshtein();
testDiffBisect();
testDiffMain();
testMatchAlphabet();
testMatchBitap();
testMatchMain();
testPatchObj();
testPatchFromText();
testPatchToText();
testPatchAddContext();
testPatchMake();
testPatchSplitMax();
testPatchAddPadding();
testPatchApply();
writeln("All test passed");
}
|
D
|
instance SLD_704_Blade(Npc_Default)
{
name[0] = "Kosa";
npcType = npctype_main;
guild = GIL_SLD;
level = 18;
voice = 8;
id = 704;
flags = NPC_FLAG_IMMORTAL;
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",47,2,sld_armor_h);
B_Scale(self);
Mdl_SetModelFatness(self,0);
fight_tactic = FAI_HUMAN_MASTER;
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,22);
CreateInvItems(self,ItMiNugget,18);
CreateInvItems(self,ItMw_1H_Sledgehammer_01,1);
CreateInvItems(self,ItMiSwordraw,10);
CreateInvItems(self,ItMiSwordrawhot,10);
CreateInvItems(self,ItMiSwordbladehot,10);
CreateInvItems(self,ItMiSwordblade,10);
daily_routine = Rtn_start_704;
};
func void Rtn_start_704()
{
TA_Smith_Sharp(8,0,20,0,"NC_HUT03_OUT_MOVEMENT");
TA_SitAround(20,0,2,0,"NC_PLACE01");
TA_Sleep(2,0,8,0,"NC_HUT03_IN");
};
func void rtn_freeminecamp_704()
{
TA_Smith_Fire(8,0,8,10,"FMC_HUT08_IN");
TA_Smith_Anvil(8,10,8,20,"FMC_HUT08_IN");
TA_Smith_Fire(8,20,8,30,"FMC_HUT08_IN");
TA_Smith_Anvil(8,30,8,40,"FMC_HUT08_IN");
TA_Smith_Cool(8,40,8,50,"FMC_HUT08_IN");
TA_Smith_Anvil(8,50,9,0,"FMC_HUT08_IN");
TA_Smith_Fire(9,0,9,10,"FMC_HUT08_IN");
TA_Smith_Anvil(9,10,9,20,"FMC_HUT08_IN");
TA_Smith_Fire(9,20,9,30,"FMC_HUT08_IN");
TA_Smith_Anvil(9,30,9,40,"FMC_HUT08_IN");
TA_Smith_Cool(9,40,9,50,"FMC_HUT08_IN");
TA_Smith_Anvil(9,50,10,0,"FMC_HUT08_IN");
TA_Smith_Fire(10,0,10,10,"FMC_HUT08_IN");
TA_Smith_Anvil(10,10,10,20,"FMC_HUT08_IN");
TA_Smith_Fire(10,20,10,30,"FMC_HUT08_IN");
TA_Smith_Anvil(10,30,10,40,"FMC_HUT08_IN");
TA_Smith_Cool(10,40,10,50,"FMC_HUT08_IN");
TA_Smith_Anvil(10,50,11,0,"FMC_HUT08_IN");
TA_Smith_Fire(11,0,11,10,"FMC_HUT08_IN");
TA_Smith_Anvil(11,10,11,20,"FMC_HUT08_IN");
TA_Smith_Fire(11,20,11,30,"FMC_HUT08_IN");
TA_Smith_Anvil(11,30,11,40,"FMC_HUT08_IN");
TA_Smith_Cool(11,40,11,50,"FMC_HUT08_IN");
TA_Smith_Anvil(11,50,12,0,"FMC_HUT08_IN");
TA_Smith_Fire(12,0,12,10,"FMC_HUT08_IN");
TA_Smith_Anvil(12,10,12,20,"FMC_HUT08_IN");
TA_Smith_Fire(12,20,12,30,"FMC_HUT08_IN");
TA_Smith_Anvil(12,30,12,40,"FMC_HUT08_IN");
TA_Smith_Cool(12,40,12,50,"FMC_HUT08_IN");
TA_Smith_Anvil(12,50,13,0,"FMC_HUT08_IN");
TA_Smith_Fire(13,0,13,10,"FMC_HUT08_IN");
TA_Smith_Anvil(13,10,13,20,"FMC_HUT08_IN");
TA_Smith_Fire(13,20,13,30,"FMC_HUT08_IN");
TA_Smith_Anvil(13,30,13,40,"FMC_HUT08_IN");
TA_Smith_Cool(13,40,13,50,"FMC_HUT08_IN");
TA_Smith_Anvil(13,50,14,0,"FMC_HUT08_IN");
TA_Smith_Fire(14,0,14,10,"FMC_HUT08_IN");
TA_Smith_Anvil(14,10,14,20,"FMC_HUT08_IN");
TA_Smith_Fire(14,20,14,30,"FMC_HUT08_IN");
TA_Smith_Anvil(14,30,14,40,"FMC_HUT08_IN");
TA_Smith_Cool(14,40,14,50,"FMC_HUT08_IN");
TA_Smith_Anvil(14,50,15,0,"FMC_HUT08_IN");
TA_Smith_Fire(15,0,15,10,"FMC_HUT08_IN");
TA_Smith_Anvil(15,10,15,20,"FMC_HUT08_IN");
TA_Smith_Fire(15,20,15,30,"FMC_HUT08_IN");
TA_Smith_Anvil(15,30,15,40,"FMC_HUT08_IN");
TA_Smith_Cool(15,40,15,50,"FMC_HUT08_IN");
TA_Smith_Anvil(15,50,16,0,"FMC_HUT08_IN");
TA_Smith_Fire(16,0,16,10,"FMC_HUT08_IN");
TA_Smith_Anvil(16,10,16,20,"FMC_HUT08_IN");
TA_Smith_Fire(16,20,16,30,"FMC_HUT08_IN");
TA_Smith_Anvil(16,30,16,40,"FMC_HUT08_IN");
TA_Smith_Cool(16,40,16,50,"FMC_HUT08_IN");
TA_Smith_Anvil(16,50,17,0,"FMC_HUT08_IN");
TA_Smith_Fire(17,0,17,10,"FMC_HUT08_IN");
TA_Smith_Anvil(17,10,17,20,"FMC_HUT08_IN");
TA_Smith_Fire(17,20,17,30,"FMC_HUT08_IN");
TA_Smith_Anvil(17,30,17,40,"FMC_HUT08_IN");
TA_Smith_Cool(17,40,17,50,"FMC_HUT08_IN");
TA_Smith_Anvil(17,50,18,0,"FMC_HUT08_IN");
TA_Smith_Fire(18,0,18,10,"FMC_HUT08_IN");
TA_Smith_Anvil(18,10,18,20,"FMC_HUT08_IN");
TA_Smith_Fire(18,20,18,30,"FMC_HUT08_IN");
TA_Smith_Anvil(18,30,18,40,"FMC_HUT08_IN");
TA_Smith_Cool(18,40,18,50,"FMC_HUT08_IN");
TA_Smith_Anvil(18,50,19,0,"FMC_HUT08_IN");
TA_Smith_Fire(19,0,19,10,"FMC_HUT08_IN");
TA_Smith_Anvil(19,10,19,20,"FMC_HUT08_IN");
TA_Smith_Fire(19,20,19,30,"FMC_HUT08_IN");
TA_Smith_Anvil(19,30,19,40,"FMC_HUT08_IN");
TA_Smith_Cool(19,40,19,50,"FMC_HUT08_IN");
TA_Smith_Anvil(19,50,20,0,"FMC_HUT08_IN");
TA_Smith_Fire(20,0,20,10,"FMC_HUT08_IN");
TA_Smith_Anvil(20,10,20,20,"FMC_HUT08_IN");
TA_Smith_Fire(20,20,20,30,"FMC_HUT08_IN");
TA_Smith_Anvil(20,30,20,40,"FMC_HUT08_IN");
TA_Smith_Cool(20,40,20,50,"FMC_HUT08_IN");
TA_Smith_Anvil(20,50,21,0,"FMC_HUT08_IN");
TA_Smith_Fire(21,0,21,10,"FMC_HUT08_IN");
TA_Smith_Anvil(21,10,21,20,"FMC_HUT08_IN");
TA_Smith_Fire(21,20,21,30,"FMC_HUT08_IN");
TA_Smith_Anvil(21,30,21,40,"FMC_HUT08_IN");
TA_Smith_Cool(21,40,21,50,"FMC_HUT08_IN");
TA_Smith_Anvil(21,50,22,0,"FMC_HUT08_IN");
TA_Sleep(22,0,8,0,"NC_HUT03_IN");
};
func void rtn_fmfree_704()
{
TA_Smith_Fire(8,0,8,10,"FMC_HUT08_IN");
TA_Smith_Anvil(8,10,8,20,"FMC_HUT08_IN");
TA_Smith_Fire(8,20,8,30,"FMC_HUT08_IN");
TA_Smith_Anvil(8,30,8,40,"FMC_HUT08_IN");
TA_Smith_Cool(8,40,8,50,"FMC_HUT08_IN");
TA_Smith_Anvil(8,50,9,0,"FMC_HUT08_IN");
TA_Smith_Fire(9,0,9,10,"FMC_HUT08_IN");
TA_Smith_Anvil(9,10,9,20,"FMC_HUT08_IN");
TA_Smith_Fire(9,20,9,30,"FMC_HUT08_IN");
TA_Smith_Anvil(9,30,9,40,"FMC_HUT08_IN");
TA_Smith_Cool(9,40,9,50,"FMC_HUT08_IN");
TA_Smith_Anvil(9,50,10,0,"FMC_HUT08_IN");
TA_Smith_Fire(10,0,10,10,"FMC_HUT08_IN");
TA_Smith_Anvil(10,10,10,20,"FMC_HUT08_IN");
TA_Smith_Fire(10,20,10,30,"FMC_HUT08_IN");
TA_Smith_Anvil(10,30,10,40,"FMC_HUT08_IN");
TA_Smith_Cool(10,40,10,50,"FMC_HUT08_IN");
TA_Smith_Anvil(10,50,11,0,"FMC_HUT08_IN");
TA_Smith_Fire(11,0,11,10,"FMC_HUT08_IN");
TA_Smith_Anvil(11,10,11,20,"FMC_HUT08_IN");
TA_Smith_Fire(11,20,11,30,"FMC_HUT08_IN");
TA_Smith_Anvil(11,30,11,40,"FMC_HUT08_IN");
TA_Smith_Cool(11,40,11,50,"FMC_HUT08_IN");
TA_Smith_Anvil(11,50,12,0,"FMC_HUT08_IN");
TA_Smith_Fire(12,0,12,10,"FMC_HUT08_IN");
TA_Smith_Anvil(12,10,12,20,"FMC_HUT08_IN");
TA_Smith_Fire(12,20,12,30,"FMC_HUT08_IN");
TA_Smith_Anvil(12,30,12,40,"FMC_HUT08_IN");
TA_Smith_Cool(12,40,12,50,"FMC_HUT08_IN");
TA_Smith_Anvil(12,50,13,0,"FMC_HUT08_IN");
TA_Smith_Fire(13,0,13,10,"FMC_HUT08_IN");
TA_Smith_Anvil(13,10,13,20,"FMC_HUT08_IN");
TA_Smith_Fire(13,20,13,30,"FMC_HUT08_IN");
TA_Smith_Anvil(13,30,13,40,"FMC_HUT08_IN");
TA_Smith_Cool(13,40,13,50,"FMC_HUT08_IN");
TA_Smith_Anvil(13,50,14,0,"FMC_HUT08_IN");
TA_Smith_Fire(14,0,14,10,"FMC_HUT08_IN");
TA_Smith_Anvil(14,10,14,20,"FMC_HUT08_IN");
TA_Smith_Fire(14,20,14,30,"FMC_HUT08_IN");
TA_Smith_Anvil(14,30,14,40,"FMC_HUT08_IN");
TA_Smith_Cool(14,40,14,50,"FMC_HUT08_IN");
TA_Smith_Anvil(14,50,15,0,"FMC_HUT08_IN");
TA_Smith_Fire(15,0,15,10,"FMC_HUT08_IN");
TA_Smith_Anvil(15,10,15,20,"FMC_HUT08_IN");
TA_Smith_Fire(15,20,15,30,"FMC_HUT08_IN");
TA_Smith_Anvil(15,30,15,40,"FMC_HUT08_IN");
TA_Smith_Cool(15,40,15,50,"FMC_HUT08_IN");
TA_Smith_Anvil(15,50,16,0,"FMC_HUT08_IN");
TA_Smith_Fire(16,0,16,10,"FMC_HUT08_IN");
TA_Smith_Anvil(16,10,16,20,"FMC_HUT08_IN");
TA_Smith_Fire(16,20,16,30,"FMC_HUT08_IN");
TA_Smith_Anvil(16,30,16,40,"FMC_HUT08_IN");
TA_Smith_Cool(16,40,16,50,"FMC_HUT08_IN");
TA_Smith_Anvil(16,50,17,0,"FMC_HUT08_IN");
TA_Smith_Fire(17,0,17,10,"FMC_HUT08_IN");
TA_Smith_Anvil(17,10,17,20,"FMC_HUT08_IN");
TA_Smith_Fire(17,20,17,30,"FMC_HUT08_IN");
TA_Smith_Anvil(17,30,17,40,"FMC_HUT08_IN");
TA_Smith_Cool(17,40,17,50,"FMC_HUT08_IN");
TA_Smith_Anvil(17,50,18,0,"FMC_HUT08_IN");
TA_Smith_Fire(18,0,18,10,"FMC_HUT08_IN");
TA_Smith_Anvil(18,10,18,20,"FMC_HUT08_IN");
TA_Smith_Fire(18,20,18,30,"FMC_HUT08_IN");
TA_Smith_Anvil(18,30,18,40,"FMC_HUT08_IN");
TA_Smith_Cool(18,40,18,50,"FMC_HUT08_IN");
TA_Smith_Anvil(18,50,19,0,"FMC_HUT08_IN");
TA_Smith_Fire(19,0,19,10,"FMC_HUT08_IN");
TA_Smith_Anvil(19,10,19,20,"FMC_HUT08_IN");
TA_Smith_Fire(19,20,19,30,"FMC_HUT08_IN");
TA_Smith_Anvil(19,30,19,40,"FMC_HUT08_IN");
TA_Smith_Cool(19,40,19,50,"FMC_HUT08_IN");
TA_Smith_Anvil(19,50,20,0,"FMC_HUT08_IN");
TA_Smith_Fire(20,0,20,10,"FMC_HUT08_IN");
TA_Smith_Anvil(20,10,20,20,"FMC_HUT08_IN");
TA_Smith_Fire(20,20,20,30,"FMC_HUT08_IN");
TA_Smith_Anvil(20,30,20,40,"FMC_HUT08_IN");
TA_Smith_Cool(20,40,20,50,"FMC_HUT08_IN");
TA_Smith_Anvil(20,50,21,0,"FMC_HUT08_IN");
TA_Smith_Fire(21,0,21,10,"FMC_HUT08_IN");
TA_Smith_Anvil(21,10,21,20,"FMC_HUT08_IN");
TA_Smith_Fire(21,20,21,30,"FMC_HUT08_IN");
TA_Smith_Anvil(21,30,21,40,"FMC_HUT08_IN");
TA_Smith_Cool(21,40,21,50,"FMC_HUT08_IN");
TA_Smith_Anvil(21,50,22,0,"FMC_HUT08_IN");
TA_Sleep(22,0,8,0,"NC_HUT03_IN");
};
|
D
|
/*
TEST_OUTPUT:
---
fail_compilation/diag11840.d(12): Error: undefined identifier `i`
fail_compilation/diag11840.d(12): Error: undefined identifier `j`
---
*/
void main()
{
int[10] data;
data[i .. j] = 0;
}
|
D
|
module metare;
import std.conv;
import std.string;
alias NUM=regex!"\\d+";
alias INT=regex!"[+-]?{NUM}";
alias LIST=regex!"{INT}(,{INT})*";
unittest
{
assert(NUM.match("1234") == Match(true, "1234".length));
assert(INT.match("12") == Match(true, "12".length));
assert(INT.match("-12") == Match(true, "-12".length));
assert(INT.match("+7") == Match(true, "+7".length));
assert(LIST.match("1,+2,-3,4") == Match(true, "1,+2,-3,4".length));
}
template regex(string re)
{
//pragma(msg, "compiling "~re);
static if(re.length) {
// parse escaped sequences
static if(re[0] == '\\') {
alias atom=compile_escape!re;
// parse meta expression
} else static if(re[0] == '{') {
alias atom=compile_meta!re;
// parse character class
} else static if(re[0] == '[') {
alias atom=compile_class!re;
// parse atom
} else static if(re[0] == '(') {
alias atom=compile_atom!re;
// parse dot
} else static if(re[0] == '.') {
alias atom=compile_anychar!re;
// parse regular literals
} else {
alias atom=compile_char!re;
}
// pase predicate (if any) *+?
alias pred=compile_pred!(atom, re[atom.skip..$]);
alias result=both_of!(pred, regex!(re[pred.skip..$]));
static const size_t skip=result.skip;
alias match=result.match;
} else {
static const size_t skip=0;
// end of regular expression
alias match=test_empty!(re);
}
}
template compile_char(string re)
{
//pragma(msg, "regex char: "~re);
static const size_t skip=1;
alias match=test_char!re;
}
template compile_escape(string re)
{
//pragma(msg, "regex esc: "~re);
static assert(re[0] == '\\', "escaped: invalid call");
static assert(re.length > 1, "escaped: stray backslash");
static if(re[1] == 'd') {
static const size_t skip=2;
alias match=test_digit!(re[1..$]);
} else static if(re[1] == 's') {
static const size_t skip=2;
alias match=test_space!(re[1..$]);
} else static if(re[1] == 'w') {
static const size_t skip=2;
alias match=test_word!(re[1..$]);
} else static if(re[1] == 'x') {
static const size_t skip=4;
alias match=compile_hex!(re[2..$]).match;
} else {
// any other sequence is converted to the character itself
static const size_t skip=2;
alias match=test_char!(re[1..$]);
}
}
// misc., return length of literal up the to terminator
template extract_until(string s, char terminator)
{
static assert(s.length, "missing terminator");
static if(s[0] == terminator) {
static const length=0;
} else {
static const length=1+extract_until!(s[1..$], terminator).length;
}
}
template compile_meta(string re)
{
//pragma(msg, "meta class: "~re);
static const skip=2+extract_until!(re[1..$], '}').length;
mixin("alias match="~re[1..skip-1]~".match;");
}
template compile_class(string re)
{
//pragma(msg, "char.class: "~re);
static const skip=2+extract_until!(re[1..$], ']').length;
alias match=compile_range!(re[1..skip-1]).match;
}
template compile_atom(string re)
{
//pragma(msg, "atom: "~re);
static const skip=2+extract_until!(re[1..$], ')').length;
alias match=regex!(re[1..skip-1]).match;
}
// parse literal 'a-zA0-5' to union of range tests a-z || A-A || 0-5
template compile_range(string re)
{
static if(re.length == 0) {
// end of match, return Match(false,0)
static const skip=0;
alias match=test_false!(0);
} else static if(re.length > 2 && re[1] == '-') {
// true range
static const skip=3;
alias match=either_of!(
test_range!(re[0],re[2])
, compile_range!(re[skip..$])
).match;
} else {
// degenerated range: 'X-X'
static const skip=1;
alias match=either_of!(
test_range!(re[0],re[0])
, compile_range!(re[skip..$])
).match;
}
}
// match any character (dot)
template compile_anychar(string re)
{
static const skip=1;
alias match=test_any!1;
}
// modify previous (term) regex with one of *+? predicates, or none
template compile_pred(alias term, string re)
{
//pragma(msg, "regex pred: "~re~" +"~to!string(term.skip));
static if(re.length) {
static if(re[0] == '*') {
static const size_t skip=term.skip+1;
alias match=zero_or_more!term;
} else static if(re[0] == '+') {
static const size_t skip=term.skip+1;
alias match=one_or_more!term;
} else static if(re[0] == '?') {
static const size_t skip=term.skip+1;
alias match=zero_or_one!term;
} else {
// no predicate, return term
static const size_t skip=term.skip;
alias match=term.match;
}
} else {
// no predicate, end of regex, also return term
static const size_t skip=term.skip;
alias match=term.match;
}
}
// convert \xNN hex expression to character and match it
template compile_hex(string re)
{
static assert (re.length >= 2);
alias match=test_char!(hexString!(re[0..2]));
}
// match both expressions
template both_of(alias re1, alias re2)
{
static const size_t skip=re1.skip+re2.skip;
alias match=test_join!(re1,re2);
}
// match either of expressions
template either_of(alias re1, alias re2)
{
alias match=test_either!(re1,re2);
}
/***********************************************************************/
/** runtime calls ******************************************************/
// result of match: success and mathed length
// in case the success == false, the length is matched portion (points to first unmatched char)
struct Match
{
bool _success;
ulong length;
bool opCast(T : bool)() const { return _success; }
}
// match single character
Match test_char(string re)(string s)
{
static if(re.length) {
if(s.length && s[0] == re[0])
return Match(1,1);
}
return Match(0,0);
}
// match single digit
Match test_digit(string re)(string s)
{
return (s.length && s[0] >= '0' && s[0] <= '9')? Match(1,1) : Match(0,0);
}
// match any of space
Match test_space(string re)(string s)
{
if(s.length) {
if(
s[0] == ' '
|| s[0] == '\t'
|| s[0] == '\n'
|| s[0] == '\r'
|| s[0] == '\f'
) return Match(1,1);
}
return Match(0,0);
}
// match any of word characters
Match test_word(string re)(string s)
{
if(s.length) {
if(
(s[0] >= 'A' && s[0] <= 'Z')
|| (s[0] >= 'a' && s[0] <= 'z')
|| s[0] == '_'
) return Match(1,1);
}
return Match(0,0);
}
// match range
Match test_range(char left, char right)(string s)
{
if(s.length) {
if(s[0] >= left && s[0] <= right)
return Match(1,1);
}
return Match(0,0);
}
// match at the end of regex
Match test_empty(string re)(string s)
{
static assert(re.length == 0, "test_empty(): invalid call");
return Match(1,0);
}
// always match, return requested chars to skip
Match test_true(int length)(string s)
{
return Match(1,length);
}
// never match, return requested chars to skip
Match test_false(int length)(string s)
{
return Match(0,length);
}
// always match if sufficient input length, return available chars
Match test_any(int length)(string s)
{
return (s.length >= length)? Match(1,length) : Match(0, s.length);
}
// match both of expressions, return matched length
Match test_join(alias re1, alias re2)(string s) {
auto m1=re1.match(s);
if(m1) {
auto m2=re2.match(s[m1.length..$]);
return Match(m1 && m2, m1.length+m2.length);
}
return m1;
}
// match either of expressions, mathed length is not specified
Match test_either(alias re1, alias re2)(string s) {
auto m1=re1(s);
return m1? m1 : re2.match(s);
}
// match any number of repetition of the expression
Match zero_or_more(alias term)(string s)
{
auto r=Match(1,0);
Match n=term.match(s);
while(n) {
r.length+=n.length;
n=term.match(s[r.length..$]);
}
return r;
}
// conditionally match the expression, always match but matched length may be different
Match zero_or_one(alias term)(string s)
{
Match r=term.match(s);
return r? r : Match(1,0);
}
// match at least one repetition of the expression
Match one_or_more(alias term)(string s)
{
Match r=term.match(s);
if(!r) return r;
Match n=term.match(s[r.length..$]);
while(n) {
r.length+=n.length;
n=term.match(s[r.length..$]);
}
return r;
}
|
D
|
/Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Intermediates.noindex/RNTrackPlayer.build/Debug-iphonesimulator/RNTrackPlayer.build/Objects-normal/x86_64/SessionCategories.o : /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/MediaURL.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/RemoteCommandController/RemoteCommand.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AVPlayerWrapper/AVPlayerWrapperDelegate.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AVPlayerWrapper/AVPlayerWrapperState.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoKeyValue.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoControllerProtocol.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AVPlayerWrapper/AVPlayerWrapperProtocol.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AudioItem.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AudioSessionController/AudioSession.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/QueueManager.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/RemoteCommandController/RemoteCommandController.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AudioSessionController/AudioSessionController.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoController.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AVPlayerWrapper/AVPlayerWrapper.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoCenter.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Observer/AVPlayerTimeObserver.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Observer/AVPlayerItemObserver.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Observer/AVPlayerItemNotificationObserver.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Observer/AVPlayerObserver.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AudioPlayer.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/QueuedAudioPlayer.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/APError.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/SessionCategories.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Capabilities.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/PitchAlgorithms.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Event.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/TimeEventFrequency.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/MediaItemProperty.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoProperty.swift /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/MediaPlayer.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 /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTBridge.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeModule.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTFrameUpdate.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeDelegate.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTInvalidating.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Support/RNTrackPlayer-Bridging-Header.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTJavaScriptLoader.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTEventEmitter.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayer.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Intermediates.noindex/RNTrackPlayer.build/Debug-iphonesimulator/RNTrackPlayer.build/Objects-normal/x86_64/SessionCategories~partial.swiftmodule : /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/MediaURL.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/RemoteCommandController/RemoteCommand.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AVPlayerWrapper/AVPlayerWrapperDelegate.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AVPlayerWrapper/AVPlayerWrapperState.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoKeyValue.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoControllerProtocol.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AVPlayerWrapper/AVPlayerWrapperProtocol.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AudioItem.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AudioSessionController/AudioSession.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/QueueManager.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/RemoteCommandController/RemoteCommandController.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AudioSessionController/AudioSessionController.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoController.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AVPlayerWrapper/AVPlayerWrapper.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoCenter.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Observer/AVPlayerTimeObserver.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Observer/AVPlayerItemObserver.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Observer/AVPlayerItemNotificationObserver.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Observer/AVPlayerObserver.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AudioPlayer.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/QueuedAudioPlayer.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/APError.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/SessionCategories.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Capabilities.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/PitchAlgorithms.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Event.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/TimeEventFrequency.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/MediaItemProperty.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoProperty.swift /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/MediaPlayer.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 /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTBridge.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeModule.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTFrameUpdate.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeDelegate.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTInvalidating.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Support/RNTrackPlayer-Bridging-Header.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTJavaScriptLoader.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTEventEmitter.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayer.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Intermediates.noindex/RNTrackPlayer.build/Debug-iphonesimulator/RNTrackPlayer.build/Objects-normal/x86_64/SessionCategories~partial.swiftdoc : /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/MediaURL.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/RemoteCommandController/RemoteCommand.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AVPlayerWrapper/AVPlayerWrapperDelegate.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AVPlayerWrapper/AVPlayerWrapperState.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoKeyValue.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoControllerProtocol.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AVPlayerWrapper/AVPlayerWrapperProtocol.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AudioItem.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AudioSessionController/AudioSession.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/QueueManager.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/RemoteCommandController/RemoteCommandController.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AudioSessionController/AudioSessionController.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoController.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AVPlayerWrapper/AVPlayerWrapper.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoCenter.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Observer/AVPlayerTimeObserver.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Observer/AVPlayerItemObserver.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Observer/AVPlayerItemNotificationObserver.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Observer/AVPlayerObserver.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/AudioPlayer.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/QueuedAudioPlayer.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/APError.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/SessionCategories.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Capabilities.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/PitchAlgorithms.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Event.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/TimeEventFrequency.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/MediaItemProperty.swift /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/NowPlayingInfoController/NowPlayingInfoProperty.swift /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/MediaPlayer.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 /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTBridge.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeModule.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTFrameUpdate.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeDelegate.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTInvalidating.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/node_modules/react-native-track-player/ios/RNTrackPlayer/Support/RNTrackPlayer-Bridging-Header.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTJavaScriptLoader.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTEventEmitter.h /Volumes/iMacProjetos/Curso/Rocketseat/GoNative/module4/ios/build/module4/Build/Products/Debug-iphonesimulator/include/React/RCTDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayer.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module mach.sdl.input.event.drop;
private:
import derelict.sdl2.types;
import derelict.sdl2.functions : SDL_free;
import mach.sdl.input.event.mixins;
import std.string : fromStringz;
public:
/// https://wiki.libsdl.org/SDL_DropEvent
struct DropFileEvent{
mixin EventMixin!SDL_DropEvent;
/// The original SDL event's char* needs to be destroyed using SDL_free.
/// If using drop events, make sure to call Event.conclude at some point
/// (which goes on to call this method) in order to avoid memory leaks.
void conclude(){
SDL_free(this.eventdata.file);
}
/// Get the path to the file dropped.
@property string path() const{
return cast(string) fromStringz(this.eventdata.file);
}
/// TODO: What's the best way to allocate and assign a file path?
}
|
D
|
module game;
import std.uuid;
import types;
interface ITronGame
{
static maxPlayers = 2;
void restart();
// true on success, false on game end
bool tick();
// true on success, false on max players reached
bool addPlayer(UUID uuid);
void setDirection(UUID uuid, string direction);
string getGrid();
}
struct Player
{
Vector2 position;
Vector2 direction;
bool isAlive = true;
this(Vector2 position, Vector2 direction)
{
this.position = position;
this.direction = direction;
}
}
class TronGame : ITronGame
{
private:
Player[UUID] players;
bool[Vector2] grid; // True means filled, false/unset means empty
Vector2 dimensions;
Vector2[size_t] defaultPositions;
Vector2[size_t] defaultDirections;
// Init functions
void setGridSize(Vector2 dimensions)
{
this.dimensions = dimensions;
defaultPositions[0] = Vector2(dimensions.x / 4, dimensions.y / 2);
defaultPositions[1] = Vector2(dimensions.x * 3 / 4, dimensions.y / 2);
defaultDirections[0] = Vector2(1, 0);
defaultDirections[1] = Vector2(-1, 0);
}
void resetGrid()
{
grid = null;
auto i = players.length - 1;
foreach (uuid, ref player; players)
{
player.position = defaultPositions[i];
player.direction = defaultDirections[i];
player.isAlive = true;
i--;
}
drawPlayersToGrid();
}
public this(Vector2 dimensions = Vector2(96, 64))
{
setGridSize(dimensions);
resetGrid();
}
public void restart()
{
resetGrid();
}
// Update functions
public bool tick()
{
foreach (ref player; players)
{
if (player.isAlive)
player.position = player.position + player.direction;
if (player.position in grid)
if (grid[player.position]) // Throws range violation if not in grid
player.isAlive = false;
}
drawPlayersToGrid();
// False on game end
int alivePlayers = 0;
foreach (player; players)
if (player.isAlive)
alivePlayers++;
return alivePlayers >= 2;
}
void drawPlayersToGrid()
{
foreach (player; players)
grid[player.position] = true;
}
public bool addPlayer(UUID uuid)
{
if (uuid in players)
return true; // Already exists
if (players.length >= maxPlayers)
return false; // Full game
Player p = Player();
p.isAlive = false;
players[uuid] = p;
return true;
}
// Input
public void setDirection(UUID uuid, string direction)
{
Player* player = &players[uuid];
if (players[uuid].isAlive)
{
if (direction == "left" && player.direction != Vector2(1, 0))
player.direction = Vector2(-1, 0);
else if (direction == "up" && player.direction != Vector2(0, 1))
player.direction = Vector2(0, -1);
else if (direction == "right" && player.direction != Vector2(-1, 0))
player.direction = Vector2(1, 0);
else if (direction == "down" && player.direction != Vector2(0, -1))
player.direction = Vector2(0, 1);
}
}
// Getters
public string getGrid()
{
string s;
foreach (y; 0 .. dimensions.y)
{
foreach (x; 0 .. dimensions.x)
{
auto coord = Vector2(x, y);
if (coord in grid && grid[coord]) // Throws range violation if not in grid
s ~= "1";
else
s ~= "0";
}
s ~= "\n";
}
return s;
}
}
|
D
|
PLONG PLAT ED95 KD LOMAGAGE HIMAGAGE SLAT SLONG RESULTNO DP DM ROCKTYPE
332.438668 51.4040491 9 41.2000008 35 100 -31.3999996 138.600006 1170 8.16458891 37.9686144 sediments
-33.0580874 39.2126332 9 16.5 35 100 -30.3999996 139.399994 1161 7.95694722 82.0534697 sediments, tillite
-41.9634396 47.1283348 5 200 35 100 -30.5 139.300003 1165 4.43196392 29.1188412 sediments, redbeds
-36.0299205 47.6098852 25 4.0999999 35 100 -30.2000008 139 1166 21.9885905 136.122343 sediments, sandstone, tillite
219.300003 -4.19999981 9.39999962 22.3999996 56 65 -10 121 7800 4.9000001 9.60000038 extrusives, basalts, andesites
221.899994 42 8.80000019 0 63 75 -9.69999981 119.5 1211 5.30000019 9.69999981 intrusives, granodiorite, andesite dykes
223 26 13 14.8000002 35 100 -30.2999992 139.5 1157 26 26 extrusives
271 63 2.9000001 352 50 80 -34 151 1595 3.5 4.5 intrusives
|
D
|
module Editor.GUITest;
void RenderGUI()
{
/*
const scrollAreaWidth = w.size.x / 4;
const scrollAreaHeight = w.size.y - 20;
int scrollArea2 = 0;
imguiBeginScrollArea("Scroll area 2", 20 + (1 * scrollAreaWidth), 10, scrollAreaWidth, scrollAreaHeight, &scrollArea2);
imguiSeparatorLine();
imguiSeparator();
foreach (i; 0 .. 100)
imguiLabel("A wall of text");
imguiEndScrollArea();
imguiDrawText(0, 0, TextAlign.left, "Free text", RGBA(32, 192, 32, 192));
imguiRender( w.size.x, w.size.y);
*/
}
|
D
|
/**
* @author Lee Avital
*
* Holds various functions used for generating
* and evaluating scrabble moves
*/
module solver;
import board;
import trie;
import rack;
import position;
import move;
import constants;
import std.stdio;
import std.array;
import std.format;
Board theboard;
TrieNode dictionary;
Rack therack;
/**
* find the union of two hash sets
*
* Ideally, the first parameter is larger but it will work both ways
*/
T[V] set_union(T, V)(T[V] a, T[V] b){
// if a is smaller than b, add everything in a to b
if( a.length < b.length ){
foreach(V v, T t; a){
b[v] = t;
}
return b;
}
// if b is smaller than a, add everything in b to a
else{
foreach(V v, T t; b){
a[v] = t;
}
return a;
}
}
/**
* solve
* @param b the board to solve
* @param d the first node in a DAWG that holds all valid words
* @param r the rack
*/
void solve( Board b, TrieNode d, Rack r){
theboard = b;
dictionary = d;
therack = r;
int[Move] moves;
// compute the possible anchor squares
for( int x = 0; x < 26; x++ ){
for( int y = 0; y < 26; y++ ){
auto pos = Position(x, y);
if( theboard[pos.x, pos.y] != ' ' ) {
if ( theboard[pos.left] == ' ' && pos.left.x < 26 ){
auto poss = extendLeft( "", dictionary, pos.left, 3 );
moves = set_union( moves, poss );
}
}
}
}
foreach(Move m, int s; moves){
writefln("%s will score %d points", m, s);
}
}
int[Move] extendLeft( string prefix, TrieNode n, Position anchor, int limit){
int[Move] moves;
// first extend right from the anchor without placing any tiles on the left
moves = set_union( extendRight( prefix, n, anchor), moves );
// if we have more room to the left, we can generate a prefix and test with it
if( limit > 0 ){
foreach( char c; therack.characters ){
auto childNode = n.search( c ~ "" );
if( ! (childNode is null) ){
therack.remove( c );
moves = set_union( extendLeft( prefix ~ c, childNode, anchor, limit - 1 ), moves );
therack.add( c );
}
}
}
return moves;
}
int[Move] extendRight( string prefix, TrieNode n, Position anchor){
int[Move] moves;
// if the square is vacant
if( theboard[anchor.x, anchor.y] == ' ' ){
if( n.isWord ){
writefln("recording %s", prefix );
// record a move here
auto leftPos = Position( anchor.x - cast(int)prefix.length, anchor.y);
// record the move
auto m = Move( leftPos.x, leftPos.y, prefix );
moves[ m ] = evaluateMove( theboard, m );
}
foreach( char c; therack.characters){
auto subNode = n.search( "" ~ c );
writefln("trying to place: %c at %s", c, anchor );
if( ! ( subNode is null ) && checkCrossSet(c, anchor) ){
therack.remove( c );
moves = set_union( extendRight( prefix ~ c, subNode, anchor.right), moves );
therack.add( c );
}
}
}
else{
auto c = theboard[anchor.x, anchor.y];
writefln("found an adjacent: %c", c );
auto subNode = n.search( c ~ "" );
if( !(subNode is null) ){
moves = set_union( extendRight( prefix ~ c, subNode, anchor.right), moves );
}else{
// won't make any words
}
}
return moves;
}
/**
* evaluate a move and return the number of points scored
*
* @param b the board on which the move is played
* @param m the move to be evaluated
*/
int evaluateMove( Board b, Move m){
// count the total
auto total = 0;
// keep track of the multiplier
auto multiplier = 1;
// keep track of a position (moving right)
auto currPos = m.position;
foreach( ulong i; 0 .. m.word.length ){
total += LETTER_VALUES[ m.word[ i ] ] * b.getLetterMultiplier( currPos );
multiplier *= b.getWordMultiplier( currPos );
// figure out if we need a cross set
if( b[ currPos.above ] != ' ' || b[ currPos.below ] != ' ' ){
auto tileptr = currPos.above;
while( b[tileptr] != ' '){
total += LETTER_VALUES[ b[tileptr] ];
tileptr = tileptr.above;
}
tileptr = currPos.below;
while( b[tileptr] != ' '){
total += LETTER_VALUES[ b[tileptr] ];
tileptr = tileptr.below;
}
// double count this letter because it's both a down word and an accros word
total += LETTER_VALUES[ m.word[i] ];
}
// move the position pointer right
currPos = currPos.right;
}
return total * multiplier;
}
/**
* check to see if a given character is in a positions cross set
* i.e. , if A is the word above and B is below, is AcB a word?
*
* @param c the character to check
* @param anchor the position at which to check
*/
bool checkCrossSet( char c, Position anchor ){
// get all of the letters directly above
auto strAbove = "";
auto nodeAbove = anchor.above;
while( theboard[ nodeAbove.x, nodeAbove.y ] != ' ' ){
strAbove = theboard[nodeAbove.x, nodeAbove.y] ~ strAbove;
nodeAbove = nodeAbove.above;
}
// get all of the letters below
auto strBelow = "";
auto nodeBelow = anchor.below;
while( theboard[ nodeBelow.x, nodeBelow.y ] != ' ' ){
strBelow ~= theboard[nodeBelow.x, nodeBelow.y];
nodeBelow = nodeBelow.below;
}
// concat:
// above + this + below
auto crossStr = strAbove ~ c ~ strBelow;
// return isWord( above )
return crossStr.length == 1 || dictionary.contains( crossStr );
}
// unit test for evaluateMove()
unittest{
auto b = new Board();
auto m = Move(3,3,"FOO");
// simple case, no cross sections
// Foo = 4 + 1 + 1
assert( evaluateMove(b, m) == 6);
// also, no cross set
// FOOBAR = 4 + 1 + 1 + 3 + 1 + 1 = 11
auto m2 = Move(3, 3, "FOOBAR");
assert( evaluateMove(b, m2 ) == 11);
b[3,4] = 'O';
auto m3 = Move(3, 3, "SO");
// one cross set on the first character
assert( evaluateMove(b, m3) == 4 );
writefln("finished unittest 1 for evaluateMove");
}
unittest{
int[string] d1;
int[string] d2;
d1["two"] = 2;
d2["three"] = 3;
d2["four"] = 4;
auto d3 = set_union( d1, d2 );
// test small -- big case
assert( d3.length == 3 );
assert( d3["four"] == 4 );
assert( d3["three"] == 3 );
assert( d3["two"] == 2 );
// this is the big -- small case
d3 = set_union( d2, d1 );
assert( d3.length == 3 );
assert( d3["four"] == 4 );
assert( d3["three"] == 3 );
assert( d3["two"] == 2 );
writeln( "finished unittest 1 for set_union" );
}
|
D
|
/Users/liujianhao/code/rust/simple_web_app/simple_web_app/target/rls/debug/build/indexmap-6ae93174130df92a/build_script_build-6ae93174130df92a: /Users/liujianhao/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/indexmap-1.7.0/build.rs
/Users/liujianhao/code/rust/simple_web_app/simple_web_app/target/rls/debug/build/indexmap-6ae93174130df92a/build_script_build-6ae93174130df92a.d: /Users/liujianhao/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/indexmap-1.7.0/build.rs
/Users/liujianhao/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/indexmap-1.7.0/build.rs:
|
D
|
module test.RowBindingTest;
import hunt.database;
import hunt.database.base;
import hunt.database.base.Annotations;
import hunt.util.UnitTest;
import std.conv;
import std.format;
import std.range;
import std.stdio;
class RowBindingTest {
string sql;
int result;
Statement statement;
RowSet rs;
Database db;
this() {
db = new Database(
"postgresql://postgres:123456@10.1.11.44:5432/postgres?charset=utf-8");
}
@Before
void setUp() {
}
@After
void dispose() {
db.close();
}
// @Test
// void simpleStructTest() {
// statement = db.prepare("SELECT * FROM public.test limit 10");
// rs = statement.query();
// TestEntity[] testEntities = rs.bind!TestEntity();
// foreach (TestEntity t; testEntities) {
// writeln(t);
// }
// // TestEntity(1, "{escaped}")
// assert(testEntities.length > 0);
// assert(testEntities[0].id == 1);
// }
@Test
void testClassWithColumn() {
statement = db.prepare("SELECT * FROM test limit 10");
rs = statement.query();
ClassEntity[] testEntities = rs.bind!ClassEntity();
foreach (ClassEntity t; testEntities) {
writeln(t);
}
// id=1, value={escaped}, desc=
assert(testEntities.length > 0);
assert(testEntities[0].id == 1);
assert(!testEntities[0].value.empty());
}
@Test
void testClassWithJoin() {
sql = `SELECT a.id as immutable__as__id, a.message as immutable__as__message,
b.id as world__as__id, b.randomnumber as world__as__randomnumber
FROM immutable as a LEFT JOIN world as b on a.id = b.id where a.id=1;`;
statement = db.prepare(sql);
rs = statement.query();
// Immutable[] testEntities = rs.bind!(Immutable, true, (a, b) => a ~ "__as__" ~ b)(); // bug
Immutable[] testEntities = rs.bind!(Immutable, true, `a ~ "__as__" ~ b`)();
foreach (Immutable t; testEntities) {
writeln(t);
}
// id=1, message=fortune: No such file or directory, world={id=0, randomnumber=3847}
assert(testEntities.length > 0);
assert(testEntities[0].world !is null);
assert(testEntities[0].world.id == 0);
}
}
struct TestEntity {
int id;
string val;
}
// Inherit
class EntityBase {
@Column("val")
string value;
}
class ClassEntity : EntityBase {
int id;
string desc;
override string toString() {
return format("id=%d, value=%s, desc=%s", id, value, desc);
}
}
// Join
@Table("immutable")
class Immutable {
int id;
string message;
World world;
override string toString() {
return format("id=%d, message=%s, world={%s}", id, message, world.to!string());
}
}
alias DbIgnor = hunt.database.base.Annotations.Ignore;
@Table("world")
class World {
@DbIgnor("Repeated column")
int id;
string randomnumber;
// int randomnumber;
// float randomnumber;
override string toString() {
return format("id=%d, randomnumber=%s", id, randomnumber);
}
}
|
D
|
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.build/Services/Service.swift.o : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/ServiceID.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Utilities/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/Service.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/ServiceCache.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Utilities/Extendable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/ServiceType.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Config/Config.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Provider/Provider.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/Container.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/SubContainer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/BasicSubContainer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/BasicContainer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Utilities/ServiceError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/ContainerAlias.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/Services.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Environment/Environment.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/ServiceFactory.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/BasicServiceFactory.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/TypeServiceFactory.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/Core.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 /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/Service.build/Service~partial.swiftmodule : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/ServiceID.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Utilities/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/Service.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/ServiceCache.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Utilities/Extendable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/ServiceType.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Config/Config.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Provider/Provider.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/Container.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/SubContainer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/BasicSubContainer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/BasicContainer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Utilities/ServiceError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/ContainerAlias.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/Services.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Environment/Environment.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/ServiceFactory.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/BasicServiceFactory.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/TypeServiceFactory.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/Core.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 /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/Service.build/Service~partial.swiftdoc : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/ServiceID.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Utilities/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/Service.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/ServiceCache.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Utilities/Extendable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/ServiceType.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Config/Config.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Provider/Provider.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/Container.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/SubContainer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/BasicSubContainer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/BasicContainer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Utilities/ServiceError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Container/ContainerAlias.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/Services.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Environment/Environment.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/ServiceFactory.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/BasicServiceFactory.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/service.git-6643607890189502733/Sources/Service/Services/TypeServiceFactory.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/Core.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 /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
|
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.container, std.range;
void get(Args...)(ref Args args)
{
import std.traits, std.meta, std.typecons;
static if (Args.length == 1) {
alias Arg = Args[0];
static if (isArray!Arg) {
static if (isSomeChar!(ElementType!Arg)) {
args[0] = readln.chomp.to!Arg;
} else {
args[0] = readln.split.to!Arg;
}
} else static if (isTuple!Arg) {
auto input = readln.split;
static foreach (i; 0..Fields!Arg.length) {
args[0][i] = input[i].to!(Fields!Arg[i]);
}
} else {
args[0] = readln.chomp.to!Arg;
}
} else {
auto input = readln.split;
assert(input.length == Args.length);
static foreach (i; 0..Args.length) {
args[i] = input[i].to!(Args[i]);
}
}
}
void get_lines(Args...)(size_t N, ref Args args)
{
import std.traits, std.range;
static foreach (i; 0..Args.length) {
static assert(isArray!(Args[i]));
args[i].length = N;
}
foreach (i; 0..N) {
static if (Args.length == 1) {
get(args[0][i]);
} else {
auto input = readln.split;
static foreach (j; 0..Args.length) {
args[j][i] = input[j].to!(ElementType!(Args[j]));
}
}
}
}
void main()
{
int N; long K; get(N, K);
long[] AS; get(AS);
long[long] ms = [0: 1];
long[] ns = [0];
long r, s;
foreach (i, a; AS) {
s += a;
auto n = (s - i.to!long - 1) % K;
if (n < 0) n += K;
ns ~= n;
auto j = i.to!long + 1 - K;
if (j >= 0) --ms[ns[j]];
if (n in ms) r += ms[n];
++ms[n];
}
writeln(r);
}
/*
1 1
0 1 2
3 2 1 1
0 3 5 6 7
{0:1}
{0:1, 2:1}
{0:1, 2:1, 3:1}
{0:1, 2:1, 3:2}
{0:1, 2:1, 3:3}
5 4
1 4 2 3 5
0 1 5 7 10 15
{0:1}
{0:2}
{0:2, 3:1}
{0:3, 3:1}
{0:3, 3:1, 2:1}
{0:3, 3:1, 2:2}
8 4
4 2 4 2 4 2 4 2
0 2 0 2 0 2 0 2
0 0 2 2 0 0 2 2 0
{0:1}
{0:1, 3:1}
{0:2, 3:1}
{0:2, 3:1, 1:1}
{0:2, 3:1, 1:1}
{0:2, 3:2, 1:1}
10 7
14 15 92 65 35 89 79 32 38 46
0 1 1 2 0 5 2 4 3 4
0 0 1 2 4 4 2 4 1 4 1
2 4 1 1 1 1 1
1 1 0 6 4 4 6 4 0 4 0
1 2 2 2 1
1 + 4*3/2 = 7
1 + 1 = 2
7 + 2 = 9
1 1 2
2 3
4
*/
|
D
|
/**
*
* THIS FILE IS AUTO-GENERATED BY ./parse_specs.d FOR MCU attiny48 WITH ARCHITECTURE avr25
*
*/
module avr.specs.specs_attiny48;
enum __AVR_ARCH__ = 25;
enum __AVR_ASM_ONLY__ = false;
enum __AVR_ENHANCED__ = false;
enum __AVR_HAVE_MUL__ = false;
enum __AVR_HAVE_JMP_CALL__ = false;
enum __AVR_MEGA__ = false;
enum __AVR_HAVE_LPMX__ = true;
enum __AVR_HAVE_MOVW__ = true;
enum __AVR_HAVE_ELPM__ = false;
enum __AVR_HAVE_ELPMX__ = false;
enum __AVR_HAVE_EIJMP_EICALL_ = false;
enum __AVR_2_BYTE_PC__ = true;
enum __AVR_3_BYTE_PC__ = false;
enum __AVR_XMEGA__ = false;
enum __AVR_HAVE_RAMPX__ = false;
enum __AVR_HAVE_RAMPY__ = false;
enum __AVR_HAVE_RAMPZ__ = false;
enum __AVR_HAVE_RAMPD__ = false;
enum __AVR_TINY__ = false;
enum __AVR_PM_BASE_ADDRESS__ = 0;
enum __AVR_SFR_OFFSET__ = 32;
enum __AVR_DEVICE_NAME__ = "attiny48";
|
D
|
/Users/donghyungko/Documents/git-project/rust/the_rust_programming_language/ch07_module/target/rls/debug/deps/ch07_module-844b19a6f5c112e4.rmeta: src/main.rs
/Users/donghyungko/Documents/git-project/rust/the_rust_programming_language/ch07_module/target/rls/debug/deps/ch07_module-844b19a6f5c112e4.d: src/main.rs
src/main.rs:
|
D
|
module UnrealScript.TribesGame.TrVGSNode_Warning;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.TribesGame.TrVGSNode;
extern(C++) interface TrVGSNode_Warning : TrVGSNode
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class TribesGame.TrVGSNode_Warning")); }
private static __gshared TrVGSNode_Warning mDefaultProperties;
@property final static TrVGSNode_Warning DefaultProperties() { mixin(MGDPC("TrVGSNode_Warning", "TrVGSNode_Warning TribesGame.Default__TrVGSNode_Warning")); }
}
|
D
|
/* SEATD for SciTE
* Copyright (c) 2007 Jascha Wetzel. All rights reserved
* License: Artistic License 2.0, see license.txt
*/
module scite.seatd_scite;
import scite.scite_ext;
import abstract_plugin;
import tango.stdc.string;
version(Windows) import tango.sys.win32.Types;
/**************************************************************************************************
SciTE specific implementation of the AbstractPlugin interface
**************************************************************************************************/
class SeatdScite : public AbstractPlugin, public Extension
{
enum SelectionListT {
none,
goto_declaration,
goto_module
}
ExtensionAPI host;
string[int] buffer_filepaths;
int active_buffer;
SelectionListT select_list_type_;
this()
{
super();
}
// temporarily copied from abstract_plugin - becomes specialization
/***********************************************************************************************
***********************************************************************************************/
void gotoDeclarationAtCursor(string text)
{
auto bufferinfo = parseBuffer(text, false);
auto modinfo = bufferinfo;
Declaration decl = root_package_.findDeclaration(fqIdentAtCursor, modinfo);
if ( decl is null )
callTip("symbol not found");
else
{
if ( modinfo !is bufferinfo )
gotoModule(modinfo);
gotoDeclaration(decl);
}
}
/***********************************************************************************************
Called when the user types text. Used to shrink the selection lists.
Uses control character 0x08 for backspace.
Returns: true if the character has been processed. Usually it shouldn't be processed
by other parts of the editor in that case.
***********************************************************************************************/
bool onChar(dchar c)
{
if ( c == '.' || c == 8 || contains(FQN_CHARS, c) )
{
string[] prev_list;
if ( c == 8 )
{
prev_list = full_list_;
if ( live_search_str_.length > 0 )
live_search_str_ = live_search_str_[0..$-1];
if ( live_search_str_.length == 0 ) {
current_list_ = prev_list;
showSelectionList(false);
return true;
}
}
else
{
live_search_str_ ~= c;
if ( current_list_ is null )
prev_list = full_list_;
else
prev_list = current_list_;
}
current_list_ = null;
foreach ( l; prev_list )
{
auto source = toUpper(l.dup);
if ( locatePattern(source, live_search_str_) < source.length )
current_list_ ~= l;
}
showSelectionList(false);
return true;
}
return false;
}
/**********************************************************************************************
**********************************************************************************************/
void showSelectionList(bool init=true)
{
if ( init ) {
full_list_.sort;
current_list_ = full_list_;
live_search_str_ = null;
}
showSelectionList(current_list_);
}
string live_search_str_;
string[] full_list_,
current_list_;
// temp copy end
/**********************************************************************************************
Get a list of include paths that have been set by the user in some configuration facility.
**********************************************************************************************/
string[] getIncludePaths()
{
auto global_ip_c = host.Property("seatd.global.include"),
local_ip_c = host.Property("seatd.local.include"),
dir_home_c = host.Property("SciteDirectoryHome");
auto global_ip = global_ip_c[0 .. strlen(global_ip_c)],
local_ip = local_ip_c[0 .. strlen(local_ip_c)],
dir_home = dir_home_c[0 .. strlen(dir_home_c)];
if ( dir_home.length > 0 && contains("/\\", dir_home[$-1]) )
dir_home ~= FileConst.PathSeparatorChar;
auto paths = split(local_ip, ";");
paths ~= split(global_ip, ";");
return paths;
}
/**********************************************************************************************
Read a fully qualified identifier from the current editor buffer at the cursor.
**********************************************************************************************/
string fqIdentAtCursor()
{
sendEditor(SCI_SETWORDCHARS, 0, cast(sptr_t)FQN_CHARS.ptr);
auto pos = sendEditor(SCI_GETCURRENTPOS),
start = sendEditor(SCI_WORDSTARTPOSITION, pos),
end = sendEditor(SCI_WORDENDPOSITION, pos);
if ( end <= start )
return null;
return host.Range(host.Pane.paneEditor, start, end)[0..end-start];
}
/**********************************************************************************************
Output to a host logging facility, message box or similar.
**********************************************************************************************/
void log(string str)
{
host.Trace((str~\n~\0).ptr);
}
/**********************************************************************************************
Display a small hint-class message for signatures, DDocs, simple messages like
"identifier not found", or similar. Usually a small popup window.
**********************************************************************************************/
void callTip(string text)
{
sendEditor(SCI_CALLTIPCANCEL);
auto pos = sendEditor(SCI_GETCURRENTPOS);
sendEditor(SCI_CALLTIPSHOW, pos, cast(sptr_t)(text~\0).ptr);
}
/**********************************************************************************************
Open the given source file in the editor.
**********************************************************************************************/
void openFile(string filepath)
{
host.Perform(("open:"~filepath~\0).ptr);
}
/**********************************************************************************************
Set the cursor (and view) to the given position in the file
**********************************************************************************************/
void setCursor(int line, int col)
{
sendEditor(SCI_ENSUREVISIBLEENFORCEPOLICY, line);
sendEditor(SCI_GOTOPOS, sendEditor(SCI_FINDCOLUMN, line, col));
}
/**********************************************************************************************
Access the current buffer's text data.
**********************************************************************************************/
string getBufferText()
{
size_t len = sendEditor(SCI_GETLENGTH);
string text;
text.length = len+1;
sendEditor(SCI_GETTEXT, text.length, cast(sptr_t)text.ptr);
text.length = text.length-1;
return text;
}
/**********************************************************************************************
Determine whether the current buffer is to be parsed.
Usually done using the file extension or editor settings.
**********************************************************************************************/
bool isParsableBuffer()
{
string* filename = active_buffer in buffer_file_names;
string empty = "";
if ( filename is null )
filename = ∅
if ( SCLEX_D != sendEditor(SCI_GETLEXER)
|| filename.length < 3
|| ((*filename)[$-2 .. $] != ".d" && (*filename)[$-3 .. $] != ".di")
)
return true;
return false;
}
/**********************************************************************************************
Display a selection list.
Will be called repeatedly, while the user types and the list shrinks.
**********************************************************************************************/
void showSelectionList(string[] entries)
{
string concat_list;
bool first = true;
foreach ( l; entries )
{
if ( first )
first = false;
else
concat_list ~= " ";
concat_list ~= l;
}
sendEditor(SCI_USERLISTSHOW, 3, cast(sptr_t)(concat_list~\0).ptr);
}
sptr_t sendEditor(uint msg, uptr_t wParam=0, sptr_t lParam=0)
{
return host.Send(host.Pane.paneEditor, msg, wParam, lParam);
}
//=============================================================================================
// Implementation of the SciTE Extension interface
extern(Windows):
/**********************************************************************************************
Initialize the extension. Called by COMExtension in SciTE.
**********************************************************************************************/
bool Initialise(ExtensionAPI host_)
{
host = host_;
return host !is null;
}
// ditto
bool Finalise()
{
return true;
}
/**********************************************************************************************
Buffer handling. Implementation of the SciTE Extension API.
**********************************************************************************************/
bool Clear()
{
buffer_filepaths[active_buffer] = null;
return true;
}
/// ditto
bool Load(char *filename)
{
buffer_filepaths[active_buffer] = filename[0 .. strlen(filename)];
setActiveFilepath(buffer_filepaths[index]);
return true;
}
/// ditto
bool InitBuffer(int index)
{
active_buffer = index;
if ( (index in buffer_filepaths) !is null )
setActiveFilepath(buffer_filepaths[index]);
return true;
}
/// ditto
bool ActivateBuffer(int index)
{
active_buffer = index;
if ( (index in buffer_filepaths) !is null )
setActiveFilepath(buffer_filepaths[index]);
return true;
}
/// ditto
bool RemoveBuffer(int index)
{
if ( (index in buffer_filepaths) !is null )
buffer_filepaths[index] = null;
return true;
}
/// ditto
bool OnOpen(char *filename)
{
buffer_filepaths[active_buffer] = filename[0 .. strlen(filename)];
setActiveFilepath(buffer_filepaths[active_buffer]);
return false;
}
/// ditto
bool OnSwitchFile(char *filename)
{
buffer_filepaths[active_buffer] = filename[0 .. strlen(filename)];
setActiveFilepath(buffer_filepaths[active_buffer]);
return false;
}
/**********************************************************************************************
Called on selection
**********************************************************************************************/
bool OnUserListSelection(int index, char* text)
{
select_list_type_ = SelectionListT.none;
try
{
auto str = text[0..strlen(text)];
if ( select_list_type_ == SelectionListT.goto_declaration )
gotoDeclaration(str);
else if ( select_list_type_ == SelectionListT.goto_module )
gotoModule(str);
}
catch ( Exception e )
log(e.msg~"\n");
return true;
}
/***********************************************************************************************
Called when a SciTE shortcut with id in [1500, 1599] is issued.
***********************************************************************************************/
bool OnCommand(uint cmd)
{
try switch ( cmd )
{
case 0:
if ( select_list_type_ != SelectionListT.none ) {
listDeclarations();
select_list_type_ = SelectionListT.goto_declaration;
}
break;
case 1:
if ( select_list_type_ == SelectionListT.none ) {
listModules();
select_list_type_ = SelectionListT.goto_module;
}
break;
case 2:
if ( select_list_type_ == SelectionListT.none )
gotoDeclaration();
break;
default:
break;
}
catch ( Exception e )
log(e.msg~"\n");
return true;
}
/***********************************************************************************************
Untranslated WM_KEYDOWN
***********************************************************************************************/
bool OnKey(int val, int mod)
{
if ( select_list_type_ == SelectionListT.none )
return false;
try
{
// TODO: do virtual key translation properly - patch SciTE?
if ( (val >= 'A' && val <= 'Z') || (val >= '0' && val <= '9') || val == 189 || val == 190 || val == SCK_BACK )
{
dchar c;
switch ( val )
{
case SCK_BACK:
c = 8;
break;
case 189:
c = '_';
break;
case 190:
c = '.';
break;
default:
c = val;
break;
}
return onChar(c);
}
switch ( val )
{
case VK_UP:
case VK_DOWN:
case SCK_RETURN:
case SCK_TAB:
case VK_SHIFT:
break;
default:
select_list_type = SelectionListT.none;
}
}
catch ( Exception e )
log(e.msg~"\n");
return false;
}
/***********************************************************************************************
***********************************************************************************************/
bool OnRawChar(char, uint)
{
return false;
}
bool OnExecute(char *)
{
return false;
}
bool OnDwellStart(int, char *)
{
return false;
}
bool OnClose(char *)
{
return false;
}
bool OnBeforeSave(char *)
{
return false;
}
bool OnSave(char *)
{
return false;
}
bool OnChar(char)
{
return false;
}
bool OnSavePointReached()
{
return false;
}
bool OnSavePointLeft()
{
return false;
}
bool OnStyle(uint, int, int, Accessor)
{
return false;
}
bool OnDoubleClick()
{
return false;
}
bool OnUpdateUI()
{
return false;
}
bool OnMarginClick()
{
return false;
}
bool OnMacro(char *, char *)
{
return false;
}
bool SendProperty(char *)
{
return false;
}
}
|
D
|
/Volumes/itechplushd1/projects/ios/Former/Build/Intermediates/Former.build/Debug-iphonesimulator/Former.build/Objects-normal/x86_64/ViewFormer.o : /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSegmentedCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormTextFieldCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSwitchCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormCheckCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormLabelCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSliderCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormInlinePickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormInlineDatePickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormDatePickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSelectorDatePickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormPickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSelectorPickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormStepperCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormTextViewCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/FormerProtocol.swift /Volumes/itechplushd1/projects/ios/Former/Former/Controllers/FormViewController.swift /Volumes/itechplushd1/projects/ios/Former/Former/Helpers/UITableViewCell+Former.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/Former.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/SectionFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/ViewFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/ViewFormers/BaseViewFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/ViewFormers/LabelViewFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/ViewFormers/CustomViewFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/RowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SegmentedRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/TextFieldRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/BaseRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SwitchRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/CheckRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/LabelRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/CustomRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SliderRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/PickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/InlinePickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/DatePickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/InlineDatePickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SelectorDatePickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SelectorPickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/StepperRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/TextViewRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/Views/FormLabelHeaderView.swift /Volumes/itechplushd1/projects/ios/Former/Former/Views/FormLabelFooterView.swift /Volumes/itechplushd1/projects/ios/Former/Former/Views/FormHeaderFooterView.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Volumes/itechplushd1/projects/ios/Former/Former/Former.h /Volumes/itechplushd1/projects/ios/Former/Build/Intermediates/Former.build/Debug-iphonesimulator/Former.build/unextended-module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Volumes/itechplushd1/projects/ios/Former/Build/Intermediates/Former.build/Debug-iphonesimulator/Former.build/Objects-normal/x86_64/ViewFormer~partial.swiftmodule : /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSegmentedCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormTextFieldCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSwitchCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormCheckCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormLabelCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSliderCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormInlinePickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormInlineDatePickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormDatePickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSelectorDatePickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormPickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSelectorPickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormStepperCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormTextViewCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/FormerProtocol.swift /Volumes/itechplushd1/projects/ios/Former/Former/Controllers/FormViewController.swift /Volumes/itechplushd1/projects/ios/Former/Former/Helpers/UITableViewCell+Former.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/Former.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/SectionFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/ViewFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/ViewFormers/BaseViewFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/ViewFormers/LabelViewFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/ViewFormers/CustomViewFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/RowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SegmentedRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/TextFieldRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/BaseRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SwitchRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/CheckRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/LabelRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/CustomRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SliderRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/PickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/InlinePickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/DatePickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/InlineDatePickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SelectorDatePickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SelectorPickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/StepperRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/TextViewRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/Views/FormLabelHeaderView.swift /Volumes/itechplushd1/projects/ios/Former/Former/Views/FormLabelFooterView.swift /Volumes/itechplushd1/projects/ios/Former/Former/Views/FormHeaderFooterView.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Volumes/itechplushd1/projects/ios/Former/Former/Former.h /Volumes/itechplushd1/projects/ios/Former/Build/Intermediates/Former.build/Debug-iphonesimulator/Former.build/unextended-module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Volumes/itechplushd1/projects/ios/Former/Build/Intermediates/Former.build/Debug-iphonesimulator/Former.build/Objects-normal/x86_64/ViewFormer~partial.swiftdoc : /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSegmentedCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormTextFieldCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSwitchCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormCheckCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormLabelCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSliderCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormInlinePickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormInlineDatePickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormDatePickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSelectorDatePickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormPickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormSelectorPickerCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormStepperCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Cells/FormTextViewCell.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/FormerProtocol.swift /Volumes/itechplushd1/projects/ios/Former/Former/Controllers/FormViewController.swift /Volumes/itechplushd1/projects/ios/Former/Former/Helpers/UITableViewCell+Former.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/Former.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/SectionFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/ViewFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/ViewFormers/BaseViewFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/ViewFormers/LabelViewFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/ViewFormers/CustomViewFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/Commons/RowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SegmentedRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/TextFieldRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/BaseRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SwitchRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/CheckRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/LabelRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/CustomRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SliderRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/PickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/InlinePickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/DatePickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/InlineDatePickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SelectorDatePickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/SelectorPickerRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/StepperRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/RowFormers/TextViewRowFormer.swift /Volumes/itechplushd1/projects/ios/Former/Former/Views/FormLabelHeaderView.swift /Volumes/itechplushd1/projects/ios/Former/Former/Views/FormLabelFooterView.swift /Volumes/itechplushd1/projects/ios/Former/Former/Views/FormHeaderFooterView.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Volumes/itechplushd1/projects/ios/Former/Former/Former.h /Volumes/itechplushd1/projects/ios/Former/Build/Intermediates/Former.build/Debug-iphonesimulator/Former.build/unextended-module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
func void B_SetBabeDefaultPerceptions()
{
Npc_PercEnable(self,PERC_ASSESSTALK,B_Babe_RefuseTalk);
Npc_PercEnable(self,PERC_ASSESSDAMAGE,ZS_Babe_Flee);
Npc_PercEnable(self,PERC_DRAWWEAPON,ZS_Babe_Flee);
};
|
D
|
/Users/damouse/Documents/ios/fabagainstbackend/build/FabAgainstBackend.build/Release/FabAgainstBackend.build/Objects-normal/x86_64/Session.o : /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/DemoPlayer.swift /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/Session.swift /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/Room.swift /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/Shared.swift /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/main.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/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
/Users/damouse/Documents/ios/fabagainstbackend/build/FabAgainstBackend.build/Release/FabAgainstBackend.build/Objects-normal/x86_64/Session~partial.swiftmodule : /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/DemoPlayer.swift /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/Session.swift /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/Room.swift /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/Shared.swift /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/main.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/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
/Users/damouse/Documents/ios/fabagainstbackend/build/FabAgainstBackend.build/Release/FabAgainstBackend.build/Objects-normal/x86_64/Session~partial.swiftdoc : /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/DemoPlayer.swift /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/Session.swift /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/Room.swift /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/Shared.swift /Users/damouse/Documents/ios/fabagainstbackend/FabAgainstBackend/main.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/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
|
D
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.