ObjFW  Diff

Differences From Artifact [3e8ea2da55]:

To Artifact [5d2497256d]:


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

26
27
28
29
30
31
32
33
34
35
36
37
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFXMLAttribute.h"

@class OFString;
@class OFArray;
@class OFMutableString;
@class OFMutableArray;
@class OFMutableDictionary;


/**
 * \brief A class which stores an XML element.
 */
@interface OFXMLElement: OFObject <OFCopying, OFSerialization>
{
	OFString *name;
	OFString *ns;
	OFString *defaultNamespace;
	OFMutableArray *attributes;
	OFMutableDictionary *namespaces;
	OFMutableArray *children;







<
<
|






>




|







10
11
12
13
14
15
16


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */



#import "OFXMLNode.h"

@class OFString;
@class OFArray;
@class OFMutableString;
@class OFMutableArray;
@class OFMutableDictionary;
@class OFXMLAttribute;

/**
 * \brief A class which stores an XML element.
 */
@interface OFXMLElement: OFXMLNode
{
	OFString *name;
	OFString *ns;
	OFString *defaultNamespace;
	OFMutableArray *attributes;
	OFMutableDictionary *namespaces;
	OFMutableArray *children;
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
 * \brief Removes all children and sets the string value to the specified
 *	  string.
 *
 * \param stringValue The new string value for the element
 */
- (void)setStringValue: (OFString*)stringValue;

/**
 * \brief Returns a string with the string value of all children concatenated.
 *
 * \return A string with the string value of all children concatenated
 */
- (OFString*)stringValue;

/**
 * \brief Returns an integer with the decimal value of all children
 *	  concatenated.
 *
 * \return An integer with the decimal value of all children concatenated
 */
- (intmax_t)decimalValue;

/**
 * \brief Returns an integer with the hexadecimal value of all children
 *	  concatenated.
 *
 * \return An integer with the hexadecimal value of all children concatenated
 */
- (uintmax_t)hexadecimalValue;

/**
 * \brief Returns a float with the float value of all children concatenated.
 *
 * \return A float with the float value of all children concatenated
 */
- (float)floatValue;

/**
 * \brief Returns a double with the double value of all children concatenated.
 *
 * \return A double with the double value of all children concatenated
 */
- (double)doubleValue;

/**
 * \brief Returns an OFString representing the OFXMLElement as an XML string.
 *
 * \return An OFString representing the OFXMLElement as an XML string
 */
- (OFString*)XMLString;

/**
 * \brief Returns an OFString representing the OFXMLElement as an XML string
 *	  with indentation.
 *
 * \param indentation The indentation for the XML string
 * \return An OFString representing the OFXMLElement as an XML string with
 *	   indentation
 */
- (OFString*)XMLStringWithIndentation: (unsigned int)indentation;

/**
 * \brief Adds the specified attribute.
 *
 * If an attribute with the same name and namespace already exists, it is not
 * added.
 *
 * \param attribute The attribute to add







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







296
297
298
299
300
301
302






















































303
304
305
306
307
308
309
 * \brief Removes all children and sets the string value to the specified
 *	  string.
 *
 * \param stringValue The new string value for the element
 */
- (void)setStringValue: (OFString*)stringValue;























































/**
 * \brief Adds the specified attribute.
 *
 * If an attribute with the same name and namespace already exists, it is not
 * added.
 *
 * \param attribute The attribute to add