ObjFW  Check-in [47e65e5a97]

Overview
Comment:Add -[appendCStringWithoutUTF8Checking:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 47e65e5a97663b45e6bfbe72cff8ce38f5e21d84318f608f4685592eff2a3618
User & Date: js on 2009-06-18 18:26:59
Other Links: manifest | tags
Context
2009-06-18
18:42
Preliminary OFXMLElement implementation. check-in: f9c673f241 user: js tags: trunk
18:26
Add -[appendCStringWithoutUTF8Checking:]. check-in: 47e65e5a97 user: js tags: trunk
2009-06-15
19:22
Remove whitespaces at EOL. check-in: 172e662b71 user: js tags: trunk
Changes

Modified src/OFDictionary.m from [01f5ecb4a1] to [3ec4eb0e31].

14
15
16
17
18
19
20
21

22
23
24
25
26
27
28
14
15
16
17
18
19
20

21
22
23
24
25
26
27
28







-
+







#include <string.h>

#import "OFDictionary.h"
#import "OFIterator.h"
#import "OFExceptions.h"

/* Reference for static linking */
void _reference_to_OFIterator_in_OFDictionary()
void _references_to_categories_of_OFDictionary()
{
	_OFIterator_reference = 1;
}

@implementation OFDictionary
+ dictionary;
{

Modified src/OFMutableString.h from [2a9861e6dd] to [aa01340072].

28
29
30
31
32
33
34











35
36
37
38
39
40
41
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







+
+
+
+
+
+
+
+
+
+
+







/**
 * Appends a C string to the OFString.
 *
 * \param str A C string to append
 */
- appendCString: (const char*)str;

/**
 * Appends a C string to the OFString without checking whether it is valid
 * UTF-8.
 *
 * Only use this if you are 100% sure the string you append is either ASCII or
 * UTF-8!
 *
 * \param str A C string to append
 */
- appendCStringWithoutUTF8Checking: (const char*)str;

/**
 * Appends another OFString to the OFString.
 *
 * \param str An OFString to append
 */
- appendString: (OFString*)str;

Modified src/OFMutableString.m from [69cd258f82] to [b1e7f862ab].

81
82
83
84
85
86
87













88
89
90
91

92
93
94
95
96
97
98
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 = [self resizeMemory: string
			     toSize: length + strlength + 1];
	memcpy(string + length, str, strlength + 1);
	length += strlength;

	return self;
}

- appendCStringWithoutUTF8Checking: (const char*)str
{
	size_t strlength;

	strlength = strlen(str);
	string = [self resizeMemory: string
			     toSize: length + strlength + 1];
	memcpy(string + length, str, strlength + 1);
	length += strlength;

	return self;
}

- appendString: (OFString*)str
{
	return [self appendCString: [str cString]];
	return [self appendCStringWithoutUTF8Checking: [str cString]];
}

- appendWithFormat: (OFString*)fmt, ...
{
	id ret;
	va_list args;

Modified src/OFString.h from [924026e22c] to [c66ab2551c].

132
133
134
135
136
137
138

139
140
141
142
143
144
145
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146







+







 * \param delimiter The delimiter for splitting
 * \return An autoreleased OFArray with the splitted string
 */
- (OFArray*)splitWithDelimiter: (OFString*)delimiter;

- setToCString: (const char*)str;
- appendCString: (const char*)str;
- appendCStringWithoutUTF8Checking: (const char*)str;
- appendString: (OFString*)str;
- appendWithFormat: (OFString*)fmt, ...;
- appendWithFormat: (OFString*)fmt
      andArguments: (va_list)args;
- reverse;
- upper;
- lower;

Modified src/OFString.m from [67f5019bf6] to [f0f301f9d4].

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







-
+







#import "OFURLEncoding.h"
#import "OFExceptions.h"
#import "OFMacros.h"

#import "asprintf.h"

/* Reference for static linking */
void _reference_to_OFURLEncoding_in_OFString()
void _references_to_categories_of_OFString()
{
	_OFURLEncoding_reference = 1;
};

int
of_string_check_utf8(const char *str, size_t len)
{
367
368
369
370
371
372
373






374
375
376
377
378
379
380
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386







+
+
+
+
+
+







- setToCString: (const char*)str
{
	@throw [OFNotImplementedException newWithClass: isa
					   andSelector: _cmd];
}

- appendCString: (const char*)str
{
	@throw [OFNotImplementedException newWithClass: isa
					   andSelector: _cmd];
}

- appendCStringWithoutUTF8Checking: (const char*)str
{
	@throw [OFNotImplementedException newWithClass: isa
					   andSelector: _cmd];
}

- appendString: (OFString*)str
{