ftp.nice.ch/Attic/openStep/implementation/gnustep/sources/libFoundation.0.7.tgz#/libFoundation-0.7/FoundationTestsuite/tests/basic/MyObject.h

This is MyObject.h in view mode; [Download] [Up]

/* 
   MyObject.h

   Copyright (C) 1995, 1996, 1997 Ovidiu Predescu and Mircea Oancea.
   All rights reserved.

   Author: Ovidiu Predescu <ovidiu@bx.logicnet.ro>

   This file is part of libFoundation.

   Permission to use, copy, modify, and distribute this software and its
   documentation for any purpose and without fee is hereby granted, provided
   that the above copyright notice appear in all copies and that both that
   copyright notice and this permission notice appear in supporting
   documentation.

   We disclaim all warranties with regard to this software, including all
   implied warranties of merchantability and fitness, in no event shall
   we be liable for any special, indirect or consequential damages or any
   damages whatsoever resulting from loss of use, data or profits, whether in
   an action of contract, negligence or other tortious action, arising out of
   or in connection with the use or performance of this software.
*/

#ifndef __MyObject_h__
#define __MyObject_h__

#include <config.h>
#include <Foundation/NSObject.h>

@class NSTimer;

typedef struct {
    char c;
} Struct1;

typedef struct {
    short s;
} Struct2;

typedef struct {
    short s;
    char c;
} Struct3;

typedef struct {
    int i;
} Struct4;

typedef struct {
    int i;
    char c;
} Struct5;

typedef struct {
    int i;
    short s;
} Struct6;

typedef struct {
    int i;
    short s;
    char c;
} Struct7;

typedef struct {
    int i;
    int j;
} Struct8;

typedef struct {
    int i;
    int j;
    char c;
} Struct9;

typedef struct {
    int i;
    int j;
    short s;
} Struct10;

typedef struct {
    int i;
    int j;
    short s;
    char c;
} Struct11;

typedef struct {
    double d;
    int i;
} Struct12;

typedef struct {
    double d;
    int i;
    char c;
} Struct13;

typedef struct {
    double d;
    int i;
    short s;
} Struct14;

typedef struct {
    double d;
    int i;
    short s;
    char c;
} Struct15;

typedef struct {
    char c1;
    short s;
    char c2;
    int i;
    double d;
} Struct16;

@class NSTimer;
@class NSDate;

@interface MyObject : NSObject
{
    BOOL flag;
    short shortValue;
    int intValue;
    float floatValue;
    double doubleValue;
    char* str;
    union {
	Struct1	s1;
	Struct2	s2;
	Struct3	s3;
	Struct4	s4;
	Struct5 s5;
	Struct6	s6;
	Struct7 s7;
	Struct8	s8;
	Struct9 s9;
	Struct10 s10;
	Struct11 s11;
	Struct12 s12;
	Struct13 s13;
	Struct14 s14;
	Struct15 s15;
	Struct16 s16;
    } structure;
}

- method;
- method:arg;

- setFlag:(BOOL)flag;
- setShortValue:(short)s;
- setIntValue:(int)n;
- setString:(char*)s;
- setFlag:(BOOL)flag intValue:(int)i floatValue:(float)f doubleValue:(double)d;
- setStruct1:(Struct1)s;
- setStruct2:(Struct2)s;
- setStruct3:(Struct3)s;
- setStruct4:(Struct4)s;
- setStruct5:(Struct5)s;
- setStruct6:(Struct6)s;
- setStruct7:(Struct7)s;
- setStruct8:(Struct8)s;
- setStruct9:(Struct9)s;
- setStruct10:(Struct10)s;
- setStruct11:(Struct11)s;
- setStruct12:(Struct12)s;
- setStruct13:(Struct13)s;
- setStruct14:(Struct14)s;
- setStruct15:(Struct15)s;
- setStruct16:(Struct16)s;

- (BOOL)flag;
- (short)shortValue;
- (int)intValue;
- (float)floatValue;
- (double)doubleValue;
- (char*)string;
- (Struct1)struct1;
- (Struct2)struct2;
- (Struct3)struct3;
- (Struct4)struct4;
- (Struct5)struct5;
- (Struct6)struct6;
- (Struct7)struct7;
- (Struct8)struct8;
- (Struct9)struct9;
- (Struct10)struct10;
- (Struct11)struct11;
- (Struct12)struct12;
- (Struct13)struct13;
- (Struct14)struct14;
- (Struct15)struct15;
- (Struct16)struct16;

@end

#if !NeXT_foundation_LIBRARY
@interface MyObject (TimerTest)
+ (NSTimer*)newTimerWithInterval:(double)interval
	repeats:(int)repeats;
+ (NSTimer*)newScheduledTimerWithInterval:(double)interval
	repeats:(int)repeats;
- alarm:(NSTimer*)aTimer;
+ printTimeIntervalSinceReferenceDateFor:(NSDate*)date;
@end


@interface MyObject (RunLoopTest)
+ (NSString*)defaultMode;
@end
#endif /* !NeXT_foundation_LIBRARY */


@interface MyObject (PropertyListTest)
+ (BOOL)verifyObject:anObject;
+ (BOOL)verifyArray:anObject;
+ (BOOL)verifyDict:anObject;
@end /* MyObject (PropertyListTest) */


@interface MyObject (NSScannerTest)
+ (void)scanInt:scanner;
+ (void)scanFloat:scanner;
+ (void)scanDouble:scanner;
+ (void)scanLongLong:scanner;
@end


@interface Forwarder : NSObject
{
    id object;
}
- setObject:anObject;
- object;
@end


@interface MySecondForwarder : Forwarder
@end

#endif /* __MyObject_h__ */

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.