├── .gitignore ├── Cartfile ├── Cartfile.resolved ├── Carthage └── Checkouts │ ├── Result │ ├── .gitignore │ ├── .swift-version │ ├── .travis.yml │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── Package.swift │ ├── README.md │ ├── Result.podspec │ ├── Result.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── Result-Mac.xcscheme │ │ │ ├── Result-iOS.xcscheme │ │ │ ├── Result-tvOS.xcscheme │ │ │ └── Result-watchOS.xcscheme │ ├── Result │ │ ├── Info.plist │ │ ├── Result.h │ │ ├── Result.swift │ │ └── ResultProtocol.swift │ └── Tests │ │ ├── LinuxMain.swift │ │ └── ResultTests │ │ ├── Info.plist │ │ └── ResultTests.swift │ ├── SwiftyJSON │ ├── .github │ │ ├── ISSUE_TEMPLATE │ │ └── PULL_REQUEST_TEMPLATE │ ├── .gitignore │ ├── .hound.yml │ ├── .swift-version │ ├── .swiftlint.yml │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── Example │ │ ├── Example.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ ├── Example │ │ │ ├── AppDelegate.swift │ │ │ ├── Base.lproj │ │ │ │ ├── LaunchScreen.xib │ │ │ │ └── Main.storyboard │ │ │ ├── Images.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ │ └── LaunchImage.launchimage │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── Default@2x.png │ │ │ ├── Info.plist │ │ │ ├── SwiftyJSONTests.json │ │ │ └── ViewController.swift │ │ └── Playground.playground │ │ │ ├── Contents.swift │ │ │ ├── Resources │ │ │ └── SwiftyJSONTests.json │ │ │ └── contents.xcplayground │ ├── LICENSE │ ├── Package.swift │ ├── README.md │ ├── Source │ │ ├── Info-iOS.plist │ │ ├── Info-macOS.plist │ │ ├── Info-tvOS.plist │ │ ├── Info-watchOS.plist │ │ ├── SwiftyJSON.h │ │ └── SwiftyJSON.swift │ ├── SwiftyJSON.podspec │ ├── SwiftyJSON.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── SwiftyJSON iOS.xcscheme │ │ │ ├── SwiftyJSON macOS.xcscheme │ │ │ ├── SwiftyJSON tvOS.xcscheme │ │ │ └── SwiftyJSON watchOS.xcscheme │ ├── SwiftyJSON.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ ├── Tests │ │ └── SwiftyJSONTests │ │ │ ├── ArrayTests.swift │ │ │ ├── BaseTests.swift │ │ │ ├── CodableTests.swift │ │ │ ├── ComparableTests.swift │ │ │ ├── DictionaryTests.swift │ │ │ ├── Info-iOS.plist │ │ │ ├── Info-macOS.plist │ │ │ ├── Info-tvOS.plist │ │ │ ├── LiteralConvertibleTests.swift │ │ │ ├── MergeTests.swift │ │ │ ├── MutabilityTests.swift │ │ │ ├── NestedJSONTests.swift │ │ │ ├── NumberTests.swift │ │ │ ├── PerformanceTests.swift │ │ │ ├── PrintableTests.swift │ │ │ ├── RawRepresentableTests.swift │ │ │ ├── RawTests.swift │ │ │ ├── SequenceTypeTests.swift │ │ │ ├── StringTests.swift │ │ │ ├── SubscriptTests.swift │ │ │ └── Tests.json │ └── scripts │ │ └── carthage.sh │ └── swift-protobuf │ ├── .github │ └── issue_template.md │ ├── .gitignore │ ├── .jazzy.yaml │ ├── DevTools │ ├── CollectTests.awk │ ├── CopyrightFixup.sh │ └── LibraryVersions.py │ ├── Documentation │ ├── API.md │ ├── CONFORMANCE_TESTS.md │ ├── INTERNALS.md │ ├── PLUGIN.md │ ├── RELEASING.md │ └── STYLE_GUIDELINES.md │ ├── LICENSE.txt │ ├── Makefile │ ├── Package.swift │ ├── Package@swift-4.swift │ ├── Performance │ ├── .gitignore │ ├── Harness.cc │ ├── Harness.h │ ├── Harness.swift │ ├── Protobuf.tracetemplate │ ├── css │ │ └── harness-visualization.css │ ├── generators │ │ ├── cpp.sh │ │ ├── proto.sh │ │ └── swift.sh │ ├── harness-visualization.html │ ├── js │ │ ├── harness-visualization.js │ │ └── results.js.template │ ├── main.cc │ ├── main.swift │ ├── perf_runner.sh │ └── runners │ │ ├── cpp.sh │ │ └── swift.sh │ ├── Protos │ ├── README.md │ ├── SwiftProtobufPluginLibrary │ │ └── swift_protobuf_module_mappings.proto │ ├── conformance │ │ └── conformance.proto │ ├── generated_swift_names_enum_cases.proto │ ├── generated_swift_names_enums.proto │ ├── generated_swift_names_fields.proto │ ├── generated_swift_names_messages.proto │ ├── google │ │ └── protobuf │ │ │ ├── any.proto │ │ │ ├── any_test.proto │ │ │ ├── api.proto │ │ │ ├── compiler │ │ │ └── plugin.proto │ │ │ ├── descriptor.proto │ │ │ ├── duration.proto │ │ │ ├── empty.proto │ │ │ ├── field_mask.proto │ │ │ ├── map_lite_unittest.proto │ │ │ ├── map_proto2_unittest.proto │ │ │ ├── map_unittest.proto │ │ │ ├── source_context.proto │ │ │ ├── struct.proto │ │ │ ├── test_messages_proto2.proto │ │ │ ├── test_messages_proto3.proto │ │ │ ├── timestamp.proto │ │ │ ├── type.proto │ │ │ ├── unittest.proto │ │ │ ├── unittest_arena.proto │ │ │ ├── unittest_custom_options.proto │ │ │ ├── unittest_drop_unknown_fields.proto │ │ │ ├── unittest_embed_optimize_for.proto │ │ │ ├── unittest_empty.proto │ │ │ ├── unittest_enormous_descriptor.proto │ │ │ ├── unittest_import.proto │ │ │ ├── unittest_import_lite.proto │ │ │ ├── unittest_import_public.proto │ │ │ ├── unittest_import_public_lite.proto │ │ │ ├── unittest_lazy_dependencies.proto │ │ │ ├── unittest_lazy_dependencies_custom_option.proto │ │ │ ├── unittest_lazy_dependencies_enum.proto │ │ │ ├── unittest_lite.proto │ │ │ ├── unittest_lite_imports_nonlite.proto │ │ │ ├── unittest_mset.proto │ │ │ ├── unittest_mset_wire_format.proto │ │ │ ├── unittest_no_arena.proto │ │ │ ├── unittest_no_arena_import.proto │ │ │ ├── unittest_no_arena_lite.proto │ │ │ ├── unittest_no_field_presence.proto │ │ │ ├── unittest_no_generic_services.proto │ │ │ ├── unittest_optimize_for.proto │ │ │ ├── unittest_preserve_unknown_enum.proto │ │ │ ├── unittest_preserve_unknown_enum2.proto │ │ │ ├── unittest_proto3.proto │ │ │ ├── unittest_proto3_arena.proto │ │ │ ├── unittest_proto3_arena_lite.proto │ │ │ ├── unittest_proto3_lite.proto │ │ │ ├── unittest_well_known_types.proto │ │ │ └── wrappers.proto │ ├── pluginlib_descriptor_test.proto │ ├── unittest_swift_all_required_types.proto │ ├── unittest_swift_cycle.proto │ ├── unittest_swift_enum.proto │ ├── unittest_swift_enum_optional_default.proto │ ├── unittest_swift_enum_proto3.proto │ ├── unittest_swift_extension.proto │ ├── unittest_swift_extension2.proto │ ├── unittest_swift_extension3.proto │ ├── unittest_swift_extension4.proto │ ├── unittest_swift_fieldorder.proto │ ├── unittest_swift_groups.proto │ ├── unittest_swift_naming.proto │ ├── unittest_swift_naming_no_prefix.proto │ ├── unittest_swift_oneof_all_required.proto │ ├── unittest_swift_oneof_merging.proto │ ├── unittest_swift_performance.proto │ ├── unittest_swift_reserved.proto │ ├── unittest_swift_reserved_ext.proto │ ├── unittest_swift_runtime_proto2.proto │ ├── unittest_swift_runtime_proto3.proto │ └── unittest_swift_startup.proto │ ├── README.md │ ├── Reference │ ├── SwiftProtobufPluginLibrary │ │ └── swift_protobuf_module_mappings.pb.swift │ ├── conformance │ │ └── conformance.pb.swift │ ├── generated_swift_names_enum_cases.pb.swift │ ├── generated_swift_names_enums.pb.swift │ ├── generated_swift_names_fields.pb.swift │ ├── generated_swift_names_messages.pb.swift │ ├── google │ │ └── protobuf │ │ │ ├── any.pb.swift │ │ │ ├── any_test.pb.swift │ │ │ ├── api.pb.swift │ │ │ ├── compiler │ │ │ └── plugin.pb.swift │ │ │ ├── descriptor.pb.swift │ │ │ ├── duration.pb.swift │ │ │ ├── empty.pb.swift │ │ │ ├── field_mask.pb.swift │ │ │ ├── map_lite_unittest.pb.swift │ │ │ ├── map_proto2_unittest.pb.swift │ │ │ ├── map_unittest.pb.swift │ │ │ ├── source_context.pb.swift │ │ │ ├── struct.pb.swift │ │ │ ├── test_messages_proto2.pb.swift │ │ │ ├── test_messages_proto3.pb.swift │ │ │ ├── timestamp.pb.swift │ │ │ ├── type.pb.swift │ │ │ ├── unittest.pb.swift │ │ │ ├── unittest_arena.pb.swift │ │ │ ├── unittest_custom_options.pb.swift │ │ │ ├── unittest_drop_unknown_fields.pb.swift │ │ │ ├── unittest_embed_optimize_for.pb.swift │ │ │ ├── unittest_empty.pb.swift │ │ │ ├── unittest_enormous_descriptor.pb.swift │ │ │ ├── unittest_import.pb.swift │ │ │ ├── unittest_import_lite.pb.swift │ │ │ ├── unittest_import_public.pb.swift │ │ │ ├── unittest_import_public_lite.pb.swift │ │ │ ├── unittest_lazy_dependencies.pb.swift │ │ │ ├── unittest_lazy_dependencies_custom_option.pb.swift │ │ │ ├── unittest_lazy_dependencies_enum.pb.swift │ │ │ ├── unittest_lite.pb.swift │ │ │ ├── unittest_lite_imports_nonlite.pb.swift │ │ │ ├── unittest_mset.pb.swift │ │ │ ├── unittest_mset_wire_format.pb.swift │ │ │ ├── unittest_no_arena.pb.swift │ │ │ ├── unittest_no_arena_import.pb.swift │ │ │ ├── unittest_no_arena_lite.pb.swift │ │ │ ├── unittest_no_field_presence.pb.swift │ │ │ ├── unittest_no_generic_services.pb.swift │ │ │ ├── unittest_optimize_for.pb.swift │ │ │ ├── unittest_preserve_unknown_enum.pb.swift │ │ │ ├── unittest_preserve_unknown_enum2.pb.swift │ │ │ ├── unittest_proto3.pb.swift │ │ │ ├── unittest_proto3_arena.pb.swift │ │ │ ├── unittest_proto3_arena_lite.pb.swift │ │ │ ├── unittest_proto3_lite.pb.swift │ │ │ ├── unittest_well_known_types.pb.swift │ │ │ └── wrappers.pb.swift │ ├── pluginlib_descriptor_test.pb.swift │ ├── unittest_swift_all_required_types.pb.swift │ ├── unittest_swift_cycle.pb.swift │ ├── unittest_swift_enum.pb.swift │ ├── unittest_swift_enum_optional_default.pb.swift │ ├── unittest_swift_enum_proto3.pb.swift │ ├── unittest_swift_extension.pb.swift │ ├── unittest_swift_extension2.pb.swift │ ├── unittest_swift_extension3.pb.swift │ ├── unittest_swift_extension4.pb.swift │ ├── unittest_swift_fieldorder.pb.swift │ ├── unittest_swift_groups.pb.swift │ ├── unittest_swift_naming.pb.swift │ ├── unittest_swift_naming_no_prefix.pb.swift │ ├── unittest_swift_oneof_all_required.pb.swift │ ├── unittest_swift_oneof_merging.pb.swift │ ├── unittest_swift_performance.pb.swift │ ├── unittest_swift_reserved.pb.swift │ ├── unittest_swift_reserved_ext.pb.swift │ ├── unittest_swift_runtime_proto2.pb.swift │ ├── unittest_swift_runtime_proto3.pb.swift │ └── unittest_swift_startup.pb.swift │ ├── Sources │ ├── Conformance │ │ ├── conformance.pb.swift │ │ ├── failure_list_swift.txt │ │ ├── main.swift │ │ ├── test_messages_proto2.pb.swift │ │ └── test_messages_proto3.pb.swift │ ├── SwiftProtobuf │ │ ├── AnyMessageStorage.swift │ │ ├── AnyUnpackError.swift │ │ ├── BinaryDecoder.swift │ │ ├── BinaryDecodingError.swift │ │ ├── BinaryDecodingOptions.swift │ │ ├── BinaryDelimited.swift │ │ ├── BinaryEncoder.swift │ │ ├── BinaryEncodingError.swift │ │ ├── BinaryEncodingSizeVisitor.swift │ │ ├── BinaryEncodingVisitor.swift │ │ ├── CustomJSONCodable.swift │ │ ├── Decoder.swift │ │ ├── DoubleFormatter.swift │ │ ├── Enum.swift │ │ ├── ExtensibleMessage.swift │ │ ├── ExtensionFieldValueSet.swift │ │ ├── ExtensionFields.swift │ │ ├── ExtensionMap.swift │ │ ├── FieldTag.swift │ │ ├── FieldTypes.swift │ │ ├── Google_Protobuf_Any+Extensions.swift │ │ ├── Google_Protobuf_Any+Registry.swift │ │ ├── Google_Protobuf_Duration+Extensions.swift │ │ ├── Google_Protobuf_FieldMask+Extensions.swift │ │ ├── Google_Protobuf_ListValue+Extensions.swift │ │ ├── Google_Protobuf_Struct+Extensions.swift │ │ ├── Google_Protobuf_Timestamp+Extensions.swift │ │ ├── Google_Protobuf_Value+Extensions.swift │ │ ├── Google_Protobuf_Wrappers+Extensions.swift │ │ ├── HashVisitor.swift │ │ ├── Internal.swift │ │ ├── JSONDecoder.swift │ │ ├── JSONDecodingError.swift │ │ ├── JSONDecodingOptions.swift │ │ ├── JSONEncoder.swift │ │ ├── JSONEncodingError.swift │ │ ├── JSONEncodingVisitor.swift │ │ ├── JSONIntegerConverting.swift │ │ ├── JSONMapEncodingVisitor.swift │ │ ├── JSONScanner.swift │ │ ├── MathUtils.swift │ │ ├── Message+AnyAdditions.swift │ │ ├── Message+BinaryAdditions.swift │ │ ├── Message+JSONAdditions.swift │ │ ├── Message+JSONArrayAdditions.swift │ │ ├── Message+TextFormatAdditions.swift │ │ ├── Message.swift │ │ ├── MessageExtension.swift │ │ ├── NameMap.swift │ │ ├── ProtoNameProviding.swift │ │ ├── ProtobufAPIVersionCheck.swift │ │ ├── ProtobufMap.swift │ │ ├── SelectiveVisitor.swift │ │ ├── SimpleExtensionMap.swift │ │ ├── StringUtils.swift │ │ ├── TextFormatDecoder.swift │ │ ├── TextFormatDecodingError.swift │ │ ├── TextFormatEncoder.swift │ │ ├── TextFormatEncodingVisitor.swift │ │ ├── TextFormatScanner.swift │ │ ├── TimeUtils.swift │ │ ├── UnknownStorage.swift │ │ ├── Varint.swift │ │ ├── Version.swift │ │ ├── Visitor.swift │ │ ├── WireFormat.swift │ │ ├── ZigZag.swift │ │ ├── any.pb.swift │ │ ├── api.pb.swift │ │ ├── duration.pb.swift │ │ ├── empty.pb.swift │ │ ├── field_mask.pb.swift │ │ ├── source_context.pb.swift │ │ ├── struct.pb.swift │ │ ├── timestamp.pb.swift │ │ ├── type.pb.swift │ │ └── wrappers.pb.swift │ ├── SwiftProtobufPluginLibrary │ │ ├── Array+Extensions.swift │ │ ├── CodePrinter.swift │ │ ├── Descriptor+Extensions.swift │ │ ├── Descriptor.swift │ │ ├── FieldNumbers.swift │ │ ├── Google_Protobuf_Compiler_CodeGeneratorResponse+Extensions.swift │ │ ├── Google_Protobuf_SourceCodeInfo+Extensions.swift │ │ ├── HashableArray.swift │ │ ├── NamingUtils.swift │ │ ├── ProtoFileToModuleMappings.swift │ │ ├── ProvidesLocationPath.swift │ │ ├── ProvidesSourceCodeLocation.swift │ │ ├── SwiftLanguage.swift │ │ ├── SwiftProtobufInfo.swift │ │ ├── SwiftProtobufNamer.swift │ │ ├── UnicodeScalar+Extensions.swift │ │ ├── descriptor.pb.swift │ │ ├── plugin.pb.swift │ │ └── swift_protobuf_module_mappings.pb.swift │ └── protoc-gen-swift │ │ ├── CommandLine+Extensions.swift │ │ ├── Descriptor+Extensions.swift │ │ ├── EnumGenerator.swift │ │ ├── ExtensionSetGenerator.swift │ │ ├── FieldGenerator.swift │ │ ├── FileGenerator.swift │ │ ├── FileIo.swift │ │ ├── GenerationError.swift │ │ ├── GeneratorOptions.swift │ │ ├── Google_Protobuf_DescriptorProto+Extensions.swift │ │ ├── Google_Protobuf_FileDescriptorProto+Extensions.swift │ │ ├── MessageFieldGenerator.swift │ │ ├── MessageGenerator.swift │ │ ├── MessageStorageClassGenerator.swift │ │ ├── OneofGenerator.swift │ │ ├── StringUtils.swift │ │ ├── Version.swift │ │ └── main.swift │ ├── SwiftProtobuf.podspec │ ├── SwiftProtobuf.xcodeproj │ ├── ProtobufTestSuite_Info.plist │ ├── Protobuf_Info.plist │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ ├── SwiftProtobuf_iOS.xcscheme │ │ ├── SwiftProtobuf_macOS.xcscheme │ │ ├── SwiftProtobuf_tvOS.xcscheme │ │ ├── SwiftProtobuf_watchOS.xcscheme │ │ └── xcschememanagement.plist │ └── Tests │ ├── LinuxMain.swift │ ├── SwiftProtobufPluginLibraryTests │ ├── Descriptor+TestHelpers.swift │ ├── DescriptorTestData.swift │ ├── Test_Descriptor.swift │ ├── Test_NamingUtils.swift │ ├── Test_ProtoFileToModuleMappings.swift │ ├── Test_SwiftLanguage.swift │ └── Test_SwiftProtobufNamer.swift │ └── SwiftProtobufTests │ ├── Message+UInt8ArrayHelpers.swift │ ├── TestHelpers.swift │ ├── Test_AllTypes.swift │ ├── Test_AllTypes_Proto3.swift │ ├── Test_Any.swift │ ├── Test_Api.swift │ ├── Test_BasicFields_Access_Proto2.swift │ ├── Test_BasicFields_Access_Proto3.swift │ ├── Test_BinaryDecodingOptions.swift │ ├── Test_BinaryDelimited.swift │ ├── Test_Conformance.swift │ ├── Test_Duration.swift │ ├── Test_Empty.swift │ ├── Test_Enum.swift │ ├── Test_EnumWithAliases.swift │ ├── Test_Enum_Proto2.swift │ ├── Test_Extensions.swift │ ├── Test_ExtremeDefaultValues.swift │ ├── Test_FieldMask.swift │ ├── Test_FieldOrdering.swift │ ├── Test_GroupWithGroups.swift │ ├── Test_JSON.swift │ ├── Test_JSONDecodingOptions.swift │ ├── Test_JSON_Array.swift │ ├── Test_JSON_Conformance.swift │ ├── Test_JSON_Group.swift │ ├── Test_Map.swift │ ├── Test_MapFields_Access_Proto2.swift │ ├── Test_MapFields_Access_Proto3.swift │ ├── Test_Map_JSON.swift │ ├── Test_Merge.swift │ ├── Test_MessageSet.swift │ ├── Test_Naming.swift │ ├── Test_OneofFields_Access_Proto2.swift │ ├── Test_OneofFields_Access_Proto3.swift │ ├── Test_Packed.swift │ ├── Test_ParsingMerge.swift │ ├── Test_ReallyLargeTagNumber.swift │ ├── Test_RecursiveMap.swift │ ├── Test_Required.swift │ ├── Test_Reserved.swift │ ├── Test_SimpleExtensionMap.swift │ ├── Test_Struct.swift │ ├── Test_TextFormat_Map_proto3.swift │ ├── Test_TextFormat_Unknown.swift │ ├── Test_TextFormat_WKT_proto3.swift │ ├── Test_TextFormat_proto2.swift │ ├── Test_TextFormat_proto2_extensions.swift │ ├── Test_TextFormat_proto3.swift │ ├── Test_Timestamp.swift │ ├── Test_Type.swift │ ├── Test_Unknown_proto2.swift │ ├── Test_Unknown_proto3.swift │ ├── Test_Wrappers.swift │ ├── any_test.pb.swift │ ├── conformance.pb.swift │ ├── descriptor.pb.swift │ ├── generated_swift_names_enum_cases.pb.swift │ ├── generated_swift_names_enums.pb.swift │ ├── generated_swift_names_fields.pb.swift │ ├── generated_swift_names_messages.pb.swift │ ├── map_proto2_unittest.pb.swift │ ├── map_unittest.pb.swift │ ├── test_messages_proto3.pb.swift │ ├── unittest.pb.swift │ ├── unittest_arena.pb.swift │ ├── unittest_custom_options.pb.swift │ ├── unittest_drop_unknown_fields.pb.swift │ ├── unittest_embed_optimize_for.pb.swift │ ├── unittest_empty.pb.swift │ ├── unittest_import.pb.swift │ ├── unittest_import_lite.pb.swift │ ├── unittest_import_public.pb.swift │ ├── unittest_import_public_lite.pb.swift │ ├── unittest_lite.pb.swift │ ├── unittest_lite_imports_nonlite.pb.swift │ ├── unittest_mset.pb.swift │ ├── unittest_mset_wire_format.pb.swift │ ├── unittest_no_arena.pb.swift │ ├── unittest_no_arena_import.pb.swift │ ├── unittest_no_arena_lite.pb.swift │ ├── unittest_no_field_presence.pb.swift │ ├── unittest_no_generic_services.pb.swift │ ├── unittest_optimize_for.pb.swift │ ├── unittest_preserve_unknown_enum.pb.swift │ ├── unittest_preserve_unknown_enum2.pb.swift │ ├── unittest_proto3.pb.swift │ ├── unittest_proto3_arena.pb.swift │ ├── unittest_swift_all_required_types.pb.swift │ ├── unittest_swift_cycle.pb.swift │ ├── unittest_swift_enum.pb.swift │ ├── unittest_swift_enum_optional_default.pb.swift │ ├── unittest_swift_enum_proto3.pb.swift │ ├── unittest_swift_extension.pb.swift │ ├── unittest_swift_extension2.pb.swift │ ├── unittest_swift_extension3.pb.swift │ ├── unittest_swift_extension4.pb.swift │ ├── unittest_swift_fieldorder.pb.swift │ ├── unittest_swift_groups.pb.swift │ ├── unittest_swift_naming.pb.swift │ ├── unittest_swift_naming_no_prefix.pb.swift │ ├── unittest_swift_oneof_all_required.pb.swift │ ├── unittest_swift_oneof_merging.pb.swift │ ├── unittest_swift_performance.pb.swift │ ├── unittest_swift_reserved.pb.swift │ ├── unittest_swift_reserved_ext.pb.swift │ ├── unittest_swift_runtime_proto2.pb.swift │ ├── unittest_swift_runtime_proto3.pb.swift │ ├── unittest_swift_startup.pb.swift │ └── unittest_well_known_types.pb.swift ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── OpenCastSwift.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ ├── OpenCastSwift Mac.xcscheme │ └── OpenCastSwift iOS.xcscheme ├── OpenCastSwift.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── README.md ├── Sample Apps.xcodeproj └── project.pbxproj ├── Sample Mac App ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Cast.imageset │ │ ├── Artboard 2.png │ │ ├── Artboard 2@2x.png │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ └── Base.lproj │ │ └── MainMenu.xib ├── Info.plist ├── Sample_Mac_App.entitlements └── StatusItemController.swift ├── Sample iOS App ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── DetailsViewController.swift ├── DeviceCell.swift ├── Info.plist └── ViewController.swift └── Source ├── .DS_Store ├── Definitions └── CASTV2Protocol.swift ├── Helpers ├── CastV2PlatformReader.swift └── Proto │ ├── cast_channel.pb.swift │ └── cast_channel.proto ├── Models ├── AppAvailability.swift ├── CastApp.swift ├── CastDevice.swift ├── CastMedia.swift ├── CastMediaStatus.swift ├── CastMessage.swift ├── CastMultizoneDevice.swift ├── CastMultizoneStatus.swift └── CastStatus.swift ├── Networking ├── CastClient.swift ├── CastDeviceScanner.swift └── Channels │ ├── CastChannel.swift │ ├── Channelable.swift │ ├── DeviceAuthChannel.swift │ ├── DeviceConnectionChannel.swift │ ├── DeviceDiscoveryChannel.swift │ ├── DeviceSetupChannel.swift │ ├── HeartbeatChannel.swift │ ├── MediaControlChannel.swift │ ├── MultizoneControlChannel.swift │ ├── ReceiverControlChannel.swift │ └── RequestSink.swift └── Supporting Files ├── ChromeCastCore.h └── Info.plist /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # Xcode 4 | # 5 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 6 | 7 | ## Build generated 8 | build/ 9 | DerivedData/ 10 | 11 | ## Various settings 12 | *.pbxuser 13 | !default.pbxuser 14 | *.mode1v3 15 | !default.mode1v3 16 | *.mode2v3 17 | !default.mode2v3 18 | *.perspectivev3 19 | !default.perspectivev3 20 | xcuserdata/ 21 | 22 | ## Other 23 | *.moved-aside 24 | *.xccheckout 25 | *.xcscmblueprint 26 | 27 | ## Obj-C/Swift specific 28 | *.hmap 29 | *.ipa 30 | *.dSYM.zip 31 | *.dSYM 32 | 33 | ## Playgrounds 34 | timeline.xctimeline 35 | playground.xcworkspace 36 | 37 | # Swift Package Manager 38 | # 39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 40 | # Packages/ 41 | # Package.pins 42 | .build/ 43 | 44 | # CocoaPods 45 | # 46 | # We recommend against adding the Pods directory to your .gitignore. However 47 | # you should judge for yourself, the pros and cons are mentioned at: 48 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 49 | # 50 | # Pods/ 51 | 52 | # Carthage 53 | # 54 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 55 | # Carthage/Checkouts 56 | 57 | Carthage/Build 58 | 59 | # fastlane 60 | # 61 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 62 | # screenshots whenever they are needed. 63 | # For more information about the recommended setup visit: 64 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 65 | 66 | fastlane/report.xml 67 | fastlane/Preview.html 68 | fastlane/screenshots 69 | fastlane/test_output 70 | -------------------------------------------------------------------------------- /Cartfile: -------------------------------------------------------------------------------- 1 | github "apple/swift-protobuf" ~> 1.0 2 | github "SwiftyJSON/SwiftyJSON" ~> 4.0 3 | github "antitypical/Result" ~> 3.2 4 | -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "SwiftyJSON/SwiftyJSON" "4.1.0" 2 | github "antitypical/Result" "3.2.4" 3 | github "apple/swift-protobuf" "1.0.3" 4 | -------------------------------------------------------------------------------- /Carthage/Checkouts/Result/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | xcuserdata 3 | *.xcuserdatad 4 | *.xccheckout 5 | *.mode* 6 | *.pbxuser 7 | 8 | Carthage/Build 9 | .build 10 | -------------------------------------------------------------------------------- /Carthage/Checkouts/Result/.swift-version: -------------------------------------------------------------------------------- 1 | 3.0 2 | -------------------------------------------------------------------------------- /Carthage/Checkouts/Result/.travis.yml: -------------------------------------------------------------------------------- 1 | matrix: 2 | include: 3 | - script: 4 | - set -o pipefail 5 | - xcodebuild $XCODE_ACTION -scheme Result-Mac | xcpretty 6 | - xcodebuild $XCODE_ACTION -scheme Result-iOS -sdk iphonesimulator -destination "name=iPhone SE" | xcpretty 7 | - xcodebuild $XCODE_ACTION -scheme Result-tvOS -sdk appletvsimulator -destination "name=Apple TV 1080p" | xcpretty 8 | - xcodebuild build -scheme Result-watchOS -sdk watchsimulator | xcpretty 9 | # - pod lib lint 10 | env: 11 | - JOB=Xcode 12 | - XCODE_ACTION="build-for-testing test-without-building" 13 | os: osx 14 | osx_image: xcode8 15 | language: objective-c 16 | - script: 17 | - swift build 18 | - swift test 19 | env: JOB=SPM 20 | os: osx 21 | osx_image: xcode8 22 | language: objective-c 23 | - script: 24 | - swift build 25 | - swift test 26 | env: JOB=Linux 27 | sudo: required 28 | dist: trusty 29 | language: generic 30 | install: 31 | - eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)" 32 | - script: 33 | - swift build 34 | - swift test 35 | env: 36 | - JOB=Linux 37 | - SWIFT_VERSION=3.1 38 | sudo: required 39 | dist: trusty 40 | language: generic 41 | install: 42 | - eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)" 43 | notifications: 44 | email: false 45 | -------------------------------------------------------------------------------- /Carthage/Checkouts/Result/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | We love that you're interested in contributing to this project! 2 | 3 | To make the process as painless as possible, we have just a couple of guidelines 4 | that should make life easier for everyone involved. 5 | 6 | ## Prefer Pull Requests 7 | 8 | If you know exactly how to implement the feature being suggested or fix the bug 9 | being reported, please open a pull request instead of an issue. Pull requests are easier than 10 | patches or inline code blocks for discussing and merging the changes. 11 | 12 | If you can't make the change yourself, please open an issue after making sure 13 | that one isn't already logged. 14 | 15 | ## Contributing Code 16 | 17 | Fork this repository, make it awesomer (preferably in a branch named for the 18 | topic), send a pull request! 19 | 20 | All code contributions should match our [coding 21 | conventions](https://github.com/github/swift-style-guide). 22 | 23 | Thanks for contributing! :boom::camel: 24 | -------------------------------------------------------------------------------- /Carthage/Checkouts/Result/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Rob Rix 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Carthage/Checkouts/Result/Package.swift: -------------------------------------------------------------------------------- 1 | import PackageDescription 2 | 3 | let package = Package( 4 | name: "Result", 5 | targets: [ 6 | Target( 7 | name: "Result" 8 | ) 9 | ] 10 | ) 11 | -------------------------------------------------------------------------------- /Carthage/Checkouts/Result/Result.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'Result' 3 | s.version = '3.2.4' 4 | s.summary = 'Swift type modelling the success/failure of arbitrary operations' 5 | 6 | s.homepage = 'https://github.com/antitypical/Result' 7 | s.license = { :type => 'MIT', :file => 'LICENSE' } 8 | s.author = { 'Rob Rix' => 'rob.rix@github.com' } 9 | s.source = { :git => 'https://github.com/antitypical/Result.git', :tag => s.version } 10 | s.source_files = 'Result/*.swift' 11 | s.requires_arc = true 12 | s.ios.deployment_target = '8.0' 13 | s.osx.deployment_target = '10.9' 14 | s.watchos.deployment_target = '2.0' 15 | s.tvos.deployment_target = '9.0' 16 | end 17 | -------------------------------------------------------------------------------- /Carthage/Checkouts/Result/Result.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Carthage/Checkouts/Result/Result/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.2.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 Rob Rix. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Carthage/Checkouts/Result/Result/Result.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 Rob Rix. All rights reserved. 2 | 3 | /// Project version number for Result. 4 | extern double ResultVersionNumber; 5 | 6 | /// Project version string for Result. 7 | extern const unsigned char ResultVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /Carthage/Checkouts/Result/Tests/LinuxMain.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | @testable import ResultTests 4 | 5 | XCTMain([ 6 | testCase(ResultTests.allTests), 7 | testCase(NoErrorTests.allTests), 8 | ]) 9 | -------------------------------------------------------------------------------- /Carthage/Checkouts/Result/Tests/ResultTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 3.2.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/.github/ISSUE_TEMPLATE: -------------------------------------------------------------------------------- 1 | ### What did you do? 2 | 3 | Please replace this with what you did. 4 | 5 | ### What did you expect to happen? 6 | 7 | Please replace this with what you expected to happen. 8 | 9 | ### What actually happened instead? 10 | 11 | Please replace this with what happened instead. 12 | 13 | ### Environment 14 | 15 | List the software versions you're using: 16 | 17 | - SwiftyJSON: *?.?.?* 18 | - Xcode Version: *?.? (????)* (Open Xcode; In menubar: Xcode > About Xcode) 19 | - Swift Version: *?.?* (Open Xcode Preferences; Components > Toolchains. If none, use `Xcode Default`.) 20 | 21 | Please also mention which package manager you used and its version. Delete the 22 | other package managers in this list: 23 | 24 | - Cocoapods: *?.?.?* (Use `pod --version` in Terminal) 25 | - Carthage: *?.?* (Use `carthage version` in Terminal) 26 | - Swift Package Manager *?.?.? (swiftpm-???)* (Use `swift build --version` in Terminal) 27 | 28 | ### Project that demonstrates the issue 29 | 30 | Please link to a project we can download that reproduces the issue. Feel free 31 | to delete this section if it's not relevant to the issue (eg - feature request). 32 | 33 | The project should be [short, self-contained, and correct example](http://sscce.org/). -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/.github/PULL_REQUEST_TEMPLATE: -------------------------------------------------------------------------------- 1 | The PR should summarize what was changed and why. Here are some questions to 2 | help you if you're not sure: 3 | 4 | - What behavior was changed? 5 | - What code was refactored / updated to support this change? 6 | - What issues are related to this PR? Or why was this change introduced? 7 | 8 | Checklist - While not every PR needs it, new features should consider this list: 9 | 10 | - [ ] Does this have tests? 11 | - [ ] Does this have documentation? 12 | - [ ] Does this break the public API (Requires major version bump)? 13 | - [ ] Is this a new feature (Requires minor version bump)? -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | *.xccheckout 19 | 20 | #CocoaPods 21 | Pods 22 | 23 | #Carthage 24 | Carthage/Build 25 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/.hound.yml: -------------------------------------------------------------------------------- 1 | swift: 2 | config_file: .swiftlint.yml 3 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/.swift-version: -------------------------------------------------------------------------------- 1 | 3.0 2 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: 2 | - force_cast 3 | - force_try 4 | - variable_name 5 | - type_name 6 | - file_length 7 | - line_length 8 | - type_body_length 9 | - cyclomatic_complexity 10 | - function_body_length 11 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode9.3 3 | xcode_sdk: iphonesimulator10.0 4 | script: 5 | - set -o pipefail 6 | - travis_retry xcodebuild -workspace SwiftyJSON.xcworkspace -scheme "SwiftyJSON iOS" -destination "platform=iOS Simulator,name=iPhone 6" build-for-testing test | xcpretty 7 | - travis_retry xcodebuild -workspace SwiftyJSON.xcworkspace -scheme "SwiftyJSON macOS" build-for-testing test | xcpretty 8 | - travis_retry xcodebuild -workspace SwiftyJSON.xcworkspace -scheme "SwiftyJSON tvOS" -destination "platform=tvOS Simulator,name=Apple TV" build-for-testing test | xcpretty 9 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Example/Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // AppDelegate.swift 2 | // 3 | // Copyright (c) 2014 - 2016 Pinglin Tang 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | import UIKit 24 | import SwiftyJSON 25 | 26 | @UIApplicationMain 27 | class AppDelegate: UIResponder, UIApplicationDelegate { 28 | 29 | var window: UIWindow? 30 | 31 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 32 | 33 | let navigationController = self.window?.rootViewController as! UINavigationController 34 | let viewController = navigationController.topViewController as! ViewController 35 | 36 | if let file = Bundle.main.path(forResource: "SwiftyJSONTests", ofType: "json") { 37 | do { 38 | let data = try Data(contentsOf: URL(fileURLWithPath: file)) 39 | let json = try JSON(data: data) 40 | viewController.json = json 41 | } catch { 42 | viewController.json = JSON.null 43 | } 44 | } else { 45 | viewController.json = JSON.null 46 | } 47 | 48 | return true 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Example/Example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Example/Example/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "extent" : "full-screen", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "filename" : "Default@2x.png", 15 | "minimum-system-version" : "7.0", 16 | "orientation" : "portrait", 17 | "scale" : "2x" 18 | }, 19 | { 20 | "orientation" : "portrait", 21 | "idiom" : "ipad", 22 | "extent" : "full-screen", 23 | "minimum-system-version" : "7.0", 24 | "scale" : "1x" 25 | }, 26 | { 27 | "orientation" : "landscape", 28 | "idiom" : "ipad", 29 | "extent" : "full-screen", 30 | "minimum-system-version" : "7.0", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "orientation" : "portrait", 35 | "idiom" : "ipad", 36 | "extent" : "full-screen", 37 | "minimum-system-version" : "7.0", 38 | "scale" : "2x" 39 | }, 40 | { 41 | "orientation" : "landscape", 42 | "idiom" : "ipad", 43 | "extent" : "full-screen", 44 | "minimum-system-version" : "7.0", 45 | "scale" : "2x" 46 | } 47 | ], 48 | "info" : { 49 | "version" : 1, 50 | "author" : "xcode" 51 | } 52 | } -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Example/Example/Images.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhmiles/OpenCastSwift/a8a233268a25f45bead79c76e747b6997c45f158/Carthage/Checkouts/SwiftyJSON/Example/Example/Images.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Example/Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Example/Playground.playground/contents.xcplayground: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Ruoyu Fu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Package.swift: -------------------------------------------------------------------------------- 1 | import PackageDescription 2 | 3 | let package = Package( 4 | name: "SwiftyJSON") 5 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Source/Info-iOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Source/Info-macOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Source/Info-tvOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | UIRequiredDeviceCapabilities 26 | 27 | arm64 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Source/Info-watchOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Source/SwiftyJSON.h: -------------------------------------------------------------------------------- 1 | // SwiftyJSON.h 2 | // 3 | // Copyright (c) 2014 - 2017 Ruoyu Fu, Pinglin Tang 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | @import Foundation; 24 | 25 | //! Project version number for SwiftyJSON. 26 | FOUNDATION_EXPORT double SwiftyJSONVersionNumber; 27 | 28 | //! Project version string for SwiftyJSON. 29 | FOUNDATION_EXPORT const unsigned char SwiftyJSONVersionString[]; 30 | 31 | 32 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/SwiftyJSON.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "SwiftyJSON" 3 | s.version = "4.1.0" 4 | s.summary = "SwiftyJSON makes it easy to deal with JSON data in Swift" 5 | s.homepage = "https://github.com/SwiftyJSON/SwiftyJSON" 6 | s.license = { :type => "MIT" } 7 | s.authors = { "lingoer" => "lingoerer@gmail.com", "tangplin" => "tangplin@gmail.com" } 8 | 9 | s.requires_arc = true 10 | s.osx.deployment_target = "10.9" 11 | s.ios.deployment_target = "8.0" 12 | s.watchos.deployment_target = "2.0" 13 | s.tvos.deployment_target = "9.0" 14 | s.source = { :git => "https://github.com/SwiftyJSON/SwiftyJSON.git", :tag => s.version } 15 | s.source_files = "Source/*.swift" 16 | end 17 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/SwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/SwiftyJSON.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/SwiftyJSON.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/SwiftyJSON.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Tests/SwiftyJSONTests/ArrayTests.swift: -------------------------------------------------------------------------------- 1 | // ArrayTests.swift 2 | // 3 | // Copyright (c) 2014 - 2017 Pinglin Tang 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | import XCTest 24 | import SwiftyJSON 25 | 26 | class ArrayTests: XCTestCase { 27 | 28 | func testSingleDimensionalArraysGetter() { 29 | let array = ["1", "2", "a", "B", "D"] 30 | let json = JSON(array) 31 | XCTAssertEqual((json.array![0] as JSON).string!, "1") 32 | XCTAssertEqual((json.array![1] as JSON).string!, "2") 33 | XCTAssertEqual((json.array![2] as JSON).string!, "a") 34 | XCTAssertEqual((json.array![3] as JSON).string!, "B") 35 | XCTAssertEqual((json.array![4] as JSON).string!, "D") 36 | } 37 | 38 | func testSingleDimensionalArraysSetter() { 39 | let array = ["1", "2", "a", "B", "D"] 40 | var json = JSON(array) 41 | json.arrayObject = ["111", "222"] 42 | XCTAssertEqual((json.array![0] as JSON).string!, "111") 43 | XCTAssertEqual((json.array![1] as JSON).string!, "222") 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Tests/SwiftyJSONTests/Info-iOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Tests/SwiftyJSONTests/Info-macOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/Tests/SwiftyJSONTests/Info-tvOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Carthage/Checkouts/SwiftyJSON/scripts/carthage.sh: -------------------------------------------------------------------------------- 1 | carthage build --no-skip-current 2 | carthage archive SwiftyJSON 3 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/.github/issue_template.md: -------------------------------------------------------------------------------- 1 | Please be sure to include: 2 | 3 | * what OS you are developing on (Linux or macOS, including the version) 4 | 5 | * for macOS, what version of Xcode you are using (`xcodebuild -version`), 6 | for Linux, what version of Swift (`swift --version`) 7 | 8 | * what version of Swift is your code set to compile with (i.e. from project 9 | settings, etc.) 10 | 11 | * what branch/tag of SwiftProtobuf you are using (1.0.0, etc.) 12 | 13 | * if you are getting compile errors, please be sure include all errors/warnings, 14 | sometimes the error before the one you are stuck on is important. 15 | 16 | * lastly, if it all possible, provide a snippet of `.proto` and/or source 17 | that shows the problem. 18 | 19 | Thank you! 20 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | *~ 5 | xcuserdata 6 | xcbaselines 7 | /_test 8 | /docs 9 | /build 10 | mined_words.txt 11 | /DescriptorTestData.bin 12 | 13 | # Intermediate conformance test outputs 14 | failing_tests.txt 15 | nonexistent_tests.txt 16 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/.jazzy.yaml: -------------------------------------------------------------------------------- 1 | documentation: "Documentation/{API,GENERATED_CODE,PLUGIN}.md" 2 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/DevTools/CopyrightFixup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eu 4 | 5 | readonly DevToolsDir=$(dirname "$(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,")") 6 | readonly RootDir="${DevToolsDir}/.." 7 | 8 | cd "${RootDir}" 9 | 10 | for f in `find . -name '*.swift' -o -name '*.cc' | sed -e 's|./||' | grep -v '.pb.swift'`; do 11 | if head -n 4 $f | grep 'DO NOT EDIT' > /dev/null; then 12 | # If the first lines contain 'DO NOT EDIT', then 13 | # this is a generated file and we should not 14 | # try to check or edit the copyright message. 15 | # But: print the filename; all such files should be .pb.swift 16 | # files that we're not even looking at here. 17 | echo "DO NOT EDIT: $f" 18 | else 19 | tmp=$f~ 20 | mv $f $tmp 21 | if head -n 10 $tmp | grep 'Copyright.*Apple' > /dev/null; then 22 | # This has a copyright message, update it 23 | # Edit the first line to have the correct filename 24 | head -n 1 $tmp | sed "s|// [^-]* - \(.*\)|// $f - \1|" >$f 25 | # Followed by the current copyright text: 26 | cat <>$f 27 | // 28 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 29 | // Licensed under Apache License v2.0 with Runtime Library Exception 30 | // 31 | // See LICENSE.txt for license information: 32 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 33 | EOF 34 | # Followed by the body of the file 35 | # The copyright message ends at the first blank comment line after 36 | # the first line containing "LICENSE.txt": 37 | cat $tmp | sed -n '/LICENSE.txt/,$ p' | sed -n '/^\/\/$/,$ p' >> $f 38 | rm $tmp 39 | else 40 | # This does not have a copyright message, insert one 41 | echo "Inserting copyright >> $f" 42 | cat <>$f 43 | // $f - description 44 | // 45 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 46 | // Licensed under Apache License v2.0 with Runtime Library Exception 47 | // 48 | // See LICENSE.txt for license information: 49 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 50 | // 51 | 52 | EOF 53 | cat $tmp >> $f 54 | fi 55 | fi 56 | done 57 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Package.swift: -------------------------------------------------------------------------------- 1 | // Package.swift - description 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | 10 | import PackageDescription 11 | 12 | let package = Package( 13 | name: "SwiftProtobuf", 14 | targets: [ 15 | Target(name: "SwiftProtobufPluginLibrary", 16 | dependencies: ["SwiftProtobuf"]), 17 | Target(name: "protoc-gen-swift", 18 | dependencies: ["SwiftProtobufPluginLibrary", "SwiftProtobuf"]), 19 | Target(name: "Conformance", 20 | dependencies: ["SwiftProtobuf"]), 21 | ] 22 | ) 23 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Package@swift-4.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:4.0 2 | 3 | // Package.swift 4 | // 5 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See LICENSE.txt for license information: 9 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 10 | // 11 | 12 | import PackageDescription 13 | 14 | let package = Package( 15 | name: "SwiftProtobuf", 16 | products: [ 17 | .executable(name: "protoc-gen-swift", targets: ["protoc-gen-swift"]), 18 | .library(name: "SwiftProtobuf", type: .static, targets: ["SwiftProtobuf"]), 19 | .library(name: "SwiftProtobufPluginLibrary", targets: ["SwiftProtobufPluginLibrary"]), 20 | ], 21 | targets: [ 22 | .target(name: "SwiftProtobuf"), 23 | .target(name: "SwiftProtobufPluginLibrary", 24 | dependencies: ["SwiftProtobuf"]), 25 | .target(name: "protoc-gen-swift", 26 | dependencies: ["SwiftProtobufPluginLibrary", "SwiftProtobuf"]), 27 | .target(name: "Conformance", 28 | dependencies: ["SwiftProtobuf"]), 29 | .testTarget(name: "SwiftProtobufTests", 30 | dependencies: ["SwiftProtobuf"]), 31 | .testTarget(name: "SwiftProtobufPluginLibraryTests", 32 | dependencies: ["SwiftProtobufPluginLibrary"]), 33 | ], 34 | swiftLanguageVersions: [3, 4] 35 | ) 36 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Performance/.gitignore: -------------------------------------------------------------------------------- 1 | _generated/ 2 | _results/ 3 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Performance/Harness.cc: -------------------------------------------------------------------------------- 1 | // Performance/Harness.cc - C++ performance harness definition 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Defines the class that runs the performance tests. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include "Harness.h" 24 | 25 | using std::chrono::duration_cast; 26 | using std::chrono::steady_clock; 27 | using std::endl; 28 | using std::function; 29 | using std::ostream; 30 | using std::result_of; 31 | using std::sqrt; 32 | using std::string; 33 | using std::vector; 34 | 35 | Harness::Harness(std::ostream* results_stream) : 36 | results_stream(results_stream), 37 | measurement_count(10), 38 | repeated_count(10) {} 39 | 40 | void Harness::write_to_log(const string& name, 41 | const vector& timings) const { 42 | if (results_stream == nullptr) { 43 | return; 44 | } 45 | 46 | (*results_stream) << "\"" << name << "\": ["; 47 | for (const auto& duration : timings) { 48 | auto micros = duration_cast(duration); 49 | (*results_stream) << micros.count() / run_count() << ", "; 50 | } 51 | (*results_stream) << "]," << endl; 52 | } 53 | 54 | Harness::Statistics Harness::compute_statistics( 55 | const vector& timings) const { 56 | microseconds_d::rep sum = 0; 57 | microseconds_d::rep sqsum = 0; 58 | 59 | for (const auto& duration : timings) { 60 | auto micros = duration_cast(duration); 61 | auto count = micros.count(); 62 | sum += count; 63 | sqsum += count * count; 64 | } 65 | 66 | auto n = timings.size(); 67 | Statistics stats; 68 | stats.mean = sum / n; 69 | stats.stddev = sqrt(sqsum / n - stats.mean * stats.mean); 70 | return stats; 71 | } 72 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Performance/Protobuf.tracetemplate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhmiles/OpenCastSwift/a8a233268a25f45bead79c76e747b6997c45f158/Carthage/Checkouts/swift-protobuf/Performance/Protobuf.tracetemplate -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Performance/css/harness-visualization.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 16px; 3 | } 4 | 5 | p.info-text { 6 | padding: 16px; 7 | } 8 | 9 | h3 > small { 10 | float: right; 11 | } 12 | 13 | table.numeric td { 14 | text-align: right; 15 | } 16 | 17 | table.numeric th { 18 | background-color: #eee; 19 | text-align: center; 20 | } 21 | 22 | table.numeric tfoot td { 23 | font-size: 12px; 24 | font-style: italic; 25 | } 26 | 27 | table.numeric td:first-child, 28 | table.numeric th:first-child { 29 | text-align: left; 30 | } 31 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Performance/harness-visualization.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Swift Protobuf Performance Harness Visualization 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 |

