1 /* 2 Copyright (C) 2000-2005 SKYRIX Software AG 3 4 This file is part of SOPE. 5 6 SOPE is free software; you can redistribute it and/or modify it under 7 the terms of the GNU Lesser General Public License as published by the 8 Free Software Foundation; either version 2, or (at your option) any 9 later version. 10 11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY 12 WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 14 License for more details. 15 16 You should have received a copy of the GNU Lesser General Public 17 License along with SOPE; see the file COPYING. If not, write to the 18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 19 02111-1307, USA. 20 */ 21 22 #ifndef __NGExtensions_NSObject_Values_H__ 23 #define __NGExtensions_NSObject_Values_H__ 24 25 #import <Foundation/NSObject.h> 26 #import <Foundation/NSString.h> 27 28 @protocol NGBaseTypeValues 29 30 - (BOOL)boolValue; 31 32 - (signed char)charValue; 33 - (unsigned char)unsignedCharValue; 34 - (signed short)shortValue; 35 - (unsigned short)unsignedShortValue; 36 - (signed int)intValue; 37 - (unsigned int)unsignedIntValue; 38 - (signed long)longValue; 39 - (unsigned long)unsignedLongValue; 40 - (signed long long)longLongValue; 41 - (unsigned long long)unsignedLongLongValue; 42 - (float)floatValue; 43 44 @end 45 46 /* 47 The default basetype methods perform their operation on the 48 string-representation of the object. 49 50 -boolValue returns YES per default. (id != nil) 51 */ 52 @interface NSObject(NGValues) < NGBaseTypeValues > 53 54 - (double)doubleValue; 55 56 - (NSString *)stringValue; 57 58 @end 59 60 @interface NSString(NGValues) 61 62 + (NSString *) stringWithUnsignedLongLong: (unsigned long long)value; 63 64 - (BOOL)boolValue; 65 - (NSString *)stringValue; 66 67 @end 68 69 #endif /* __NGExtensions_NSObject_Values_H__ */ 70