mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 17:12:03 +00:00
Tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14475 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0bdbf81f1a
commit
8b683db39b
2 changed files with 70 additions and 27 deletions
|
@ -796,7 +796,8 @@ fail:
|
||||||
/**
|
/**
|
||||||
* We initially assume that the location of a source file is the
|
* We initially assume that the location of a source file is the
|
||||||
* same as the header, but if there is no file at that location,
|
* same as the header, but if there is no file at that location,
|
||||||
* we expect the source to be in the current directory instead.
|
* we expect the source to be in the documentatation directory
|
||||||
|
* or the current directory instead.
|
||||||
*/
|
*/
|
||||||
path = [fileName stringByDeletingPathExtension];
|
path = [fileName stringByDeletingPathExtension];
|
||||||
path = [path stringByAppendingPathExtension: @"m"];
|
path = [path stringByAppendingPathExtension: @"m"];
|
||||||
|
@ -805,7 +806,23 @@ fail:
|
||||||
path = [path lastPathComponent];
|
path = [path lastPathComponent];
|
||||||
if ([mgr isReadableFileAtPath: path] == NO)
|
if ([mgr isReadableFileAtPath: path] == NO)
|
||||||
{
|
{
|
||||||
path = nil; // No default source file found.
|
NSUserDefaults *defs;
|
||||||
|
NSString *ddir;
|
||||||
|
|
||||||
|
defs = [NSUserDefaults standardUserDefaults];
|
||||||
|
ddir = [defs stringForKey: @"DocumentationDirectory"];
|
||||||
|
if ([ddir length] > 0)
|
||||||
|
{
|
||||||
|
path = [ddir stringByAppendingPathComponent: path];
|
||||||
|
if ([mgr isReadableFileAtPath: path] == NO)
|
||||||
|
{
|
||||||
|
path = nil; // No default source file found.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
path = nil; // No default source file found.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (path != nil)
|
if (path != nil)
|
||||||
|
@ -2645,36 +2662,60 @@ fail:
|
||||||
* header.
|
* header.
|
||||||
*/
|
*/
|
||||||
mgr = [NSFileManager defaultManager];
|
mgr = [NSFileManager defaultManager];
|
||||||
if ([mgr isReadableFileAtPath: line] == NO)
|
if ([line isAbsolutePath] == YES)
|
||||||
{
|
{
|
||||||
if ([line isAbsolutePath] == YES)
|
if ([mgr isReadableFileAtPath: line] == NO)
|
||||||
{
|
{
|
||||||
[self log: @"AutogsdocSource: %@ not found!",
|
[self log: @"AutogsdocSource: %@ not found!",
|
||||||
line];
|
line];
|
||||||
line = nil;
|
line = nil;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
NSString *p;
|
{
|
||||||
|
NSString *p;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try forming a path relative to the
|
* Try forming a path relative to the header.
|
||||||
* header file if the source file was not
|
*/
|
||||||
* found in the specified location.
|
p = [info objectForKey: @"Header"];
|
||||||
*/
|
p = [p stringByDeletingLastPathComponent];
|
||||||
p = [info objectForKey: @"Header"];
|
p = [p stringByAppendingPathComponent: line];
|
||||||
p = [p stringByDeletingLastPathComponent];
|
if ([mgr isReadableFileAtPath: p] == YES)
|
||||||
p = [p stringByAppendingPathComponent: line];
|
{
|
||||||
if ([mgr isReadableFileAtPath: p] == NO)
|
line = p;
|
||||||
|
}
|
||||||
|
else if ([mgr isReadableFileAtPath: line] == NO)
|
||||||
|
{
|
||||||
|
NSUserDefaults *defs;
|
||||||
|
NSString *ddir;
|
||||||
|
NSString *old = p;
|
||||||
|
|
||||||
|
defs = [NSUserDefaults standardUserDefaults];
|
||||||
|
ddir = [defs stringForKey:
|
||||||
|
@"DocumentationDirectory"];
|
||||||
|
if ([ddir length] > 0)
|
||||||
{
|
{
|
||||||
[self log: @"AutogsdocSource: %@ not "
|
p = [ddir stringByAppendingPathComponent:
|
||||||
@"found (tried %@ too)!",
|
line];
|
||||||
line, p];
|
if ([mgr isReadableFileAtPath: p] == YES)
|
||||||
line = nil;
|
{
|
||||||
|
line = p;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[self log: @"AutogsdocSource: %@ not "
|
||||||
|
@"found (tried %@ and %@ too)!",
|
||||||
|
line, old, p];
|
||||||
|
line = nil;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
line = p;
|
[self log: @"AutogsdocSource: %@ not "
|
||||||
|
@"found (tried %@ too)!",
|
||||||
|
line, old];
|
||||||
|
line = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,9 +29,10 @@
|
||||||
<p>
|
<p>
|
||||||
The simple way to use this is to run the command with one or more
|
The simple way to use this is to run the command with one or more
|
||||||
header file names as arguments ... the tool will automatically
|
header file names as arguments ... the tool will automatically
|
||||||
parse corresponding source files in the same directory (or the
|
parse corresponding source files in the same directory as the
|
||||||
directory specified using the DocumentationDirectory default),
|
headers (or the current directory, or the directory specified
|
||||||
and produce gsdoc files as output.<br />
|
using the DocumentationDirectory default), and produce gsdoc
|
||||||
|
files as output.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Even without any human assistance, this tool will produce skeleton
|
Even without any human assistance, this tool will produce skeleton
|
||||||
|
@ -61,9 +62,10 @@
|
||||||
multiple source files.<br />
|
multiple source files.<br />
|
||||||
If a file name is absolute, it is used just as supplied.<br />
|
If a file name is absolute, it is used just as supplied.<br />
|
||||||
If on the other hand, it is a relative path, the software looks for
|
If on the other hand, it is a relative path, the software looks for
|
||||||
the source file first relative to the direcotory in which autogsdoc
|
the source file first relative to the location of the header file,
|
||||||
is running and then, if not found there, relative to the directory
|
and if not found there, relative to the current directory in which
|
||||||
in which the header file is located.
|
autogsdoc is running, and finally relative to the directory
|
||||||
|
specified by the DocumentationDirectory default.
|
||||||
</item>
|
</item>
|
||||||
<item><strong><abstract></strong>
|
<item><strong><abstract></strong>
|
||||||
An abstract of the content of the document ... placed in the head
|
An abstract of the content of the document ... placed in the head
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue