ObjFW
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 
23 OF_ASSUME_NONNULL_BEGIN
24 
25 @class OFMutableArray OF_GENERIC(ObjectType);
26 @class OFXMLElement;
27 @class OFXMLElementBuilder;
28 
47 - (void)elementBuilder: (OFXMLElementBuilder *)builder
48  didBuildElement: (OFXMLElement *)element;
49 
50 @optional
61 - (void)elementBuilder: (OFXMLElementBuilder *)builder
62  didBuildOrphanNode: (OFXMLNode *)node;
63 
82 - (void)elementBuilder: (OFXMLElementBuilder *)builder
83  didNotExpectCloseTag: (OFString *)name
84  prefix: (nullable OFString *)prefix
85  namespace: (nullable OFString *)nameSpace;
86 
95 - (OFString *)elementBuilder: (OFXMLElementBuilder *)builder
96  foundUnknownEntityNamed: (OFString *)entity;
97 @end
98 
109 OF_SUBCLASSING_RESTRICTED
111 {
112  OFMutableArray OF_GENERIC(OFXMLElement *) *_stack;
113  id <OFXMLElementBuilderDelegate> _Nullable _delegate;
114 }
115 
119 @property OF_NULLABLE_PROPERTY (assign, nonatomic)
120  id <OFXMLElementBuilderDelegate> delegate;
121 
127 + (instancetype)builder;
128 @end
129 
130 OF_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:139
A class implementing the OFXMLParserDelegate protocol that can build OFXMLElements from the document ...
Definition: OFXMLElementBuilder.h:112
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 OFXMLElementBuilder.
Definition: OFXMLElementBuilder.h:36
A protocol that needs to be implemented by delegates for OFXMLParser.
Definition: OFXMLParser.h:38