/** GSWResourceManager.m -
GSWeb: Class GSWResourceManager
Copyright (C) 1999-2005 Free Software Foundation, Inc.
Written by: Manuel Guesdon
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#include "config.h"
RCS_ID("$Id$")
#include "GSWeb.h"
#include
#include
static NSString * emptyStr=@"";
//====================================================================
@implementation GSWResourceManager
GSWBundle* globalAppGSWBundle=nil;
GSWProjectBundle* globalAppProjectBundle=nil;
NSDictionary* globalMime=nil;
NSString* globalMimePListPathName=nil;
NSDictionary* localGS2ISOLanguages=nil;
NSDictionary* localISO2GSLanguages=nil;
NSString* globalLanguagesPListPathName=nil;
NSString* localNotFoundMarker=@"NOTFOUND";
//--------------------------------------------------------------------
+(void)initialize
{
if (self==[GSWResourceManager class])
{
NSBundle* mainBundle=nil;
GSWDeployedBundle* deployedBundle=nil;
//if ((self=[[super superclass] initialize]))
{
NSString* bundlePath=nil;
mainBundle=[GSWApplication mainBundle];
bundlePath=[mainBundle bundlePath];
deployedBundle=(GSWDeployedBundle*)[GSWDeployedBundle bundleWithPath:bundlePath];
globalAppProjectBundle=[[deployedBundle projectBundle] retain];
NSAssert(globalAppProjectBundle,@"no globalAppProjectBundle");
//call deployedBundle bundlePath
//call globalAppProjectBundle bundlePath
//call isDebuggingEnabled
};
};
};
//--------------------------------------------------------------------
-(id)init
{
if ((self=[super init]))
{
//TODO NSBundle* mainBundle=[NSBundle mainBundle];
NSArray* allFrameworks=[NSBundle allFrameworks];
int i=0;
int allFrameworksCount=[allFrameworks count];
NSString* bundlePath=nil;
NSBundle* bundle=nil;
NSDictionary* infoDictionary=nil;
for(i=0;i",
object_getClassName(self),
(void*)self,
(void*)_frameworkProjectBundlesCache,
_appURLs,
_frameworkURLs,
_appPaths,
_frameworkPaths,
_urlValuedElementsData,
_frameworkClassPaths];
}
NS_HANDLER
{
//TODO
[self unlock];
[localException raise];
}
NS_ENDHANDLER;
[self unlock];
return dscr;
};
//--------------------------------------------------------------------
-(void)_initFrameworkProjectBundles
{
//OK
NSArray* allFrameworks=nil;
int i=0;
int allFrameworksCount=0;
NSBundle* bundle=nil;
NSString* frameworkName=nil;
allFrameworks=[NSBundle allFrameworks];
allFrameworksCount=[allFrameworks count];
for(i=0;i