Reintroduce the HTMLNodeFilterValue for Tree Walker implementation
While the Node Iterator treats skip & reject the same way, the Tree Walker can skip over a node
and all its children if rejected.
This reverses dc3de7a470
This commit is contained in:
@@ -8,6 +8,13 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
typedef NS_ENUM(unsigned short, HTMLNodeFilterValue)
|
||||
{
|
||||
HTMLNodeFilterAccept = 1,
|
||||
HTMLNodeFilterReject = 2,
|
||||
HTMLNodeFilterSkip = 3
|
||||
};
|
||||
|
||||
typedef NS_ENUM(unsigned long, HTMLNodeFilterShowOptions)
|
||||
{
|
||||
HTMLNodeFilterShowAll = 0xFFFFFFFF,
|
||||
@@ -23,12 +30,12 @@ typedef NS_ENUM(unsigned long, HTMLNodeFilterShowOptions)
|
||||
|
||||
@protocol HTMLNodeFilter <NSObject>
|
||||
|
||||
- (BOOL)acceptNode:(HTMLNode *)node;
|
||||
- (HTMLNodeFilterValue)acceptNode:(HTMLNode *)node;
|
||||
|
||||
@end
|
||||
|
||||
@interface HTMLNodeFilterBlock : NSObject <HTMLNodeFilter>
|
||||
|
||||
+ (instancetype)filterWithBlock:(BOOL (^)(HTMLNode *node))block;
|
||||
+ (instancetype)filterWithBlock:(HTMLNodeFilterValue (^)(HTMLNode *node))block;
|
||||
|
||||
@end
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user