home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / Apps / DevTools / ClassEditor.0.3 / Examples / ASCIIExampleClass.m < prev    next >
Encoding:
Text File  |  1995-01-23  |  1.7 KB  |  97 lines

  1. /* ASCIIExampleClass.m                 
  2.  *
  3.  * This object controls the data of a beaker (molecules, cameras, groups etc.)
  4.  * It is the main document of BeakerBoy and controls everything from loading to
  5.  * setting up the browser which does most of the other work.
  6.  *
  7.  * For interface-info see the header file. The comments in this file mostly
  8.  * cover only the real implementation details.
  9.  *
  10.  * Written by:         Thomas Engel
  11.  * Created:            23.10.1995 (Copyleft)
  12.  * Last modified:     12.11.1995
  13.  */
  14.  
  15. #define CURRENT_VERSION 1.2
  16.  
  17. #import "ASCIIExampleClass.h"
  18.  
  19. #import <misckit/MiscString.h>
  20.  
  21. @implementation ASCIIExampleClass
  22.  
  23. + initialize
  24. {
  25.     if ( self == [ASCIIExampleClass class] )
  26.         [ASCIIExampleClass setVersion:CURRENT_VERSION];
  27.  
  28.     return self;
  29. }
  30.  
  31. - init
  32. {
  33.     [super init];
  34.     return [self initFromText:[MiscString newWithString:"- myMethod:sender"]];
  35.     
  36.     // BUG BUG..memory leak !
  37. }
  38.  
  39. - initFromText:theLine
  40. {
  41.     [super init];
  42.     name = [MiscString new];
  43.     [name takeStringValue:theLine];
  44.     [name replaceEveryOccurrenceOf:";" with:" "];
  45.     [name trimWhiteSpaces];
  46.  
  47.     // Now charAt:0 _MUST_ be the mehtod type !!
  48.     
  49.     selectorName = [name copy];
  50.     [selectorName replaceCharAt:0 withChar:' ']; 
  51.     [selectorName trimWhiteSpaces];
  52.  
  53.     return self;
  54. }
  55.  
  56. - free
  57. {
  58.     [selectorName free];
  59.     return [super free];
  60. }
  61.  
  62. - freeAll
  63. {
  64.     // Ok now lets free it right away.
  65.  
  66.     return self;
  67. }
  68.  
  69. - (char *)name
  70. {
  71.     return [name stringValue];
  72. }
  73.  
  74. - (char *)selectorName
  75. {
  76.     return [selectorName stringValue];
  77. }
  78.  
  79. - (BOOL)isInstanceMethod
  80. {
  81.     if( [name charAt:0] == '+' ) return NO;
  82.     return YES;
  83. }
  84.  
  85. - (void *)doNothing:(int)right butWithSpeed:forTesting;
  86. {
  87.     // stupid dummy !!!
  88. }
  89. @end
  90.  
  91. /*
  92.  * Hisory: 13.01.95 Buh
  93.  *                And more one that can be found somewhere else all right ??
  94.  *            
  95.  *
  96.  * Bugs: - ...
  97.  */