ObjFW
Loading...
Searching...
No Matches
OFXMLElementBuilder.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 "OFObject.h"
17#import "OFXMLParser.h"
18
19OF_ASSUME_NONNULL_BEGIN
20
21@class OFMutableArray OF_GENERIC(ObjectType);
22@class OFXMLElement;
24
32@protocol OFXMLElementBuilderDelegate <OFObject>
43- (void)elementBuilder: (OFXMLElementBuilder *)builder
44 didBuildElement: (OFXMLElement *)element;
45
46@optional
57- (void)elementBuilder: (OFXMLElementBuilder *)builder
58 didBuildOrphanNode: (OFXMLNode *)node;
59
78- (void)elementBuilder: (OFXMLElementBuilder *)builder
79 didNotExpectCloseTag: (OFString *)name
80 prefix: (nullable OFString *)prefix
81 namespace: (nullable OFString *)nameSpace;
82
91- (OFString *)elementBuilder: (OFXMLElementBuilder *)builder
92 foundUnknownEntityNamed: (OFString *)entity;
93@end
94
105OF_SUBCLASSING_RESTRICTED
107{
108 OFMutableArray OF_GENERIC(OFXMLElement *) *_stack;
109 id <OFXMLElementBuilderDelegate> _Nullable _delegate;
110}
111
115@property OF_NULLABLE_PROPERTY (assign, nonatomic)
116 id <OFXMLElementBuilderDelegate> delegate;
123+ (instancetype)builder;
124@end
125
126OF_ASSUME_NONNULL_END
An abstract class for storing, adding and removing objects in an array.
Definition OFMutableArray.h:44
The root class for all other classes inside ObjFW.
Definition OFObject.h:688
A class for handling strings.
Definition OFString.h:135
A class implementing the OFXMLParserDelegate protocol that can build OFXMLElements from the document ...
Definition OFXMLElementBuilder.h:108
A class which stores an XML element.
Definition OFXMLElement.h:34
A class which stores an XML element.
Definition OFXMLNode.h:27
A protocol that needs to be implemented by delegates for OFXMLParser.
Definition OFXMLParser.h:34