2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
25 #include "NGTaskStream.h"
27 @implementation NGTaskStream
29 - (id)initWithPath:(NSString *)_executable
30 arguments:(NSArray *)_args
31 environment:(NSDictionary *)_env
43 return [self->task isRunning];
48 - (unsigned)readBytes:(void *)_buf count:(unsigned)_len {
51 - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len {
57 NSLog(@"tried to close already closed stream %@", self);
60 [self->task terminate];
64 - (NGStreamMode)mode {
65 return NGStreamMode_readWrite;
67 - (BOOL)isRootStream {
74 NSLog(@"WARNING: called mark on a stream which doesn't support marking !");
78 [[[NGStreamException alloc] initWithStream:self
79 reason:@"marking not supported"] raise];
82 - (BOOL)markSupported {
88 - (NSString *)description {
89 return [NSString stringWithFormat:
90 @"<%@[0x%08X] task=%@ mode=%@>",
91 NSStringFromClass([self class]), (unsigned)self,
93 [self modeDescription]];
96 @end /* NGTaskStream */