ObjFW
OFString+XMLUnescaping.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2023 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 "OFString.h"
17 
18 OF_ASSUME_NONNULL_BEGIN
19 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 extern int _OFString_XMLUnescaping_reference;
26 #ifdef __cplusplus
27 }
28 #endif
29 
30 #ifdef OF_HAVE_BLOCKS
31 
39 typedef OFString *_Nullable (^OFStringXMLUnescapingBlock)(OFString *string,
40  OFString *entity);
41 #endif
42 
62 - (nullable OFString *)string: (OFString *)string
63  containsUnknownEntityNamed: (OFString *)entity;
64 @end
65 
66 @interface OFString (XMLUnescaping)
70 @property (readonly, nonatomic) OFString *stringByXMLUnescaping;
71 
80 - (OFString *)stringByXMLUnescapingWithDelegate:
81  (nullable id <OFStringXMLUnescapingDelegate>)delegate;
82 
83 #ifdef OF_HAVE_BLOCKS
84 
92 - (OFString *)stringByXMLUnescapingWithBlock: (OFStringXMLUnescapingBlock)block;
93 #endif
94 @end
95 
96 OF_ASSUME_NONNULL_END
The root class for all other classes inside ObjFW.
Definition: OFObject.h:686
OFString *(^ OFStringXMLUnescapingBlock)(OFString *string, OFString *entity)
A block which is called to replace unknown XML entities in an XML string.
Definition: OFString+XMLUnescaping.h:39
OFString * stringByXMLUnescaping
The string with XML entities unescapted.
Definition: OFString+XMLUnescaping.h:70
A class for handling strings.
Definition: OFString.h:134
A protocol that needs to be implemented by delegates for stringByXMLUnescapingWithHandler:.