23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#include <stringprep.h>
#import "XMPPJID.h"
#import "XMPPExceptions.h"
@implementation XMPPJID
@synthesize node;
@synthesize domain;
@synthesize resource;
+ JID
{
return [[[self alloc] init] autorelease];
}
+ JIDWithString: (OFString*)str
{
|
<
<
<
<
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#include <stringprep.h>
#import "XMPPJID.h"
#import "XMPPExceptions.h"
@implementation XMPPJID
+ JID
{
return [[[self alloc] init] autorelease];
}
+ JIDWithString: (OFString*)str
{
|
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
node = [[OFString alloc] initWithCString: nodepart];
} @finally {
free(nodepart);
}
[old release];
}
- (void)setDomain: (OFString*)domain_
{
OFString *old = domain;
char *srv;
Stringprep_rc rc;
|
>
>
>
>
>
|
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
node = [[OFString alloc] initWithCString: nodepart];
} @finally {
free(nodepart);
}
[old release];
}
- (OFString*)node
{
return [[node copy] autorelease];
}
- (void)setDomain: (OFString*)domain_
{
OFString *old = domain;
char *srv;
Stringprep_rc rc;
|
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
domain = [[OFString alloc] initWithCString: srv];
} @finally {
free(srv);
}
[old release];
}
- (void)setResource: (OFString*)resource_
{
OFString *old = resource;
char *res;
Stringprep_rc rc;
|
>
>
>
>
>
|
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
domain = [[OFString alloc] initWithCString: srv];
} @finally {
free(srv);
}
[old release];
}
- (OFString*)domain
{
return [[node copy] autorelease];
}
- (void)setResource: (OFString*)resource_
{
OFString *old = resource;
char *res;
Stringprep_rc rc;
|
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
resource = [[OFString alloc] initWithCString: res];
} @finally {
free(res);
}
[old release];
}
- (OFString*)bareJID
{
if (node != nil)
return [OFString stringWithFormat: @"%@@%@", node, domain];
else
return [OFString stringWithFormat: @"%@", domain];
|
>
>
>
>
>
|
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
resource = [[OFString alloc] initWithCString: res];
} @finally {
free(res);
}
[old release];
}
- (OFString*)resource
{
return [[resource copy] autorelease];
}
- (OFString*)bareJID
{
if (node != nil)
return [OFString stringWithFormat: @"%@@%@", node, domain];
else
return [OFString stringWithFormat: @"%@", domain];
|