Skip to content

Commit

Permalink
Separated KSCrashReportFilter protocol from the rest of the filters.
Browse files Browse the repository at this point in the history
  • Loading branch information
kstenerud committed Dec 1, 2016
1 parent 81ccec2 commit 343e6c6
Show file tree
Hide file tree
Showing 14 changed files with 689 additions and 738 deletions.
6 changes: 0 additions & 6 deletions Mac/KSCrash-Mac.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
CB6240E317EBCA74006471F1 /* KSSysCtl.h in Headers */ = {isa = PBXBuildFile; fileRef = CB8E567817EB9B43000C56D3 /* KSSysCtl.h */; settings = {ATTRIBUTES = (Private, ); }; };
CB6240E417EBCA74006471F1 /* KSZombie.h in Headers */ = {isa = PBXBuildFile; fileRef = CB8E567917EB9B43000C56D3 /* KSZombie.h */; settings = {ATTRIBUTES = (Private, ); }; };
CB6240E817EBCA74006471F1 /* KSCrashReportFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = CB8E56A117EB9B7E000C56D3 /* KSCrashReportFilter.h */; settings = {ATTRIBUTES = (Public, ); }; };
CB6240E917EBCA74006471F1 /* KSCrashReportFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = CB8E56A217EB9B7E000C56D3 /* KSCrashReportFilter.m */; };
CB6240EA17EBCA74006471F1 /* KSCrashReportFilterAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = CB8E56A317EB9B7E000C56D3 /* KSCrashReportFilterAlert.h */; settings = {ATTRIBUTES = (Public, ); }; };
CB6240EB17EBCA74006471F1 /* KSCrashReportFilterAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = CB8E56A417EB9B7E000C56D3 /* KSCrashReportFilterAlert.m */; };
CB6240EC17EBCA74006471F1 /* KSCrashReportFilterAppleFmt.h in Headers */ = {isa = PBXBuildFile; fileRef = CB8E56A517EB9B7E000C56D3 /* KSCrashReportFilterAppleFmt.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -272,7 +271,6 @@
CB8E569A17EB9B43000C56D3 /* KSSysCtl.h in Headers */ = {isa = PBXBuildFile; fileRef = CB8E567817EB9B43000C56D3 /* KSSysCtl.h */; settings = {ATTRIBUTES = (Private, ); }; };
CB8E569B17EB9B43000C56D3 /* KSZombie.h in Headers */ = {isa = PBXBuildFile; fileRef = CB8E567917EB9B43000C56D3 /* KSZombie.h */; settings = {ATTRIBUTES = (Private, ); }; };
CB8E56B917EB9B7E000C56D3 /* KSCrashReportFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = CB8E56A117EB9B7E000C56D3 /* KSCrashReportFilter.h */; settings = {ATTRIBUTES = (Public, ); }; };
CB8E56BA17EB9B7E000C56D3 /* KSCrashReportFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = CB8E56A217EB9B7E000C56D3 /* KSCrashReportFilter.m */; };
CB8E56BB17EB9B7E000C56D3 /* KSCrashReportFilterAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = CB8E56A317EB9B7E000C56D3 /* KSCrashReportFilterAlert.h */; settings = {ATTRIBUTES = (Public, ); }; };
CB8E56BC17EB9B7E000C56D3 /* KSCrashReportFilterAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = CB8E56A417EB9B7E000C56D3 /* KSCrashReportFilterAlert.m */; };
CB8E56BD17EB9B7E000C56D3 /* KSCrashReportFilterAppleFmt.h in Headers */ = {isa = PBXBuildFile; fileRef = CB8E56A517EB9B7E000C56D3 /* KSCrashReportFilterAppleFmt.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -518,7 +516,6 @@
CB8E567817EB9B43000C56D3 /* KSSysCtl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KSSysCtl.h; path = ../../Source/KSCrash/Recording/Tools/KSSysCtl.h; sourceTree = "<group>"; };
CB8E567917EB9B43000C56D3 /* KSZombie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KSZombie.h; path = ../../Source/KSCrash/Recording/Tools/KSZombie.h; sourceTree = "<group>"; };
CB8E56A117EB9B7E000C56D3 /* KSCrashReportFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KSCrashReportFilter.h; path = ../../Source/KSCrash/Reporting/Filters/KSCrashReportFilter.h; sourceTree = "<group>"; };
CB8E56A217EB9B7E000C56D3 /* KSCrashReportFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KSCrashReportFilter.m; path = ../../Source/KSCrash/Reporting/Filters/KSCrashReportFilter.m; sourceTree = "<group>"; };
CB8E56A317EB9B7E000C56D3 /* KSCrashReportFilterAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KSCrashReportFilterAlert.h; path = ../../Source/KSCrash/Reporting/Filters/KSCrashReportFilterAlert.h; sourceTree = "<group>"; };
CB8E56A417EB9B7E000C56D3 /* KSCrashReportFilterAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KSCrashReportFilterAlert.m; path = ../../Source/KSCrash/Reporting/Filters/KSCrashReportFilterAlert.m; sourceTree = "<group>"; };
CB8E56A517EB9B7E000C56D3 /* KSCrashReportFilterAppleFmt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KSCrashReportFilterAppleFmt.h; path = ../../Source/KSCrash/Reporting/Filters/KSCrashReportFilterAppleFmt.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -982,7 +979,6 @@
isa = PBXGroup;
children = (
CB8E56A117EB9B7E000C56D3 /* KSCrashReportFilter.h */,
CB8E56A217EB9B7E000C56D3 /* KSCrashReportFilter.m */,
CB8E56A317EB9B7E000C56D3 /* KSCrashReportFilterAlert.h */,
CB8E56A417EB9B7E000C56D3 /* KSCrashReportFilterAlert.m */,
CB8E56A517EB9B7E000C56D3 /* KSCrashReportFilterAppleFmt.h */,
Expand Down Expand Up @@ -1414,7 +1410,6 @@
CB62411317EBCA74006471F1 /* NSData+GZip.m in Sources */,
CB6240AC17EBCA74006471F1 /* KSCrashReport.c in Sources */,
CB6240C417EBCA74006471F1 /* KSCrashSentry_User.c in Sources */,
CB6240E917EBCA74006471F1 /* KSCrashReportFilter.m in Sources */,
CB6240D617EBCA74006471F1 /* KSMach_x86_32.c in Sources */,
CB7A6C9917FB9A1000997792 /* KSDynamicLinker.c in Sources */,
CB62410B17EBCA74006471F1 /* KSHTTPMultipartPostBody.m in Sources */,
Expand Down Expand Up @@ -1496,7 +1491,6 @@
CB8E563617EB9AFD000C56D3 /* KSCrashType.c in Sources */,
CB8E568C17EB9B43000C56D3 /* KSMach_Arm.c in Sources */,
CB8E56FA17EB9B89000C56D3 /* NSError+SimpleConstructor.m in Sources */,
CB8E56BA17EB9B7E000C56D3 /* KSCrashReportFilter.m in Sources */,
CB8F1DD41CCAF3B40022CDF0 /* KSCrashInstallation+Alert.m in Sources */,
CB69B8DE1DC0F106002713B1 /* KSLogger.c in Sources */,
CB8E56E817EB9B89000C56D3 /* Container+DeepSearch.m in Sources */,
Expand Down
1 change: 1 addition & 0 deletions Source/KSCrash/Installations/KSCrashInstallation.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#import "KSCrashInstallation.h"
#import "KSCrashInstallation+Private.h"
#import "KSCrashReportFilterBasic.h"
#import "KSCrashAdvanced.h"
#import "KSCString.h"
#import "KSJSONCodecObjC.h"
Expand Down
1 change: 1 addition & 0 deletions Source/KSCrash/Installations/KSCrashInstallationConsole.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#import "KSCrashInstallation+Private.h"
#import "KSCrashReportSinkConsole.h"
#import "KSCrashReportFilterAppleFmt.h"
#import "KSCrashReportFilterBasic.h"
#import "KSCrashReportFilterJSON.h"
#import "KSCrashReportFilterStringify.h"

Expand Down
1 change: 1 addition & 0 deletions Source/KSCrash/Installations/KSCrashInstallationStandard.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#import "KSCrashInstallationStandard.h"
#import "KSCrashInstallation+Private.h"
#import "KSCrashReportSinkStandard.h"
#import "KSCrashReportFilterBasic.h"


@implementation KSCrashInstallationStandard
Expand Down
1 change: 1 addition & 0 deletions Source/KSCrash/Installations/KSCrashInstallationVictory.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#import "KSCrashInstallationVictory.h"
#import "KSCrashInstallation+Private.h"
#import "KSCrashReportFilterBasic.h"
#import "KSCrashReportSinkVictory.h"


Expand Down
149 changes: 0 additions & 149 deletions Source/KSCrash/Reporting/Filters/KSCrashReportFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,152 +43,3 @@
onCompletion:(KSCrashReportFilterCompletion) onCompletion;

@end


/**
* Very basic filter that passes through reports untouched.
*
* Input: Anything.
* Output: Same as input (passthrough).
*/
@interface KSCrashReportFilterPassthrough : NSObject <KSCrashReportFilter>

+ (KSCrashReportFilterPassthrough*) filter;

@end


/**
* Passes reports to a series of subfilters, then stores the results of those operations
* as keyed values in final master reports.
*
* Input: Anything
* Output: NSDictionary
*/
@interface KSCrashReportFilterCombine : NSObject <KSCrashReportFilter>

/** Constructor.
*
* @param firstFilter The first filter, followed by key, filter, key, ...
* Each "filter" can be id<KSCrashReportFilter> or an NSArray
* of filters (which gets wrapped in a pipeline filter).
*/
+ (KSCrashReportFilterCombine*) filterWithFiltersAndKeys:(id) firstFilter, ... NS_REQUIRES_NIL_TERMINATION;

/** Initializer.
*
* @param firstFilter The first filter, followed by key, filter, key, ...
* Each "filter" can be id<KSCrashReportFilter> or an NSArray
* of filters (which gets wrapped in a pipeline filter).
*/
- (id) initWithFiltersAndKeys:(id)firstFilter, ... NS_REQUIRES_NIL_TERMINATION;

@end


/**
* A pipeline of filters. Reports get passed through each subfilter in order.
*
* Input: Depends on what's in the pipeline.
* Output: Depends on what's in the pipeline.
*/
@interface KSCrashReportFilterPipeline : NSObject <KSCrashReportFilter>

/** The filters in this pipeline. */
@property(nonatomic,readonly,retain) NSArray* filters;

/** Constructor.
*
* @param firstFilter The first filter, followed by filter, filter, ...
*/
+ (KSCrashReportFilterPipeline*) filterWithFilters:(id) firstFilter, ... NS_REQUIRES_NIL_TERMINATION;

/** Initializer.
*
* @param firstFilter The first filter, followed by filter, filter, ...
*/
- (id) initWithFilters:(id) firstFilter, ... NS_REQUIRES_NIL_TERMINATION;

- (void) addFilter:(id<KSCrashReportFilter>) filter;

@end


/**
* Extracts data associated with a key from each report.
*/
@interface KSCrashReportFilterObjectForKey : NSObject <KSCrashReportFilter>

/** Constructor.
*
* @param key The key to search for in each report. If the key is a string,
* it will be interpreted as a key path.
* @param allowNotFound If NO, filtering will stop with an error if the key
* was not found in a report.
*/
+ (KSCrashReportFilterObjectForKey*) filterWithKey:(id) key
allowNotFound:(BOOL) allowNotFound;

/** Initializer.
*
* @param key The key to search for in each report. If the key is a string,
* it will be interpreted as a key path.
* @param allowNotFound If NO, filtering will stop with an error if the key
* was not found in a report.
*/
- (id) initWithKey:(id) key
allowNotFound:(BOOL) allowNotFound;

@end


/**
* Takes values by key from the report and concatenates their string representations.
*
* Input: NSDictionary
* Output: NSString
*/
@interface KSCrashReportFilterConcatenate : NSObject <KSCrashReportFilter>

/** Constructor.
*
* @param separatorFmt Formatting text to use when separating the values. You may include
* %@ in the formatting text to include the key name as well.
* @param firstKey Series of keys to extract from the source report.
*/
+ (KSCrashReportFilterConcatenate*) filterWithSeparatorFmt:(NSString*) separatorFmt
keys:(id) firstKey, ... NS_REQUIRES_NIL_TERMINATION;

/** Constructor.
*
* @param separatorFmt Formatting text to use when separating the values. You may include
* %@ in the formatting text to include the key name as well.
* @param firstKey Series of keys to extract from the source report.
*/
- (id) initWithSeparatorFmt:(NSString*) separatorFmt
keys:(id) firstKey, ... NS_REQUIRES_NIL_TERMINATION;

@end


/**
* Fetches subsets of data from the source reports. All other data is discarded.
*
* Input: NSDictionary
* Output: NSDictionary
*/
@interface KSCrashReportFilterSubset : NSObject <KSCrashReportFilter>

/** Constructor.
*
* @param firstKeyPath Series of key paths to search in the source reports.
*/
+ (KSCrashReportFilterSubset*) filterWithKeys:(id) firstKeyPath, ... NS_REQUIRES_NIL_TERMINATION;

/** Initializer.
*
* @param firstKeyPath Series of key paths to search in the source reports.
*/
- (id) initWithKeys:(id) firstKeyPath, ... NS_REQUIRES_NIL_TERMINATION;

@end
Loading

0 comments on commit 343e6c6

Please sign in to comment.