Update version
[pithos-ios] / Classes / ComputeModel.h
1 //
2 //  ComputeModel.h
3 //  OpenStack
4 //
5 //  Created by Mike Mayo on 10/4/10.
6 //  The OpenStack project is provided under the Apache 2.0 license.
7 //
8
9 #import <Foundation/Foundation.h>
10
11 // superclass for OpenStack Compute models with common parsing and utility methods
12 @interface ComputeModel : NSObject <NSCoding> {
13     NSString *identifier;
14     NSString *name;
15 }
16
17 @property (nonatomic, retain) NSString *identifier;
18 @property (nonatomic, retain) NSString *name;
19
20 // parses the stuff common to all models for you
21 - (id)initWithJSONDict:(NSDictionary *)dict;
22
23 - (NSInteger)intForKey:(NSString *)key inDict:(NSDictionary *)dict;
24 - (NSDate *)dateForKey:(NSString *)key inDict:(NSDictionary *)dict;
25
26 + (NSDate *)dateFromString:(NSString *)dateString;
27 + (NSDate *)dateFromRFC1123String:(NSString *)dateString;
28 + (NSString *)localDateDescriptionFromDate:(NSDate *)date;
29 - (NSDate *)dateFromString:(NSString *)dateString;
30
31 - (NSComparisonResult)compare:(ComputeModel *)aComputeModel;
32
33 @end