From f040bd1c6af65f94581d4d5faba774302ae54179 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 21 Jun 2000 11:04:41 +0000 Subject: [PATCH] Some documentation improvements git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6748 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 + Documentation/gsdoc/NSScanner.gsdoc | 176 ++++++++++- Documentation/gsdoc/NSScanner.html | 244 ++++++++++++--- Tools/GNUmakefile | 2 +- Tools/Makefile.postamble | 5 +- Tools/gsdoc-0_6_6.dtd | 447 ++++++++++++++++++++++++++++ Tools/gsdoc.gsdoc | 99 ++++-- Tools/gsdoc.m | 186 +++++++++--- 8 files changed, 1045 insertions(+), 120 deletions(-) create mode 100644 Tools/gsdoc-0_6_6.dtd diff --git a/ChangeLog b/ChangeLog index 1c566a5d3..2163851f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,12 @@ 2000-06-21 Richard Frith-Macdonald * Source/NSScanner.m: ([-scanHexInt:]) fixed to permit leading 0x or 0X + * Documentation/gsdoc/NSScanner.gsdoc: fleshed out + * Tools/Makefile.postamble: Added documentation target - build before + install + * Tools/gsdoc-0_6_6.dtd: New dtd under development - add java support + * Tools/gsdoc.m: Update to work with current dtd + * Tools/gsdoc.gsdoc: Add a little more text on document body structure. 2000-06-20 Richard Frith-Macdonald diff --git a/Documentation/gsdoc/NSScanner.gsdoc b/Documentation/gsdoc/NSScanner.gsdoc index 1e6110b6c..8da1c7227 100644 --- a/Documentation/gsdoc/NSScanner.gsdoc +++ b/Documentation/gsdoc/NSScanner.gsdoc @@ -1,5 +1,5 @@ - + NSScanner @@ -7,153 +7,309 @@ - 0.1 - 28 February, 2000 + 1.0 + 21 June, 2000 - NSScanner + The NSScanner class documentation Foundation/NSScanner.h NSCopying - - + +

+ The NSScanner class cluster (currently a single class in GNUstep) + provides a mechanism to parse the contents of a string into number + and string values by making a sequence of scan operations to + step through the string retrieving successive items. +

+

+ You can tell the scanner whether its scanning is supposed to be + case sensitive or not, and you can specify a set of characters + to be skipped before each scanning operation (by default, + whitespace and newlines). +

