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

InputSource.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    InputSource.h
00006  *
00007  *  $Id: InputSource.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_INPUTSOURCE_H_
00014 #define _ACEXML_INPUTSOURCE_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 
00023 #include "ACEXML/common/CharStream.h"
00024 
00025 /**
00026  * @class ACEXML_InputSource InputSource.h "ACEXML/common/InputSource.h"
00027  *
00028  * @brief ACEXML_InputSource encapsulates the actual input stream with some
00029  * added information.
00030  *
00031  * This class allows a SAX application to encapsulate information
00032  * about an input source in a single object, which may include a
00033  * public identifier, a system identifier, a byte stream (possibly
00034  * with a specified encoding), and/or a character stream.
00035  *
00036  * There are two places that the application will deliver this input
00037  * source to the parser: as the argument to the Parser.parse method,
00038  * or as the return value of the EntityResolver.resolveEntity method.
00039  *
00040  * The SAX parser will use the InputSource object to determine how to
00041  * read XML input. If there is a character stream available, the
00042  * parser will read that stream directly; if not, the parser will use
00043  * a byte stream, if available; if neither a character stream nor a
00044  * byte stream is available, the parser will attempt to open a URI
00045  * connection to the resource identified by the system identifier.
00046  *
00047  * An InputSource object belongs to the application: the SAX parser
00048  * shall never modify it in any way (it may modify a copy if
00049  * necessary).
00050  *
00051  * @sa ACEXML_CharStream
00052  */
00053 class ACEXML_Export ACEXML_InputSource
00054 {
00055 public:
00056   /*
00057    * Default constructor.
00058    */
00059   ACEXML_InputSource (void);
00060 
00061   /*
00062    * Create a new input source with a ACEXML_Char stream.
00063    * Notice that ACEXML_InputSource assumes the ownership
00064    * of <stream>
00065    */
00066   ACEXML_InputSource (ACEXML_CharStream *stream);
00067 
00068   /*
00069    * Create a new input source with a system identifier.
00070    */
00071   ACEXML_InputSource (const ACEXML_Char *systemId);
00072 
00073   /*
00074    * Default destructor.
00075    */
00076   virtual ~ACEXML_InputSource (void);
00077 
00078   /*
00079    * Get the ACEXML_Char stream for this input source.
00080    */
00081   virtual ACEXML_CharStream *getCharStream (void);
00082 
00083   /*
00084    * Get the character encoding for a byte stream or URI.
00085    */
00086   virtual const ACEXML_Char *getEncoding (void);
00087 
00088   /*
00089    * Get the public identifier for this input source.
00090    */
00091   virtual const ACEXML_Char *getPublicId (void);
00092 
00093   /*
00094    * Get the system identifier for this input source.
00095    */
00096   virtual const ACEXML_Char *getSystemId (void);
00097 
00098   /*
00099    * Set the ACEXML_Char stream for this input source.
00100    * Notice that ACEXML_InputSource assumes the ownership
00101    * of <stream>
00102    */
00103   virtual void setCharStream (ACEXML_CharStream *charStream);
00104 
00105   /*
00106    * Set the character encoding, if known.
00107    */
00108   virtual void setEncoding (const ACEXML_Char *encoding);
00109 
00110   /*
00111    * Set the public identifier for this input source.
00112    */
00113   virtual void setPublicId (const ACEXML_Char *publicId);
00114 
00115   /*
00116    * Set the public identifier for this input source.
00117    */
00118   virtual void setSystemId (const ACEXML_Char *systemId);
00119 
00120 private:
00121   ACEXML_Char *publicId_;
00122   ACEXML_Char *systemId_;
00123   ACEXML_CharStream *charStream_;
00124   ACEXML_Char *encoding_;
00125 };
00126 
00127 
00128 #include "ace/post.h"
00129 
00130 #endif /* _ACEXML_INPUTSOURCE_H_ */

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