libs-gsweb/GSWeb.framework/GSWResponse.h

163 lines
5.1 KiB
C
Raw Normal View History

/* GSWResponse.h - GSWeb: Class GSWResponse
Copyright (C) 1999 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
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.
*/
// $Id$
#ifndef _GSWResponse_h__
#define _GSWResponse_h__
//====================================================================
@protocol GSWActionResults
-(GSWResponse*)generateResponse;
@end
//====================================================================
@interface GSWResponse : NSObject <NSCopying>
{
@private
NSString* httpVersion;
unsigned int status;
NSMutableDictionary* headers;
NSMutableArray* contentFaults;
NSMutableData* contentData;
NSStringEncoding contentEncoding;
NSDictionary* userInfo;
NSMutableArray* cookies;
BOOL isClientCachingDisabled;
BOOL contentFaultsHaveBeenResolved;
BOOL isFinalizeInContextHasBeenCalled;
};
-(id)init;
-(void)dealloc;
-(id)copyWithZone:(NSZone*)zone_;
-(NSData*)content;
-(void)willSend;//NDFN
-(NSString*)headerForKey:(NSString*)key_;
-(NSArray*)headerKeys;
-(NSArray*)headersForKey:(NSString*)key_;
-(NSString*)httpVersion;
-(void)setContent:(NSData*)someData;
-(void)setHeader:(NSString*)header_
forKey:(NSString*)key_;
-(void)setHeaders:(NSArray*)headerList_
forKey:(NSString*)key_;
-(void)setHTTPVersion:(NSString*)version_;
-(void)setStatus:(unsigned int)status_;
-(void)setUserInfo:(NSDictionary*)userInfo_;
-(unsigned int)status;
-(NSDictionary*)userInfo;
-(NSString*)description;
-(void)disableClientCaching;
@end
//====================================================================
@interface GSWResponse (GSWContentConveniences)
-(void)appendContentBytes:(const void*)contentsBytes_
length:(unsigned)length_;
-(void)appendContentCharacter:(char)char_;
-(void)appendContentString:(NSString*)string_;
-(void)appendContentData:(NSData*)contentData_;
-(void)setContentEncoding:(NSStringEncoding)encoding_;
-(NSStringEncoding)contentEncoding;
@end
//====================================================================
@interface GSWResponse (GSWHTMLConveniences)
-(void)appendContentHTMLString:(NSString*)string_;
-(void)appendContentHTMLAttributeValue:(NSString*)string_;
-(void)appendContentHTMLConvertString:(NSString*)string_;
-(void)appendContentHTMLEntitiesConvertString:(NSString*)string_;
+(NSString*)stringByEscapingHTMLString:(NSString*)string_;
+(NSString*)stringByEscapingHTMLAttributeValue:(NSString*)string_;
+(NSString*)stringByConvertingToHTMLEntities:(NSString*)string_;
+(NSString*)stringByConvertingToHTML:(NSString*)string_;
@end
//====================================================================
@interface GSWResponse (Cookies)
-(NSString*)_formattedCookiesString;
-(NSMutableArray*)allocCookiesIFND;
-(void)addCookie:(GSWCookie*)cookie_;
-(void)removeCookie:(GSWCookie*)cookie_;
-(NSArray*)cookies;
-(NSArray*)cookiesHeadersValues;//NDFN
@end
//====================================================================
@interface GSWResponse (GSWResponseA)
-(BOOL)isFinalizeInContextHasBeenCalled;//NDFN
-(void)_finalizeInContext:(GSWContext*)context_;
-(void)_initContentData;
-(void)_appendContentAsciiString:(NSString*)_string;
@end
//====================================================================
@interface GSWResponse (GSWResponseB)
-(void)_resolveContentFaultsInContext:(GSWContext*)context_;
-(void)_appendContentFault:(id)_unknown;
@end
//====================================================================
@interface GSWResponse (GSWResponseC)
-(BOOL)_isClientCachingDisabled;
-(unsigned int)_contentDataLength;
@end
//====================================================================
@interface GSWResponse (GSWResponseD)
-(BOOL)_responseIsEqual:(GSWResponse*)response_;
@end
//====================================================================
@interface GSWResponse (GSWActionResults) <GSWActionResults>
-(GSWResponse*)generateResponse;
@end
//====================================================================
@interface GSWResponse (GSWResponseDefaultEncoding)
+(void)setDefaultEncoding:(NSStringEncoding)_encoding;
+(NSStringEncoding)defaultEncoding;
@end
2000-08-14 Manuel Guesdon <mguesdon@orange-concept.com> * GSWeb.framework/GSWApplication.m: added "exit" in terminate generate simple response in -handleException:inContext: be sure to have a context in -_handleException:inContext: generate simple response in -_handleException:inContext: generate simple response in -handlePageRestorationErrorInContext: be sure to have a context in -_handlePageRestorationErrorInContext: generate simple response in -_handlePageRestorationErrorInContext: generate simple response in -handleSessionCreationErrorInContext: generate simple response in -handleSessionRestorationErrorInContext: be sure to have a context in -_handleSessionRestorationErrorInContext: generate simple response in -_handleSessionRestorationErrorInContext: * GSWeb.framework/GSWComponentRequestHandler.m: added default response when we catch exceptions,... handle more exceptions * GSWeb.framework/GSWConstants.h/.m: added GSWHTTPHeader_UserAgent * GSWeb.framework/GSWDefaultAdaptor.m: terminate application if it is locked * GSWeb.framework/GSWDefaultAdaptorThread.m: Added default response to handle exceptions and various errors Correct bug in request data reading (request datas were sometimes not complely readen) * GSWeb.framework/GSWFileUpload.m: Added Exception handling * GSWeb.framework/GSWRequest.m: add exception handling * GSWeb.framework/GSWResponse.h/.m: added GSWResponse (GSWResponseError) * GSWAdaptor/Apache/GNUmakefile: added -DEAPI * GSWAdaptor/Apache/mod_gsweb.c: added debug traces * GSWAdaptor/common/GSWConfig.c/.h: added debug traces, added init parameter * Makefile.postamble: added docs generation * Doc/GNUstepWeb-HOWTO moved to howto.gsdoc * Doc/gsweb.gsdoc: new file * GSWeb.framework/Makefile.postamble: added docs generation * GSWExtensions.framework/Makefile.postamble: added docs generation * GSWExtensionsGSW.framework/Makefile.postamble: added docs generation git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@7244 72102866-910b-0410-8b05-ffd578937521
2000-08-25 10:36:16 +00:00
//====================================================================
@interface GSWResponse (GSWResponseError)
//NDFN
//Last cHance Response
+(GSWResponse*)responseWithMessage:(NSString*)message_
inContext:(GSWContext*)context_
forRequest:(GSWRequest*)request_;
@end
#endif //_GSWResponse_h__