+
localizedScannerWithString: aString + Returns an NSScanner instance set up to scan aString + (using initWithString:) and with a locale set the default locale + (using setLocale:). scannerWithString: aString + Returns an NSScanner instance set up to scan aString + (using initWithString:) and with no locale set. caseSensitive + If the scanner is set to be case-sensitive in its scanning of + the string (other than characters to be skipped), this method + returns YES, otherwise it returns NO. +
+ The default is for a scanner to not be case sensitive.
charactersToBeSkipped + Returns a set of characters containing those characters that the + scanner ignores when starting any scan operation. Once a character + not in this set has been encountered during an operation, skipping + is finished, and any further characters from this set that are + found are scanned normally. +
+ The default for this is the whitespaceAndNewlineCharacterSet.
initWithString: aString + Initialises the scanner to scan aString. The GNUstep + implementation may make an internal copy of the original + string - so it is not safe to assume that if you modify a + mutable string that you initialised a scanner with, the changes + will be visible to the scanner. +
+ Returns the scanner object.
isAtEnd + Returns YES if there are no characters left to be scanned in the + string (or if all the characters that are left are in the set of + characters to be skipped). Returns NO otherwise. locale + Returns the locale set for the scanner, or nil if no locale has + been set. A scanner uses it's locale to alter the way it handles + scanning - it uses the NSDecimalSeparator value for scanning + numbers. scanCharactersFromSet: - scanSet + set intoString: stringValue + After initial skipping (if any), this method scans any characters + from set, terminating when a character not in the set + is found. + Returns YES if any character is scanned, NO otherwise. + If stringValue is not null, any character scanned are + stored in a string returned in this value. scanDecimal: decimalValue + Not implemented. + scanDouble: doubleValue + After initial skipping (if any), this method scans a double value, + placing it in doubleValue if that is not null. + Returns YES if anything is scanned, NO otherwise. +
+ On overflow, HUGE_VAL or -HUGE_VAL is put into doubleValue +
+ On underflow, 0.0 is put into doubleValue +
+ Scans past any excess digits
scanFloat: floatValue + After initial skipping (if any), this method scans a float value, + placing it in floatValue if that is not null. + Returns YES if anything is scanned, NO otherwise. +
+ On overflow, HUGE_VAL or -HUGE_VAL is put into floatValue +
+ On underflow, 0.0 is put into floatValue +
+ Scans past any excess digits
scanHexInt: intValue + After initial skipping (if any), this method scans a hexadecimal + integer value (optionally prefixed by "0x" or "0X"), + placing it in intValue if that is not null. +
+ Returns YES if anything is scanned, NO otherwise. +
+ On overflow, INT_MAX or INT_MIN is put into intValue +
+ Scans past any excess digits
scanInt: intValue + After initial skipping (if any), this method scans a integer value, + placing it in intValue if that is not null. +
+ Returns YES if anything is scanned, NO otherwise. +
+ On overflow, INT_MAX or INT_MIN is put into intValue +
+ Scans past any excess digits
scanLocation + Returns the current position that the scanner has reached in + scanning the string. This is the position at which the next scan + operation will begin. scanLongLong: longLongValue + After initial skipping (if any), this method scans a long + decimal integer value placing it in longLongValue if that + is not null. +
+ Returns YES if anything is scanned, NO otherwise. +
+ On overflow, LONG_LONG_MAX or LONG_LONG_MIN is put into + longLongValue +
+ Scans past any excess digits
+ + scanRadixUnsignedInt: + intValue + + After initial skipping (if any), this method scans an unsigned + integer value placing it in intValue if that is not null. + If the number begins with "0x" or "0X" it is treated as hexadecimal, + otherwise if the number begins with "0" it is treated as octal, + otherwise the number is treated as decimal. +
+ Returns YES if anything is scanned, NO otherwise. +
+ On overflow, INT_MAX or INT_MIN is put into intValue +
+ Scans past any excess digits +
+ +
scanString: - string + aString intoString: stringValue + After initial skipping (if any), this method scans for + aString and places the string ound in stringValue + if that is not null. +
+ Returns YES if anything is scanned, NO otherwise.
scanUpToCharactersFromSet: - stopSet + set intoString: stringValue + After initial skipping (if any), this method scans characters until + it finds one in set. The scanned characters are placed in + stringValue if that is not null. +
+ Returns YES if anything is scanned, NO otherwise.
scanUpToString: - stopString + aString + intoString: + stringValue + After initial skipping (if any), this method scans characters until + it finds aString. The scanned characters are placed in + stringValue if that is not null. If aString is + not found, all the characters up to the end of the scanned string + will be returned. +
+ Returns YES if anything is scanned, NO otherwise.
setCaseSensitive: flag + Sets the case sensitivity of the scanner. +
+ Case sensitivity governs matrching of characters being scanned, + but does not effect the characters in the set to be skipped. +
+ The default is for a scanner to not be case sensitive.
setCharactersToBeSkipped: skipSet + Sets the set of characters that the scanner will skip over at the + start of each scanning operation to be skipSet. + Skipping is performed by literal character matchins - the case + sensitivity of the scanner does not effect it. + If this is set to nil, no skipping is done. +
+ The default for this is the whitespaceAndNewlineCharacterSet.
setLocale: aLocale + This method sets the locale used by the scanner to aLocale. + The locale may be set to nil. setScanLocation: index + This method sets the location in the scanned string at which the + next scan operation begins. + Raises an NSRangeException if index is beyond the end of the + scanned string. string + Returns the string used by the scanner.
diff --git a/Documentation/gsdoc/NSScanner.html b/Documentation/gsdoc/NSScanner.html index 663d365b5..c72b880ed 100644 --- a/Documentation/gsdoc/NSScanner.html +++ b/Documentation/gsdoc/NSScanner.html @@ -11,9 +11,9 @@
Richard Frith-Macdonald
-

Version: 0.1

-

Date: 28 February, 2000

-

NSScanner

+

Version: 1.0

+

Date: 21 June, 2000

+

The NSScanner class documentation

NSScanner

Declared in: Foundation/NSScanner.h

Inherits from: NSObject

@@ -21,7 +21,23 @@


- +

+ + The NSScanner class cluster (currently a single class in GNUstep) + provides a mechanism to parse the contents of a string into number + and string values by making a sequence of scan operations to + step through the string retrieving successive items. +

+ +

