Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

CharStream.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    CharStream.h
00006  *
00007  *  $Id: CharStream.h,v 1.1.1.1 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Nanbor Wang <nanbor@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef _ACEXML_CHARSTREAM_H_
00014 #define _ACEXML_CHARSTREAM_H_
00015 
00016 #include "ace/pre.h"
00017 #include "ACEXML/common/ACEXML_Export.h"
00018 
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 #pragma once
00021 #endif /* ACE_LACKS_PRAGMA_ONCE */
00022 #include "ACEXML/common/XML_Types.h"
00023 
00024 /**
00025  * @class ACEXML_CharStream CharStream.h "ACEXML/common/CharStream.h"
00026  *
00027  * ACEXML_CharStream is an abstract class (interface) which defines the
00028  * basic opertions a parser could use to retrieve XML charater sequence.
00029  * The sequence can be read from a file or a character buffer.
00030  */
00031 class ACEXML_Export ACEXML_CharStream
00032 {
00033 public:
00034 
00035   /**
00036    * Virtual destructor, must have.
00037    */
00038   virtual ~ACEXML_CharStream () = 0;
00039 
00040   /**
00041    * Returns the available ACEXML_Char in the buffer.  -1
00042    * if the object is not initialized properly.
00043    */
00044   virtual int available (void) = 0;
00045 
00046   /**
00047    * Close this stream and release all resources used by it.
00048    */
00049   virtual int close (void) = 0;
00050 
00051   /**
00052    * Read the next ACEXML_Char.  Return -1 if we are not able to
00053    * return an ACEXML_Char, 0 if EOS is reached, or 1 if succeed.
00054    */
00055   virtual int get (ACEXML_Char& ch) = 0;
00056 
00057   /**
00058    * Read the next batch of ACEXML_Char strings
00059    */
00060   virtual int read (ACEXML_Char *str,
00061                     size_t len) = 0;
00062 
00063   /**
00064    * Peek the next ACEXML_Char in the CharStream.  Return the
00065    * character if succeess, -1 if EOS is reached.
00066    */
00067   virtual int peek (void) = 0;
00068 
00069   /*
00070    * Get the character encoding for a byte stream or URI.
00071    */
00072   virtual const ACEXML_Char *getEncoding (void)  = 0;
00073 
00074 };
00075 
00076 #include "ace/post.h"
00077 
00078 
00079 #endif /* _ACEXML_CHARSTREAM_H_ */

Generated on Mon Jun 16 13:23:19 2003 for ACEXML by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002