File: issue12403.objc.m.golden

package info (click to toggle)
golang-golang-x-mobile 0.0~git20250520.a1d9079%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,784 kB
  • sloc: objc: 1,512; java: 1,489; ansic: 1,159; xml: 365; asm: 34; sh: 14; makefile: 5
file content (91 lines) | stat: -rw-r--r-- 2,445 bytes parent folder | download
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Objective-C API for talking to issue12403 Go package.
//   gobind -lang=objc issue12403
//
// File is generated by gobind. Do not edit.

#include <Foundation/Foundation.h>
#include "seq.h"
#include "_cgo_export.h"
#include "Issue12403.objc.h"

@implementation Issue12403Parsable {
}

- (nonnull instancetype)initWithRef:(id)ref {
	self = [super init];
	if (self) { __ref = ref; }
	return self;
}

- (NSString* _Nonnull)fromJSON:(NSString* _Nullable)jstr {
	int32_t refnum = go_seq_go_to_refnum(self._ref);
	nstring _jstr = go_seq_from_objc_string(jstr);
	nstring r0 = proxyissue12403_Parsable_FromJSON(refnum, _jstr);
	NSString *_ret0_ = go_seq_to_objc_string(r0);
	return _ret0_;
}

- (NSString* _Nonnull)toJSON:(NSError* _Nullable* _Nullable)error {
	int32_t refnum = go_seq_go_to_refnum(self._ref);
	struct proxyissue12403_Parsable_ToJSON_return res = proxyissue12403_Parsable_ToJSON(refnum);
	NSString *_ret0_ = go_seq_to_objc_string(res.r0);
	Universeerror* _error = nil;
	GoSeqRef* _error_ref = go_seq_from_refnum(res.r1);
	if (_error_ref != NULL) {
		_error = _error_ref.obj;
		if (_error == nil) {
			_error = [[Universeerror alloc] initWithRef:_error_ref];
		}
	}
	if (_error != nil && error != nil) {
		*error = _error;
	}
	if (_error != nil) {
		return nil;
	}
	return _ret0_;
}

@end



nstring cproxyissue12403_Parsable_FromJSON(int32_t refnum, nstring jstr) {
	@autoreleasepool {
		Issue12403Parsable* o = go_seq_objc_from_refnum(refnum);
		NSString *_jstr = go_seq_to_objc_string(jstr);
		NSString* _Nonnull ret0_;
		ret0_ = [o fromJSON:_jstr];
		nstring _ret0_ = go_seq_from_objc_string(ret0_);
		return _ret0_;
	}
}

struct cproxyissue12403_Parsable_ToJSON_return cproxyissue12403_Parsable_ToJSON(int32_t refnum) {
	@autoreleasepool {
		Issue12403Parsable* o = go_seq_objc_from_refnum(refnum);
		NSString* _Nonnull ret0_;
		NSError* error = nil;
		ret0_ = [o toJSON:&error];
		nstring _ret0_ = go_seq_from_objc_string(ret0_);
		NSError *_error = nil;
		if (error != nil) {
			_error = error;
		}
		int32_t __error;
		if ([_error conformsToProtocol:@protocol(goSeqRefInterface)]) {
			id<goSeqRefInterface> _error_proxy = (id<goSeqRefInterface>)(_error);
			__error = go_seq_go_to_refnum(_error_proxy._ref);
		} else {
			__error = go_seq_to_refnum(_error);
		}
		cproxyissue12403_Parsable_ToJSON_return _sres = {
		  _ret0_, __error
		};
		return _sres;
	}
}

__attribute__((constructor)) static void init() {
	init_seq();
}