+ + You can tell the scanner whether its scanning is supposed to be + case sensitive or not, and you can specify a set of characters + to be skipped before each scanning operation (by default, + whitespace and newlines). +

+ +

localizedScannerWithString:

-+ (id) localizedScannerWithString: (NSString*)aString
++ (id) localizedScannerWithString: (NSString*)aString;
+ Returns an NSScanner instance set up to scan aString + (using initWithString:) and with a locale set the default locale + (using setLocale:).

scannerWithString:

-+ (id) scannerWithString: (NSString*)aString
++ (id) scannerWithString: (NSString*)aString;
+ Returns an NSScanner instance set up to scan aString + (using initWithString:) and with no locale set.

caseSensitive

-- (BOOL) caseSensitive
+- (BOOL) caseSensitive;
+ If the scanner is set to be case-sensitive in its scanning of + the string (other than characters to be skipped), this method + returns YES, otherwise it returns NO. +
+ The default is for a scanner to not be case sensitive.

charactersToBeSkipped

-- (NSCharacterSet*) charactersToBeSkipped
+- (NSCharacterSet*) charactersToBeSkipped;
+ Returns a set of characters containing those characters that the + scanner ignores when starting any scan operation. Once a character + not in this set has been encountered during an operation, skipping + is finished, and any further characters from this set that are + found are scanned normally. +
+ The default for this is the whitespaceAndNewlineCharacterSet.

initWithString:

-- (id) initWithString: (NSString*)aString
+- (id) initWithString: (NSString*)aString;
+ Initialises the scanner to scan aString. The GNUstep + implementation may make an internal copy of the original + string - so it is not safe to assume that if you modify a + mutable string that you initialised a scanner with, the changes + will be visible to the scanner. +
+ Returns the scanner object.

isAtEnd

-- (BOOL) isAtEnd
+- (BOOL) isAtEnd;
+ Returns YES if there are no characters left to be scanned in the + string (or if all the characters that are left are in the set of + characters to be skipped). Returns NO otherwise.

locale

-- (NSDictionary*) locale
+- (NSDictionary*) locale;
+ Returns the locale set for the scanner, or nil if no locale has + been set. A scanner uses it's locale to alter the way it handles + scanning - it uses the NSDecimalSeparator value for scanning + numbers.

scanCharactersFromSet:intoString:

-- (BOOL) scanCharactersFromSet: (NSCharacterSet*)scanSet intoString: (NSString**)stringValue
+- (BOOL) scanCharactersFromSet: (NSCharacterSet*)set intoString: (NSString**)stringValue;
+ After initial skipping (if any), this method scans any characters + from set, terminating when a character not in the set + is found. + Returns YES if any character is scanned, NO otherwise. + If stringValue is not null, any character scanned are + stored in a string returned in this value.

scanDecimal:

-- (BOOL) scanDecimal: (NSDecimal*)decimalValue
+- (BOOL) scanDecimal: (NSDecimal*)decimalValue;
+Standards: MacOS-X NotOpenStep
+ Not implemented.

scanDouble:

-- (BOOL) scanDouble: (double*)doubleValue
+- (BOOL) scanDouble: (double*)doubleValue;
+ After initial skipping (if any), this method scans a double value, + placing it in doubleValue if that is not null. + Returns YES if anything is scanned, NO otherwise. +
+ On overflow, HUGE_VAL or -HUGE_VAL is put into doubleValue +
+ On underflow, 0.0 is put into doubleValue +
+ Scans past any excess digits

scanFloat:

-- (BOOL) scanFloat: (float*)floatValue
+- (BOOL) scanFloat: (float*)floatValue;
+ After initial skipping (if any), this method scans a float value, + placing it in floatValue if that is not null. + Returns YES if anything is scanned, NO otherwise. +
+ On overflow, HUGE_VAL or -HUGE_VAL is put into floatValue +
+ On underflow, 0.0 is put into floatValue +
+ Scans past any excess digits

scanHexInt:

-- (BOOL) scanHexInt: (unsigned int*)intValue
+- (BOOL) scanHexInt: (unsigned int*)intValue;
+ After initial skipping (if any), this method scans a hexadecimal + integer value (optionally prefixed by "0x" or "0X"), + placing it in intValue if that is not null. +
+ Returns YES if anything is scanned, NO otherwise. +
+ On overflow, INT_MAX or INT_MIN is put into intValue +
+ Scans past any excess digits

scanInt:

