//
//  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>
#import <UIKit/UIKit.h>
//typedef  struct {
//    
//    NSString* id;
//    
//    float  height;
//    
//    
//}MyTestStruct;


@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;

+(NSString*) get_config_path;
+(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;
+(void) enum_font;
+(NSDictionary*) dictfromfile:(NSString*) path;
+(NSArray*) expression_varable:(NSString*)content regex:(NSString*) pattern;
+(NSTextCheckingResult*) expression_findfistMatch:(NSString*)content regex:(NSString*) pattern;
+(NSData*) getdbfile;
+(NSString*) getdbzip;
+ (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size;
+ (CGRect)scaleToSize:(CGRect )from to:(CGSize)to;
+ (CGRect)rectAlign:(CGRect )parent rect:(CGRect)rect hAlign:(NSString*)hAlign vAlign:(NSString*)vAlign;
+ (CGRect)rectVAlign:(CGRect )parent rect:(CGRect)rect vAlign:(NSString*)vAlign;
+(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;
+(UIImage*)generateBarCode:(NSString*)barCodeStr width:(CGFloat)width height:(CGFloat)height;
+(UIImage*)generateQRCode:(NSString*)barCodeStr width:(CGFloat)width height:(CGFloat)height;
//+(void) add_recent_model:(NSDictionary*) model;
+ (long long) freeDiskSpaceInMegaBytes;

+(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator;



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