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
|
* the packaging of this file.
*/
#import <string.h>
#import "OFConstString.h"
@implementation OFConstString
+ new:(const char*)str
{
return [[OFConstString alloc] init:str];
}
- init
{
return [self init:NULL];
}
- init:(const char*)str
{
if ((self = [super init])) {
if (str == NULL) {
length = 0;
string = NULL;
} else {
length = strlen(str);
|
|
|
|
|
|
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
|
* the packaging of this file.
*/
#import <string.h>
#import "OFConstString.h"
@implementation OFConstString
+ new: (const char*)str
{
return [[OFConstString alloc] init: str];
}
- init
{
return [self init: NULL];
}
- init: (const char*)str
{
if ((self = [super init])) {
if (str == NULL) {
length = 0;
string = NULL;
} else {
length = strlen(str);
|