mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Attempt to allow documentation to be generated for uninstalled base package.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29655 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
563261266c
commit
43bcaac3ad
5 changed files with 64 additions and 10 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2010-02-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Headers/Additions/GNUstepBase/GSXML.h:
|
||||||
|
* Source/Additions/GSXML.m: new method to allow an additional DTD
|
||||||
|
directory to be set for the parser.
|
||||||
|
* Tools/autogsdoc.m: Add flag to allow command line setting of extra
|
||||||
|
DTD directory.
|
||||||
|
* Source/DocMakefile: Set extra DTD directory to the Tools directory
|
||||||
|
so that gsdoc DTDs can be found even when they haven't been installed.
|
||||||
|
|
||||||
2010-02-16 Niels Grewe <niels.grewe@halbordnung.de>
|
2010-02-16 Niels Grewe <niels.grewe@halbordnung.de>
|
||||||
|
|
||||||
* Source/Additions/GSXML.m:
|
* Source/Additions/GSXML.m:
|
||||||
|
|
|
@ -206,6 +206,7 @@ extern "C" {
|
||||||
withContentsOfURL: (NSURL*)url;
|
withContentsOfURL: (NSURL*)url;
|
||||||
+ (GSXMLParser*) parserWithSAXHandler: (GSSAXHandler*)handler
|
+ (GSXMLParser*) parserWithSAXHandler: (GSSAXHandler*)handler
|
||||||
withData: (NSData*)data;
|
withData: (NSData*)data;
|
||||||
|
+ (void) setDTDs: (NSString*)aPath;
|
||||||
+ (NSString*) xmlEncodingStringForStringEncoding: (NSStringEncoding)encoding;
|
+ (NSString*) xmlEncodingStringForStringEncoding: (NSStringEncoding)encoding;
|
||||||
|
|
||||||
- (void) abortParsing;
|
- (void) abortParsing;
|
||||||
|
|
|
@ -1619,6 +1619,10 @@ static NSMapTable *nodeNames = 0;
|
||||||
*/
|
*/
|
||||||
@implementation GSXMLParser
|
@implementation GSXMLParser
|
||||||
|
|
||||||
|
/* To override location for DTDs
|
||||||
|
*/
|
||||||
|
static NSString *dtdPath = nil;
|
||||||
|
|
||||||
static NSString *endMarker = @"At end of incremental parse";
|
static NSString *endMarker = @"At end of incremental parse";
|
||||||
|
|
||||||
+ (void) initialize
|
+ (void) initialize
|
||||||
|
@ -1777,6 +1781,15 @@ static NSString *endMarker = @"At end of incremental parse";
|
||||||
withData: data]);
|
withData: data]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Sets a directory in which to look for DTDs when resolving external
|
||||||
|
* references. Can be used whjen DTDs have not been installed in the
|
||||||
|
* normal locatioons.
|
||||||
|
*/
|
||||||
|
+ (void) setDTDs: (NSString*)aPath
|
||||||
|
{
|
||||||
|
ASSIGNCOPY(dtdPath, aPath);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the name of the string encoding (for XML) to use for the
|
* Return the name of the string encoding (for XML) to use for the
|
||||||
* specified OpenStep encoding.
|
* specified OpenStep encoding.
|
||||||
|
@ -2541,16 +2554,28 @@ loadEntityFunction(void *ctx,
|
||||||
range: r];
|
range: r];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dtdPath != nil)
|
||||||
|
{
|
||||||
|
found = [dtdPath stringByAppendingPathComponent: name];
|
||||||
|
found = [found stringByAppendingPathExtension: @"dtd"];
|
||||||
|
if (![[NSFileManager defaultManager] fileExistsAtPath: found])
|
||||||
|
{
|
||||||
|
found = nil;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (found == nil)
|
||||||
|
{
|
||||||
#ifdef GNUSTEP
|
#ifdef GNUSTEP
|
||||||
found = [NSBundle pathForLibraryResource: name
|
found = [NSBundle pathForLibraryResource: name
|
||||||
ofType: @"dtd"
|
ofType: @"dtd"
|
||||||
inDirectory: @"DTDs"];
|
inDirectory: @"DTDs"];
|
||||||
#else
|
#else
|
||||||
found = [[NSBundle bundleForClass: NSClassFromString(@"GSXMLNode")]
|
found = [[NSBundle bundleForClass: [GSXMLNode class]
|
||||||
pathForResource: name
|
pathForResource: name
|
||||||
ofType: @"dtd"
|
ofType: @"dtd"
|
||||||
inDirectory: @"DTDs"];
|
inDirectory: @"DTDs"];
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
if (found == nil)
|
if (found == nil)
|
||||||
{
|
{
|
||||||
NSLog(@"unable to find GNUstep DTD - '%@' for '%s'", name, eid);
|
NSLog(@"unable to find GNUstep DTD - '%@' for '%s'", name, eid);
|
||||||
|
@ -2566,9 +2591,20 @@ loadEntityFunction(void *ctx,
|
||||||
*/
|
*/
|
||||||
if (file == nil)
|
if (file == nil)
|
||||||
{
|
{
|
||||||
file = [[NSBundle mainBundle] pathForResource: local
|
if (dtdPath != nil)
|
||||||
ofType: @""
|
{
|
||||||
inDirectory: @"DTDs"];
|
file = [dtdPath stringByAppendingPathComponent: local];
|
||||||
|
if (![[NSFileManager defaultManager] fileExistsAtPath: local])
|
||||||
|
{
|
||||||
|
file = nil;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (file == nil)
|
||||||
|
{
|
||||||
|
file = [[NSBundle mainBundle] pathForResource: local
|
||||||
|
ofType: @""
|
||||||
|
inDirectory: @"DTDs"];
|
||||||
|
}
|
||||||
if (file == nil)
|
if (file == nil)
|
||||||
{
|
{
|
||||||
file = [NSBundle pathForLibraryResource: local
|
file = [NSBundle pathForLibraryResource: local
|
||||||
|
|
|
@ -202,6 +202,7 @@ BaseAdditions_AGSDOC_FLAGS = \
|
||||||
-HeaderDirectory ../Headers/Additions/GNUstepBase \
|
-HeaderDirectory ../Headers/Additions/GNUstepBase \
|
||||||
-Declared GNUstepBase \
|
-Declared GNUstepBase \
|
||||||
-Standards YES \
|
-Standards YES \
|
||||||
|
-DTDs ../Tools \
|
||||||
-ConstantsTemplate TypesAndConstants \
|
-ConstantsTemplate TypesAndConstants \
|
||||||
-FunctionsTemplate Functions \
|
-FunctionsTemplate Functions \
|
||||||
-MacrosTemplate Functions \
|
-MacrosTemplate Functions \
|
||||||
|
|
|
@ -809,6 +809,8 @@ main(int argc, char **argv, char **env)
|
||||||
@"\t\tBOOL\t(NO)\n\tif YES, create documentation pages "
|
@"\t\tBOOL\t(NO)\n\tif YES, create documentation pages "
|
||||||
@"for display in HTML frames",
|
@"for display in HTML frames",
|
||||||
@"MakeFrames",
|
@"MakeFrames",
|
||||||
|
@"\t\tString\t(nil)\n\tIf set, look for DTDs in the given directory",
|
||||||
|
@"DTDs",
|
||||||
nil];
|
nil];
|
||||||
argSet = [NSSet setWithArray: [argsRecognized allKeys]];
|
argSet = [NSSet setWithArray: [argsRecognized allKeys]];
|
||||||
argsGiven = [[NSProcessInfo processInfo] arguments];
|
argsGiven = [[NSProcessInfo processInfo] arguments];
|
||||||
|
@ -853,6 +855,10 @@ main(int argc, char **argv, char **env)
|
||||||
|
|
||||||
mgr = [NSFileManager defaultManager];
|
mgr = [NSFileManager defaultManager];
|
||||||
|
|
||||||
|
if ([GSXMLParser respondsToSelector: @selector(setDTDs:)])
|
||||||
|
{
|
||||||
|
[GSXMLParser setDTDs: [defs stringForKey: @"DTDs"]];
|
||||||
|
}
|
||||||
|
|
||||||
verbose = [defs boolForKey: @"Verbose"];
|
verbose = [defs boolForKey: @"Verbose"];
|
||||||
warn = [defs boolForKey: @"Warn"];
|
warn = [defs boolForKey: @"Warn"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue