bonus-material-app/nativeplugins/Mpaas-Scan/ios/mPaas.framework/Headers/MPJSONKit.h

88 lines
1.7 KiB
C
Raw Normal View History

2024-12-20 09:23:59 +08:00
//
// MPJSONKit.h
// MPJSONKit
//
// Created by shenmo on 12/28/14.
// Copyright (c) 2014 shenmo. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "DTNumber.h"
#pragma mark APJSONExtensions.h
@interface NSObject (APJSONKitExtensions)
/**
* NSObject序列化成字符串
*
* @return .APJSONString
*/
- (NSString *)JSONString_mp;
- (NSString *)APJSONString;
@end
@interface NSString (APJSONKitExtensions)
/**
* NSObject对象
*
* @return NSObject对象APJSONValue
*/
- (id)JSONValue;
- (id)APJSONValue;
@end
@interface NSData (APJSONKitExtensions)
/**
* Data反序列化成NSObject对象
* Data应该应该是utf8编码的json字符串
*
* @return NSObject对象APJSONValue
*/
- (id)JSONValue;
- (id)APJSONValue;
@end
#pragma mark DTJsonDecoder.h
extern NSString * const NSClassCastExpcetion;
@interface DTJsonDecoder : NSObject
+ (DTJsonDecoder *)decoder;
- (id)decodeWithClass:(Class)cls elementClass:(Class)elementClass fromJSONString:(NSString *)string;
- (id)decodeWithClass:(Class)cls elementClass:(Class)elementClass fromJSONObject:(id)json;
- (id)decodeWithClassName:(NSString *)className elementClass:(Class)elementClass fromJSONObject:(id)json;
@end
#pragma mark DTJsonEncoder.h
@interface DTJsonEncoder : NSObject
/**
* Creates and return a new <code>DTJsonEncoder</code> object.
*
* @return A newly created and initialized object of <code>DTJsonEncoder</code.
*/
+ (DTJsonEncoder *)encoder;
/**
* Encodes a JSON object into a string with JSON format.
*
*
*/
- (NSString *)encodeObject:(id)object;
@end