com.svincent.moksa
Class Io

java.lang.Object
  |
  +--com.svincent.moksa.WamObject
        |
        +--com.svincent.moksa.Io

public class Io
extends WamObject

Provides the Prolog environment with an ISO I/O subsystem.


Inner Class Summary
static class Io.Close_2
          Closes the specified file.
static class Io.Current_input_1
          Unifies the given variable with the current input
static class Io.Current_output_1
          Unifies the given variable with the current output
static class Io.Flush_output_1
          Flushes the specified stream.
static class Io.Get_char_2
          Gets a character from the given output stream.
static class Io.Get_prolog_token_2
          Gets a Prolog token from the given output stream.
static class Io.Get_stream_properties_2
          get_stream_properties (S, Props)
static class Io.Nl_1
          Prints a newline to the given output stream.
static class Io.Open_4
          Opens the specified file.
static class Io.PrologInput
          An identifier for an input stream.
 class Io.PrologInputStream
          A wrapper for a Java InputStream.
static class Io.PrologOutput
          An identifier for an output stream.
static class Io.PrologOutputStream
           
 class Io.PrologReader
          A wrapper for a Java Reader.
static class Io.PrologWriter
           
static class Io.Put_char_2
          Puts the given character to the given output stream.
static class Io.StreamIdentifier
          An identifier for a currently open input or output stream.
static class Io.Write_2
          Writes its argument to the given output stream.
 
Field Summary
static int Append
          Modes
static int Read
          Modes
static int Write
          Modes
 
Constructor Summary
Io(PrologEngine _engine, java.io.InputStream _in, java.io.OutputStream _out)
           
 
Method Summary
 Io.StreamIdentifier getStream(PrologTerm term)
          Retrieves a StreamIdentifier, given a PrologTerm.
 Io.PrologInputStream openInput(java.lang.String uri, java.io.InputStream in, CompoundTerm options)
           
 Io.PrologReader openInput(java.lang.String uri, java.io.Reader in, CompoundTerm options)
           
 Io.PrologInput openInputUri(java.lang.String uri)
          Open an URI, with a list of options.
 Io.PrologInput openInputUri(java.lang.String uri, CompoundTerm options)
          Open an URI, with a list of options.
 Io.PrologOutputStream openOutput(java.lang.String uri, java.io.OutputStream out, CompoundTerm options)
           
 Io.PrologWriter openOutput(java.lang.String uri, java.io.Writer out, CompoundTerm options)
           
 Io.PrologOutput openOutputUri(java.lang.String uri, boolean append)
           
 Io.PrologOutput openOutputUri(java.lang.String uri, CompoundTerm options, boolean append)
           
 Io.PrologInput openString(java.lang.String s)
           
 Io.PrologInput openString(java.lang.String s, CompoundTerm options)
          Open a String as an input source, with a list of options.
static int parseModeName(java.lang.String modeName)
          Parses the mode name, returns -1 on error.
 
Methods inherited from class com.svincent.moksa.WamObject
tag, tag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Read

public static final int Read
Modes

Write

public static final int Write
Modes

Append

public static final int Append
Modes
Constructor Detail

Io

public Io(PrologEngine _engine,
          java.io.InputStream _in,
          java.io.OutputStream _out)
Method Detail

openInputUri

public Io.PrologInput openInputUri(java.lang.String uri)
                            throws java.io.IOException
Open an URI, with a list of options. If the options list is null or empty, defaults are assumed.

openInputUri

public Io.PrologInput openInputUri(java.lang.String uri,
                                   CompoundTerm options)
                            throws java.io.IOException
Open an URI, with a list of options. If the options list is null or empty, defaults are assumed.

openString

public Io.PrologInput openString(java.lang.String s)
                          throws java.io.IOException

openString

public Io.PrologInput openString(java.lang.String s,
                                 CompoundTerm options)
                          throws java.io.IOException
Open a String as an input source, with a list of options. If the options list is null or empty, defaults are assumed. This method allows parsing from a string, etc.

openInput

public Io.PrologReader openInput(java.lang.String uri,
                                 java.io.Reader in,
                                 CompoundTerm options)

openInput

public Io.PrologInputStream openInput(java.lang.String uri,
                                      java.io.InputStream in,
                                      CompoundTerm options)

openOutputUri

public Io.PrologOutput openOutputUri(java.lang.String uri,
                                     boolean append)
                              throws java.io.IOException

openOutputUri

public Io.PrologOutput openOutputUri(java.lang.String uri,
                                     CompoundTerm options,
                                     boolean append)
                              throws java.io.IOException

openOutput

public Io.PrologWriter openOutput(java.lang.String uri,
                                  java.io.Writer out,
                                  CompoundTerm options)

openOutput

public Io.PrologOutputStream openOutput(java.lang.String uri,
                                        java.io.OutputStream out,
                                        CompoundTerm options)

getStream

public Io.StreamIdentifier getStream(PrologTerm term)

Retrieves a StreamIdentifier, given a PrologTerm.

If the given term is itself a StreamIdentifier, just return it. If it is an atom, and the given atom has been used as a stream alias for a currently open stream, return that stream. Otherwise, return null.


parseModeName

public static int parseModeName(java.lang.String modeName)
Parses the mode name, returns -1 on error.



This is documentation for Moksa Prolog, which can be found at http://www.svincent.com/moksa/

Copyright © 1999 Shawn P. Vincent.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.