3 * The Cheat - The legendary universal game trainer for Mac OS X.
4 * http://www.brokenzipper.com/trac/wiki/TheCheat
6 * Copyright (c) 2003-2011, Charles McGarvey et al.
8 * Distributable under the terms and conditions of the 2-clause BSD
9 * license; see the file COPYING for the legal text of the license.
12 #import <Cocoa/Cocoa.h>
14 #import "CheaterTypes.h"
20 #define TC_MAX_VAR_SIZE (256)
22 @interface Variable
: NSObject
< NSCoding
>
28 #if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED
37 // use the accessor methods unless you need fast access
38 // do not change these variables directly or things will be screwed.
40 TCIntegerSign _integerSign
;
41 #if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED
50 // #############################################################################
51 #pragma mark Initialization
52 // #############################################################################
54 // type and sign can't be changed once variable is created.
56 - (id
)init
; // default: TCInt32
57 - (id
)initWithType
:(TCVariableType
)type
; // default: TCSigned
58 - (id
)initWithType
:(TCVariableType
)type integerSign
:(TCIntegerSign
)sign
;
60 - (void)setProcess
:(Process
*)process
;
65 // #############################################################################
67 // #############################################################################
69 - (id
)initWithCoder
:(NSCoder
*)coder
;
70 - (void)encodeWithCoder
:(NSCoder
*)coder
;
72 // #############################################################################
73 #pragma mark Accessors
74 // #############################################################################
76 - (TCVariableType
)type
;
77 - (TCIntegerSign
)integerSign
;
78 - (NSString
*)typeString
;
81 - (void)setAddress
:(TCAddress
)addr
;
82 - (NSString
*)addressString
;
83 - (BOOL
)setAddressString
:(NSString
*)string
;
85 - (void const *)value
;
86 - (void)setValue
:(void const *)value
;
87 - (void)setValue
:(void const *)value size
:(unsigned)size
;
88 - (NSString
*)stringValue
;
89 - (BOOL
)setStringValue
:(NSString
*)value
;
91 void bigEndianValue(void *buffer
, Variable
*variable
);
93 - (unsigned)valueSize
;
97 - (void)setEnabled
:(BOOL
)enabled
;
99 #if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED
101 - (void)setTag
:(NSInteger
)tag
;
104 - (void)setTag
:(int)tag
;