//
//  RAUtils.h
//  RedAnt ERP Mobile
//
//  Created by Ray on 9/17/15.
//  Copyright (c) 2015 United Software Applications, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
//typedef  struct {
//    
//    NSString* id;
//    
//    float  height;
//    
//    
//}MyTestStruct;
typedef void (^add_to_cart_Handler)(void);

@interface RAUtils : NSObject
+(NSData*) dict2data:(NSDictionary*) dict;
+(NSString*) FloatFormat:(float)value;
+(UIViewController*) getViewController:(UIView*) view;
+ (CGRect)relativeFrameForScreenWithView:(UIView *)v;
+(NSDictionary*) error_json :(int)code err_msg:(NSString*)msg;
+(void) message_alert :(NSString*) msg title:(NSString*) title controller:(UIViewController*) vc;
+(void) alert_view :(NSString*) msg title:(NSString*) title ;
+(UIAlertView * ) waiting_alert :(NSString*) msg title:(NSString*) title;
+ (float)fileSizeForDir:(NSString*)path;//计算文件夹下文件的总大小；
+(void) deletefiles :(NSString*) path;
+(UIColor*) strColor:(NSString*) color;
+(NSDictionary*) string2dict:(NSString*) str;
+(NSString*) dict2string:(NSDictionary*) dict;
+(NSString*) arr2string:(NSArray *) arr separator:(NSString*)separator trim:(bool) btrim;
+(NSString*) arr2string:(NSArray *) arr separator:(NSString*)separator trim:(bool) btrim brackets:(NSString*)brackets;
+(NSString*) base64en:(NSString*) string;
+(NSString*) base64de:(NSString*) string;
+(NSDictionary*) device_info;
+(NSDictionary*) error_dict:(NSError*)error;
+ (NSArray*) allFilesAtPath:(NSString*) dirString;

+(NSDictionary*) dictfromfile:(NSString*) path;

+(NSData*) getdbfile;

+ (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size;
+(UIImage*)img_compress:(UIImage*)image kbsize:(float) size;
+(NSString* )current_date;
+(NSMutableArray*)dictionary2array:(NSDictionary*)json count_fields:(NSString*) count_fields item_mark:(NSString*) item_mark items_mark:(NSString* )items_mark;


+(void) add_recent_model:(NSDictionary*) model;
+ (long long) freeDiskSpaceInMegaBytes;

+(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator;
+(void) add_to_cart:(UIViewController*) vc selectorholder:(id)holder selector:(SEL)addtocart;


+ (bool)mergeContentsOfPath:(NSString *)srcDir intoPath:(NSString *)dstDir error:(NSError**)err;
@end
