gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ANN: dkautogen in DevelKit


From: Stefan Urbanek
Subject: ANN: dkautogen in DevelKit
Date: Tue, 12 Oct 2004 13:37:37 -0400

Hi,

I have recreated method-generation StepTalk script in ObjectiveC with
some improvements. It is now part of the DevelKit.

ABOUT

dkautogen - generate accessor (setter and getter), dealloc and archiving
method sources

DOWNLOAD

http://stefan.agentfarms.net/Download/GNUstep/DevelopmentKit-20041012.tar.gz

(i'll update it in DevelKit CVS as soon as they process my new ssh key
on savannah)

DOCUMENTATION

To learn more type: dkautogen help
that will print this message:

Help for dkautogen

To each .h and corresponding .m file a category DKGenerated is appended.
If there is already such category, then it is replaced.

Instance variable keywords
  hidden - do not generate accessor methods
  exposed - expose accessor methods
  retained - object is retained by class
  notretained - object is NOT retained by class
  readonly - instance variable is read only (setter is not generated)
  notarchived - ignore in archiving
  object - instance variable of unknown type is an object (see below)

Class keywords (defaults for all instance variables)
  hidden - do not generate accessor methods
  exposed - expose accessor methods
  retained - all objects are retained by class
  notretained - no object is retained by class
  readonly - all instance variable are read only
  objects - assume all unknown types as objects
  customarchive - do not generate archiving methods
  nosuperarchive - do not call archiving in superclass
  customdealloc - do not generate -dealloc method

Known types
All standard C types including NSPoint, NSSize, NSRect and NSRange are
treated as non-objects. By default only id and Class types are treated
as objects.
Generated methods by default:
accessors (getter and setter), dealloc methon, initWithCoder:, and
encodeWithCoder

How to use
Attributes are written in same comments used for auto-documentation.
They are separated from documentation by pipe '|' character. Example:

    NSString *name; /* Object name | object readonly retained */
Class defaults are written immediately before @interface:

    /* This is my class | nosuperarchive retained objects */
    @interface MyClass : NSObject

Preferences (also usable as switches on commandline with '-' prefix):
    interfaceTemplate      - path to .h file template
    implementationTemplate - path to .m file template
    beginTag               - tag used to mark beginning of generated
code
    endTag                 - tag used to mark end of generated code

Example:
    dkautogen -implementationTemplate MyTemplate.m SomeClass.h


Feedback in form of comments, patches and bugreports is welcome.

Enjoy,

Stefan Urbanek
-- 
http://stefan.agentfarms.net

First they ignore you, then they laugh at you, then they fight you, then
you win.
- Mahatma Gandhi






reply via email to

[Prev in Thread] Current Thread [Next in Thread]