-- (BOOL) scanInt: (int*)intValue
+- (BOOL) scanInt: (int*)intValue;
+ After initial skipping (if any), this method scans a integer value, + placing it in intValue if that is not null. +
+ Returns YES if anything is scanned, NO otherwise. +
+ On overflow, INT_MAX or INT_MIN is put into intValue +
+ Scans past any excess digits

scanLocation

-- (unsigned int) scanLocation
+- (unsigned int) scanLocation;
+ Returns the current position that the scanner has reached in + scanning the string. This is the position at which the next scan + operation will begin.

scanLongLong:

-- (BOOL) scanLongLong: (longlong*)longLongValue
+- (BOOL) scanLongLong: (longlong*)longLongValue;
+ After initial skipping (if any), this method scans a long + decimal integer value placing it in longLongValue if that + is not null. +
+ Returns YES if anything is scanned, NO otherwise. +
+ On overflow, LONG_LONG_MAX or LONG_LONG_MIN is put into + longLongValue +
+ Scans past any excess digits
-

scanString:intoString:

-- (BOOL) scanString: (NSString*)string intoString: (NSString**)stringValue
+

scanRadixUnsignedInt:

+- (BOOL) scanRadixUnsignedInt: (unsigned int*)intValue;
+Standards: GNUstep NotOpenStep NotMacOS-X
+ After initial skipping (if any), this method scans an unsigned + integer value placing it in intValue if that is not null. + If the number begins with "0x" or "0X" it is treated as hexadecimal, + otherwise if the number begins with "0" it is treated as octal, + otherwise the number is treated as decimal. +
+ Returns YES if anything is scanned, NO otherwise. +
+ On overflow, INT_MAX or INT_MIN is put into intValue +
+ Scans past any excess digits
-

scanUpToCharactersFromSet:intoString:

-- (BOOL) scanUpToCharactersFromSet: (NSCharacterSet*)stopSet intoString: (NSString**)stringValue
+

scanString:intoString:

+- (BOOL) scanString: (NSString*)aString intoString: (NSString**)stringValue;
+ After initial skipping (if any), this method scans for + aString and places the string ound in stringValue + if that is not null. +
+ Returns YES if anything is scanned, NO otherwise.
-

scanUpToString:

-- (BOOL) scanUpToString: (NSString*)stopString
+

scanUpToCharactersFromSet:intoString:

+- (BOOL) scanUpToCharactersFromSet: (NSCharacterSet*)set intoString: (NSString**)stringValue;
+ After initial skipping (if any), this method scans characters until + it finds one in set. The scanned characters are placed in + stringValue if that is not null. +
+ Returns YES if anything is scanned, NO otherwise.
-

setCaseSensitive:

-- (void) setCaseSensitive: (BOOL)flag
+

scanUpToString:intoString:

+- (BOOL) scanUpToString: (NSString*)aString intoString: (NSString**)stringValue;
+ After initial skipping (if any), this method scans characters until + it finds aString. The scanned characters are placed in + stringValue if that is not null. If aString is + not found, all the characters up to the end of the scanned string + will be returned. +
+ Returns YES if anything is scanned, NO otherwise.
-

setCharactersToBeSkipped:

-- (void) setCharactersToBeSkipped: (NSCharacterSet*)skipSet
+

setCaseSensitive:

+- (void) setCaseSensitive: (BOOL)flag;
+ Sets the case sensitivity of the scanner. +
+ Case sensitivity governs matrching of characters being scanned, + but does not effect the characters in the set to be skipped. +
+ The default is for a scanner to not be case sensitive.
-

setLocale:

-- (void) setLocale: (NSDictionary*)aLocale
+

setCharactersToBeSkipped:

+- (void) setCharactersToBeSkipped: (NSCharacterSet*)skipSet;
+ Sets the set of characters that the scanner will skip over at the + start of each scanning operation to be skipSet. + Skipping is performed by literal character matchins - the case + sensitivity of the scanner does not effect it. + If this is set to nil, no skipping is done. +
+ The default for this is the whitespaceAndNewlineCharacterSet.
-

setScanLocation:

-- (void) setScanLocation: (unsigned int)index
+

setLocale:

+- (void) setLocale: (NSDictionary*)aLocale;
+ This method sets the locale used by the scanner to aLocale. + The locale may be set to nil.
-

string

-- (NSString*) string
+

setScanLocation:

