This is IIOmodule.m in view mode; [Download] [Up]
// // IIOmodule is an abstract super class for IO modules for accessing a database. // The items in a database is organized heirarchly into a directory tree. A // directory is permitted to have both subdirectories and items. A IO module // supports a standard interface to a browser. This permits the same browser // to be used with different types of databases provided that the database can // be organized into a directory tree. This standard interface is specified // by having the IIOmodule support the following methods: // // (IOrderedListD *)subDirectoryOf:directoryNode // This method should return a list of nodes that corresponds to the // subdirectories of the directory that corresponds to the node // directoryNode. The ownership of the list of nodes passes to the // caller. A nil directoryNode indicates the root node. // // (IOrderedListD *)itemHeadersOf:directoryNode // This method should return a list of nodes that corresponds to the // items of the directory that corresponds to the node of directoryNode. // The ownership of the list of nodes passes to the caller. // // (IOrderedListD *)itemOf:itemNode // This method should return the item that corresponds to itemNode. // This method should send a message to the the editor to display this // item. The ownership of the item passes to the caller. // // A node is a private object that corresponds to a directory or an item. // It should implement the following methods: // // (const char *)titleForCell; // This method should return the name of the directory or item that // corresponds to this node. This is used for the title of the // corresponding browser cell. // // (BOOL)isLeaf; // This method indicates for a node that corresponds to a directory // whether it has subdirectories or not. TRUE if it has no // subdirectories. // // A node should save in its private instance variables the links to its // corresponding directory object or item object. This allows a uniform // interface to the browser module using the above methods but a custom // interface to the IO module using private instance variables and methods. // #import "IIOmodule.h" #import <string.h> @implementation IIOmodule - setRootName:(char *)rootName { strncpy (iRootName, rootName, sizeof(iRootName)-1); return self; } - (char *)rootName { return (iRootName); } - (BOOL)toggleActive:node { // this routine should be overriden return YES; } - subDirectoryOf:node { // this routine should be overriden return self; } - itemHeadersOf:node { // this routine should be overriden return self; } - itemOf:node { // this routine should be overriden return self; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.