Overview
Context
Changes
Modified src/OFPlugin.m
from [7906a08f5e]
to [510d0be2d3].
︙ | | |
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
-
-
-
+
+
+
|
#import "OFPlugin.h"
#import "OFString.h"
#import "OFAutoreleasePool.h"
#import "OFExceptions.h"
#ifdef _WIN32
#define dlopen(file, mode) LoadLibrary(file)
#define dlsym(handle, symbol) GetProcAddress(handle, symbol)
#define dlclose(handle) FreeLibrary(handle)
# define dlopen(file, mode) LoadLibrary(file)
# define dlsym(handle, symbol) GetProcAddress(handle, symbol)
# define dlclose(handle) FreeLibrary(handle)
#endif
@implementation OFPlugin
+ pluginFromFile: (OFString*)path
{
OFAutoreleasePool *pool;
OFMutableString *file;
|
︙ | | |
Modified src/OFXMLElement.h
from [ab1302a21f]
to [c4cba39561].
︙ | | |
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
-
+
|
{
OFString *name;
OFString *namespace;
OFString *defaultNamespace;
OFMutableArray *attributes;
OFMutableDictionary *namespaces;
OFMutableArray *children;
OFString *text;
OFString *characters;
OFMutableString *comment;
}
/**
* \param name The name for the element
* \return A new autoreleased OFXMLElement with the specified element name
*/
|
︙ | | |
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
|
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
|
-
+
-
-
+
+
+
-
+
-
+
|
* namespace and value
*/
+ elementWithName: (OFString*)name
namespace: (OFString*)ns
stringValue: (OFString*)stringval;
/**
* Creates a new element, only consisting of the specified text.
* Creates a new element, only consisting of the specified characters.
*
* \param text The text the element represents
* \return A new autoreleased OFXMLElement consisting of the specified text
* \param chars The characters the element represents
* \return A new autoreleased OFXMLElement consisting of the specified
* characters
*/
+ elementWithText: (OFString*)text;
+ elementWithCharacters: (OFString*)chars;
/**
* Creates a new element, only consisting of the specified comment.
*
* \param comment The comment the element represents
* \return A new autoreleased OFXMLElement consisting of the specified comment
*/
+ elementWithComment: (OFString*)text;
+ elementWithComment: (OFString*)comment;
/**
* Initializes an already allocated OFXMLElement with the specified element
* name.
*
* \param name The name for the element
* \return An initialized OFXMLElement with the specified element name
|
︙ | | |
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
-
+
-
-
+
+
-
+
-
+
|
*/
- initWithName: (OFString*)name
namespace: (OFString*)ns
stringValue: (OFString*)stringval;
/**
* Initializes an already allocated OFXMLElement so that it only consists of the
* specified text.
* specified characters.
*
* \param text The text the element represents
* \return An initialized OFXMLElement consisting of the specified text
* \param chars The characters the element represents
* \return An initialized OFXMLElement consisting of the specified characters
*/
- initWithText: (OFString*)text;
- initWithCharacters: (OFString*)chars;
/**
* Initializes an already allocated OFXMLElement so that it only consists of the
* specified comment.
*
* \param comment The comment the element represents
* \return An initialized OFXMLElement consisting of the specified comment
*/
- initWithComment: (OFString*)text;
- initWithComment: (OFString*)comment;
/**
* \return A new autoreleased OFString representing the OFXMLElement as an
* XML string
*/
- (OFString*)string;
|
︙ | | |
Modified src/OFXMLElement.m
from [9fef639632]
to [05eb8e5213].
︙ | | |
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
-
+
-
+
|
stringValue: (OFString*)stringval
{
return [[[self alloc] initWithName: name
namespace: ns
stringValue: stringval] autorelease];
}
+ elementWithText: (OFString*)text
+ elementWithCharacters: (OFString*)chars
{
return [[[self alloc] initWithText: text] autorelease];
return [[[self alloc] initWithCharacters: chars] autorelease];
}
+ elementWithComment: (OFString*)comment
{
return [[[self alloc] initWithComment: comment] autorelease];
}
|
︙ | | |
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
-
+
+
-
+
-
+
|
self = [super init];
name = [name_ copy];
namespace = [ns copy];
if (stringval != nil) {
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];;
[self addChild: [OFXMLElement elementWithText: stringval]];
[self addChild:
[OFXMLElement elementWithCharacters: stringval]];
[pool release];
}
namespaces = [[OFMutableDictionary alloc] initWithKeysAndObjects:
@"http://www.w3.org/XML/1998/namespace", @"xml",
@"http://www.w3.org/2000/xmlns/", @"xmlns", nil];
return self;
}
- initWithText: (OFString*)text_
- initWithCharacters: (OFString*)chars
{
self = [super init];
text = [text_ copy];
characters = [chars copy];
return self;
}
- initWithComment: (OFString*)comment_
{
self = [super init];
|
︙ | | |
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
-
-
+
+
|
size_t len, i, j, attrs_count;
OFString *prefix = nil;
OFXMLAttribute **attrs_carray;
OFString *ret, *tmp;
OFMutableDictionary *all_namespaces;
OFString *def_ns;
if (text != nil)
return [text stringByXMLEscaping];
if (characters != nil)
return [characters stringByXMLEscaping];
if (comment != nil) {
OFMutableString *str;
str = [OFMutableString stringWithString: @"<!--"];
[str appendString: comment];
[str appendString: @"-->"];
|
︙ | | |
427
428
429
430
431
432
433
434
435
436
437
438
439
|
428
429
430
431
432
433
434
435
436
437
438
439
440
|
-
+
|
- (void)dealloc
{
[name release];
[namespace release];
[attributes release];
[namespaces release];
[children release];
[text release];
[characters release];
[comment release];
[super dealloc];
}
@end
|
Modified tests/OFXMLElementTests.m
from [e3337d2bec]
to [3f6cbf99e7].
︙ | | |
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
-
-
+
+
|
(elem[3] = [OFXMLElement elementWithName: @"foo"
namespace: @"urn:objfw:test"
stringValue: @"x"]) &&
R([elem[3] setPrefix: @"objfw-test"
forNamespace: @"urn:objfw:test"]) &&
[[elem[3] string] isEqual: @"<objfw-test:foo>x</objfw-test:foo>"])
TEST(@"+[elementWithText:]",
(elem[3] = [OFXMLElement elementWithText: @"<foo>"]) &&
TEST(@"+[elementWithCharacters:]",
(elem[3] = [OFXMLElement elementWithCharacters: @"<foo>"]) &&
[[elem[3] string] isEqual: @"<foo>"])
TEST(@"+[elementWithComment:]",
(elem[3] = [OFXMLElement elementWithComment: @" comment "]) &&
[[elem[3] string] isEqual: @"<!-- comment -->"])
TEST(@"-[addAttributeWithName:stringValue:]",
|
︙ | | |