ObjFW  Diff

Differences From Artifact [1362f58459]:

To Artifact [ba4e0fdeba]:


33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47







-
+







}

- initWithString: (OFString*)string
{
	self = [super init];

	@try {
		processingInstructions = [string copy];
		_processingInstructions = [string copy];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}
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
112
113
114
115
116
117
118
119
120
121

122
123
124
125
126
127

128
129
130
131
132
133
134

135
136
137
138
139
140
141

142
143
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
112
113
114
115
116
117
118



119
120
121
122
123
124

125
126
127
128
129
130
131

132
133
134
135
136
137
138

139
140
141







-
+












-
+




-
+

-
-
+
+




-
+









-
+




-
+















-
-
-
+





-
+






-
+






-
+



		if (![[element name] isEqual: [self className]] ||
		    ![[element namespace] isEqual: OF_SERIALIZATION_NS])
			@throw [OFInvalidArgumentException
			    exceptionWithClass: [self class]
				      selector: _cmd];

		processingInstructions = [[element stringValue] copy];
		_processingInstructions = [[element stringValue] copy];

		objc_autoreleasePoolPop(pool);
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (BOOL)isEqual: (id)object
{
	OFXMLProcessingInstructions *otherProcessingInstructions;
	OFXMLProcessingInstructions *processingInstructions;

	if (![object isKindOfClass: [OFXMLProcessingInstructions class]])
		return NO;

	otherProcessingInstructions = object;
	processingInstructions = object;

	return ([otherProcessingInstructions->processingInstructions
	    isEqual: processingInstructions]);
	return ([processingInstructions->_processingInstructions
	    isEqual: _processingInstructions]);
}

- (uint32_t)hash
{
	return [processingInstructions hash];
	return [_processingInstructions hash];
}

- (OFString*)stringValue
{
	return @"";
}

- (OFString*)XMLString
{
	return [OFString stringWithFormat: @"<?%@?>", processingInstructions];
	return [OFString stringWithFormat: @"<?%@?>", _processingInstructions];
}

- (OFString*)XMLStringWithIndentation: (unsigned int)indentation
{
	return [OFString stringWithFormat: @"<?%@?>", processingInstructions];
	return [OFString stringWithFormat: @"<?%@?>", _processingInstructions];
}

- (OFString*)XMLStringWithIndentation: (unsigned int)indentation
				level: (unsigned int)level
{
	OFString *ret;

	if (indentation > 0 && level > 0) {
		char *whitespaces = [self allocMemoryWithSize:
		    (level * indentation) + 1];
		memset(whitespaces, ' ', level * indentation);
		whitespaces[level * indentation] = 0;

		@try {
			ret = [OFString stringWithFormat:
			    @"%s<?%@?>",
			    whitespaces,
			    processingInstructions];
			    @"%s<?%@?>", whitespaces, _processingInstructions];
		} @finally {
			[self freeMemory: whitespaces];
		}
	} else
		ret = [OFString stringWithFormat: @"<?%@?>",
						  processingInstructions];
						  _processingInstructions];

	return ret;
}

- (OFString*)description
{
	return [OFString stringWithFormat: @"<?%@?>", processingInstructions];
	return [OFString stringWithFormat: @"<?%@?>", _processingInstructions];
}

- (OFXMLElement*)XMLElementBySerializing
{
	return [OFXMLElement elementWithName: [self className]
				   namespace: OF_SERIALIZATION_NS
				 stringValue: processingInstructions];
				 stringValue: _processingInstructions];
}
@end