Skip to content

Commit 475c6b3

Browse files
author
Alexey Khokhlov
committed
Regenrate xcode 9
1 parent 1753af0 commit 475c6b3

33 files changed

Lines changed: 1153 additions & 682 deletions

Source/Google.Protobuf.Api.proto.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public extension Google.Protobuf {
377377
return builderResult.sourceContext
378378
}
379379
set (value) {
380-
builderResult.hasSourceContext = true
380+
builderResult.hasSourceContext = value != nil
381381
builderResult.sourceContext = value
382382
}
383383
}

Source/Google.Protobuf.Compiler.Plugin.proto.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ public extension Google.Protobuf.Compiler {
705705
return builderResult.compilerVersion
706706
}
707707
set (value) {
708-
builderResult.hasCompilerVersion = true
708+
builderResult.hasCompilerVersion = value != nil
709709
builderResult.compilerVersion = value
710710
}
711711
}

Source/Google.Protobuf.Descriptor.proto.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ public extension Google.Protobuf {
895895
return builderResult.options
896896
}
897897
set (value) {
898-
builderResult.hasOptions = true
898+
builderResult.hasOptions = value != nil
899899
builderResult.options = value
900900
}
901901
}
@@ -953,7 +953,7 @@ public extension Google.Protobuf {
953953
return builderResult.sourceCodeInfo
954954
}
955955
set (value) {
956-
builderResult.hasSourceCodeInfo = true
956+
builderResult.hasSourceCodeInfo = value != nil
957957
builderResult.sourceCodeInfo = value
958958
}
959959
}
@@ -2372,7 +2372,7 @@ public extension Google.Protobuf {
23722372
return builderResult.options
23732373
}
23742374
set (value) {
2375-
builderResult.hasOptions = true
2375+
builderResult.hasOptions = value != nil
23762376
builderResult.options = value
23772377
}
23782378
}
@@ -3413,7 +3413,7 @@ public extension Google.Protobuf {
34133413
return builderResult.options
34143414
}
34153415
set (value) {
3416-
builderResult.hasOptions = true
3416+
builderResult.hasOptions = value != nil
34173417
builderResult.options = value
34183418
}
34193419
}
@@ -3816,7 +3816,7 @@ public extension Google.Protobuf {
38163816
return builderResult.options
38173817
}
38183818
set (value) {
3819-
builderResult.hasOptions = true
3819+
builderResult.hasOptions = value != nil
38203820
builderResult.options = value
38213821
}
38223822
}
@@ -4187,7 +4187,7 @@ public extension Google.Protobuf {
41874187
return builderResult.options
41884188
}
41894189
set (value) {
4190-
builderResult.hasOptions = true
4190+
builderResult.hasOptions = value != nil
41914191
builderResult.options = value
41924192
}
41934193
}
@@ -4565,7 +4565,7 @@ public extension Google.Protobuf {
45654565
return builderResult.options
45664566
}
45674567
set (value) {
4568-
builderResult.hasOptions = true
4568+
builderResult.hasOptions = value != nil
45694569
builderResult.options = value
45704570
}
45714571
}
@@ -4947,7 +4947,7 @@ public extension Google.Protobuf {
49474947
return builderResult.options
49484948
}
49494949
set (value) {
4950-
builderResult.hasOptions = true
4950+
builderResult.hasOptions = value != nil
49514951
builderResult.options = value
49524952
}
49534953
}
@@ -5413,7 +5413,7 @@ public extension Google.Protobuf {
54135413
return builderResult.options
54145414
}
54155415
set (value) {
5416-
builderResult.hasOptions = true
5416+
builderResult.hasOptions = value != nil
54175417
builderResult.options = value
54185418
}
54195419
}

Source/Google.Protobuf.Struct.proto.swift

