ObjFW  Check-in [d6a3d8a5db]

Overview
Comment:Add OF_NOT_IMPLEMENTED macro.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d6a3d8a5db3e1cf7910b5d07664e2793922cc4bb6be53bd63b49e3141aed4ade
User & Date: js on 2008-10-29 16:37:19
Other Links: manifest | tags
Context
2008-10-29
17:29
Add getMemForNItems:withSize: & resizeMem:toNItems:withSize: in OFObject check-in: 49859c2bcc user: js tags: trunk
16:37
Add OF_NOT_IMPLEMENTED macro. check-in: d6a3d8a5db user: js tags: trunk
2008-10-28
19:00
Better overflow checking. check-in: 2aaab788cc user: js tags: trunk
Changes

Modified src/Makefile from [bfb2e35d1d] to [4d6994e0b2].

11
12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
11
12
13
14
15
16
17

18
19
20
21
22
23
24
25
26
27







-
+
+








       OFList.m			\
       OFListObject.m		\
       OFObject.m		\
       OFString.m		\
       OFWideCString.m		\
       OFXMLFactory.m

INCLUDES = ${SRCS:.m=.h}
INCLUDES = ${SRCS:.m=.h}	\
	   OFMacros.h

include ../buildsys.mk

CPPFLAGS += -I..
OBJCFLAGS += ${LIB_CFLAGS}
LD = ${OBJC}
LDFLAGS += ${LIB_LDFLAGS}
LIBS += -lobjc

Added src/OFMacros.h version [bcf6a12bee].
















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
/*
 * 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.
 */

#define OF_NOT_IMPLEMENTED(ret)						\
	[[OFNotImplementedException newWithObject: self			\
				      andSelector: _cmd] raise];	\
	return ret;

Modified src/OFString.m from [28feddcc2f] to [a6d9bc8397].

16
17
18
19
20
21
22

23
24
25
26
27
28
29
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30







+








#import "OFString.h"
#import "OFConstCString.h"
#import "OFConstWideCString.h"
#import "OFCString.h"
#import "OFWideCString.h"
#import "OFExceptions.h"
#import "OFMacros.h"

@implementation OFString
+ newAsConstCString: (const char*)str
{
	return [[OFConstCString alloc] initAsConstCString: str];
}

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
92

93
94
95
96
97
98
99
100

101
102
103
104
105
106
107
108
109

110
111
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
92







-
-
-
+




-
-
-
+




-
+
-
-











-
-
-
+




-
+
-
-
-




-
-
-
+




-
-
-
-
+




-
-
-
-
-
+


+ newAsWideCString: (wchar_t*)str
{
	return [[OFWideCString alloc] initAsWideCString: str];
}

- (char*)cString
{
	[[OFNotImplementedException newWithObject: self
				      andSelector: @selector(cString)] raise];
	return NULL;
	OF_NOT_IMPLEMENTED(NULL)
}

- (wchar_t*)wcString
{
	[[OFNotImplementedException newWithObject: self
				      andSelector: @selector(wcString)] raise];
	return NULL;
	OF_NOT_IMPLEMENTED(NULL)
}

- (size_t)length
{
	[[OFNotImplementedException newWithObject: self
	OF_NOT_IMPLEMENTED(0)
				      andSelector: @selector(length)] raise];
	return 0;
}

- (OFString*)setTo: (OFString*)str
{
	[self free];
	self = [str clone];
	return self;
}

- (OFString*)clone
{
	[[OFNotImplementedException newWithObject: self
				      andSelector: @selector(clone)] raise];
	return nil;
	OF_NOT_IMPLEMENTED(nil)
}

- (int)compareTo: (OFString*)str
{
	[[OFNotImplementedException newWithObject: self
	OF_NOT_IMPLEMENTED(0)
				      andSelector: @selector(compareTo:)]
	    raise];
	return 0;
}

- (OFString*)append: (OFString*)str
{
	[[OFNotImplementedException newWithObject: self
				      andSelector: @selector(append:)] raise];
	return nil;
	OF_NOT_IMPLEMENTED(nil)
}

- (OFString*)appendCString: (const char*)str
{
	[[OFNotImplementedException newWithObject: self
				      andSelector: @selector(appendCString:)]
	    raise];
	return nil;
	OF_NOT_IMPLEMENTED(nil)
}

- (OFString*)appendWideCString: (const wchar_t*)str
{
	[[OFNotImplementedException newWithObject: self
				      andSelector: @selector(
						       appendWideCString:)]
	    raise];
	return nil;
	OF_NOT_IMPLEMENTED(nil)
}
@end