([Coder -initForReadingFromFile:filename]): New method.

([Coder -initForWritingToFile:filename]): New method.
([Coder -closeCoder]): New method.
([Coder -isClosed]): New method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@814 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Andrew McCallum 1996-01-25 15:27:30 +00:00
parent 9bd48868b3
commit 57298e58f9

View file

@ -225,6 +225,13 @@ my_object_is_class(id object)
formatVersion: DEFAULT_FORMAT_VERSION];
}
- initForReadingFromFile: (id <String>) filename
{
return [self initForReadingFromStream:
[StdioStream streamWithFilename: filename
fmode: "r"]];
}
- initForWritingToStream: (id <Streaming>) s
formatVersion: (int) version
{
@ -242,6 +249,13 @@ my_object_is_class(id object)
formatVersion: DEFAULT_FORMAT_VERSION];
}
- initForWritingToFile: (id <String>) filename
{
return [self initForWritingToStream:
[StdioStream streamWithFilename: filename
fmode: "w"]];
}
+ coderWritingToStream: (id <Streaming>)s
{
return [[[self alloc] initForWritingToStream: s]
@ -1158,6 +1172,18 @@ exc_return_null(arglist_t f)
}
}
/* We must separate the idea of "closing" a coder and "deallocating"
a coder because of delays in deallocation due to -autorelease. */
- (void) closeCoder
{
[[cstream stream] closeStream];
}
- (BOOL) isClosed
{
return [[cstream stream] isClosed];
}
- (void) dealloc
{
/* xxx No. [self _finishDecodeRootObject]; */