ifish/Ifish/AlibcTradeSDK-3.1.1.96/Frameworks/AlibcTradeCommon.framework/Headers/NSString+AlibcURL.h

67 lines
1.7 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* NSString+AlibcURL.h
*
* 阿里百川电商
* 项目名称:阿里巴巴电商 AlibcTradeCommon
* 版本号3.1.1.93
* 发布时间2017-03-06
* 开发团队:阿里巴巴百川商业化团队
* 阿里巴巴电商SDK答疑群号1229144682(阿里旺旺)
* Copyright (c) 2016-2019 阿里巴巴-移动事业群-百川. All rights reserved.
*/
#ifndef NSString_AlibcURL_h
#define NSString_AlibcURL_h
#import <Foundation/Foundation.h>
@interface NSString (AlibcURL)
/*!
Parses a URL query string into a dictionary with auto encoding(UTF8 & GBK).
@returns query dictionary
*/
- (NSDictionary *)aliQueryDictionaryByAutoDecoding;
/*!
Parses a URL query string into a dictionary without encoding.
@returns query dictionary
*/
- (NSDictionary *)aliQueryDictionary;
- (NSString *)aliStringByAddingURLEncodedQueryDictionary:(NSDictionary *)query;
// 对于 URL 中已有的 key, 保持URL中原有的 key, 不覆盖
- (NSString *)aliStringByAddingQueryDictionary:(NSDictionary *)query;
- (id)aliUrlEncoded;
- (NSString *)aliURLDecoding;
- (NSString *)aliTrim;
/**
* 将 k1=v1&k2=v2 形式的字符串 转换成 @{@"k1": @"v1", @"k2": @"v2"}
* 注意: k1=&k2=%k3=v3 会生成 @{@"k1": @"", @"k2": @"", @"k3": @"v3"}
*
* @return query params dictionary
*/
- (NSMutableDictionary *)aliURLQueryStringToDictionary;
/**
* 根据 Dictionary 中的内容, 生成 k1=v1&k2=v2 形式的字符串
* 注意: 允许 k1=&k2=%k3=v3 这种有 key 无 value 的情况
*
* @param dictionary 如 @{@"k1": @"v1", @"k2": @"v2"}
*
* @return 转换生成的 dictionary 对象
*/
+ (instancetype)aliURLQueryStringWithDictionary:(NSDictionary *)dictionary;
@end
#endif /* NSString_AlibcURL_h */