From fb4035f4403005ad400e98a0f1f6f527a26a1658 Mon Sep 17 00:00:00 2001 From: dmaclach Date: Sun, 11 Nov 2018 10:46:22 -0800 Subject: Deprecate GTMRegex. Use NSRegularExpression instead. (#184) --- Foundation/GTMRegex.h | 3 +++ Foundation/GTMRegex.m | 6 ++++++ Foundation/GTMRegexTest.m | 6 ++++++ 3 files changed, 15 insertions(+) (limited to 'Foundation') diff --git a/Foundation/GTMRegex.h b/Foundation/GTMRegex.h index 03f7ae5..1108041 100644 --- a/Foundation/GTMRegex.h +++ b/Foundation/GTMRegex.h @@ -117,6 +117,9 @@ _EXTERN NSString* kGTMRegexPatternErrorErrorString _INITIALIZE_AS(@"patternError // withReplacement:@"\\1\\2"]; // .... // + +// Use NSRegularExpression instead +NS_DEPRECATED(10_0, 10_7, 1_0, 4_0) @interface GTMRegex : NSObject { @private NSString *pattern_; diff --git a/Foundation/GTMRegex.m b/Foundation/GTMRegex.m index 957b9ce..5649156 100644 --- a/Foundation/GTMRegex.m +++ b/Foundation/GTMRegex.m @@ -20,6 +20,10 @@ #import "GTMRegex.h" #import "GTMDefines.h" +#pragma clang diagnostic push +// Ignore all of the deprecation warnings for GTMRegex +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // This is the pattern to use for walking replacement text when doing // substitutions. // @@ -796,3 +800,5 @@ static NSString *const kReplacementPattern = } @end + +#pragma clang diagnostic push diff --git a/Foundation/GTMRegexTest.m b/Foundation/GTMRegexTest.m index 65aadd5..75f5aad 100644 --- a/Foundation/GTMRegexTest.m +++ b/Foundation/GTMRegexTest.m @@ -26,6 +26,10 @@ // libregex, we just want to test our wrapper. // +#pragma clang diagnostic push +// Ignore all of the deprecation warnings for GTMRegex +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + @interface GTMRegexTest : GTMTestCase @end @@ -1218,3 +1222,5 @@ } @end + +#pragma clang diagnostic pop -- cgit v1.2.3