IOService Struct Reference
[I/O Services.]

Inherits CoreFileServer.

Inherited by IOImpl.

List of all members.

Public Methods

virtual bool mountFilesystem (const Char *name, const Char *path)=0
virtual void unmountFilesystem (const Char *name)=0
virtual void associate (const Char *type, const Char *rw)=0
virtual InputStreamcreateInputStream (const Char *filename)=0
virtual OutputStreamcreateOutputStream (const Char *filename)=0
virtual ServicefromFile (const Char *filename)=0
virtual ServicefromStream (InputStream *s, const Char *type)=0
virtual bool toFile (Service *srv, const Char *filename)=0
virtual bool toStream (Service *srv, OutputStream *os, const Char *type)=0
virtual bool runStream (InputStream *s, Context *context=0)=0
virtual DirectorygetDirectory (const Char *path)=0


Detailed Description

Data management service.


Member Function Documentation

virtual void IOService::associate const Char   type,
const Char   rw
[pure virtual]
 

Associate a file extension with a particular ReaderWriter service.

virtual InputStream* IOService::createInputStream const Char   filename [pure virtual]
 

Open an input stream on a file. For many services, you may use fromFile() instead.

virtual OutputStream* IOService::createOutputStream const Char   filename [pure virtual]
 

Open an output stream to a new file.

virtual Service* IOService::fromFile const Char   filename [pure virtual]
 

Load an object from a disk file. Uses the file extension to locate a ReaderWriter.

virtual Service* IOService::fromStream InputStream   s,
const Char   type
[pure virtual]
 

Load an object from an input stream.

Parameters:
s  The input stream.
type  A type string used to locate a reader for this service. This is usually the file extension associated with the data type, such as "png" for PNG image files.
Returns:
The loaded service is successful, NULL otherwise.

virtual Directory* IOService::getDirectory const Char   path [pure virtual]
 

Access a directory of files.

virtual bool IOService::mountFilesystem const Char   name,
const Char   path
[pure virtual]
 

Add a new file source.

Parameters:
name  A unique name for the mount point. If a previous mount uses the same name it will be overwritten.
path  The mount point. This may be a directory or (eventually) an archive like a .zip file.
Returns:
True if successful, false if the mount point could not be found or accessed.
Once the filesystem has been mounted, you can access it by name:
 Ref<InputStream> s = io:createInputStream("<I>fsname/filename</I>");

virtual bool IOService::runStream InputStream   s,
Context   context = 0
[pure virtual]
 

Read and execute script code from an input stream.

virtual bool IOService::toFile Service   srv,
const Char   filename
[pure virtual]
 

Write an object to a disk file. Uses the file extension to locate a ReaderWriter.

virtual bool IOService::toStream Service   srv,
OutputStream   os,
const Char   type
[pure virtual]
 

Write an object to an output stream.

Parameters:
srv  The object to write.
os  The output stream
type  A type string is used to locate a writer for this service. This is usually the file extension associated with the file format, such as "png" for PNG image files.

virtual void IOService::unmountFilesystem const Char   name [pure virtual]
 

Remove a file source.


The documentation for this struct was generated from the following file:


Flat Four Engine
Copyright (C) 2001 by 379, Inc.
This page generated by Doxygen