Added GSPrintf()

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14714 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2002-10-11 09:14:14 +00:00
parent b517be3070
commit dfbdc838df
12 changed files with 241 additions and 92 deletions

View file

@ -53,7 +53,7 @@ main(int argc, char** argv, char **env)
if ([args count] <= 1)
{
NSLog(@"No file names given to parse.");
GSPrintf(stderr, @"No file names given to parse.\n");
}
else
{
@ -69,22 +69,23 @@ main(int argc, char** argv, char **env)
myString = [NSString stringWithContentsOfFile: file];
result = [myString propertyList];
if (result == nil)
NSLog(@"Parsing '%@' - nil property list", file);
GSPrintf(stderr, @"Parsing '%@' - nil property list\n", file);
else if ([result isKindOfClass: [NSDictionary class]] == YES)
NSLog(@"Parsing '%@' - a dictionary", file);
GSPrintf(stderr, @"Parsing '%@' - a dictionary\n", file);
else if ([result isKindOfClass: [NSArray class]] == YES)
NSLog(@"Parsing '%@' - an array", file);
GSPrintf(stderr, @"Parsing '%@' - an array\n", file);
else if ([result isKindOfClass: [NSData class]] == YES)
NSLog(@"Parsing '%@' - a data object", file);
GSPrintf(stderr, @"Parsing '%@' - a data object\n", file);
else if ([result isKindOfClass: [NSString class]] == YES)
NSLog(@"Parsing '%@' - a string", file);
GSPrintf(stderr, @"Parsing '%@' - a string\n", file);
else
NSLog(@"Parsing '%@' - unexpected class - %@",
file, [[result class] description]);
GSPrintf(stderr, @"Parsing '%@' - unexpected class - %@\n",
file, [[result class] description]);
}
NS_HANDLER
{
NSLog(@"Parsing '%@' - %@", file, [localException reason]);
GSPrintf(stderr, @"Parsing '%@' - %@\n", file,
[localException reason]);
}
NS_ENDHANDLER
}