ObjFW
OFXMLElementBuilder.h
1 /*
2  * Copyright (c) 2008-2021 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 
19 OF_ASSUME_NONNULL_BEGIN
20 
21 @class OFMutableArray OF_GENERIC(ObjectType);
22 @class OFXMLElement;
23 @class OFXMLElementBuilder;
24 
43 - (void)elementBuilder: (OFXMLElementBuilder *)builder
44  didBuildElement: (OFXMLElement *)element;
45 
46 @optional
57 - (void)elementBuilder: (OFXMLElementBuilder *)builder
58  didBuildParentlessNode: (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 
106 {
107  OFMutableArray OF_GENERIC(OFXMLElement *) *_stack;
108  id <OFXMLElementBuilderDelegate> _Nullable _delegate;
109  OF_RESERVE_IVARS(OFXMLElementBuilder, 4)
110 }
111 
115 @property OF_NULLABLE_PROPERTY (assign, nonatomic)
117 
123 + (instancetype)elementBuilder;
124 @end
125 
126 OF_ASSUME_NONNULL_END
struct objc_object * id
A pointer to any object.
Definition: ObjFWRT.h:90
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:520
A class for handling strings.
Definition: OFString.h:132
A class implementing the OFXMLParserDelegate protocol that can build OFXMLElements from the document ...
Definition: OFXMLElementBuilder.h:107
A class which stores an XML element.
Definition: OFXMLElement.h:34
A class which stores an XML element.
Definition: OFXMLNode.h:30
A protocol that needs to be implemented by delegates for OFXMLElementBuilder.
Definition: OFXMLElementBuilder.h:32
A protocol that needs to be implemented by delegates for OFXMLParser.
Definition: OFXMLParser.h:34