Overview
Context
Changes
Modified src/Makefile
from [b48a2876b6]
to [4590acbe8d].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
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
|
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
|
LIB = ${LIB_PREFIX}objfw${LIB_SUFFIX}
LIB_MAJOR = 1
LIB_MINOR = 0
SRCS = OFConstString.m \
OFList.m \
OFListObject.m \
OFObject.m \
OFString.m
SRCS = OFConstString.m \
OFConstWideString.m \
OFList.m \
OFListObject.m \
OFObject.m \
OFString.m \
OFWideString.m
OBJCFLAGS += -fPIC -DPIC -fno-nil-recivers -fconstant-string-class=OFConstString
INCLUDES = OFConstString.h \
OFConstWideString.h \
OFList.h \
OFListObject.h \
OFObject.h \
OFString.h
OFString.h \
OFWideString.h
include ../buildsys.mk
LD = ${OBJC}
LIBS += -lobjc
|
Modified src/OFConstString.m
from [f25f4f5f15]
to [8c3560516b].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
-
|
/*
* Copyright (c) 2008
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of libobjfw. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#import <stdlib.h>
#import <string.h>
#import "OFConstString.h"
@implementation OFConstString
+ new:(const char*)str
{
return [[OFConstString alloc] init:str];
|
︙ | | |
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
-
+
|
- init:(const char*)str
{
if ((self = [super init])) {
if (str == NULL) {
length = 0;
string = NULL;
} else {
length = strlen(string);
length = strlen(str);
string = str;
}
}
return self;
}
- (const char*)cString
|
︙ | | |
Added src/OFConstWideString.h version [30aab21810].
|
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
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of libobjfw. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#import <stddef.h>
#import <wchar.h>
#import "OFObject.h"
@interface OFConstWideString: OFObject
{
const wchar_t *wstring;
size_t length;
}
+ new:(const wchar_t*)wstr;
- init;
- init:(const wchar_t*)wstr;
- (const wchar_t*)wcString;
- (size_t)length;
@end
/* vim: se syn=objc: */
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | |
Added src/OFConstWideString.m version [1ca10a0426].
|
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
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of libobjfw. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#import <wchar.h>
#import "OFConstWideString.h"
@implementation OFConstWideString
+ new:(const wchar_t*)wstr
{
return [[OFConstWideString alloc] init:wstr];
}
- init
{
return [self init:NULL];
}
- init:(const wchar_t*)wstr
{
if ((self = [super init])) {
if (wstr == NULL) {
length = 0;
wstring = NULL;
} else {
length = wcslen(wstr);
wstring = wstr;
}
}
return self;
}
- (const wchar_t*)wcString
{
return wstring;
}
- (size_t)length
{
return length;
}
@end
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Modified src/OFString.m
from [ec546376b0]
to [7b8481ed3a].
︙ | | |
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
-
+
|
- init:(const char*)str
{
if ((self = [super init])) {
if (str == NULL) {
length = 0;
string = NULL;
} else {
length = strlen(string);
length = strlen(str);
if ((string = [self getMem:length]) == NULL)
return NULL;
memcpy(string, str, length);
}
}
return self;
}
|
︙ | | |
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
-
-
+
-
-
-
+
+
-
-
+
+
-
-
+
-
+
-
-
+
+
-
+
|
string = newstr;
return self;
}
- (OFString*)clone
{
if (string != NULL)
return [OFString new:string];
return [OFString new:string];
return [OFString new];
}
- (OFString*)append: (const char*)str
{
char *new_string;
size_t new_length, str_length;
char *newstr;
size_t newlen, strlength;
if (str == NULL)
return [self setTo:str];
str_length = strlen(str);
new_length = length + str_length;
strlength = strlen(str);
newlen = length + strlength;
if ((new_string =
[self resizeMem:string toSize:new_length + 1]) == NULL) {
if ((newstr = [self resizeMem:string toSize:newlen + 1]) == NULL) {
/* FIXME: Add error handling */
return nil;
}
string = new_string;
string = newstr;
memcpy(string + length, str, str_length);
string[new_length] = '\0';
memcpy(string + length, str, strlength);
string[newlen] = '\0';
length = new_length;
length = newlen;
return self;
}
@end
|
Added src/OFWideString.h version [7d19c57893].
|
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
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of libobjfw. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#import <stddef.h>
#import <wchar.h>
#import "OFObject.h"
@interface OFWideString: OFObject
{
wchar_t *wstring;
size_t length;
}
+ new:(const wchar_t*)wstr;
- init;
- init:(const wchar_t*)wstr;
- (wchar_t*)wcString;
- (size_t)length;
- (OFWideString*)setTo:(const wchar_t*)wstr;
- (OFWideString*)clone;
- (OFWideString*)append:(const wchar_t*)wstr;
@end
/* vim: se syn=objc: */
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Added src/OFWideString.m version [b821122f3b].