Lines changed: 72 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public extension Google.Protobuf {
256256
return builderResult.value
257257
}
258258
set (value) {
259-
builderResult.hasValue = true
259+
builderResult.hasValue = value != nil
260260
builderResult.value = value
261261
}
262262
}
@@ -650,68 +650,102 @@ public extension Google.Protobuf {
650650
//OneOf declaration start
651651

652652
public enum Kind {
653-
case OneOfKindNotSet
653+
case oneOfKindNotSet
654654

655655
public func checkOneOfIsSet() -> Bool {
656656
switch self {
657-
case .OneOfKindNotSet: return false
657+
case .oneOfKindNotSet: return false
658658
default: return true
659659
}
660660
}
661-
case NullValue(Google.Protobuf.NullValue)
661+
case nullValue(Google.Protobuf.NullValue)
662662

663663
public static func getNullValue(_ value:Kind) -> Google.Protobuf.NullValue? {
664664
switch value {
665-
case .NullValue(let enumValue): return enumValue
665+
case .nullValue(let enumValue): return enumValue
666+
default: return nil
667+
}
668+
}
669+
public func getNullValue() -> Google.Protobuf.NullValue? {
670+
switch self {
671+
case .nullValue(let enumValue): return enumValue
666672
default: return nil
667673
}
668674
}
669-
case NumberValue(Double)
675+
case numberValue(Double)
670676

671677
public static func getNumberValue(_ value:Kind) -> Double? {
672678
switch value {
673-
case .NumberValue(let enumValue): return enumValue
679+
case .numberValue(let otherValue): return otherValue
674680
default: return nil
675681
}
676682
}
677-
case StringValue(String)
683+
public func getNumberValue() -> Double? {
684+
switch self {
685+
case .numberValue(let otherValue): return otherValue
686+
default: return nil
687+
}
688+
}
689+
case stringValue(String)
678690

679691
public static func getStringValue(_ value:Kind) -> String? {
680692
switch value {
681-
case .StringValue(let enumValue): return enumValue
693+
case .stringValue(let otherValue): return otherValue
694+
default: return nil
695+
}
696+
}
697+
public func getStringValue() -> String? {
698+
switch self {
699+
case .stringValue(let otherValue): return otherValue
682700
default: return nil
683701
}
684702
}
685-
case BoolValue(Bool)
703+
case boolValue(Bool)
686704

687705
public static func getBoolValue(_ value:Kind) -> Bool? {
688706
switch value {
689-
case .BoolValue(let enumValue): return enumValue
707+
case .boolValue(let otherValue): return otherValue
708+
default: return nil
709+
}
710+
}
711+
public func getBoolValue() -> Bool? {
712+
switch self {
713+
case .boolValue(let otherValue): return otherValue
690714
default: return nil
691715
}
692716
}
693-
case StructValue(Google.Protobuf.Struct)
717+
case structValue(Google.Protobuf.Struct)
694718

695719
public static func getStructValue(_ value:Kind) -> Google.Protobuf.Struct? {
696720
switch value {
697-
case .StructValue(let enumValue):
698-
return enumValue
699-
default: return nil
721+
case .structValue(let messageValue): return messageValue
722+
default: return nil
723+
}
724+
}
725+
public func getStructValue() -> Google.Protobuf.Struct? {
726+
switch self {
727+
case .structValue(let messageValue): return messageValue
728+
default: return nil
700729
}
701730
}
702-
case ListValue(Google.Protobuf.ListValue)
731+
case listValue(Google.Protobuf.ListValue)
703732

704733
public static func getListValue(_ value:Kind) -> Google.Protobuf.ListValue? {
705734
switch value {
706-
case .ListValue(let enumValue):
707-
return enumValue
708-
default: return nil
735+
case .listValue(let messageValue): return messageValue
736+
default: return nil
737+
}
738+
}
739+
public func getListValue() -> Google.Protobuf.ListValue? {
740+
switch self {
741+
case .listValue(let messageValue): return messageValue
742+
default: return nil
709743
}
710744
}
711745
}
712746
//OneOf declaration end
713747

714-
fileprivate var storageKind:Value.Kind = Value.Kind.OneOfKindNotSet
748+
fileprivate var storageKind:Value.Kind = Value.Kind.oneOfKindNotSet
715749
public func getOneOfKind() -> Value.Kind {
716750
let copyObjectKind = storageKind
717751
return copyObjectKind
@@ -721,15 +755,12 @@ public extension Google.Protobuf {
721755
return Value.Kind.getNullValue(storageKind)
722756
}
723757
set (newvalue) {
724-
storageKind = Value.Kind.NullValue(newvalue)
758+
storageKind = Value.Kind.nullValue(newvalue)
725759
}
726760
}
727761
public fileprivate(set) var hasNullValue:Bool {
728762
get {
729-
guard let _ = Value.Kind.getNullValue(storageKind) else {
730-
return false
731-
}
732-
return true
763+
return Value.Kind.getNullValue(storageKind) != nil
733764
}
734765
set(newValue) {
735766
}
@@ -740,15 +771,12 @@ public extension Google.Protobuf {
740771
return Value.Kind.getNumberValue(storageKind)
741772
}
742773
set (newvalue) {
743-
storageKind = Value.Kind.NumberValue(newvalue)
774+
storageKind = Value.Kind.numberValue(newvalue)
744775
}
745776
}
746777
public fileprivate(set) var hasNumberValue:Bool {
747778
get {
748-
guard let _ = Value.Kind.getNumberValue(storageKind) else {
749-
return false
750-
}
751-
return true
779+
return Value.Kind.getNumberValue(storageKind) != nil
752780
}
753781
set(newValue) {
754782
}
@@ -759,15 +787,12 @@ public extension Google.Protobuf {
759787
return Value.Kind.getStringValue(storageKind)
760788
}
761789
set (newvalue) {
762-
storageKind = Value.Kind.StringValue(newvalue)
790+
storageKind = Value.Kind.stringValue(newvalue)
763791
}
764792
}
765793
public fileprivate(set) var hasStringValue:Bool {
766794
get {
767-
guard let _ = Value.Kind.getStringValue(storageKind) else {
768-
return false
769-
}
770-
return true
795+
return Value.Kind.getStringValue(storageKind) != nil
771796
}
772797
set(newValue) {
773798
}
@@ -778,15 +803,12 @@ public extension Google.Protobuf {
778803
return Value.Kind.getBoolValue(storageKind)
779804
}
780805
set (newvalue) {
781-
storageKind = Value.Kind.BoolValue(newvalue)
806+
storageKind = Value.Kind.boolValue(newvalue)
782807
}
783808
}
784809
public fileprivate(set) var hasBoolValue:Bool {
785810
get {
786-
guard let _ = Value.Kind.getBoolValue(storageKind) else {
787-
return false
788-
}
789-
return true
811+
return Value.Kind.getBoolValue(storageKind) != nil
790812
}
791813
set(newValue) {
792814
}
@@ -796,15 +818,12 @@ public extension Google.Protobuf {
796818
return Value.Kind.getStructValue(storageKind)
797819
}
798820
set (newvalue) {
799-
storageKind = Value.Kind.StructValue(newvalue)
821+
storageKind = Value.Kind.structValue(newvalue)
800822
}
801823
}
802824
public fileprivate(set) var hasStructValue:Bool {
803825
get {
804-
guard let _ = Value.Kind.getStructValue(storageKind) else {
805-
return false
806-
}
807-
return true
826+
return Value.Kind.getStructValue(storageKind) != nil
808827
}
809828
set(newValue) {
810829
}
@@ -814,15 +833,12 @@ public extension Google.Protobuf {
814833
return Value.Kind.getListValue(storageKind)
815834
}
816835
set (newvalue) {
817-
storageKind = Value.Kind.ListValue(newvalue)
836+
storageKind = Value.Kind.listValue(newvalue)
818837
}
819838
}
820839
public fileprivate(set) var hasListValue:Bool {
821840
get {
822-
guard let _ = Value.Kind.getListValue(storageKind) else {
823-
return false
824-
}
825-
return true
841+
return Value.Kind.getListValue(storageKind) != nil
826842
}
827843
set(newValue) {
828844
}
@@ -1018,6 +1034,10 @@ public extension Google.Protobuf {
10181034
required override public init () {
10191035
super.init()
10201036
}
1037+
public func setKind(_ oneOf:Value.Kind) -> Google.Protobuf.Value.Builder {
1038+
builderResult.storageKind = oneOf
1039+
return self
1040+
}
10211041
/// Represents a null value.
10221042
public var nullValue:Google.Protobuf.NullValue {
10231043
get {
@@ -1131,7 +1151,7 @@ public extension Google.Protobuf {
11311151
return builderResult.structValue
11321152
}
11331153
set (value) {
1134-
builderResult.hasStructValue = true
1154+
builderResult.hasStructValue = value != nil
11351155
builderResult.structValue = value
11361156
}
11371157
}
@@ -1186,7 +1206,7 @@ public extension Google.Protobuf {
11861206
return builderResult.listValue
11871207
}
11881208
set (value) {
1189-
builderResult.hasListValue = true
1209+
builderResult.hasListValue = value != nil
11901210
builderResult.listValue = value
11911211
}
11921212
}

Source/Google.Protobuf.Type.proto.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public extension Google.Protobuf {
342342
return builderResult.sourceContext
343343
}
344344
set (value) {
345-
builderResult.hasSourceContext = true
345+
builderResult.hasSourceContext = value != nil
346346
builderResult.sourceContext = value
347347
}
348348
}
@@ -1610,7 +1610,7 @@ public extension Google.Protobuf {
16101610
return builderResult.sourceContext
16111611
}
16121612
set (value) {
1613-
builderResult.hasSourceContext = true
1613+
builderResult.hasSourceContext = value != nil
16141614
builderResult.sourceContext = value
16151615
}
16161616
}
@@ -2297,7 +2297,7 @@ public extension Google.Protobuf {
22972297
return builderResult.value
22982298
}
22992299
set (value) {
2300-
builderResult.hasValue = true
2300+
builderResult.hasValue = value != nil
23012301
builderResult.value = value
23022302
}
23032303
}

0 commit comments

Comments
 (0)