+- (void) setScanLocation: (unsigned int)index;
+ This method sets the location in the scanned string at which the + next scan operation begins. + Raises an NSRangeException if index is beyond the end of the + scanned string. + +
+

string

+- (NSString*) string;
+ + Returns the string used by the scanner.
diff --git a/Tools/GNUmakefile b/Tools/GNUmakefile index d00f0f1bb..6d25d3022 100644 --- a/Tools/GNUmakefile +++ b/Tools/GNUmakefile @@ -32,7 +32,7 @@ include ../config.mak # DTDs to install dtddir = $(GNUSTEP_RESOURCES)/DTDs -DTD_FILES = gsdoc-0_6_5.dtd +DTD_FILES = gsdoc-0_6_5.dtd gsdoc-0_6_6.dtd # The application to be compiled TOOL_NAME = gdnc gsdoc defaults plmerge \ diff --git a/Tools/Makefile.postamble b/Tools/Makefile.postamble index abdee7611..92a042ba8 100644 --- a/Tools/Makefile.postamble +++ b/Tools/Makefile.postamble @@ -15,7 +15,7 @@ # after-all:: # Things to do before installing -# before-install:: +before-install:: documentation # Things to do after installing after-install:: @@ -78,3 +78,6 @@ copy-dist: $(DIST_FILES) cp $$f ../snap/Tools ; \ done +documentation: $(GNUSTEP_OBJ_DIR)/gsdoc + $(GNUSTEP_OBJ_DIR)/gsdoc gsdoc + diff --git a/Tools/gsdoc-0_6_6.dtd b/Tools/gsdoc-0_6_6.dtd new file mode 100644 index 000000000..08657dffc --- /dev/null +++ b/Tools/gsdoc-0_6_6.dtd @@ -0,0 +1,447 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tools/gsdoc.gsdoc b/Tools/gsdoc.gsdoc index 21bf089ee..bc471d127 100644 --- a/Tools/gsdoc.gsdoc +++ b/Tools/gsdoc.gsdoc @@ -1,5 +1,5 @@ - + GNUstep Documentation XML markup language (GSDoc) @@ -10,8 +10,8 @@ A person who has devotes far too much time to GNUstep development. - 0.1 - 4 march, 2000 + 0.2 + 21 June, 2000 This documents the GNUstep Documentation markup language and tools @@ -118,8 +118,8 @@

<?xml version="1.0"?> -<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.5//EN" "http://www.gnustep.org/gsdoc-0_6_5.xml"> -<gsdoc base="MyDoc" prev="First.html" next="Last.html" up="Overview.html"> +<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.6//EN" "http://www.gnustep.org/gsdoc-0_6_6.xml"> +<gsdoc base="MyDoc" prev="First" next="Last" up="Overview"> <head> ... your document head here </head> @@ -184,22 +184,22 @@ document head that must be present.

- <head> - <title>GNUstep Documentation XML markup language (GSDoc)</title> - <author name="Richard Frith-Macdonald"> - <email address="rfm@gnu.org"/> - <url url="http://www.gnustep.org/developers/whoiswho.html"/> - <desc> - A person who has devotes far too much time to GNUstep development. - </desc> - </author> - <version>0.1</version> - <date>4 march, 2000</date> - <abstract> - This documents the GNUstep Documentation markup language and tools - </abstract> - <copy>Free Software Foundation, Inc.</copy> - </head> +<head> + <title>GNUstep Documentation XML markup language (GSDoc)</title> + <author name="Richard Frith-Macdonald"> + <email address="rfm@gnu.org"/> + <url url="http://www.gnustep.org/developers/whoiswho.html"/> + <desc> + A person who has devotes far too much time to GNUstep development. + </desc> + </author> + <version>0.1</version> + <date>4 march, 2000</date> + <abstract> + This documents the GNUstep Documentation markup language and tools + </abstract> + <copy>Free Software Foundation, Inc.</copy> +</head>

The above example shows all the elements possible in a document head - @@ -250,6 +250,63 @@ parts of the document would be expected to have their own separate page numbering schemes.

+ +<body> + <front> + <contents/> + <chapter> + <heading>Preface</heading> + <p> + Here is an introductory chapter for a dummy document. + </p> + </chapter> + </front> + <chapter> + <heading>Main text</heading> + <p> + Here is the main text of a chapter in the document. + </p> + </chapter> + <back> + <chapter> + <heading>Afterword</heading> + <p> + Adn after the main part of the doucment we can have some other stuff. + </p> + </chapter> + <index type="class"/> + </back> +</body> + +

+ The above example shows all the elements possible in a document body - +

+ + + + This is an optional part of the document that can come before the + main text. Typically, this could be used to contain an automatically + generated contents page and possibly an introduction. + When output is generated in book form, this part of the document + would probably have a different page numbering scheme from the + main part. + + + +

+ After the front part of the document body comes a + mandatory sequence of one or more chapters. This is where + the main part of the document resides. +

+
+ + + After the chapters making up the main part of the body of the + document is an optional back part which may contain + chapters (such as appendices) possibly followed by an automatically + generated index. + +
diff --git a/Tools/gsdoc.m b/Tools/gsdoc.m index 9c04ac455..197d1c460 100644 --- a/Tools/gsdoc.m +++ b/Tools/gsdoc.m @@ -505,6 +505,7 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt) } if (strcmp(node->name, "class") == 0 + || strcmp(node->name, "jclass") == 0 || strcmp(node->name, "category") == 0 || strcmp(node->name, "protocol") == 0 || strcmp(node->name, "function") == 0 @@ -772,7 +773,8 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt) { NSMutableString *text = [NSMutableString string]; - if (strcmp(node->name, "class") == 0) + if ((strcmp(node->name, "class") == 0) + || (strcmp(node->name, "jclass") == 0)) { NSString *className = [self getProp: "name" fromNode: node]; NSString *superName = [self getProp: "super" fromNode: node]; @@ -819,7 +821,8 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt) desc = [self parseDesc: node]; node = node->next; } - while (node != 0 && strcmp(node->name, "method") == 0) + while (node != 0 && ((strcmp(node->name, "method") == 0) + || (strcmp(node->name, "jmethod") == 0))) { NSString *s = [self parseMethod: node]; @@ -1315,7 +1318,15 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt) } else { + xmlNodePtr old = node; + [text appendString: [self parseText: node end: &node]]; + /* + * If we found text, the node will have been advanced, but if + * it failed we need to advance ourselves. + */ + if (node == old) + node = node->next; continue; } @@ -1502,11 +1513,26 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt) [text appendString: @"\r\n"]; [text appendString: @"\r\n"]; if (prevName != nil) - [text appendFormat: @"[Previous]\n", prevName]; + { + if ([[prevName pathExtension] isEqual: @"html"] == YES) + [text appendFormat: @"[Previous]\n", prevName]; + else + [text appendFormat: @"[Previous]\n", prevName]; + } if (upName != nil) - [text appendFormat: @"[Up]\n", upName]; + { + if ([[upName pathExtension] isEqual: @"html"] == YES) + [text appendFormat: @"[Up]\n", upName]; + else + [text appendFormat: @"[Up]\n", upName]; + } if (nextName != nil) - [text appendFormat: @"[Next]\n", nextName]; + { + if ([[nextName pathExtension] isEqual: @"html"] == YES) + [text appendFormat: @"[Next]\n", nextName]; + else + [text appendFormat: @"[Next]\n", nextName]; + } [text appendFormat: @"

%@

\r\n", title]; @@ -1783,11 +1809,11 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt) NSString *ref = [self getProp: "id" fromNode: node]; NSString *type = [self getProp: "type" fromNode: node]; NSString *over = [self getProp: "override" fromNode: node]; -// NSString *role = [self getProp: "role" fromNode: node]; BOOL factory = [[self getProp: "factory" fromNode: node] boolValue]; BOOL desInit = [[self getProp: "init" fromNode: node] boolValue]; NSMutableString *lText = [NSMutableString string]; NSMutableString *sText = [NSMutableString string]; + BOOL isJava = (strcmp(node->name, "jmethod") == 0); NSString *desc = nil; NSArray *standards = nil; @@ -1796,56 +1822,117 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt) ref = [NSString stringWithFormat: @"method-%u", labelIndex++]; } - if (factory) + if (isJava) { - [lText appendString: @"+ ("]; - } - else - { - [lText appendString: @"- ("]; - } - if (type == nil) - type = @"id"; - [lText appendString: type]; - [lText appendString: @")"]; + NSMutableString *decl = [NSMutableString string]; + NSMutableString *args = [NSMutableString stringWithString: @"("]; + NSString *name = [self getProp: "name" fromNode: node]; - node = node->children; - while (node != 0 && strcmp(node->name, "sel") == 0) - { - NSString *sel = [self parseText: node->children]; + if (factory) + { + [decl appendString: @"static "]; + } + if (type == nil) + type = @"Object"; + [decl appendString: type]; + [decl appendString: @" "]; - if (sel == nil) return nil; - [sText appendString: sel]; - [lText appendFormat: @" %@", sel]; - node = node->next; - if (node != 0 && strcmp(node->name, "arg") == 0) + node = node->children; + while (node != 0 && strcmp(node->name, "arg") == 0) { NSString *arg = [self parseText: node->children]; NSString *typ = [self getProp: "type" fromNode: node]; - if (arg == nil) return nil; + if (arg == nil) break; + if ([args length] > 1) + { + [args appendString: @", "]; + } if (typ != nil) { - [lText appendFormat: @" (%@)%@", typ, arg]; + [args appendString: typ]; + [args appendString: @" "]; + } + [args appendString: arg]; + node = node->next; + } + if (node != 0 && strcmp(node->name, "vararg") == 0) + { + if ([args length] > 1) + { + [args appendString: @", ..."]; } else { - [lText appendString: @" "]; - [lText appendString: arg]; + [args appendString: @"..."]; } node = node->next; - if (node != 0 && strcmp(node->name, "vararg") == 0) - { - [lText appendString: @", ..."]; - node = node->next; - break; - } + } + [args appendString: @")"]; + + [lText appendString: decl]; + [lText appendString: @""]; + [lText appendString: name]; + [lText appendString: @""]; + [lText appendString: args]; + [sText appendString: decl]; + [sText appendString: name]; + [sText appendString: args]; + } + else + { + if (factory) + { + [lText appendString: @"+ ("]; } else { - break; /* Just a selector */ + [lText appendString: @"- ("]; + } + if (type == nil) + type = @"id"; + [lText appendString: type]; + [lText appendString: @")"]; + + node = node->children; + while (node != 0 && strcmp(node->name, "sel") == 0) + { + NSString *sel = [self parseText: node->children]; + + if (sel == nil) return nil; + [sText appendString: sel]; + [lText appendFormat: @" %@", sel]; + node = node->next; + if (node != 0 && strcmp(node->name, "arg") == 0) + { + NSString *arg = [self parseText: node->children]; + NSString *typ = [self getProp: "type" fromNode: node]; + + if (arg == nil) return nil; + if (typ != nil) + { + [lText appendFormat: @" (%@)%@", typ, arg]; + } + else + { + [lText appendString: @" "]; + [lText appendString: arg]; + } + node = node->next; + if (node != 0 && strcmp(node->name, "vararg") == 0) + { + [lText appendString: @", ..."]; + node = node->next; + break; + } + } + else + { + break; /* Just a selector */ + } } } + if (node != 0 && strcmp(node->name, "desc") == 0) { desc = [self parseDesc: node]; @@ -1856,22 +1943,29 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt) standards = [self parseStandards: node]; } - if (factory) + if (isJava) { - NSString *s = [@"+" stringByAppendingString: sText]; - [self setEntry: s withRef: ref inIndexOfType: @"method"]; + [self setEntry: sText withRef: ref inIndexOfType: @"method"]; } else { - NSString *s = [@"-" stringByAppendingString: sText]; - [self setEntry: s withRef: ref inIndexOfType: @"method"]; + if (factory) + { + NSString *s = [@"+" stringByAppendingString: sText]; + [self setEntry: s withRef: ref inIndexOfType: @"method"]; + } + else + { + NSString *s = [@"-" stringByAppendingString: sText]; + [self setEntry: s withRef: ref inIndexOfType: @"method"]; + } } [text appendFormat: @"

%@

\r\n", ref, sText]; if (desInit) { [text appendString: @"This is the designated initialiser
\r\n"]; } - [text appendFormat: @"%@
\r\n", lText]; + [text appendFormat: @"%@;
\r\n", lText]; if ([over isEqual: @"subclass"]) { [text appendString: @"Your subclass must override this " @@ -1946,7 +2040,11 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt) break; case XML_ELEMENT_NODE: - if (strcmp(node->name, "code") == 0 + if (strcmp(node->name, "br") == 0) + { + [text appendString: @"
"]; + } + else if (strcmp(node->name, "code") == 0 || strcmp(node->name, "em") == 0 || strcmp(node->name, "file") == 0 || strcmp(node->name, "site") == 0