ObjFW  Diff

Differences From Artifact [817f97f00f]:

To Artifact [a8bd3c93ce]:


19
20
21
22
23
24
25

26
27
28
29
30
31
32
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33







+








OF_ASSUME_NONNULL_BEGIN

@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
@class OFMutableString;
@class OFStream;
@class OFString;
@class OFXMLAttribute;

/**
 * @class OFXMLElement OFXMLElement.h ObjFW/OFXMLElement.h
 *
 * @brief A class which stores an XML element.
136
137
138
139
140
141
142
143
144
145

146
147

148
149

150
151

152
153
154
155
156
157
158
159
137
138
139
140
141
142
143

144

145
146

147
148

149
150

151

152
153
154
155
156
157
158







-

-
+

-
+

-
+

-
+
-







 * @brief Parses the string and returns an OFXMLElement for it.
 *
 * @param string The string to parse
 * @return A new autoreleased OFXMLElement with the contents of the string
 */
+ (instancetype)elementWithXMLString: (OFString *)string;

#ifdef OF_HAVE_FILES
/**
 * @brief Parses the specified file and returns an OFXMLElement for it.
 * @brief Parses the specified stream and returns an OFXMLElement for it.
 *
 * @param path The path to the file
 * @param stream The stream to parse
 * @return A new autoreleased OFXMLElement with the contents of the specified
 *	   file
 *	   stream
 */
+ (instancetype)elementWithFile: (OFString *)path;
+ (instancetype)elementWithStream: (OFStream *)stream;
#endif

- (instancetype)init OF_UNAVAILABLE;

/**
 * @brief Initializes an already allocated OFXMLElement with the specified name.
 *
 * @param name The name for the element
214
215
216
217
218
219
220
221
222
223

224
225
226
227


228
229

230
231
232
233
234
235
236
237
213
214
215
216
217
218
219

220

221
222
223


224
225
226

227

228
229
230
231
232
233
234







-

-
+


-
-
+
+

-
+
-







 *	  with it.
 *
 * @param string The string to parse
 * @return An initialized OFXMLElement with the contents of the string
 */
- (instancetype)initWithXMLString: (OFString *)string;

#ifdef OF_HAVE_FILES
/**
 * @brief Parses the specified file and initializes an already allocated
 * @brief Parses the specified stream and initializes an already allocated
 *	  OFXMLElement with it.
 *
 * @param path The path to the file
 * @return An initialized OFXMLElement with the contents of the specified file
 * @param stream The stream to parse
 * @return An initialized OFXMLElement with the contents of the specified stream
 */
- (instancetype)initWithFile: (OFString *)path;
- (instancetype)initWithStream: (OFStream *)stream;
#endif

- (instancetype)initWithSerialization: (OFXMLElement *)element;

/**
 * @brief Sets a prefix for a namespace.
 *
 * @param prefix The prefix for the namespace