This is RZBundle.h in view mode; [Download] [Up]
/* * RZBundle * * A subclass of NXBundle that provides 2 key features: * * \t1\tParsing of the "bundle.table" resource and ability to return key/value pairs * * \t2\tParsing of the "class.list" resource and the ability to return the class * content, protocol conformance and inheritance of objects within the bundle. * * Copyright 1994 Ralph Zazula. All Rights Reserved. * * No part of this code may be reproduced in any form, compiled * or source code, nor used for any purpose without the express * written permission of the copyright holder. * * 11/14/94 - permission granted to use for any purpose excluding * resale or use as a dietary suppliment. * * By: Ralph Zazula (rzazula@next.com, zazula@hitower.com) */ #import <appkit/appkit.h> #define @(x) objc_getClass(#x) /* * This macro allows the use of class names for dynamically loaded classes. * For example: [[@(DynLoadClass) alloc] init]; * If "DynLoadClass" is not present in the runtime system, the call to * objc_getClass() will cause the RZBundle class error handler * rzbundle_objc_classHandler to be invoked and load the approprate bundle. */ @interface RZBundle : NXBundle { id infoTable; // for the contents of the 'bundle.table' file id classTable; // 'class.table' id dependTable; // 'depend.table' } int rzbundle_objc_classHandler(const char *name); /* * This function will be installed as the class lookup error * handler. This is called when objc_getClass() fails to try * and load the proper bundle for the class "name". Returns * the newly load class, or 'Nil' on failure. */ + addBundlesInPath:(const char *)path withExtension:(const char *)extension; /* * Creates RZBundle instances for all files *."extension" in the folder * "path". */ + addBundlesInPath:(const char *)path; /* * Creates RZBundle instances for all files *.bundle in the folder * "path". */ + setup; /* * Installs the class lookup error handling function for automatic * bundle loading. */ + alloc; + allocFromZone:(NXZone *)zone; + (RZBundle *)bundleContainingClass:(const char *)className; /* * Returns the first bundle found containing the class "className" or 'nil' if * no bundles currently initialized contain the class "className". */ + (BOOL)doPreloadsFor:(RZBundle *)bundle; /* * Attempts to load any bundles containing classes required to load "bundle". * Returns YES on success (all external classes found) and NO on failure. * Upon success, the code for "bundle" and the code of any required bundles * will be loaded. Upon failure, the code for "bundle" will not be loaded but * some or all of the prerequisite bundles may be loaded. */ + classNamed:(const char *)className; /* * Searches all initialized bundles for one containing "className". If a bundle * is found, the receiver performs any preloading required and then returns the * class for "className". Returns 'Nil' if the class "className" cannot be found, * or if the preloading could not be performed. */ + (BOOL)loadNib:(const char *)name for:anObject; /* * Locates and loads the nib "name" with "anObject" as the owner. */ - (NXStringTable *)classTable; /* * Returns the NXStringTable instance representing the 'class.table' file * for the reciever. This table has the names of the classes defined * in the receiver. */ - (NXStringTable *)dependTable; /* * Returns the NXStringTable instance representing the 'depend.table' file * for the reciever. This table has the names of the external classes * required by the receiver. The class list may contain classes already * present in the runtime system (i.e., it is not pruned against objc_lookUpClass()). */ - (NXStringTable *)infoTable; /* * Returns the NXStringTable instance representing the 'bundle.table' file * for the reciever. This table has the user-defined key/value pairs. */ - classNamed:(const char *)className; /* * Overriden to perform dependency checking and bundle pre-loading * before loading the code for the receiving bundle. */ - principalClass; /* * Overriden to perform dependency checking and bundle pre-loading * before loading the code for the receiving bundle. */ - free; - (BOOL)containsClass:(const char *)name; /* * Returns YES if this bundle contains the class named 'name'. This information * is based on the contents of the file 'class.table' in the receivers bundle. */ - (BOOL)doPreloads; /* * Checks for any external class dependancies and tries to resolve them. Returns * YES on success and NO on failure. Upon success, the recivers code and the code * of any required bundles will be loaded. Upon failure, the receivers code will * not be loaded but some or all of the prerequisite bundles may be loaded. */ - (const char *)valueForString:(const char *)s; /* * Returns the string value for keyword 's' found in the resource * 'bundle.table'. Returns NULL if the keyword is not found. */ @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.