session-ios/Signal/src/util/StringUtil.h
Frederic Jacobs c6d44e59e2 TextSecureKit Refactoring
- Using same clang format file for old and new files.
- Moving out all TextSecure code to allow other clients (OS X, iOS) to
  integrate easily TextSecure functionality.
- Use TextSecure API to signup.
2015-12-22 23:41:10 +01:00

26 lines
985 B
Objective-C

#import <Foundation/Foundation.h>
@interface NSString (Util)
/// The utf-8 encoding of the string's text.
- (NSData *)encodedAsUtf8;
/// The ascii encoding of the string's text.
/// Throws when the string contains non-ascii characters.
- (NSData *)encodedAsAscii;
- (NSRegularExpression *)toRegularExpression;
- (NSString *)withMatchesAgainst:(NSRegularExpression *)regex replacedBy:(NSString *)replacement;
- (bool)containsAnyMatches:(NSRegularExpression *)regex;
- (NSString *)withPrefixRemovedElseNull:(NSString *)prefix;
- (NSData *)decodedAsJsonIntoData;
- (NSDictionary *)decodedAsJsonIntoDictionary;
- (NSData *)decodedAsHexString;
- (NSData *)decodedAsSpaceSeparatedHexString;
- (NSData *)decodedAsBase64Data;
- (NSNumber *)tryParseAsDecimalNumber;
- (NSNumber *)tryParseAsUnsignedInteger;
- (NSString *)removeAllCharactersIn:(NSCharacterSet *)characterSet;
- (NSString *)digitsOnly;
- (NSString *)withCharactersInRange:(NSRange)range replacedBy:(NSString *)substring;
@end