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 program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License version 3.0 only,
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * version 3.0 for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * version 3.0 along with this program. If not, see
17 * <https://www.gnu.org/licenses/>.
18 */
19
20#import "OFObject.h"
21#import "OFXMLParser.h"
22
23OF_ASSUME_NONNULL_BEGIN
24
25@class OFMutableArray OF_GENERIC(ObjectType);
26@class OFXMLElement;
28
35@protocol OFXMLElementBuilderDelegate <OFObject>
46- (void)elementBuilder: (OFXMLElementBuilder *)builder
47 didBuildElement: (OFXMLElement *)element;
48
49@optional
60- (void)elementBuilder: (OFXMLElementBuilder *)builder
61 didBuildOrphanNode: (OFXMLNode *)node;
62
81- (void)elementBuilder: (OFXMLElementBuilder *)builder
82 didNotExpectCloseTag: (OFString *)name
83 prefix: (nullable OFString *)prefix
84 namespace: (nullable OFString *)nameSpace;
85
94- (OFString *)elementBuilder: (OFXMLElementBuilder *)builder
95 foundUnknownEntityNamed: (OFString *)entity;
96@end
97
108OF_SUBCLASSING_RESTRICTED
110{
111 OFMutableArray OF_GENERIC(OFXMLElement *) *_stack;
112 id <OFXMLElementBuilderDelegate> _Nullable _delegate;
113}
114
118@property OF_NULLABLE_PROPERTY (assign, nonatomic)
119 id <OFXMLElementBuilderDelegate> delegate;
126+ (instancetype)builder;
127@end
128
129OF_ASSUME_NONNULL_END
An abstract class for storing, adding and removing objects in an array.
Definition OFMutableArray.h:48
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
A class for handling strings.
Definition OFString.h:143
A class implementing the OFXMLParserDelegate protocol that can build OFXMLElements from the document ...
Definition OFXMLElementBuilder.h:111
A class which stores an XML element.
Definition OFXMLElement.h:38
A class which stores an XML element.
Definition OFXMLNode.h:31
A protocol that needs to be implemented by delegates for OFXMLParser.
Definition OFXMLParser.h:38