ObjFW
Loading...
Searching...
No Matches
OFXMLAttribute.h
1/*
2 * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3 *
4 * All rights reserved.
5 *
6 * This file is part of ObjFW. It may be distributed under the terms of the
7 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
8 * the packaging of this file.
9 *
10 * Alternatively, it may be distributed under the terms of the GNU General
11 * Public License, either version 2 or 3, which can be found in the file
12 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
13 * file.
14 */
15
16#import "OFXMLNode.h"
17
18OF_ASSUME_NONNULL_BEGIN
19
20@class OFString;
21
27OF_SUBCLASSING_RESTRICTED
29{
30#if defined(OF_XML_ELEMENT_M) || defined(OF_XML_PARSER_M)
31@public
32#endif
33 OFString *_name, *_Nullable _namespace, *_stringValue;
34 bool _useDoubleQuotes;
35}
36
40@property (readonly, nonatomic) OFString *name;
41
45#ifndef __cplusplus
46@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *namespace;
47#else
48@property OF_NULLABLE_PROPERTY (readonly, nonatomic, getter=namespace)
49 OFString *nameSpace;
50#endif
51
59+ (instancetype)attributeWithName: (OFString *)name
60 stringValue: (OFString *)stringValue;
61
70+ (instancetype)attributeWithName: (OFString *)name
71 namespace: (nullable OFString *)nameSpace
72 stringValue: (OFString *)stringValue;
73
81- (instancetype)initWithName: (OFString *)name
82 stringValue: (OFString *)stringValue;
83
92- (instancetype)initWithName: (OFString *)name
93 namespace: (nullable OFString *)nameSpace
94 stringValue: (OFString *)stringValue OF_DESIGNATED_INITIALIZER;
95@end
96
97OF_ASSUME_NONNULL_END
A class for handling strings.
Definition OFString.h:135
A representation of an attribute of an XML element as an object.
Definition OFXMLAttribute.h:29
A class which stores an XML element.
Definition OFXMLNode.h:27