FileHandle subclass

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7526 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2000-09-16 20:31:32 +00:00
parent 241df24284
commit 645e311da1
2 changed files with 1452 additions and 0 deletions

View file

@ -0,0 +1,98 @@
/* Interface for WindowsFileHandle for GNUStep
Copyright (C) 1997 Free Software Foundation, Inc.
Written by: Richard Frith-Macdonald <richard@brainstorm.co.uk>
Date: 1997
This file is part of the GNUstep Base 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., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
*/
#ifndef __WindowsFileHandle_h_GNUSTEP_BASE_INCLUDE
#define __WindowsFileHandle_h_GNUSTEP_BASE_INCLUDE
#include <Foundation/NSFileHandle.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSDictionary.h>
#include <Foundation/NSRunLoop.h>
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
@interface WindowsFileHandle : NSFileHandle <RunLoopEvents>
{
HANDLE handle;
int descriptor;
BOOL closeOnDealloc;
BOOL isStandardFile;
BOOL isNullDevice;
BOOL isNonBlocking;
BOOL wasNonBlocking;
BOOL acceptOK;
BOOL connectOK;
BOOL readOK;
BOOL writeOK;
NSMutableDictionary *readInfo;
int readPos;
NSMutableArray *writeInfo;
int writePos;
NSString *address;
NSString *service;
NSString *protocol;
}
- (id)initAsClientAtAddress:address
service:service
protocol:protocol;
- (id)initAsClientInBackgroundAtAddress:address
service:service
protocol:protocol
forModes:modes;
- (id)initAsServerAtAddress:address
service:service
protocol:protocol;
- (id)initForReadingAtPath:(NSString*)path;
- (id)initForWritingAtPath:(NSString*)path;
- (id)initForUpdatingAtPath:(NSString*)path;
- (id)initWithStandardError;
- (id)initWithStandardInput;
- (id)initWithStandardOutput;
- (id)initWithNullDevice;
- (void)checkAccept;
- (void)checkConnect;
- (void)checkRead;
- (void)checkWrite;
- (void)ignoreReadDescriptor;
- (void)ignoreWriteDescriptor;
- (void)setNonBlocking:(BOOL)flag;
- (void)postReadNotification;
- (void)postWriteNotification;
- (void)receivedEvent: (void*)data
type: (RunLoopEventType)type
extra: (void*)extra
forMode: (NSString*)mode;
- (NSDate*)timedOutEvent: (void*)data
type: (RunLoopEventType)type
forMode: (NSString*)mode;
- (void)watchReadDescriptorForModes:(NSArray*)modes;
- (void)watchWriteDescriptor;
@end
#endif /* __WindowsFileHandle_h_GNUSTEP_BASE_INCLUDE */

1354
Source/WindowsFileHandle.m Normal file

File diff suppressed because it is too large Load diff