/usr/include/GNUstep/NGStreams/NGFileStream.h is in libsope-dev 3.2.10-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | /*
Copyright (C) 2000-2005 SKYRIX Software AG
This file is part of SOPE.
SOPE is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
SOPE 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with SOPE; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#ifndef __NGStreams_NGFileStream_H__
#define __NGStreams_NGFileStream_H__
/*
NGFileStream
NGFileStream is a stream which allows reading/writing local files.
*/
#if defined(__MINGW32__) && defined(HAVE_WINDOWS_H)
# include <windows.h>
#endif
#ifdef HAVE_POLL_H
# include <poll.h>
#endif
#ifdef HAVE_SYS_POLL_H
# include <sys/poll.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#if defined(__MINGW32__)
# include <winsock.h>
#endif
#include <NGStreams/NGStreamsDecls.h>
#include <NGStreams/NGStream.h>
#include <NGStreams/NGStreamProtocols.h>
@class NSFileHandle;
NGStreams_EXPORT NSString *NGFileReadOnly;
NGStreams_EXPORT NSString *NGFileWriteOnly;
NGStreams_EXPORT NSString *NGFileReadWrite;
NGStreams_EXPORT NSString *NGFileAppend;
NGStreams_EXPORT NSString *NGFileReadAppend;
NGStreams_EXPORT id<NGInputStream> NGIn;
NGStreams_EXPORT id<NGOutputStream> NGOut;
NGStreams_EXPORT id<NGOutputStream> NGErr;
NGStreams_EXPORT void NGInitStdio(void);
@interface NGFileStream : NGStream < NGPositionableStream >
{
@private
#if defined(__MINGW32__)
HANDLE fh; // Windows file handle
#else
int fd; // Unix file descriptor
#endif
NGStreamMode streamMode;
NSString *systemPath;
NSFileHandle *handle; // not retained !
int markDelta; // tracks mark, for marking (special value -1)
}
- (id)initWithPath:(NSString *)_path;
- (id)initWithFileHandle:(NSFileHandle *)_handle; // use with care !
// throws
// NGUnknownStreamModeException when _mode is invalid
// NGCouldNotOpenStreamException when the file could not be opened
- (BOOL)openInMode:(NSString *)_mode;
- (BOOL)isOpen;
// Foundation file handles
- (NSFileHandle *)fileHandle;
- (int)fileDescriptor;
#if defined(__MINGW32__)
- (HANDLE)windowsFileHandle;
#endif
// primitives
// throws
// NGWriteOnlyStreamException when the stream is not readable
// NGStreamNotOpenException when the stream is not open
// NGEndOfStreamException when the end of the stream is reached
// NGReadErrorException when the read call failed
- (unsigned)readBytes:(void *)_buf count:(unsigned)_len;
// throws
// NGReadOnlyStreamException when the stream is not writeable
// NGStreamNotOpenException when the stream is not open
// NGWriteErrorException when the write call failed
- (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len;
// throws NGCouldNotCloseStreamException when the close call failed
- (BOOL)close;
- (NGStreamMode)mode;
- (BOOL)isRootStream;
// blocking
- (BOOL)wouldBlockInMode:(NGStreamMode)_mode; // not supported with Windows
// marking
- (BOOL)mark;
- (BOOL)rewind;
- (BOOL)markSupported; // returns YES
// NGPositionableStream
// throws
// NGStreamSeekErrorException
- (BOOL)moveToLocation:(unsigned)_location; // note that absolute moves delete marks
// throws
// NGStreamSeekErrorException
- (BOOL)moveByOffset:(int)_delta;
@end
#endif /* __NGStreams_NGFileStream_H__ */
|