2007-01-31 18:12:33 +01:00
|
|
|
/* NSString+Utilities.h - this file is part of SOGo
|
2006-07-11 19:29:09 +02:00
|
|
|
*
|
2019-03-21 16:01:17 +01:00
|
|
|
* Copyright (C) 2006-2019 Inverse inc.
|
2006-07-11 19:29:09 +02:00
|
|
|
*
|
|
|
|
* This file is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This file is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; see the file COPYING. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NSSTRING_URL_H
|
|
|
|
#define NSSTRING_URL_H
|
|
|
|
|
|
|
|
#import <Foundation/NSString.h>
|
|
|
|
|
2014-02-04 21:03:02 +01:00
|
|
|
@class NSCharacterSet;
|
2006-07-11 19:29:09 +02:00
|
|
|
@class NSDictionary;
|
2010-10-26 20:20:46 +02:00
|
|
|
@class NSObject;
|
2006-07-11 19:29:09 +02:00
|
|
|
|
|
|
|
@interface NSString (SOGoURLExtension)
|
|
|
|
|
2012-08-13 17:26:06 +02:00
|
|
|
/* URL handling */
|
2006-07-11 19:29:09 +02:00
|
|
|
- (NSString *) composeURLWithAction: (NSString *) action
|
|
|
|
parameters: (NSDictionary *) urlParameters
|
|
|
|
andHash: (BOOL) useHash;
|
2006-07-29 00:43:28 +02:00
|
|
|
- (NSString *) hostlessURL;
|
|
|
|
|
2006-10-03 18:09:43 +02:00
|
|
|
- (NSString *) urlWithoutParameters;
|
|
|
|
|
2007-05-15 22:52:01 +02:00
|
|
|
- (NSString *) stringByDetectingURLs;
|
|
|
|
|
2012-08-13 17:26:06 +02:00
|
|
|
/* escaping */
|
2009-01-07 17:45:15 +01:00
|
|
|
- (NSString *) doubleQuotedString;
|
|
|
|
|
2012-08-13 17:26:06 +02:00
|
|
|
/* CSS and URL safety */
|
2009-01-16 16:33:07 +01:00
|
|
|
- (NSString *) asCSSIdentifier;
|
2010-01-05 23:34:35 +01:00
|
|
|
- (NSString *) fromCSSIdentifier;
|
2009-01-16 16:33:07 +01:00
|
|
|
|
2015-06-11 17:44:17 +02:00
|
|
|
/* JavaScript safety */
|
|
|
|
- (NSString *) asSafeJSString;
|
|
|
|
|
2012-08-13 17:26:06 +02:00
|
|
|
/* SQL safety */
|
|
|
|
- (NSString *) asSafeSQLString;
|
|
|
|
|
2014-09-24 20:14:25 +02:00
|
|
|
/* Unicode safety */
|
|
|
|
- (NSString *) safeString;
|
2016-04-06 17:19:18 +02:00
|
|
|
- (NSString *) safeStringByEscapingXMLString;
|
2016-04-14 21:21:49 +02:00
|
|
|
- (NSString *) safeStringByEscapingXMLString: (BOOL) encodeCR;
|
2014-09-24 20:14:25 +02:00
|
|
|
|
2012-08-13 17:26:06 +02:00
|
|
|
/* JSON */
|
|
|
|
- (NSString *) jsonRepresentation;
|
|
|
|
- (BOOL) isJSONString;
|
|
|
|
- (id) objectFromJSONString;
|
|
|
|
|
2007-08-09 22:59:30 +02:00
|
|
|
/* bare email addresses */
|
|
|
|
- (NSString *) pureEMailAddress;
|
|
|
|
|
2007-08-24 00:10:50 +02:00
|
|
|
- (NSString *) asQPSubjectString: (NSString *) encoding;
|
|
|
|
|
2012-08-13 17:26:06 +02:00
|
|
|
/* LDAP */
|
2008-08-21 21:17:38 +02:00
|
|
|
- (BOOL) caseInsensitiveMatches: (NSString *) match;
|
|
|
|
|
2018-01-12 20:47:31 +01:00
|
|
|
/* OpenSSL multiline DN */
|
|
|
|
- (NSArray *) componentsFromMultilineDN;
|
|
|
|
|
2007-04-11 21:38:06 +02:00
|
|
|
#ifndef GNUSTEP_BASE_LIBRARY
|
2007-04-11 21:33:25 +02:00
|
|
|
- (BOOL) boolValue;
|
|
|
|
#endif
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (int) timeValue;
|
|
|
|
|
2012-08-13 17:26:22 +02:00
|
|
|
/* substrings */
|
2011-07-19 22:01:13 +02:00
|
|
|
- (NSUInteger) countOccurrencesOfString: (NSString *) substring;
|
2012-08-13 17:29:44 +02:00
|
|
|
- (NSString *) stringByReplacingPrefix: (NSString *) oldPrefix
|
|
|
|
withPrefix: (NSString *) newPrefix;
|
2012-04-16 17:24:16 +02:00
|
|
|
|
|
|
|
/* Those methods provide symmetric enc-/decryption via a XOR operation */
|
|
|
|
- (NSString *) encryptWithKey: (NSString *) theKey;
|
|
|
|
- (NSString *) decryptWithKey: (NSString *) theKey;
|
|
|
|
|
2006-07-11 19:29:09 +02:00
|
|
|
@end
|
|
|
|
|
|
|
|
#endif /* NSSTRING_URL_H */
|