-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCaculatorValue.h
36 lines (29 loc) · 1.46 KB
/
CaculatorValue.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// CaculatorValue.h
// dbm-watt
//
// Created by Patrick Deng on 13-3-10.
// Copyright (c) 2013年 Code Animal. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef enum {BinNotation, OctNotation, DecNotation, HexNotation} Notation;
typedef enum {BinByteBitsLength=8, BinWordBitsLength=16, BinDWordBitsLength=32, BinQWordBitsLength=64, DecBitsLength=19, HexByteBitsLength=2, HexWordBitsLength=4, HexDWordBitsLength=8, HexQWordBitsLength=16} BitsLength;
//typedef enum {DecByteValueMin=-128, DecWordValueMin=-32768, DecDWordValueMin=-2147483648, DecQWordValueMin=-9223372036854776000} DecNotationValueMinEdge;
//typedef enum {DecByteValueMax=127, DecWordValueMax=32767, DecDWordValueMax=2147483647, DecQWordValueMax=9223372036854775999} DecNotationValueMaxEdge;
@interface CaculatorValue : NSObject
@property (nonatomic) Notation notation;
@property (nonatomic) BitsLength bitsLength;
@property (nonatomic, readonly) BOOL isNegative;
@property (strong, nonatomic, readonly) NSString* valueString;
@property (strong, nonatomic) CaculatorValue* reversedObject;
-(NSInteger) length;
-(void) appendString:(NSString*) string;
-(double) doubleValue;
-(int) intValue;
-(NSInteger) integerValue;
-(void) replaceStringInRange:(NSRange) range withString:(NSString*) string;
-(void) setString:(NSString*) string;
-(void) deleteStringInRange:(NSRange) range;
-(void) insertString:(NSString*) string atIndex:(NSUInteger) index;
-(NSString*) substringFromIndex:(NSUInteger) index;
@end