Most recent sessions are listed first.

16 |
17 | 18 |
19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Performance/js/results.js.template: -------------------------------------------------------------------------------- 1 | sessions = [ 2 | //NEW-DATA-HERE 3 | ]; 4 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Performance/main.cc: -------------------------------------------------------------------------------- 1 | // Performance/main.cc - C++ performance harness entry point 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Entry point for the C++ performance harness. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | #include 16 | 17 | #include "Harness.h" 18 | 19 | using std::ios_base; 20 | using std::ofstream; 21 | 22 | int main(int argc, char **argv) { 23 | ofstream* results_stream = (argc > 1) ? 24 | new ofstream(argv[1], ios_base::app) : nullptr; 25 | 26 | Harness harness(results_stream); 27 | harness.run(); 28 | 29 | if (results_stream) { 30 | results_stream->close(); 31 | delete results_stream; 32 | } 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Performance/main.swift: -------------------------------------------------------------------------------- 1 | // Performance/main.swift - Performance harness entry point 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Entry point that creates the performance harness and runs it. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | import Foundation 16 | 17 | let args = CommandLine.arguments 18 | let resultsFile = args.count > 1 ? 19 | FileHandle(forWritingAtPath: args[1]) : nil 20 | resultsFile?.seekToEndOfFile() 21 | 22 | let harness = Harness(resultsFile: resultsFile) 23 | harness.run() 24 | 25 | resultsFile?.closeFile() 26 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Performance/runners/cpp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # SwiftProtobuf/Performance/runners/cpp.sh - C++ test harness runner 4 | # 5 | # This source file is part of the Swift.org open source project 6 | # 7 | # Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors 8 | # Licensed under Apache License v2.0 with Runtime Library Exception 9 | # 10 | # See http://swift.org/LICENSE.txt for license information 11 | # See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 12 | # 13 | # ----------------------------------------------------------------------------- 14 | # 15 | # Functions for running the C++ harness. 16 | # 17 | # ----------------------------------------------------------------------------- 18 | 19 | function run_cpp_harness() { 20 | ( 21 | harness="$1" 22 | 23 | source "$script_dir/generators/cpp.sh" 24 | 25 | echo "Generating C++ harness source..." 26 | gen_harness_path="$script_dir/_generated/Harness+Generated.cc" 27 | generate_cpp_harness 28 | 29 | echo "Building C++ test harness..." 30 | time ( g++ --std=c++11 -O \ 31 | -o "$harness" \ 32 | -I "$script_dir" \ 33 | -I "$GOOGLE_PROTOBUF_CHECKOUT/src" \ 34 | -L "$GOOGLE_PROTOBUF_CHECKOUT/src/.libs" \ 35 | -lprotobuf \ 36 | "$gen_harness_path" \ 37 | "$script_dir/Harness.cc" \ 38 | "$script_dir/_generated/message.pb.cc" \ 39 | "$script_dir/main.cc" \ 40 | ) 41 | echo 42 | 43 | # Make sure the dylib is loadable from the harness if the user hasn't 44 | # actually installed them. 45 | cp "$GOOGLE_PROTOBUF_CHECKOUT"/src/.libs/libprotobuf.*.dylib \ 46 | "$script_dir/_generated" 47 | 48 | run_harness_and_concatenate_results "C++" "$harness" "$partial_results" 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/README.md: -------------------------------------------------------------------------------- 1 | Various test protos that are used to stress the code generator. 2 | 3 | Many of these were copied from Google's protoc project with only minor changes, hence the Google copyright notices. 4 | 5 | Others were created specifically to test Apple's Swift generator. 6 | 7 | Some are used in various Test cases, but others serve as tests just by verifying that they compile. 8 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto: -------------------------------------------------------------------------------- 1 | // Protos/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto - Swift Module mappings configuration 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See http://swift.org/LICENSE.txt for license information 9 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | 12 | syntax = "proto3"; 13 | 14 | package swift_protobuf.gen_swift; 15 | 16 | // Configuration used to define the mappings for generated proto files 17 | // to the Swift module they will be included in. 18 | message ModuleMappings { 19 | 20 | // Individual listing of the module name and the files that will go 21 | // into it. 22 | message Entry { 23 | 24 | // The Swift module name that will be imported and used to scope all 25 | // the types from the given proto files. 26 | string module_name = 1; 27 | 28 | // The proto files that should be considered it this module. The values 29 | // should be the how they are expressed to the generated; i.e. - how they 30 | // are used in import states to be used from other files, so `my_file.proto` 31 | // or `path/to/file.proto`. 32 | repeated string proto_file_path = 2; 33 | } 34 | 35 | // The mappings. 36 | repeated Entry mapping = 1; 37 | } 38 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/google/protobuf/any_test.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto3"; 32 | 33 | package protobuf_unittest; 34 | 35 | import "google/protobuf/any.proto"; 36 | 37 | message TestAny { 38 | int32 int32_value = 1; 39 | google.protobuf.Any any_value = 2; 40 | repeated google.protobuf.Any repeated_any_value = 3; 41 | } 42 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/google/protobuf/unittest_arena.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto2"; 32 | 33 | import "google/protobuf/unittest_no_arena_import.proto"; 34 | 35 | package proto2_arena_unittest; 36 | 37 | option cc_enable_arenas = true; 38 | 39 | message NestedMessage { 40 | optional int32 d = 1; 41 | } 42 | 43 | message ArenaMessage { 44 | repeated NestedMessage repeated_nested_message = 1; 45 | repeated ImportNoArenaNestedMessage repeated_import_no_arena_message = 2; 46 | }; 47 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/google/protobuf/unittest_drop_unknown_fields.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto3"; 32 | 33 | package unittest_drop_unknown_fields; 34 | option objc_class_prefix = "DropUnknowns"; 35 | 36 | option csharp_namespace = "Google.Protobuf.TestProtos"; 37 | 38 | message Foo { 39 | enum NestedEnum { 40 | FOO = 0; 41 | BAR = 1; 42 | BAZ = 2; 43 | } 44 | int32 int32_value = 1; 45 | NestedEnum enum_value = 2; 46 | } 47 | 48 | message FooWithExtraFields { 49 | enum NestedEnum { 50 | FOO = 0; 51 | BAR = 1; 52 | BAZ = 2; 53 | QUX = 3; 54 | } 55 | int32 int32_value = 1; 56 | NestedEnum enum_value = 2; 57 | int32 extra_int32_value = 3; 58 | } 59 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/google/protobuf/unittest_empty.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // This file intentionally left blank. (At one point this wouldn't compile 36 | // correctly.) 37 | 38 | syntax = "proto2"; 39 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/google/protobuf/unittest_import_lite.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: kenton@google.com (Kenton Varda) 32 | // 33 | // This is like unittest_import.proto but with optimize_for = LITE_RUNTIME. 34 | 35 | syntax = "proto2"; 36 | package protobuf_unittest_import; 37 | 38 | option optimize_for = LITE_RUNTIME; 39 | 40 | option java_package = "com.google.protobuf"; 41 | 42 | import public "google/protobuf/unittest_import_public_lite.proto"; 43 | 44 | message ImportMessageLite { 45 | optional int32 d = 1; 46 | } 47 | 48 | enum ImportEnumLite { 49 | IMPORT_LITE_FOO = 7; 50 | IMPORT_LITE_BAR = 8; 51 | IMPORT_LITE_BAZ = 9; 52 | } 53 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/google/protobuf/unittest_import_public.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: liujisi@google.com (Pherl Liu) 32 | 33 | syntax = "proto2"; 34 | 35 | package protobuf_unittest_import; 36 | 37 | option java_package = "com.google.protobuf.test"; 38 | 39 | message PublicImportMessage { 40 | optional int32 e = 1; 41 | } 42 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/google/protobuf/unittest_import_public_lite.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: liujisi@google.com (Pherl Liu) 32 | 33 | syntax = "proto2"; 34 | 35 | package protobuf_unittest_import; 36 | 37 | option optimize_for = LITE_RUNTIME; 38 | 39 | option java_package = "com.google.protobuf"; 40 | 41 | message PublicImportMessageLite { 42 | optional int32 e = 1; 43 | } 44 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/google/protobuf/unittest_lite_imports_nonlite.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: kenton@google.com (Kenton Varda) 32 | // 33 | // Tests that a "lite" message can import a regular message. 34 | 35 | syntax = "proto2"; 36 | package protobuf_unittest; 37 | 38 | import "google/protobuf/unittest.proto"; 39 | 40 | option optimize_for = LITE_RUNTIME; 41 | 42 | message TestLiteImportsNonlite { 43 | optional TestAllTypes message = 1; 44 | } 45 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/google/protobuf/unittest_no_arena_import.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto2"; 32 | 33 | package proto2_arena_unittest; 34 | 35 | message ImportNoArenaNestedMessage { 36 | optional int32 d = 1; 37 | }; 38 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/google/protobuf/unittest_no_arena_lite.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto2"; 32 | 33 | option optimize_for = LITE_RUNTIME; 34 | 35 | // We don't put this in a package within proto2 because we need to make sure 36 | // that the generated code doesn't depend on being in the proto2 namespace. 37 | // In test_util.h we do "using namespace unittest = protobuf_unittest". 38 | package protobuf_unittest_no_arena; 39 | 40 | message ForeignMessageLite { 41 | optional int32 c = 1; 42 | } 43 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/google/protobuf/unittest_no_generic_services.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: kenton@google.com (Kenton Varda) 32 | 33 | syntax = "proto2"; 34 | package google.protobuf.no_generic_services_test; 35 | 36 | 37 | // *_generic_services are false by default. 38 | 39 | message TestMessage { 40 | optional int32 a = 1; 41 | extensions 1000 to max; 42 | } 43 | 44 | enum TestEnum { 45 | FOO = 1; 46 | } 47 | 48 | extend TestMessage { 49 | optional int32 test_extension = 1000; 50 | } 51 | 52 | service TestService { 53 | rpc Foo(TestMessage) returns(TestMessage); 54 | } 55 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/google/protobuf/unittest_preserve_unknown_enum2.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto2"; 32 | 33 | package proto2_preserve_unknown_enum_unittest; 34 | 35 | enum MyEnum { 36 | FOO = 0; 37 | BAR = 1; 38 | BAZ = 2; 39 | } 40 | 41 | message MyMessage { 42 | optional MyEnum e = 1; 43 | repeated MyEnum repeated_e = 2; 44 | repeated MyEnum repeated_packed_e = 3 [packed=true]; 45 | repeated MyEnum repeated_packed_unexpected_e = 4; // not packed 46 | oneof o { 47 | MyEnum oneof_e_1 = 5; 48 | MyEnum oneof_e_2 = 6; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/pluginlib_descriptor_test.proto: -------------------------------------------------------------------------------- 1 | // Protos/pluginlib_descriptor_test.proto - test proto 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See http://swift.org/LICENSE.txt for license information 9 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | // ----------------------------------------------------------------------------- 12 | /// 13 | /// Test proto for Tests/SwiftProtobufPluginLibraryTests/Test_Descriptor.swift 14 | /// 15 | // ----------------------------------------------------------------------------- 16 | 17 | syntax = "proto2"; 18 | 19 | package swift_descriptor_test; 20 | 21 | // Use the option to test swift name generation. 22 | option swift_prefix = "SDT"; 23 | 24 | import "google/protobuf/descriptor.proto"; 25 | import "google/protobuf/compiler/plugin.proto"; 26 | 27 | enum TopLevelEnum { 28 | VALUE_ZERO = 0; 29 | VALUE_ONE = 1; 30 | VALUE_TWO = 2; 31 | } 32 | 33 | message TopLevelMessage { 34 | 35 | enum SubEnum { 36 | SUB_VALUE_0 = 0; 37 | SUB_VALUE_1 = 1; 38 | SUB_VALUE_2 = 2; 39 | } 40 | 41 | message SubMessage { 42 | optional int32 field1 = 1; 43 | optional string field2 = 2; 44 | optional SubMessage field3 = 3; 45 | } 46 | 47 | optional string field1 = 1; 48 | optional int32 field2 = 2; 49 | 50 | oneof o { 51 | TopLevelEnum field3 = 3; 52 | SubEnum field4 = 4; 53 | SubMessage field5 = 5; 54 | TopLevelMessage2 field6 = 6; 55 | } 56 | } 57 | 58 | message TopLevelMessage2 { 59 | optional TopLevelMessage left = 1; 60 | optional TopLevelMessage2 right = 2; 61 | } 62 | 63 | message ExternalRefs { 64 | optional google.protobuf.DescriptorProto desc = 1; 65 | optional google.protobuf.compiler.Version ver = 2; 66 | } 67 | 68 | extend google.protobuf.FieldOptions { 69 | optional string ext_str = 90000; 70 | } 71 | 72 | message ScoperForExt { 73 | extend google.protobuf.MessageOptions { 74 | optional TopLevelEnum ext_enum = 99001; 75 | optional TopLevelMessage2 ext_msg = 99002; 76 | } 77 | } 78 | 79 | service SomeService { 80 | rpc Foo(google.protobuf.DescriptorProto) returns (google.protobuf.compiler.Version); 81 | rpc Bar(TopLevelMessage) returns (TopLevelMessage2); 82 | } 83 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/unittest_swift_enum_optional_default.proto: -------------------------------------------------------------------------------- 1 | // Protos/unittest_swift_enum_optional_default.proto - test proto 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See http://swift.org/LICENSE.txt for license information 9 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | // ----------------------------------------------------------------------------- 12 | /// 13 | /// Test handling of enum fields with specified defaults 14 | /// 15 | // ----------------------------------------------------------------------------- 16 | 17 | syntax = "proto2"; 18 | 19 | package protobuf_unittest.extend; 20 | 21 | message EnumOptionalDefault { 22 | message NestedMessage { 23 | enum Enum { 24 | FOO = 0; 25 | } 26 | 27 | // The circular reference here forces the generator to 28 | // implement heap-backed storage. 29 | optional NestedMessage message = 1; 30 | 31 | optional Enum optional_enum = 17 [default = FOO]; 32 | } 33 | 34 | message NestedMessage2 { 35 | enum Enum { 36 | FOO = 0; 37 | } 38 | optional Enum optional_enum = 17 [default = FOO]; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/unittest_swift_extension.proto: -------------------------------------------------------------------------------- 1 | // Protos/unittest_swift_extension.proto - test proto 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See http://swift.org/LICENSE.txt for license information 9 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | // ----------------------------------------------------------------------------- 12 | /// 13 | /// Test handling of extensions to deeply nested messages. 14 | /// 15 | // ----------------------------------------------------------------------------- 16 | 17 | syntax = "proto2"; 18 | 19 | package protobuf_unittest.extend; 20 | 21 | message Foo { 22 | message Bar { 23 | message Baz { 24 | optional int32 a = 1; 25 | extensions 100 to 1000; 26 | } 27 | } 28 | } 29 | 30 | extend Foo.Bar.Baz { 31 | optional string b = 100; 32 | optional group C = 101 { 33 | optional int64 c = 999; 34 | // extensions 10 to 20; 35 | } 36 | } 37 | 38 | /* 39 | extend Foo.Bar.Baz.C { 40 | optional bool d = 12; 41 | } 42 | */ 43 | 44 | // If this compiles then it means we deal with unique proto names that 45 | // could end up with naming collisions when remapped to Swifty names. 46 | 47 | message Msg1 { 48 | extensions 1 to 1000; 49 | } 50 | message Msg2 { 51 | extensions 1 to 1000; 52 | } 53 | 54 | extend Msg1 { 55 | optional int32 a_b = 1; 56 | } 57 | 58 | extend Msg2 { 59 | optional int32 aB = 1; 60 | } 61 | 62 | // These allow testing where a StorageClass is and isn't used. 63 | 64 | message MsgNoStorage { 65 | optional int32 x = 1; 66 | 67 | extensions 100 to 200; 68 | } 69 | 70 | message MsgUsesStorage { 71 | optional int32 x = 1; 72 | // Recursive class (i.e. - can build a graph), forces _StorageClass. 73 | optional MsgUsesStorage y = 2; 74 | 75 | extensions 100 to 200; 76 | } 77 | 78 | extend MsgNoStorage { 79 | optional int32 ext_a = 100; 80 | optional int32 ext_b = 101; 81 | } 82 | 83 | extend MsgUsesStorage { 84 | optional int32 ext_c = 100; 85 | optional int32 ext_d = 101; 86 | } 87 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/unittest_swift_extension2.proto: -------------------------------------------------------------------------------- 1 | // Protos/unittest_swift_extension2.proto - test proto 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See http://swift.org/LICENSE.txt for license information 9 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | // ----------------------------------------------------------------------------- 12 | /// 13 | /// Test naming of extensions that differ only in proto package. This is a 14 | /// clone of unittest_swift_extension3.proto, but with a different proto package 15 | /// and different extension numbers. 16 | /// 17 | // ----------------------------------------------------------------------------- 18 | 19 | syntax = "proto2"; 20 | 21 | package protobuf_unittest.extend2; 22 | 23 | import "unittest_swift_extension.proto"; 24 | 25 | message MyMessage { 26 | extend protobuf_unittest.extend.Foo.Bar.Baz { 27 | optional string b = 210; 28 | optional group C = 211 { 29 | optional int64 c = 1210; 30 | } 31 | } 32 | } 33 | 34 | extend protobuf_unittest.extend.Foo.Bar.Baz { 35 | optional string b = 220; 36 | optional group C = 221 { 37 | optional int64 c = 1220; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/unittest_swift_extension3.proto: -------------------------------------------------------------------------------- 1 | // Protos/unittest_swift_extension3.proto - test proto 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See http://swift.org/LICENSE.txt for license information 9 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | // ----------------------------------------------------------------------------- 12 | /// 13 | /// Test naming of extensions that differ only in proto package. This is a 14 | /// clone of unittest_swift_extension2.proto, but with a different proto package 15 | /// and different extension numbers. 16 | /// 17 | // ----------------------------------------------------------------------------- 18 | 19 | syntax = "proto2"; 20 | 21 | package protobuf_unittest.extend3; 22 | 23 | import "unittest_swift_extension.proto"; 24 | 25 | message MyMessage { 26 | extend protobuf_unittest.extend.Foo.Bar.Baz { 27 | optional string b = 310; 28 | optional group C = 311 { 29 | optional int64 c = 1310; 30 | } 31 | } 32 | } 33 | 34 | extend protobuf_unittest.extend.Foo.Bar.Baz { 35 | optional string b = 320; 36 | optional group C = 321 { 37 | optional int64 c = 1320; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/unittest_swift_extension4.proto: -------------------------------------------------------------------------------- 1 | // Protos/unittest_swift_extension4.proto - test proto 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See http://swift.org/LICENSE.txt for license information 9 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | // ----------------------------------------------------------------------------- 12 | /// 13 | /// Test naming of extensions that differ only in proto package. This is a 14 | /// clone of unittest_swift_extension[23].proto, but with a different proto 15 | /// package, different extension numbers, and a Swift prefix option. 16 | /// 17 | // ----------------------------------------------------------------------------- 18 | 19 | syntax = "proto2"; 20 | 21 | package protobuf_unittest.extend4; 22 | option swift_prefix = "Ext4"; 23 | 24 | import "unittest_swift_extension.proto"; 25 | 26 | message MyMessage { 27 | extend protobuf_unittest.extend.Foo.Bar.Baz { 28 | optional string b = 410; 29 | optional group C = 411 { 30 | optional int64 c = 1410; 31 | } 32 | } 33 | } 34 | 35 | extend protobuf_unittest.extend.Foo.Bar.Baz { 36 | optional string b = 420; 37 | optional group C = 421 { 38 | optional int64 c = 1420; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/unittest_swift_fieldorder.proto: -------------------------------------------------------------------------------- 1 | // Protos/unittest_swift_fieldorder.proto - test proto 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See http://swift.org/LICENSE.txt for license information 9 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | // ----------------------------------------------------------------------------- 12 | /// 13 | /// Check that fields get properly ordered when serializing 14 | /// 15 | // ----------------------------------------------------------------------------- 16 | 17 | syntax = "proto2"; 18 | 19 | package swift.protobuf; 20 | 21 | message TestFieldOrderings { 22 | optional string my_string = 11; 23 | extensions 2 to 8; 24 | optional int64 my_int = 1; 25 | extensions 12 to 55; 26 | optional float my_float = 101; 27 | message NestedMessage { 28 | optional int64 oo = 2; 29 | optional int32 bb = 1; 30 | } 31 | 32 | oneof options { 33 | int64 oneof_int64 = 60; 34 | bool oneof_bool = 9; 35 | string oneof_string = 150; 36 | int32 oneof_int32 = 10; 37 | } 38 | 39 | optional NestedMessage optional_nested_message = 200; 40 | } 41 | 42 | 43 | extend TestFieldOrderings { 44 | optional string my_extension_string = 50; 45 | optional int32 my_extension_int = 5; 46 | } 47 | 48 | 49 | // These checks how the traverse() generated for a oneof 50 | // deals with field orders. Currently requires inspecting the code. 51 | message OneofTraversalGeneration { 52 | // Gaps, not no issues, no start:end: on traverse(). 53 | oneof o_Good { 54 | int32 a = 1; 55 | int32 b = 26; 56 | } 57 | 58 | // Gaps with a field in the middle of the range. 59 | oneof o_Conflict_Field { 60 | int32 a2 = 101; 61 | int32 b2 = 126; 62 | } 63 | // In the middle of previous oneof field ranges. 64 | optional int32 m = 113; 65 | 66 | // Gaps with an extension range in the middle of the range. 67 | oneof o_Conflict_ExtensionsStart { 68 | int32 a3 = 201; 69 | int32 b3 = 226; 70 | } 71 | extensions 202; 72 | 73 | // Gaps with an extension range in the middle of the range. 74 | oneof o_Conflict_ExtensionsEnd { 75 | int32 a4 = 301; 76 | int32 b4 = 326; 77 | } 78 | extensions 325; 79 | } 80 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/unittest_swift_oneof_all_required.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto2"; 32 | 33 | package protobuf_unittest; 34 | 35 | message OneOfOptionMessage1 { 36 | required int32 requiredField = 1; 37 | } 38 | 39 | message OneOfOptionMessage2 { 40 | required int32 requiredField = 1; 41 | } 42 | 43 | message OneOfContainer { 44 | oneof option { 45 | OneOfOptionMessage1 option1 = 1; 46 | OneOfOptionMessage2 option2 = 2; 47 | group Option3 = 3 { 48 | required int32 a = 4; 49 | optional string b = 5; 50 | } 51 | int32 option4 = 6; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/unittest_swift_oneof_merging.proto: -------------------------------------------------------------------------------- 1 | // Protos/unittest_swift_oneof_merging.proto - test proto 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See http://swift.org/LICENSE.txt for license information 9 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | // ----------------------------------------------------------------------------- 12 | /// 13 | /// This is based on unittest.proto's TestParsingMerge & RepeatedFieldsGenerator, 14 | /// but focused on oneofs to ensure the behaviors around merging/replaces on 15 | /// oneofs is correct. 16 | /// 17 | // ----------------------------------------------------------------------------- 18 | 19 | syntax = "proto2"; 20 | 21 | package swift_unittest; 22 | 23 | message TestMessage { 24 | message NestedMessage { 25 | optional int32 a = 1; 26 | optional int32 b = 2; 27 | optional int32 c = 3; 28 | } 29 | 30 | oneof oneof_field { 31 | uint32 oneof_uint32 = 111; 32 | NestedMessage oneof_nested_message = 112; 33 | string oneof_string = 113; 34 | bytes oneof_bytes = 114; 35 | } 36 | } 37 | 38 | message TestParsingMerge { 39 | message RepeatedFieldsGenerator { 40 | repeated TestMessage field1 = 1; 41 | repeated TestMessage field2 = 2; 42 | } 43 | 44 | optional TestMessage optional_message = 1; 45 | repeated TestMessage repeated_message = 2; 46 | } 47 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/unittest_swift_reserved_ext.proto: -------------------------------------------------------------------------------- 1 | // Protos/unittest_swift_reserved_ext.proto - test proto 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See http://swift.org/LICENSE.txt for license information 9 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | // ----------------------------------------------------------------------------- 12 | /// 13 | /// Test Swift reserved words used as enum or message names 14 | /// 15 | // ----------------------------------------------------------------------------- 16 | 17 | syntax = "proto2"; 18 | 19 | // No package or swift prefix to control naming on these. 20 | 21 | import "unittest_swift_reserved.proto"; 22 | 23 | extend protobuf_unittest.SwiftReservedTest.Type { 24 | // Will get _p added because it has no package/swift prefix to scope and 25 | // would otherwise be a problem when added to the message. 26 | optional bool debugDescription = 1000; 27 | 28 | // These will get _p added for the same reasoning. 29 | optional bool as = 1012; 30 | optional bool var = 1013; 31 | optional bool try = 1014; 32 | optional bool do = 1015; 33 | optional bool nil = 1016; 34 | } 35 | 36 | message SwiftReservedTestExt2 { 37 | extend protobuf_unittest.SwiftReservedTest.Type { 38 | optional bool hashValue = 1001; 39 | 40 | // Reserved words, since these end up in the "enum Extensions", they 41 | // can't just be get their names, and sanitation kicks. 42 | optional bool as = 1022; 43 | optional bool var = 1023; 44 | optional bool try = 1024; 45 | optional bool do = 1025; 46 | optional bool nil = 1026; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Protos/unittest_swift_startup.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto2"; 32 | 33 | package protobuf_objc_unittest; 34 | 35 | message TestObjCStartupMessage { 36 | extensions 1 to max; 37 | } 38 | 39 | extend TestObjCStartupMessage { 40 | // Singular 41 | optional int32 optional_int32_extension = 1; 42 | repeated int32 repeated_int32_extension = 2; 43 | } 44 | 45 | message TestObjCStartupNested { 46 | extend TestObjCStartupMessage { 47 | optional string nested_string_extension = 3; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/Conformance/failure_list_swift.txt: -------------------------------------------------------------------------------- 1 | # No known failures 2 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/AnyUnpackError.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/AnyUnpackError.swift - Any Unpacking Errors 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Errors that can be throw when unpacking a Google_Protobuf_Any. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | /// Describes errors that can occur when unpacking an `Google_Protobuf_Any` 16 | /// message. 17 | /// 18 | /// `Google_Protobuf_Any` messages can be decoded from protobuf binary, text 19 | /// format, or JSON. The contents are not parsed immediately; the raw data is 20 | /// held in the `Google_Protobuf_Any` message until you `unpack()` it into a 21 | /// message. At this time, any error can occur that might have occurred from a 22 | /// regular decoding operation. There are also other errors that can occur due 23 | /// to problems with the `Any` value's structure. 24 | public enum AnyUnpackError: Error { 25 | /// The `type_url` field in the `Google_Protobuf_Any` message did not match 26 | /// the message type provided to the `unpack()` method. 27 | case typeMismatch 28 | 29 | /// Well-known types being decoded from JSON must have only two fields: the 30 | /// `@type` field and a `value` field containing the specialized JSON coding 31 | /// of the well-known type. 32 | case malformedWellKnownTypeJSON 33 | 34 | /// The `Google_Protobuf_Any` message was malformed in some other way not 35 | /// covered by the other error cases. 36 | case malformedAnyField 37 | } 38 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/BinaryDecodingError.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/BinaryDecodingError.swift - Protobuf binary decoding errors 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Protobuf binary format decoding errors 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | /// Describes errors that can occur when decoding a message from binary format. 16 | public enum BinaryDecodingError: Error { 17 | /// Extraneous data remained after decoding should have been complete. 18 | case trailingGarbage 19 | 20 | /// The decoder unexpectedly reached the end of the data before it was 21 | /// expected. 22 | case truncated 23 | 24 | /// A string field was not encoded as valid UTF-8. 25 | case invalidUTF8 26 | 27 | /// The binary data was malformed in some way, such as an invalid wire format 28 | /// or field tag. 29 | case malformedProtobuf 30 | 31 | /// The definition of the message or one of its nested messages has required 32 | /// fields but the binary data did not include values for them. You must pass 33 | /// `partial: true` during decoding if you wish to explicitly ignore missing 34 | /// required fields. 35 | case missingRequiredFields 36 | 37 | /// An internal error happened while decoding. If this is ever encountered, 38 | /// please file an issue with SwiftProtobuf with as much details as possible 39 | /// for what happened (proto definitions, bytes being decoded (if possible)). 40 | case internalExtensionError 41 | 42 | /// Reached the nesting limit for messages within messages while decoding. 43 | case messageDepthLimit 44 | } 45 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/BinaryDecodingOptions.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/BinaryDecodingOptions.swift - Binary decoding options 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Binary decoding options 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | /// Options for JSONDecoding. 16 | public struct BinaryDecodingOptions { 17 | /// The maximum nesting of message with messages. The default is 100. 18 | /// 19 | /// To prevent corrupt or malicious messages from causing stack overflows, 20 | /// this controls how deep messages can be nested within other messages 21 | /// while parsing. 22 | public var messageDepthLimit: Int = 100 23 | 24 | /// Discard unknown fields while parsing. The default is false, so parsering 25 | /// does not discard unknown fields. 26 | /// 27 | /// The Protobuf binary format allows unknown fields to be still parsed 28 | /// so the schema can be expanded without requiring all readers to be updated. 29 | /// This works in part by haivng any unknown fields preserved so they can 30 | /// be relayed on without loss. For a while the proto3 syntax definition 31 | /// called for unknown fields to be dropped, but that lead to problems in 32 | /// some case. The default is to follow the spec and keep them, but setting 33 | /// this option to `true` allows a developer to strip them during a parse 34 | /// in case they have a specific need to drop the unknown fields from the 35 | /// object graph being created. 36 | public var discardUnknownFields: Bool = false 37 | 38 | public init() {} 39 | } 40 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/BinaryEncodingError.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/BinaryEncodingError.swift - Error constants 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Enum constants that identify the particular error. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | /// Describes errors that can occur when decoding a message from binary format. 16 | public enum BinaryEncodingError: Error { 17 | /// `Any` fields that were decoded from JSON cannot be re-encoded to binary 18 | /// unless the object they hold is a well-known type or a type registered via 19 | /// `Google_Protobuf_Any.register()`. 20 | case anyTranscodeFailure 21 | 22 | /// The definition of the message or one of its nested messages has required 23 | /// fields but the message being encoded did not include values for them. You 24 | /// must pass `partial: true` during encoding if you wish to explicitly ignore 25 | /// missing required fields. 26 | case missingRequiredFields 27 | } 28 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/CustomJSONCodable.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/CustomJSONCodable.swift - Custom JSON support for WKTs 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Custom protocol for the WKTs to support their custom JSON encodings. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | /// Allows WKTs to provide their custom JSON encodings. 16 | internal protocol _CustomJSONCodable { 17 | func encodedJSONString() throws -> String 18 | mutating func decodeJSON(from: inout JSONDecoder) throws 19 | 20 | /// Called when the JSON `null` literal is encountered in a position where 21 | /// a message of the conforming type is expected. The message type can then 22 | /// handle the `null` value differently, if needed; for example, 23 | /// `Google_Protobuf_Value` returns a special instance whose `kind` is set to 24 | /// `.nullValue(.nullValue)`. 25 | /// 26 | /// The default behavior is to return `nil`, which indicates that `null` 27 | /// should be treated as the absence of a message. 28 | static func decodedFromJSONNull() throws -> Self? 29 | } 30 | 31 | extension _CustomJSONCodable { 32 | internal static func decodedFromJSONNull() -> Self? { 33 | // Return nil by default. Concrete types can provide custom logic. 34 | return nil 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/ExtensibleMessage.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/ExtensibleMessage.swift - Extension support 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Additional capabilities needed by messages that allow extensions. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | // Messages that support extensions implement this protocol 16 | public protocol ExtensibleMessage: Message { 17 | var _protobuf_extensionFieldValues: ExtensionFieldValueSet { get set } 18 | } 19 | 20 | public extension ExtensibleMessage { 21 | mutating func setExtensionValue(ext: MessageExtension, value: F.ValueType) { 22 | _protobuf_extensionFieldValues[ext.fieldNumber] = F(protobufExtension: ext, value: value) 23 | } 24 | 25 | func getExtensionValue(ext: MessageExtension) -> F.ValueType? { 26 | if let fieldValue = _protobuf_extensionFieldValues[ext.fieldNumber] as? F { 27 | return fieldValue.value 28 | } 29 | return nil 30 | } 31 | 32 | func hasExtensionValue(ext: MessageExtension) -> Bool { 33 | return _protobuf_extensionFieldValues[ext.fieldNumber] is F 34 | } 35 | 36 | mutating func clearExtensionValue(ext: MessageExtension) { 37 | _protobuf_extensionFieldValues[ext.fieldNumber] = nil 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/ExtensionFieldValueSet.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/ExtensionFieldValueSet.swift - Extension support 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// A collection of extension field values on a particular object. 12 | /// This is only used within messages to manage the values of extension fields; 13 | /// it does not need to be very sophisticated. 14 | /// 15 | // ----------------------------------------------------------------------------- 16 | 17 | public struct ExtensionFieldValueSet: Equatable { 18 | fileprivate var values = [Int : AnyExtensionField]() 19 | 20 | public static func ==(lhs: ExtensionFieldValueSet, 21 | rhs: ExtensionFieldValueSet) -> Bool { 22 | guard lhs.values.count == rhs.values.count else { 23 | return false 24 | } 25 | for (index, l) in lhs.values { 26 | if let r = rhs.values[index] { 27 | if type(of: l) != type(of: r) { 28 | return false 29 | } 30 | if !l.isEqual(other: r) { 31 | return false 32 | } 33 | } else { 34 | return false 35 | } 36 | } 37 | return true 38 | } 39 | 40 | public init() {} 41 | 42 | public var hashValue: Int { 43 | var hash = 16777619 44 | for (fieldNumber, v) in values { 45 | // Note: This calculation cannot depend on the order of the items. 46 | hash = hash &+ fieldNumber &+ v.hashValue 47 | } 48 | return hash 49 | } 50 | 51 | public func traverse(visitor: inout V, start: Int, end: Int) throws { 52 | let validIndexes = values.keys.filter {$0 >= start && $0 < end} 53 | for i in validIndexes.sorted() { 54 | let value = values[i]! 55 | try value.traverse(visitor: &visitor) 56 | } 57 | } 58 | 59 | public subscript(index: Int) -> AnyExtensionField? { 60 | get { return values[index] } 61 | set { values[index] = newValue } 62 | } 63 | 64 | public var isInitialized: Bool { 65 | for (_, v) in values { 66 | if !v.isInitialized { 67 | return false 68 | } 69 | } 70 | return true 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/ExtensionMap.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/ExtensionMap.swift - Extension support 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// A set of extensions that can be passed into deserializers 12 | /// to provide details of the particular extensions that should 13 | /// be recognized. 14 | /// 15 | // ----------------------------------------------------------------------------- 16 | 17 | /// A collection of extension objects. 18 | /// 19 | /// An `ExtensionMap` is used during decoding to look up 20 | /// extension objects corresponding to the serialized data. 21 | /// 22 | /// This is a protocol so that developers can build their own 23 | /// extension handling if they need something more complex than the 24 | /// standard `SimpleExtensionMap` implementation. 25 | public protocol ExtensionMap { 26 | /// Returns the extension object describing an extension or nil 27 | subscript(messageType: Message.Type, fieldNumber: Int) -> AnyMessageExtension? { get } 28 | 29 | /// Returns the field number for a message with a specific field name 30 | /// 31 | /// The field name here matches the format used by the protobuf 32 | /// Text serialization: it typically looks like 33 | /// `package.message.field_name`, where `package` is the package 34 | /// for the proto file and `message` is the name of the message in 35 | /// which the extension was defined. (This is different from the 36 | /// message that is being extended!) 37 | func fieldNumberForProto(messageType: Message.Type, protoFieldName: String) -> Int? 38 | } 39 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/Internal.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/Internal.swift - Message support 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Internal helpers on Messages for the library. These are public 12 | /// just so the generated code can call them, but shouldn't be called 13 | /// by developers directly. 14 | /// 15 | // ----------------------------------------------------------------------------- 16 | 17 | import Foundation 18 | 19 | /// Functions that are public only because they are used by generated message 20 | /// implementations. NOT INTENDED TO BE CALLED BY CLIENTS. 21 | public enum Internal { 22 | 23 | /// A singleton instance of an empty data that is used by the generated code 24 | /// for default values. This is a performance enhancement to work around the 25 | /// fact that the `Data` type in Swift involves a new heap allocation every 26 | /// time an empty instance is initialized, instead of sharing a common empty 27 | /// backing storage. 28 | public static let emptyData = Data() 29 | 30 | /// Helper to loop over a list of Messages to see if they are all 31 | /// initialized (see Message.isInitialized for what that means). 32 | public static func areAllInitialized(_ listOfMessages: [Message]) -> Bool { 33 | for msg in listOfMessages { 34 | if !msg.isInitialized { 35 | return false 36 | } 37 | } 38 | return true 39 | } 40 | 41 | /// Helper to loop over dictionary with values that are Messages to see if 42 | /// they are all initialized (see Message.isInitialized for what that means). 43 | public static func areAllInitialized(_ mapToMessages: [K: Message]) -> Bool { 44 | for (_, msg) in mapToMessages { 45 | if !msg.isInitialized { 46 | return false 47 | } 48 | } 49 | return true 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/JSONDecodingOptions.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/JSONDecodingOptions.swift - JSON decoding options 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// JSON decoding options 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | /// Options for JSONDecoding. 16 | public struct JSONDecodingOptions { 17 | /// The maximum nesting of message with messages. The default is 100. 18 | /// 19 | /// To prevent corrupt or malicious messages from causing stack overflows, 20 | /// this controls how deep messages can be nested within other messages 21 | /// while parsing. 22 | public var messageDepthLimit: Int = 100 23 | 24 | public init() {} 25 | } 26 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/JSONEncodingError.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/JSONEncodingError.swift - Error constants 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Enum constants that identify the particular error. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | public enum JSONEncodingError: Error { 16 | /// Any fields that were decoded from binary format cannot be 17 | /// re-encoded into JSON unless the object they hold is a 18 | /// well-known type or a type registered with via 19 | /// Google_Protobuf_Any.register() 20 | case anyTranscodeFailure 21 | /// Timestamp values can only be JSON encoded if they hold a value 22 | /// between 0001-01-01Z00:00:00 and 9999-12-31Z23:59:59. 23 | case timestampRange 24 | /// Duration values can only be JSON encoded if they hold a value 25 | /// less than +/- 100 years. 26 | case durationRange 27 | /// Field masks get edited when converting between JSON and protobuf 28 | case fieldMaskConversion 29 | /// Field names were not compiled into the binary 30 | case missingFieldNames 31 | /// Instances of `Google_Protobuf_Value` can only be encoded if they have a 32 | /// valid `kind` (that is, they represent a null value, number, boolean, 33 | /// string, struct, or list). 34 | case missingValue 35 | } 36 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/Message+AnyAdditions.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/Message+AnyAdditions.swift - Any-related Message extensions 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Extends the `Message` type with `Google_Protobuf_Any`-specific behavior. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | public extension Message { 16 | /// Initialize this message from the provided `google.protobuf.Any` 17 | /// well-known type. 18 | /// 19 | /// This corresponds to the `unpack` method in the Google C++ API. 20 | /// 21 | /// If the Any object was decoded from Protobuf Binary or JSON 22 | /// format, then the enclosed field data was stored and is not 23 | /// fully decoded until you unpack the Any object into a message. 24 | /// As such, this method will typically need to perform a full 25 | /// deserialization of the enclosed data and can fail for any 26 | /// reason that deserialization can fail. 27 | /// 28 | /// See `Google_Protobuf_Any.unpackTo()` for more discussion. 29 | /// 30 | /// - Parameter unpackingAny: the message to decode. 31 | /// - Parameter extensions: An `ExtensionMap` used to look up and decode any 32 | /// extensions in this message or messages nested within this message's 33 | /// fields. 34 | /// - Parameter options: The BinaryDecodingOptions to use. 35 | /// - Throws: an instance of `AnyUnpackError`, `JSONDecodingError`, or 36 | /// `BinaryDecodingError` on failure. 37 | public init( 38 | unpackingAny: Google_Protobuf_Any, 39 | extensions: ExtensionMap? = nil, 40 | options: BinaryDecodingOptions = BinaryDecodingOptions() 41 | ) throws { 42 | self.init() 43 | try unpackingAny._storage.unpackTo(target: &self, extensions: extensions, options: options) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/MessageExtension.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/MessageExtension.swift - Extension support 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// A 'Message Extension' is an immutable class object that describes 12 | /// a particular extension field, including string and number 13 | /// identifiers, serialization details, and the identity of the 14 | /// message that is being extended. 15 | /// 16 | // ----------------------------------------------------------------------------- 17 | 18 | /// Type-erased MessageExtension field implementation. 19 | public protocol AnyMessageExtension { 20 | var fieldNumber: Int { get } 21 | var fieldName: String { get } 22 | var messageType: Message.Type { get } 23 | func _protobuf_newField(decoder: inout D) throws -> AnyExtensionField? 24 | } 25 | 26 | /// A "Message Extension" relates a particular extension field to 27 | /// a particular message. The generic constraints allow 28 | /// compile-time compatibility checks. 29 | public class MessageExtension: AnyMessageExtension { 30 | public let fieldNumber: Int 31 | public let fieldName: String 32 | public let messageType: Message.Type 33 | public init(_protobuf_fieldNumber: Int, fieldName: String) { 34 | self.fieldNumber = _protobuf_fieldNumber 35 | self.fieldName = fieldName 36 | self.messageType = MessageType.self 37 | } 38 | public func _protobuf_newField(decoder: inout D) throws -> AnyExtensionField? { 39 | return try FieldType(protobufExtension: self, decoder: &decoder) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/ProtoNameProviding.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/ProtoNameProviding.swift - Support for accessing proto names 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | 11 | 12 | /// SwiftProtobuf Internal: Common support looking up field names. 13 | /// 14 | /// Messages conform to this protocol to provide the proto/text and JSON field 15 | /// names for their fields. This allows these names to be pulled out into 16 | /// extensions in separate files so that users can omit them in release builds 17 | /// (reducing bloat and minimizing leaks of field names). 18 | public protocol _ProtoNameProviding { 19 | 20 | /// The mapping between field numbers and proto/JSON field names defined in 21 | /// the conforming message type. 22 | static var _protobuf_nameMap: _NameMap { get } 23 | } 24 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/ProtobufAPIVersionCheck.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/ProtobufAPIVersionCheck.swift - Version checking 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// A scheme that ensures that generated protos cannot be compiled or linked 12 | /// against a version of the runtime with which they are not compatible. 13 | /// 14 | /// In many cases, API changes themselves might introduce incompatibilities 15 | /// between generated code and the runtime library, but we also want to protect 16 | /// against cases where breaking behavioral changes (without affecting the API) 17 | /// would cause generated code to be incompatible with a particular version of 18 | /// the runtime. 19 | /// 20 | // ----------------------------------------------------------------------------- 21 | 22 | 23 | /// An empty protocol that encodes the version of the runtime library. 24 | /// 25 | /// This protocol will be replaced with one containing a different version 26 | /// number any time that breaking changes are made to the Swift Protobuf API. 27 | /// Combined with the protocol below, this lets us verify that generated code is 28 | /// never compiled against a version of the API with which it is incompatible. 29 | /// 30 | /// The version associated with a particular build of the compiler is defined as 31 | /// `Version.compatibilityVersion` in `protoc-gen-swift`. That version and this 32 | /// version must match for the generated protos to be compatible, so if you 33 | /// update one, make sure to update it here and in the associated type below. 34 | public protocol ProtobufAPIVersion_2 {} 35 | 36 | /// This protocol is expected to be implemented by a `fileprivate` type in each 37 | /// source file emitted by `protoc-gen-swift`. It effectively creates a binding 38 | /// between the version of the generated code and the version of this library, 39 | /// causing a compile-time error (with reasonable diagnostics) if they are 40 | /// incompatible. 41 | public protocol ProtobufAPIVersionCheck { 42 | associatedtype Version: ProtobufAPIVersion_2 43 | } 44 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/ProtobufMap.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/ProtobufMap.swift - Map<> support 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Generic type representing proto map<> fields. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | import Foundation 16 | 17 | /// SwiftProtobuf Internal: Support for Encoding/Decoding. 18 | public struct _ProtobufMap 19 | { 20 | public typealias Key = KeyType.BaseType 21 | public typealias Value = ValueType.BaseType 22 | public typealias BaseType = Dictionary 23 | } 24 | 25 | /// SwiftProtobuf Internal: Support for Encoding/Decoding. 26 | public struct _ProtobufMessageMap 27 | { 28 | public typealias Key = KeyType.BaseType 29 | public typealias Value = ValueType 30 | public typealias BaseType = Dictionary 31 | } 32 | 33 | /// SwiftProtobuf Internal: Support for Encoding/Decoding. 34 | public struct _ProtobufEnumMap 35 | { 36 | public typealias Key = KeyType.BaseType 37 | public typealias Value = ValueType 38 | public typealias BaseType = Dictionary 39 | } 40 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/TextFormatDecodingError.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/TextFormatDecodingError.swift - Protobuf text format decoding errors 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Protobuf text format decoding errors 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | public enum TextFormatDecodingError: Error { 16 | /// Text data could not be parsed 17 | case malformedText 18 | /// A number could not be parsed 19 | case malformedNumber 20 | /// Extraneous data remained after decoding should have been complete 21 | case trailingGarbage 22 | /// The data stopped before we expected 23 | case truncated 24 | /// A string was not valid UTF8 25 | case invalidUTF8 26 | /// The data being parsed does not match the type specified in the proto file 27 | case schemaMismatch 28 | /// Field names were not compiled into the binary 29 | case missingFieldNames 30 | /// A field identifier (name or number) was not found on the message 31 | case unknownField 32 | /// The enum value was not recognized 33 | case unrecognizedEnumValue 34 | /// Text format rejects conflicting values for the same oneof field 35 | case conflictingOneOf 36 | /// An internal error happened while decoding. If this is ever encountered, 37 | /// please file an issue with SwiftProtobuf with as much details as possible 38 | /// for what happened (proto definitions, bytes being decoded (if possible)). 39 | case internalExtensionError 40 | } 41 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/TimeUtils.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/TimeUtils.swift - Generally useful time/calendar functions 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Generally useful time/calendar functions and constants 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | let minutesPerDay: Int32 = 1440 16 | let minutesPerHour: Int32 = 60 17 | let secondsPerDay: Int32 = 86400 18 | let secondsPerHour: Int32 = 3600 19 | let secondsPerMinute: Int32 = 60 20 | let nanosPerSecond: Int32 = 1000000000 21 | 22 | internal func timeOfDayFromSecondsSince1970(seconds: Int64) -> (hh: Int32, mm: Int32, ss: Int32) { 23 | let secondsSinceMidnight = Int32(mod(seconds, Int64(secondsPerDay))) 24 | let ss = mod(secondsSinceMidnight, secondsPerMinute) 25 | let mm = mod(div(secondsSinceMidnight, secondsPerMinute), minutesPerHour) 26 | let hh = Int32(div(secondsSinceMidnight, secondsPerHour)) 27 | 28 | return (hh: hh, mm: mm, ss: ss) 29 | } 30 | 31 | internal func julianDayNumberFromSecondsSince1970(seconds: Int64) -> Int64 { 32 | // January 1, 1970 is Julian Day Number 2440588. 33 | // See http://aa.usno.navy.mil/faq/docs/JD_Formula.php 34 | return div(seconds + 2440588 * Int64(secondsPerDay), Int64(secondsPerDay)) 35 | } 36 | 37 | internal func gregorianDateFromSecondsSince1970(seconds: Int64) -> (YY: Int32, MM: Int32, DD: Int32) { 38 | // The following implements Richards' algorithm (see the Wikipedia article 39 | // for "Julian day"). 40 | // If you touch this code, please test it exhaustively by playing with 41 | // Test_Timestamp.testJSON_range. 42 | 43 | let JJ = julianDayNumberFromSecondsSince1970(seconds: seconds) 44 | let f = JJ + 1401 + div(div(4 * JJ + 274277, 146097) * 3, 4) - 38 45 | let e = 4 * f + 3 46 | let g = Int64(div(mod(e, 1461), 4)) 47 | let h = 5 * g + 2 48 | let DD = div(mod(h, 153), 5) + 1 49 | let MM = mod(div(h, 153) + 2, 12) + 1 50 | let YY = div(e, 1461) - 4716 + div(12 + 2 - MM, 12) 51 | 52 | return (YY: Int32(YY), MM: Int32(MM), DD: Int32(DD)) 53 | } 54 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/UnknownStorage.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/UnknownStorage.swift - Handling unknown fields 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Proto2 binary coding requires storing and recoding of unknown fields. 12 | /// This simple support class handles that requirement. A property of this type 13 | /// is compiled into every proto2 message. 14 | /// 15 | // ----------------------------------------------------------------------------- 16 | 17 | import Foundation 18 | 19 | /// Contains any unknown fields in a decoded message; that is, fields that were 20 | /// sent on the wire but were not recognized by the generated message 21 | /// implementation or were valid field numbers but with mismatching wire 22 | /// formats (for example, a field encoded as a varint when a fixed32 integer 23 | /// was expected). 24 | public struct UnknownStorage: Equatable { 25 | /// The raw protocol buffer binary-encoded bytes that represent the unknown 26 | /// fields of a decoded message. 27 | public private(set) var data = Internal.emptyData 28 | 29 | public static func ==(lhs: UnknownStorage, rhs: UnknownStorage) -> Bool { 30 | return lhs.data == rhs.data 31 | } 32 | 33 | public init() {} 34 | 35 | internal mutating func append(protobufData: Data) { 36 | data.append(protobufData) 37 | } 38 | 39 | public func traverse(visitor: inout V) throws { 40 | if !data.isEmpty { 41 | try visitor.visitUnknown(bytes: data) 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobuf/Version.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobuf/Version.swift - Runtime Version info 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// A interface for exposing the version of the runtime. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | import Foundation 16 | 17 | // Expose version information about the library. 18 | public struct Version { 19 | /// Major version. 20 | static public let major = 1 21 | /// Minor version. 22 | static public let minor = 0 23 | /// Revision number. 24 | static public let revision = 3 25 | 26 | /// String form of the version number. 27 | static public let versionString = "\(major).\(minor).\(revision)" 28 | } 29 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobufPluginLibrary/Array+Extensions.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobufPluginLibrary/Array+Extensions.swift - Additions to Arrays 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | 11 | import Foundation 12 | 13 | extension Array { 14 | 15 | /// Like map, but calls the transform with the index and value. 16 | /// 17 | /// NOTE: It would seem like doing: 18 | /// return self.enumerated().map { 19 | /// return try transform($0.index, $0.element) 20 | /// } 21 | /// would seem like a simple thing to avoid extension. However as of Xcode 8.3.2 22 | /// (Swift 3.1), building/running 5000000 interation test (macOS) of the differences 23 | /// are rather large - 24 | /// Release build: 25 | /// Using enumerated: 3.694987967 26 | /// Using enumeratedMap: 0.961241992 27 | /// Debug build: 28 | /// Using enumerated: 20.038512905 29 | /// Using enumeratedMap: 8.521299144 30 | func enumeratedMap(_ transform: (Int, Element) throws -> T) rethrows -> [T] { 31 | var i: Int = -1 32 | return try map { 33 | i += 1 34 | return try transform(i, $0) 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobufPluginLibrary/FieldNumbers.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobufPluginLibrary/FieldNumbers.swift - Proto Field numbers 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Field numbers needed by SwiftProtobufPluginLibrary since they currently aren't generated. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | import Foundation 16 | 17 | extension Google_Protobuf_FileDescriptorProto { 18 | struct FieldNumbers { 19 | static let messageType: Int32 = 4 20 | static let enumType: Int32 = 5 21 | static let service: Int32 = 6 22 | static let `extension`: Int32 = 7 23 | } 24 | } 25 | 26 | extension Google_Protobuf_DescriptorProto { 27 | struct FieldNumbers { 28 | static let field: Int32 = 2 29 | static let nestedType: Int32 = 3 30 | static let enumType: Int32 = 4 31 | static let `extension`: Int32 = 6 32 | static let oneofDecl: Int32 = 8 33 | } 34 | } 35 | 36 | extension Google_Protobuf_EnumDescriptorProto { 37 | struct FieldNumbers { 38 | static let value: Int32 = 2 39 | } 40 | } 41 | 42 | extension Google_Protobuf_ServiceDescriptorProto { 43 | struct FieldNumbers { 44 | static let method: Int32 = 2 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobufPluginLibrary/Google_Protobuf_Compiler_CodeGeneratorResponse+Extensions.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobufPluginLibrary/Google_Protobuf_Compiler_CodeGeneratorResponse+Extensions.swift - CodeGeneratorResponse extensions 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Extensions to `CodeGeneratorResponse` provide some simple helpers. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | extension Google_Protobuf_Compiler_CodeGeneratorResponse { 16 | /// Helper to make a response with an error. 17 | public init(error: String) { 18 | self.init() 19 | self.error = error 20 | } 21 | 22 | /// Helper to make a response with a set of files 23 | public init(files: [Google_Protobuf_Compiler_CodeGeneratorResponse.File]) { 24 | self.init() 25 | self.file = files 26 | } 27 | } 28 | 29 | extension Google_Protobuf_Compiler_CodeGeneratorResponse.File { 30 | /// Helper to make a Response.File with specific content. 31 | public init(name: String, content: String) { 32 | self.init() 33 | self.name = name 34 | self.content = content 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobufPluginLibrary/HashableArray.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobufPluginLibrary/HashableArray.swift - Wrapper array to support hashing 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | 11 | /// Helper type to use an array as a dictionary key. 12 | struct HashableArray: Hashable { 13 | let array: [T] 14 | let hashValue: Int 15 | 16 | init(_ array: [T]) { 17 | self.array = array 18 | var hash = Int(bitPattern: 2166136261) 19 | for i in array { 20 | hash = (hash &* Int(16777619)) ^ i.hashValue 21 | } 22 | hashValue = hash 23 | } 24 | static func ==(lhs: HashableArray, rhs: HashableArray) -> Bool { 25 | return lhs.hashValue == rhs.hashValue && lhs.array == rhs.array 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobufPluginLibrary/ProvidesLocationPath.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobufPluginLibrary/ProvidesLocationPath.swift - Proto Field numbers 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | 11 | import Foundation 12 | 13 | public protocol ProvidesLocationPath { 14 | func getLocationPath(path: inout [Int32]) 15 | var file: FileDescriptor! { get } 16 | } 17 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobufPluginLibrary/ProvidesSourceCodeLocation.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobufPluginLibrary/ProvidesSourceCodeLocation.swift - SourceCodeInfo.Location provider 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | 11 | import Foundation 12 | 13 | public protocol ProvidesSourceCodeLocation { 14 | var sourceCodeInfoLocation: Google_Protobuf_SourceCodeInfo.Location? { get } 15 | } 16 | 17 | // Default implementation for things that support ProvidesLocationPath. 18 | extension ProvidesSourceCodeLocation where Self: ProvidesLocationPath { 19 | public var sourceCodeInfoLocation: Google_Protobuf_SourceCodeInfo.Location? { 20 | var path = [Int32]() 21 | getLocationPath(path: &path) 22 | return file.sourceCodeInfoLocation(path: path) 23 | } 24 | } 25 | 26 | // Helper to get source comments out of ProvidesSourceCodeLocation 27 | extension ProvidesSourceCodeLocation { 28 | public func protoSourceComments(commentPrefix: String = "///", 29 | leadingDetachedPrefix: String? = nil) -> String { 30 | if let loc = sourceCodeInfoLocation { 31 | return loc.asSourceComment(commentPrefix: commentPrefix, 32 | leadingDetachedPrefix: leadingDetachedPrefix) 33 | } 34 | return String() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/SwiftProtobufPluginLibrary/SwiftProtobufInfo.swift: -------------------------------------------------------------------------------- 1 | // Sources/SwiftProtobufPluginLibrary/LibraryInfo.swift - Helpers info about the SwiftProtobuf library 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Helpers for info about the SwiftProtobuf library itself. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | import Foundation 16 | 17 | /// Scope for helpers about the library. 18 | public enum SwiftProtobufInfo { 19 | 20 | /// The name of the library 21 | public static let name = "SwiftProtobuf" 22 | 23 | /// Proto Files that ship with the library. 24 | public static let bundledProtoFiles: Set = [ 25 | "google/protobuf/any.proto", 26 | "google/protobuf/api.proto", 27 | // "google/protobuf/descriptor.proto" 28 | // is not a WKT; and while it is used by generator, it does NOT ship 29 | // with the library, if the library ever wants to expose full 30 | // descriptors, that could change. 31 | "google/protobuf/duration.proto", 32 | "google/protobuf/empty.proto", 33 | "google/protobuf/field_mask.proto", 34 | "google/protobuf/source_context.proto", 35 | "google/protobuf/struct.proto", 36 | "google/protobuf/timestamp.proto", 37 | "google/protobuf/type.proto", 38 | "google/protobuf/wrappers.proto", 39 | ] 40 | 41 | // Checks if a FileDescriptor is a library bundled proto file. 42 | public static func isBundledProto(file: Google_Protobuf_FileDescriptorProto) -> Bool { 43 | return file.package == "google.protobuf" && bundledProtoFiles.contains(file.name) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/protoc-gen-swift/CommandLine+Extensions.swift: -------------------------------------------------------------------------------- 1 | // Sources/protoc-gen-swift/CommandLine+Extensions - Additions to CommandLine 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | 11 | import Foundation 12 | 13 | extension CommandLine { 14 | static var programName: String { 15 | guard let base = arguments.first else { 16 | return "protoc-gen-swift" 17 | } 18 | // Strip it down to just the leaf if it was a path. 19 | let parts = splitPath(pathname: base) 20 | return parts.base + parts.suffix 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/protoc-gen-swift/GenerationError.swift: -------------------------------------------------------------------------------- 1 | // Sources/protoc-gen-swift/GenerationError.swift - Generation errors 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | 11 | enum GenerationError: Error { 12 | /// Raised when parsing the parameter string and found an unknown key 13 | case unknownParameter(name: String) 14 | /// Raised when a parameter was giving an invalid value 15 | case invalidParameterValue(name: String, value: String) 16 | /// Raised to wrap another error but provide a context message. 17 | case wrappedError(message: String, error: Error) 18 | } 19 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/protoc-gen-swift/Google_Protobuf_DescriptorProto+Extensions.swift: -------------------------------------------------------------------------------- 1 | // Sources/protoc-gen-swift/Google_Protobuf_DescriptorProto+Extensions.swift - Descriptor extensions 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Extensions to `DescriptorProto` that provide Swift-generation-specific 12 | /// functionality. 13 | /// 14 | // ----------------------------------------------------------------------------- 15 | 16 | import Foundation 17 | import SwiftProtobufPluginLibrary 18 | import SwiftProtobuf 19 | 20 | extension Google_Protobuf_DescriptorProto.ExtensionRange { 21 | 22 | /// A `String` containing the Swift range expression that represents this 23 | /// extension range. 24 | var swiftRangeExpression: String { 25 | return "\(start)..<\(end)" 26 | } 27 | 28 | /// A `String` containing the Swift Boolean expression that tests the given 29 | /// variable for containment within this extension range. 30 | /// 31 | /// - Parameter variable: The name of the variable to test in the expression. 32 | /// - Returns: A `String` containing the Boolean expression. 33 | func swiftBooleanExpression(variable: String) -> String { 34 | return "\(start) <= \(variable) && \(variable) < \(end)" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/protoc-gen-swift/Google_Protobuf_FileDescriptorProto+Extensions.swift: -------------------------------------------------------------------------------- 1 | // Sources/protoc-gen-swift/Google_Protobuf_FileDescriptorProto+Extensions.swift - Descriptor extensions 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Extensions to `FileDescriptorProto` that provide Swift-generation-specific 12 | /// functionality. 13 | /// 14 | // ----------------------------------------------------------------------------- 15 | 16 | import SwiftProtobufPluginLibrary 17 | import SwiftProtobuf 18 | 19 | extension Google_Protobuf_FileDescriptorProto { 20 | // Field numbers used to collect .proto file comments. 21 | struct FieldNumbers { 22 | static let syntax: Int32 = 12 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Sources/protoc-gen-swift/Version.swift: -------------------------------------------------------------------------------- 1 | // Sources/protoc-gen-swift/Version.swift - Protoc plugin version info 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// A simple static object that provides information about the plugin. 12 | /// 13 | // ---------------------------------------------------------------------------- 14 | 15 | import SwiftProtobuf 16 | 17 | struct Version { 18 | // The "compatibility version" of the runtime library, which must be 19 | // incremented every time a breaking change (either behavioral or 20 | // API-changing) is introduced. 21 | // 22 | // We guarantee that generated protos that contain this version token will 23 | // be compatible with the runtime library containing the matching token. 24 | // Therefore, this number (and the corresponding one in the runtime 25 | // library) should not be updated for *every* version of Swift Protobuf, 26 | // but only for those that introduce breaking changes (either behavioral 27 | // or API-changing). 28 | static let compatibilityVersion = 2 29 | 30 | static let copyright = "Copyright (C) 2014-2017 Apple Inc. and the project authors" 31 | } 32 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/SwiftProtobuf.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'SwiftProtobuf' 3 | s.version = '1.0.3' 4 | s.license = { :type => 'Apache 2.0', :file => 'LICENSE.txt' } 5 | s.summary = 'Swift Protobuf code generator plugin and runtime library' 6 | s.homepage = 'https://github.com/apple/swift-protobuf' 7 | s.author = 'Apple Inc.' 8 | s.source = { :git => 'https://github.com/apple/swift-protobuf.git', :tag => s.version } 9 | 10 | s.requires_arc = true 11 | s.ios.deployment_target = '8.0' 12 | s.osx.deployment_target = '10.9' 13 | s.tvos.deployment_target = '9.0' 14 | s.watchos.deployment_target = '2.0' 15 | 16 | s.cocoapods_version = '>= 1.1.0' 17 | 18 | s.source_files = 'Sources/SwiftProtobuf/**/*.swift' 19 | end 20 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/SwiftProtobuf.xcodeproj/ProtobufTestSuite_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | BNDL 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/SwiftProtobuf.xcodeproj/Protobuf_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/SwiftProtobuf.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/SwiftProtobuf.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SchemeUserState 5 | 6 | SwiftProtobuf.xcscheme 7 | 8 | 9 | SuppressBuildableAutocreation 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Tests/SwiftProtobufPluginLibraryTests/Descriptor+TestHelpers.swift: -------------------------------------------------------------------------------- 1 | // Sources/protoc-gen-swift/Descriptor+TestHelpers.swift - Additions to Descriptors 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | 11 | import SwiftProtobufPluginLibrary 12 | 13 | extension Google_Protobuf_FileDescriptorProto { 14 | init(name: String, dependencies: [String] = [], publicDependencies: [Int32] = []) { 15 | for idx in publicDependencies { precondition(Int(idx) <= dependencies.count) } 16 | self.init() 17 | self.name = name 18 | dependency = dependencies 19 | publicDependency = publicDependencies 20 | } 21 | init(textFormatStrings: [String]) throws { 22 | let s = textFormatStrings.joined(separator: "\n") + "\n" 23 | try self.init(textFormatString: s) 24 | } 25 | } 26 | 27 | extension Google_Protobuf_FileDescriptorSet { 28 | init(files: [Google_Protobuf_FileDescriptorProto]) { 29 | self.init() 30 | file = files 31 | } 32 | init(file: Google_Protobuf_FileDescriptorProto) { 33 | self.init() 34 | self.file = [file] 35 | } 36 | } 37 | 38 | extension Google_Protobuf_EnumValueDescriptorProto { 39 | init(name: String, number: Int32) { 40 | self.init() 41 | self.name = name 42 | self.number = number 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Tests/SwiftProtobufPluginLibraryTests/Test_SwiftLanguage.swift: -------------------------------------------------------------------------------- 1 | // Tests/SwiftProtobufPluginLibraryTests/Test_SwiftLanguage.swift - Test language utilities 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Tests for tools to ensure identifiers are valid in Swift or protobuf{2,3}. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | import XCTest 16 | import SwiftProtobufPluginLibrary 17 | 18 | class Test_SwiftLanguage: XCTestCase { 19 | func testIsValidSwiftIdentifier() { 20 | for identifier in ["H9000", "\u{1f436}\u{1f431}"] { 21 | XCTAssert(isValidSwiftIdentifier(identifier), "Should be valid: \(identifier)") 22 | } 23 | } 24 | 25 | func testIsNotValidSwiftIdentifier() { 26 | for identifier in ["_", "$0", "$f00", "12Hour", "This is bad"] { 27 | XCTAssert(!isValidSwiftIdentifier(identifier), "Should not be valid: \(identifier)") 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Tests/SwiftProtobufTests/Message+UInt8ArrayHelpers.swift: -------------------------------------------------------------------------------- 1 | // Tests/SwiftProtobufTests/Message+UInt8ArrayHelpers.swift - UInt8 array message helpers 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Helper methods to serialize/parse messages via UInt8 arrays, to ease 12 | /// test migration since the original methods have been removed from the 13 | /// runtime. 14 | /// 15 | // ----------------------------------------------------------------------------- 16 | 17 | import Foundation 18 | import SwiftProtobuf 19 | 20 | extension SwiftProtobuf.Message { 21 | init(serializedBytes: [UInt8], extensions: SwiftProtobuf.SimpleExtensionMap? = nil) throws { 22 | try self.init(serializedData: Data(serializedBytes), extensions: extensions) 23 | } 24 | 25 | func serializedBytes() throws -> [UInt8] { 26 | return try [UInt8](serializedData()) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Tests/SwiftProtobufTests/Test_Api.swift: -------------------------------------------------------------------------------- 1 | // Tests/SwiftProtobufTests/Test_Api.swift - Exercise API type 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Since API is purely compiled (there is no hand-coding 12 | /// in it) this is a fairly thin test just to ensure that the proto 13 | /// does get into the runtime. 14 | /// 15 | // ----------------------------------------------------------------------------- 16 | 17 | import Foundation 18 | import XCTest 19 | import SwiftProtobuf 20 | 21 | class Test_Api: XCTestCase, PBTestHelpers { 22 | typealias MessageTestType = Google_Protobuf_Api 23 | 24 | func testExists() { 25 | assertEncode([10,7,97,112,105,78,97,109,101,34,1,49]) { (o: inout MessageTestType) in 26 | o.name = "apiName" 27 | o.version = "1" 28 | } 29 | } 30 | 31 | func testInitializer() throws { 32 | var m = MessageTestType() 33 | m.name = "apiName" 34 | var method = Google_Protobuf_Method() 35 | method.name = "method1" 36 | m.methods = [method] 37 | var option = Google_Protobuf_Option() 38 | option.name = "option1" 39 | option.value = try Google_Protobuf_Any(message: Google_Protobuf_StringValue("value1")) 40 | m.options = [option] 41 | m.version = "1.0.0" 42 | m.syntax = .proto3 43 | 44 | XCTAssertEqual(try m.jsonString(), "{\"name\":\"apiName\",\"methods\":[{\"name\":\"method1\"}],\"options\":[{\"name\":\"option1\",\"value\":{\"@type\":\"type.googleapis.com/google.protobuf.StringValue\",\"value\":\"value1\"}}],\"version\":\"1.0.0\",\"syntax\":\"SYNTAX_PROTO3\"}") 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Tests/SwiftProtobufTests/Test_Empty.swift: -------------------------------------------------------------------------------- 1 | // Tests/SwiftProtobufTests/Test_Empty.swift - Verify well-known empty message 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Since Empty is purely compiled (there is no hand-coding 12 | /// in it) this is a fairly thin test just to ensure that the proto 13 | /// does get into the runtime. 14 | /// 15 | // ----------------------------------------------------------------------------- 16 | 17 | import Foundation 18 | import XCTest 19 | import SwiftProtobuf 20 | 21 | class Test_Empty: XCTestCase, PBTestHelpers { 22 | typealias MessageTestType = Google_Protobuf_Empty 23 | 24 | func testExists() throws { 25 | let e = Google_Protobuf_Empty() 26 | XCTAssertEqual(Data(), try e.serializedData()) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Tests/SwiftProtobufTests/Test_EnumWithAliases.swift: -------------------------------------------------------------------------------- 1 | // Tests/SwiftProtobufTests/Test_EnumWithAliases.swift - Exercise generated enums 2 | // 3 | // Copyright (c) 2014 - 2017 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Check that proto enums are properly translated into Swift enums. Among 12 | /// other things, enums can have duplicate tags, the names should be correctly 13 | /// translated into Swift lowerCamelCase conventions, etc. 14 | /// 15 | // ----------------------------------------------------------------------------- 16 | 17 | import Foundation 18 | import XCTest 19 | 20 | class Test_EnumWithAliases: XCTestCase, PBTestHelpers { 21 | typealias MessageTestType = ProtobufUnittest_SwiftEnumWithAliasTest 22 | 23 | func testJSONEncodeUsesOriginalNames() { 24 | assertJSONEncode("{\"values\":[\"FOO1\",\"BAR1\"]}") { (m: inout MessageTestType) in 25 | m.values = [.foo1, .bar1] 26 | } 27 | 28 | assertJSONEncode("{\"values\":[\"FOO1\",\"BAR1\"]}") { (m: inout MessageTestType) in 29 | m.values = [.foo2, .bar2] 30 | } 31 | } 32 | 33 | func testJSONDecodeAcceptsAllNames() throws { 34 | assertJSONDecodeSucceeds("{\"values\":[\"FOO1\",\"BAR1\"]}") { (m: MessageTestType) in 35 | return m.values == [.foo1, .bar1] 36 | } 37 | 38 | assertJSONDecodeSucceeds("{\"values\":[\"FOO2\",\"BAR2\"]}") { (m: MessageTestType) in 39 | return m.values == [.foo1, .bar1] 40 | } 41 | } 42 | 43 | func testTextFormatEncodeUsesOriginalNames() { 44 | assertTextFormatEncode("values: [FOO1, BAR1]\n") { (m: inout MessageTestType) in 45 | m.values = [.foo1, .bar1] 46 | } 47 | 48 | assertTextFormatEncode("values: [FOO1, BAR1]\n") { (m: inout MessageTestType) in 49 | m.values = [.foo2, .bar2] 50 | } 51 | } 52 | 53 | func testTextFormatDecodeAcceptsAllNames() throws { 54 | assertTextFormatDecodeSucceeds("values: [FOO1, BAR1]\n") { (m: MessageTestType) in 55 | return m.values == [.foo1, .bar1] 56 | } 57 | 58 | assertTextFormatDecodeSucceeds("values: [FOO2, BAR2]\n") { (m: MessageTestType) in 59 | return m.values == [.foo1, .bar1] 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Tests/SwiftProtobufTests/Test_FieldOrdering.swift: -------------------------------------------------------------------------------- 1 | // Tests/SwiftProtobufTests/Test_FieldOrdering.swift - Check ordering of binary fields 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Verify that binary protobuf serialization correctly emits fields 12 | /// in order by field number. This is especially interesting when there 13 | /// are extensions and/or unknown fields involved. 14 | /// 15 | /// Proper ordering is recommended but not critical for writers since all 16 | /// readers are required to accept fields out of order. 17 | /// 18 | // ----------------------------------------------------------------------------- 19 | 20 | import Foundation 21 | import XCTest 22 | 23 | class Test_FieldOrdering: XCTestCase { 24 | typealias MessageTestType = Swift_Protobuf_TestFieldOrderings 25 | 26 | func test_FieldOrdering() throws { 27 | var m = MessageTestType() 28 | m.myString = "abc" 29 | m.myInt = 1 30 | m.myFloat = 1.0 31 | var nest = MessageTestType.NestedMessage() 32 | nest.oo = 1 33 | nest.bb = 2 34 | m.optionalNestedMessage = nest 35 | m.Swift_Protobuf_myExtensionInt = 12 36 | m.Swift_Protobuf_myExtensionString = "def" 37 | m.oneofInt32 = 7 38 | 39 | let encoded1 = try m.serializedBytes() 40 | XCTAssertEqual([8, 1, 40, 12, 80, 7, 90, 3, 97, 98, 99, 146, 3, 3, 100, 101, 102, 173, 6, 0, 0, 128, 63, 194, 12, 4, 8, 2, 16, 1], encoded1) 41 | 42 | m.oneofInt64 = 8 43 | let encoded2 = try m.serializedBytes() 44 | XCTAssertEqual([8, 1, 40, 12, 90, 3, 97, 98, 99, 146, 3, 3, 100, 101, 102, 224, 3, 8, 173, 6, 0, 0, 128, 63, 194, 12, 4, 8, 2, 16, 1], encoded2) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Tests/SwiftProtobufTests/Test_JSON_Group.swift: -------------------------------------------------------------------------------- 1 | // Tests/SwiftProtobufTests/Test_JSON_Group.swift - Exercise JSON coding for groups 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Google has not specified a JSON coding for groups. The C++ implementation 12 | /// fails when decoding a JSON string that contains a group, so we verify that 13 | /// we do the same for consistency. 14 | /// 15 | // ----------------------------------------------------------------------------- 16 | 17 | import Foundation 18 | import XCTest 19 | 20 | class Test_JSON_Group: XCTestCase, PBTestHelpers { 21 | typealias MessageTestType = ProtobufUnittest_TestAllTypes 22 | 23 | func testOptionalGroup() { 24 | assertJSONDecodeFails("{\"optionalgroup\":{\"a\":3}}") 25 | } 26 | 27 | func testRepeatedGroup() { 28 | assertJSONDecodeFails("{\"repeatedgroup\":[{\"a\":1},{\"a\":2}]}") 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Tests/SwiftProtobufTests/Test_Merge.swift: -------------------------------------------------------------------------------- 1 | // Tests/SwiftProtobufTests/Test_Merge.swift - Verify merging messages 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | 11 | import Foundation 12 | import XCTest 13 | import SwiftProtobuf 14 | 15 | class Test_Merge: XCTestCase, PBTestHelpers { 16 | typealias MessageTestType = Proto3Unittest_TestAllTypes 17 | 18 | func testMergeSimple() throws { 19 | var m1 = Proto3Unittest_TestAllTypes() 20 | m1.optionalInt32 = 100 21 | 22 | var m2 = Proto3Unittest_TestAllTypes() 23 | m2.optionalInt64 = 1000 24 | 25 | do { 26 | try m1.merge(serializedData: m2.serializedData()) 27 | XCTAssertEqual(m1.optionalInt32, 100) 28 | XCTAssertEqual(m1.optionalInt64, 1000) 29 | } catch let e { 30 | XCTFail("Merge should not have thrown, but it did: \(e)") 31 | } 32 | } 33 | 34 | func testMergePreservesValueSemantics() throws { 35 | var original = Proto3Unittest_TestAllTypes() 36 | original.optionalInt32 = 100 37 | let copied = original 38 | 39 | var toMerge = Proto3Unittest_TestAllTypes() 40 | toMerge.optionalInt64 = 1000 41 | 42 | do { 43 | try original.merge(serializedData: toMerge.serializedData()) 44 | 45 | // The original should have the value from the merged message... 46 | XCTAssertEqual(original.optionalInt32, 100) 47 | XCTAssertEqual(original.optionalInt64, 1000) 48 | // ...but the older copy should not be affected. 49 | XCTAssertEqual(copied.optionalInt32, 100) 50 | XCTAssertEqual(copied.optionalInt64, 0) 51 | } catch let e { 52 | XCTFail("Merge should not have thrown, but it did: \(e)") 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Tests/SwiftProtobufTests/Test_ReallyLargeTagNumber.swift: -------------------------------------------------------------------------------- 1 | // Tests/SwiftProtobufTests/Test_ReallyLargeTagNumber.swift - Exercise extreme tag values 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Check that a message with the largest possible tag number encodes correctly. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | import Foundation 16 | import XCTest 17 | 18 | class Test_ReallyLargeTagNumber: XCTestCase { 19 | 20 | func test_ReallyLargeTagNumber() { 21 | var m = ProtobufUnittest_TestReallyLargeTagNumber() 22 | m.a = 1 23 | m.bb = 2 24 | 25 | do { 26 | let encoded = try m.serializedData() 27 | XCTAssertEqual(encoded, Data(bytes: [8, 1, 248, 255, 255, 255, 7, 2])) 28 | 29 | do { 30 | let decoded = try ProtobufUnittest_TestReallyLargeTagNumber(serializedData: encoded) 31 | XCTAssertEqual(2, decoded.bb) 32 | XCTAssertEqual(1, decoded.a) 33 | XCTAssertEqual(m, decoded) 34 | } catch { 35 | XCTFail("Decode should not fail") 36 | } 37 | } catch let e { 38 | XCTFail("Could not encode \(m): Got error \(e)") 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Tests/SwiftProtobufTests/Test_RecursiveMap.swift: -------------------------------------------------------------------------------- 1 | // Tests/SwiftProtobufTests/Test_RecursiveMap.swift - Test maps within maps 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// Verify the behavior of maps whose values are other maps. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | import Foundation 16 | import XCTest 17 | 18 | class Test_RecursiveMap: XCTestCase { 19 | func test_RecursiveMap() throws { 20 | let inner = ProtobufUnittest_TestRecursiveMapMessage() 21 | var mid = ProtobufUnittest_TestRecursiveMapMessage() 22 | mid.a = ["1": inner] 23 | var outer = ProtobufUnittest_TestRecursiveMapMessage() 24 | outer.a = ["2": mid] 25 | 26 | do { 27 | let encoded = try outer.serializedData() 28 | XCTAssertEqual(encoded, Data(bytes: [10, 12, 10, 1, 50, 18, 7, 10, 5, 10, 1, 49, 18, 0])) 29 | 30 | let decodedOuter = try ProtobufUnittest_TestRecursiveMapMessage(serializedData: encoded) 31 | if let decodedMid = decodedOuter.a["2"] { 32 | if let decodedInner = decodedMid.a["1"] { 33 | XCTAssertEqual(decodedOuter.a.count, 1) 34 | XCTAssertEqual(decodedMid.a.count, 1) 35 | XCTAssertEqual(decodedInner.a.count, 0) 36 | } else { 37 | XCTFail() 38 | } 39 | } else { 40 | XCTFail() 41 | } 42 | } catch let e { 43 | XCTFail("Failed with error \(e)") 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Tests/SwiftProtobufTests/Test_TextFormat_proto2.swift: -------------------------------------------------------------------------------- 1 | // Tests/SwiftProtobufTests/Test_TextFormat_proto2.swift - Exercise proto3 text format coding 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// This is a set of tests for text format protobuf files. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | import Foundation 16 | import XCTest 17 | import SwiftProtobuf 18 | 19 | class Test_TextFormat_proto2: XCTestCase, PBTestHelpers { 20 | typealias MessageTestType = ProtobufUnittest_TestAllTypes 21 | 22 | func test_group() { 23 | assertTextFormatEncode("OptionalGroup {\n a: 17\n}\n") {(o: inout MessageTestType) in 24 | o.optionalGroup = ProtobufUnittest_TestAllTypes.OptionalGroup.with {$0.a = 17} 25 | } 26 | } 27 | 28 | func test_group_numbers() { 29 | assertTextFormatDecodeSucceeds("16 {\n 17: 17\n}\n") {(o: MessageTestType) in 30 | o.optionalGroup == ProtobufUnittest_TestAllTypes.OptionalGroup.with {$0.a = 17} 31 | } 32 | } 33 | 34 | func test_repeatedGroup() { 35 | assertTextFormatEncode("RepeatedGroup {\n a: 17\n}\nRepeatedGroup {\n a: 18\n}\n") {(o: inout MessageTestType) in 36 | let group17 = ProtobufUnittest_TestAllTypes.RepeatedGroup.with {$0.a = 17} 37 | let group18 = ProtobufUnittest_TestAllTypes.RepeatedGroup.with {$0.a = 18} 38 | o.repeatedGroup = [group17, group18] 39 | } 40 | } 41 | 42 | func test_repeatedGroup_numbers() { 43 | assertTextFormatDecodeSucceeds("46 {\n 47: 17\n}\n46 {\n 47: 18\n}\n") {(o: MessageTestType) in 44 | let group17 = ProtobufUnittest_TestAllTypes.RepeatedGroup.with {$0.a = 17} 45 | let group18 = ProtobufUnittest_TestAllTypes.RepeatedGroup.with {$0.a = 18} 46 | return o.repeatedGroup == [group17, group18] 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Tests/SwiftProtobufTests/Test_TextFormat_proto2_extensions.swift: -------------------------------------------------------------------------------- 1 | // Tests/SwiftProtobufTests/Test_TextFormat_proto2_extensions.swift - Exercise proto3 text format coding 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// This is a set of tests for text format protobuf files. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | import Foundation 16 | import XCTest 17 | import SwiftProtobuf 18 | 19 | class Test_TextFormat_proto2_extensions: XCTestCase, PBTestHelpers { 20 | typealias MessageTestType = ProtobufUnittest_TestAllExtensions 21 | 22 | func test_file_level_extension() { 23 | assertTextFormatEncode("[protobuf_unittest.optional_int32_extension]: 789\n", 24 | extensions: ProtobufUnittest_Unittest_Extensions) { 25 | (o: inout MessageTestType) in 26 | o.ProtobufUnittest_optionalInt32Extension = 789 27 | } 28 | // Fails if we don't provide the extensions to the decoder: 29 | assertTextFormatDecodeFails("[protobuf_unittest.optional_int32_extension]: 789\n") 30 | 31 | assertTextFormatEncode("[protobuf_unittest.optionalgroup_extension] {\n a: 789\n}\n", 32 | extensions: ProtobufUnittest_Unittest_Extensions) { 33 | (o: inout MessageTestType) in 34 | o.ProtobufUnittest_optionalGroupExtension.a = 789 35 | } 36 | // Fails if we don't provide the extensions to the decoder: 37 | assertTextFormatDecodeFails("[protobuf_unittest.optionalgroup_extension] {\n a: 789\n}\n") 38 | } 39 | 40 | func test_nested_extension() { 41 | assertTextFormatEncode("[protobuf_unittest.TestNestedExtension.test]: \"foo\"\n", 42 | extensions: ProtobufUnittest_Unittest_Extensions) { 43 | (o: inout MessageTestType) in 44 | o.ProtobufUnittest_TestNestedExtension_test = "foo" 45 | } 46 | // Fails if we don't provide the extensions to the decoder: 47 | assertTextFormatDecodeFails("[protobuf_unittest.TestNestedExtension.test]: \"foo\"\n") 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Carthage/Checkouts/swift-protobuf/Tests/SwiftProtobufTests/Test_Type.swift: -------------------------------------------------------------------------------- 1 | // Tests/SwiftProtobufTests/Test_Type.swift - Exercise well-known "Type" message 2 | // 3 | // Copyright (c) 2014 - 2016 Apple Inc. and the project authors 4 | // Licensed under Apache License v2.0 with Runtime Library Exception 5 | // 6 | // See LICENSE.txt for license information: 7 | // https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt 8 | // 9 | // ----------------------------------------------------------------------------- 10 | /// 11 | /// The well-known Type message is a simplified description of a proto schema. 12 | /// 13 | // ----------------------------------------------------------------------------- 14 | 15 | import Foundation 16 | import XCTest 17 | import SwiftProtobuf 18 | 19 | // Since Type is purely compiled (there is no hand-coding 20 | // in it) this is a fairly thin test just to ensure that the proto 21 | // does get into the runtime: 22 | 23 | class Test_Type: XCTestCase, PBTestHelpers { 24 | typealias MessageTestType = Google_Protobuf_Type 25 | 26 | func testExists() { 27 | assertEncode([18,13,8,1,16,3,24,1,34,3,102,111,111,64,1, 28 | 18,9,8,8,24,2,34,3,98,97,114]) { (o: inout MessageTestType) in 29 | var field1 = Google_Protobuf_Field() 30 | field1.kind = .typeDouble 31 | field1.cardinality = .repeated 32 | field1.number = 1 33 | field1.name = "foo" 34 | field1.packed = true 35 | 36 | var field2 = Google_Protobuf_Field() 37 | field2.kind = .typeBool 38 | field2.number = 2 39 | field2.name = "bar" 40 | 41 | o.fields = [field1, field2] 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "synx" 4 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (2.3.5) 5 | claide (1.0.2) 6 | clamp (0.6.5) 7 | colored2 (3.1.2) 8 | colorize (0.8.1) 9 | nanaimo (0.2.3) 10 | synx (0.2.1) 11 | clamp (~> 0.6) 12 | colorize (~> 0.7) 13 | xcodeproj (~> 1.0) 14 | xcodeproj (1.5.3) 15 | CFPropertyList (~> 2.3.3) 16 | claide (>= 1.0.2, < 2.0) 17 | colored2 (~> 3.1) 18 | nanaimo (~> 0.2.3) 19 | 20 | PLATFORMS 21 | ruby 22 | 23 | DEPENDENCIES 24 | synx 25 | 26 | BUNDLED WITH 27 | 1.16.0 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Miles Hollingsworth 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /OpenCastSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OpenCastSwift.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /OpenCastSwift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Sample Mac App/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // CastSync 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import OpenCastSwift 11 | 12 | @NSApplicationMain 13 | class AppDelegate: NSObject, NSApplicationDelegate { 14 | let scanner = CastDeviceScanner() 15 | var clients = [String: CastClient]() 16 | 17 | @IBOutlet weak var window: NSWindow! 18 | 19 | let menuBarController = StatusItemController() 20 | 21 | func applicationDidFinishLaunching(_ aNotification: Notification) { 22 | 23 | } 24 | 25 | func applicationWillTerminate(_ aNotification: Notification) { 26 | // Insert code here to tear down your application 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sample Mac App/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /Sample Mac App/Assets.xcassets/Cast.imageset/Artboard 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhmiles/OpenCastSwift/a8a233268a25f45bead79c76e747b6997c45f158/Sample Mac App/Assets.xcassets/Cast.imageset/Artboard 2.png -------------------------------------------------------------------------------- /Sample Mac App/Assets.xcassets/Cast.imageset/Artboard 2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhmiles/OpenCastSwift/a8a233268a25f45bead79c76e747b6997c45f158/Sample Mac App/Assets.xcassets/Cast.imageset/Artboard 2@2x.png -------------------------------------------------------------------------------- /Sample Mac App/Assets.xcassets/Cast.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "filename" : "Artboard 2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "filename" : "Artboard 2@2x.png", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Sample Mac App/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Sample Mac App/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | Copyright © 2018 Miles Hollingsworth. All rights reserved. 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /Sample Mac App/Sample_Mac_App.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Sample iOS App/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Sample iOS App 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Sample iOS App/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Sample iOS App/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Sample iOS App/DeviceCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DeviceCell.swift 3 | // Sample iOS App 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class DeviceCell: UITableViewCell { 12 | @IBOutlet weak var nameLabel: UILabel! 13 | } 14 | -------------------------------------------------------------------------------- /Sample iOS App/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Source/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhmiles/OpenCastSwift/a8a233268a25f45bead79c76e747b6997c45f158/Source/.DS_Store -------------------------------------------------------------------------------- /Source/Models/AppAvailability.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppAvailability.swift 3 | // OpenCastSwift 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import SwiftyJSON 10 | 11 | public class AppAvailability: NSObject { 12 | public var availability = [String: Bool]() 13 | } 14 | 15 | extension AppAvailability { 16 | convenience init(json: JSON) { 17 | self.init() 18 | 19 | if let availability = json[CastJSONPayloadKeys.availability].dictionaryObject as? [String: String] { 20 | self.availability = availability.mapValues { $0 == "APP_AVAILABLE" } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/Models/CastApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CastApp.swift 3 | // OpenCastSwift 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import SwiftyJSON 11 | 12 | public struct CastAppIdentifier { 13 | public static let defaultMediaPlayer = "CC1AD845" 14 | public static let youTube = "YouTube" 15 | public static let googleAssistant = "97216CB6" 16 | } 17 | 18 | public final class CastApp: NSObject { 19 | public var id: String = "" 20 | public var displayName: String = "" 21 | public var isIdleScreen: Bool = false 22 | public var sessionId: String = "" 23 | public var statusText: String = "" 24 | public var transportId: String = "" 25 | public var namespaces = [String]() 26 | 27 | convenience init(json: JSON) { 28 | self.init() 29 | 30 | if let id = json[CastJSONPayloadKeys.appId].string { 31 | self.id = id 32 | } 33 | 34 | if let displayName = json[CastJSONPayloadKeys.displayName].string { 35 | self.displayName = displayName 36 | } 37 | 38 | if let isIdleScreen = json[CastJSONPayloadKeys.isIdleScreen].bool { 39 | self.isIdleScreen = isIdleScreen 40 | } 41 | 42 | if let sessionId = json[CastJSONPayloadKeys.sessionId].string { 43 | self.sessionId = sessionId 44 | } 45 | 46 | if let statusText = json[CastJSONPayloadKeys.statusText].string { 47 | self.statusText = statusText 48 | } 49 | 50 | if let transportId = json[CastJSONPayloadKeys.transportId].string { 51 | self.transportId = transportId 52 | } 53 | 54 | if let namespaces = json[CastJSONPayloadKeys.namespaces].array { 55 | self.namespaces = namespaces.compactMap { $0[CastJSONPayloadKeys.name].string } 56 | } 57 | } 58 | 59 | public override var description: String { 60 | return "CastApp(id: \(id), displayName: \(displayName), isIdleScreen: \(isIdleScreen), sessionId: \(sessionId), statusText: \(statusText), transportId: \(transportId), namespaces: \(namespaces)" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Source/Models/CastMediaStatus.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CastMediaStatus.swift 3 | // OpenCastSwift 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import SwiftyJSON 11 | 12 | public enum CastMediaPlayerState: String { 13 | case buffering = "BUFFERING" 14 | case playing = "PLAYING" 15 | case paused = "PAUSED" 16 | case stopped = "STOPPED" 17 | } 18 | 19 | public final class CastMediaStatus: NSObject { 20 | 21 | public let mediaSessionId: Int 22 | public let playbackRate: Int 23 | public let playerState: CastMediaPlayerState 24 | public let currentTime: Double 25 | public let metadata: JSON? 26 | public let contentID: String? 27 | private let createdDate = Date() 28 | 29 | public var adjustedCurrentTime: Double { 30 | return currentTime - Double(playbackRate)*createdDate.timeIntervalSinceNow 31 | } 32 | 33 | public var state: String { 34 | return playerState.rawValue 35 | } 36 | 37 | public override var description: String { 38 | return "MediaStatus(mediaSessionId: \(mediaSessionId), playbackRate: \(playbackRate), playerState: \(playerState.rawValue), currentTime: \(currentTime))" 39 | } 40 | 41 | init(json: JSON) { 42 | mediaSessionId = json[CastJSONPayloadKeys.mediaSessionId].int ?? 0 43 | 44 | playbackRate = json[CastJSONPayloadKeys.playbackRate].int ?? 1 45 | 46 | playerState = json[CastJSONPayloadKeys.playerState].string.flatMap(CastMediaPlayerState.init) ?? .buffering 47 | 48 | currentTime = json[CastJSONPayloadKeys.currentTime].double ?? 0 49 | 50 | metadata = json[CastJSONPayloadKeys.media][CastJSONPayloadKeys.metadata] 51 | 52 | if let contentID = json[CastJSONPayloadKeys.media][CastJSONPayloadKeys.contentId].string, let data = contentID.data(using: .utf8) { 53 | self.contentID = (try? JSON(data: data))?[CastJSONPayloadKeys.contentId].string ?? contentID 54 | } else { 55 | contentID = nil 56 | } 57 | 58 | super.init() 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Source/Models/CastMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CastMessage.swift 3 | // OpenCastSwift 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension CastMessage { 12 | static func encodedMessage(payload: CastPayload, namespace: String, sourceId: String, destinationId: String) throws -> Data { 13 | var message = CastMessage() 14 | message.protocolVersion = .castv210 15 | message.sourceID = sourceId 16 | message.destinationID = destinationId 17 | message.namespace = namespace 18 | 19 | switch payload { 20 | case .json(let payload): 21 | let json = try JSONSerialization.data(withJSONObject: payload, options: []) 22 | 23 | guard let jsonString = String(data: json, encoding: .utf8) else { 24 | fatalError("error forming json string") 25 | } 26 | 27 | message.payloadType = .string 28 | message.payloadUtf8 = jsonString 29 | case .data(let payload): 30 | message.payloadType = .binary 31 | message.payloadBinary = payload 32 | } 33 | 34 | return try message.serializedData() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/Models/CastMultizoneDevice.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CastMultizoneDevice.swift 3 | // OpenCastSwift Mac 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import SwiftyJSON 11 | 12 | public class CastMultizoneDevice { 13 | public let name: String 14 | public let volume: Float 15 | public let isMuted: Bool 16 | public let capabilities: DeviceCapabilities 17 | public let id: String 18 | 19 | public init(name: String, volume: Float, isMuted: Bool, capabilitiesMask: Int, id: String) { 20 | self.name = name 21 | self.volume = volume 22 | self.isMuted = isMuted 23 | capabilities = DeviceCapabilities(rawValue: capabilitiesMask) 24 | self.id = id 25 | } 26 | } 27 | 28 | extension CastMultizoneDevice { 29 | convenience init(json: JSON) { 30 | let name = json[CastJSONPayloadKeys.name].stringValue 31 | 32 | let volumeValues = json[CastJSONPayloadKeys.volume] 33 | 34 | let volume = volumeValues[CastJSONPayloadKeys.level].floatValue 35 | let isMuted = volumeValues[CastJSONPayloadKeys.muted].boolValue 36 | let capabilitiesMask = json[CastJSONPayloadKeys.capabilities].intValue 37 | let deviceId = json[CastJSONPayloadKeys.deviceId].stringValue 38 | 39 | self.init(name: name, volume: volume, isMuted: isMuted, capabilitiesMask: capabilitiesMask, id: deviceId) 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /Source/Models/CastMultizoneStatus.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CastMultizoneStatus.swift 3 | // OpenCastSwift Mac 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import SwiftyJSON 11 | 12 | public class CastMultizoneStatus { 13 | public let devices: [CastMultizoneDevice] 14 | 15 | public init(devices: [CastMultizoneDevice]) { 16 | self.devices = devices 17 | } 18 | } 19 | 20 | extension CastMultizoneStatus { 21 | 22 | convenience init(json: JSON) { 23 | let status = json[CastJSONPayloadKeys.status] 24 | let devices = status[CastJSONPayloadKeys.devices].array?.map(CastMultizoneDevice.init) ?? [] 25 | 26 | self.init(devices: devices) 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Source/Models/CastStatus.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CastStatus.swift 3 | // OpenCastSwift 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import SwiftyJSON 11 | 12 | public final class CastStatus: NSObject { 13 | 14 | public var volume: Double = 1 15 | public var muted: Bool = false 16 | public var apps: [CastApp] = [] 17 | 18 | public override var description: String { 19 | return "CastStatus(volume: \(volume), muted: \(muted), apps: \(apps))" 20 | } 21 | 22 | } 23 | 24 | extension CastStatus { 25 | 26 | convenience init(json: JSON) { 27 | self.init() 28 | // print(json) 29 | let status = json[CastJSONPayloadKeys.status] 30 | let volume = status[CastJSONPayloadKeys.volume] 31 | 32 | if let volume = volume[CastJSONPayloadKeys.level].double { 33 | self.volume = volume 34 | } 35 | if let muted = volume[CastJSONPayloadKeys.muted].bool { 36 | self.muted = muted 37 | } 38 | 39 | if let apps = status[CastJSONPayloadKeys.applications].array { 40 | self.apps = apps.compactMap(CastApp.init) 41 | } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Source/Networking/Channels/CastChannel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CastChannel.swift 3 | // OpenCastSwift 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import SwiftyJSON 11 | 12 | open class CastChannel { 13 | let namespace: String 14 | weak var requestDispatcher: RequestDispatchable! 15 | 16 | init(namespace: String) { 17 | self.namespace = namespace 18 | } 19 | 20 | open func handleResponse(_ json: JSON, sourceId: String) { 21 | // print(json) 22 | } 23 | 24 | open func handleResponse(_ data: Data, sourceId: String) { 25 | print("\n--Binary response--\n") 26 | } 27 | 28 | public func send(_ request: CastRequest, response: CastResponseHandler? = nil) { 29 | requestDispatcher.send(request, response: response) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/Networking/Channels/Channelable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Channelable.swift 3 | // OpenCastSwift Mac 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol Channelable: RequestDispatchable { 12 | var channels: [String: CastChannel] { get set } 13 | 14 | func add(channel: CastChannel) 15 | func remove(channel: CastChannel) 16 | } 17 | 18 | extension Channelable { 19 | public func add(channel: CastChannel) { 20 | let namespace = channel.namespace 21 | guard channels[namespace] == nil else { 22 | print("Channel already attached for \(namespace)") 23 | return 24 | } 25 | 26 | channels[namespace] = channel 27 | channel.requestDispatcher = self 28 | } 29 | 30 | public func remove(channel: CastChannel) { 31 | let namespace = channel.namespace 32 | guard let channel = channels.removeValue(forKey: namespace) else { 33 | print("No channel attached for \(namespace)") 34 | return 35 | } 36 | 37 | channel.requestDispatcher = nil 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Source/Networking/Channels/DeviceAuthChannel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DeviceAuthChannel.swift 3 | // OpenCastSwift Mac 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class DeviceAuthChannel: CastChannel { 12 | typealias CastAuthChallenge = Extensions_Api_CastChannel_AuthChallenge 13 | typealias CastAuthMessage = Extensions_Api_CastChannel_DeviceAuthMessage 14 | 15 | init() { 16 | super.init(namespace: CastNamespace.auth) 17 | } 18 | 19 | public func sendAuthChallenge() throws { 20 | let message = CastAuthMessage.with { 21 | $0.challenge = CastAuthChallenge() 22 | } 23 | 24 | let request = requestDispatcher.request(withNamespace: namespace, 25 | destinationId: CastConstants.receiver, 26 | payload: try message.serializedData()) 27 | 28 | send(request) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/Networking/Channels/DeviceConnectionChannel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DeviceConnectionChannel.swift 3 | // OpenCastSwift Mac 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class DeviceConnectionChannel: CastChannel { 12 | override weak var requestDispatcher: RequestDispatchable! { 13 | didSet { 14 | if let _ = requestDispatcher { 15 | connect() 16 | } 17 | } 18 | } 19 | 20 | init() { 21 | super.init(namespace: CastNamespace.connection) 22 | } 23 | 24 | func connect() { 25 | let request = requestDispatcher.request(withNamespace: namespace, 26 | destinationId: CastConstants.receiver, 27 | payload: [CastJSONPayloadKeys.type: CastMessageType.connect.rawValue]) 28 | 29 | send(request) 30 | } 31 | 32 | func connect(to app: CastApp) { 33 | let request = requestDispatcher.request(withNamespace: namespace, 34 | destinationId: app.transportId, 35 | payload: [CastJSONPayloadKeys.type: CastMessageType.connect.rawValue]) 36 | 37 | send(request) 38 | } 39 | 40 | public func leave(_ app: CastApp) { 41 | let request = requestDispatcher.request(withNamespace: namespace, 42 | destinationId: app.transportId, 43 | payload: [CastJSONPayloadKeys.type: CastMessageType.close.rawValue]) 44 | 45 | send(request) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Source/Networking/Channels/DeviceDiscoveryChannel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DeviceDiscoveryChannel.swift 3 | // OpenCastSwift 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class DeviceDiscoveryChannel: CastChannel { 12 | init() { 13 | super.init(namespace: CastNamespace.discovery) 14 | } 15 | 16 | func requestDeviceInfo() { 17 | let request = requestDispatcher.request(withNamespace: namespace, 18 | destinationId: CastConstants.receiver, 19 | payload: [CastJSONPayloadKeys.type: CastMessageType.getDeviceInfo.rawValue]) 20 | 21 | send(request) { result in 22 | switch result { 23 | case .success(let json): 24 | print(json) 25 | 26 | case .failure(let error): 27 | print(error) 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/Networking/Channels/RequestSink.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RequestDispatchable.swift 3 | // OpenCastSwift Mac 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol RequestDispatchable: class { 12 | func nextRequestId() -> Int 13 | 14 | func request(withNamespace namespace: String, destinationId: String, payload: [String: Any]) -> CastRequest 15 | func request(withNamespace namespace: String, destinationId: String, payload: Data) -> CastRequest 16 | 17 | func send(_ request: CastRequest, response: CastResponseHandler?) 18 | } 19 | 20 | extension RequestDispatchable { 21 | func request(withNamespace namespace: String, destinationId: String, payload: [String: Any]) -> CastRequest { 22 | var payload = payload 23 | let requestId = nextRequestId() 24 | payload[CastJSONPayloadKeys.requestId] = requestId 25 | 26 | return CastRequest(id: requestId, 27 | namespace: namespace, 28 | destinationId: destinationId, 29 | payload: payload) 30 | } 31 | 32 | func request(withNamespace namespace: String, destinationId: String, payload: Data) -> CastRequest { 33 | return CastRequest(id: nextRequestId(), 34 | namespace: namespace, 35 | destinationId: destinationId, 36 | payload: payload) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Source/Supporting Files/ChromeCastCore.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenCastSwift.h 3 | // OpenCastSwift 4 | // 5 | // Created by Miles Hollingsworth on 4/22/18 6 | // Copyright © 2018 Miles Hollingsworth. All rights reserved. 7 | // 8 | 9 | @import Foundation; 10 | 11 | FOUNDATION_EXPORT double ChromeCastCoreVersionNumber; 12 | FOUNDATION_EXPORT const unsigned char ChromeCastCoreVersionString[]; 13 | -------------------------------------------------------------------------------- /Source/Supporting Files/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright © 2018 Miles Hollingsworth. All rights reserved. 23 | NSPrincipalClass 24 | 25 | 26 | 27 | --------------------------------------------------------------------------------