InputSource.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    InputSource.h
00006  *
00007  *  InputSource.h,v 1.7 2005/02/14 10:52:08 jwillemsen 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   /**
00063    * Create a new input source with a ACEXML_Char stream.
00064    * Notice that ACEXML_InputSource assumes the ownership
00065    * of <stream>
00066    */
00067   explicit ACEXML_InputSource (ACEXML_CharStream *stream);
00068 
00069   /**
00070    * Create a new input source with a system identifier.
00071    */
00072   ACEXML_InputSource (const ACEXML_Char *systemId);
00073 
00074   /**
00075    * Default destructor.
00076    */
00077   virtual ~ACEXML_InputSource (void);
00078 
00079   /**
00080    * Get the ACEXML_Char stream for this input source.
00081    */
00082   virtual ACEXML_CharStream *getCharStream (void) const;
00083 
00084   /**
00085    * Get the character encoding for a byte stream or URI.
00086    */
00087   virtual const ACEXML_Char *getEncoding (void) const;
00088 
00089   /**
00090    * Get the public identifier for this input source.
00091    */
00092   virtual const ACEXML_Char *getPublicId (void) const;
00093 
00094   /**
00095    * Get the system identifier for this input source.
00096    */
00097   virtual const ACEXML_Char *getSystemId (void) const;
00098 
00099   /**
00100    * Set the ACEXML_Char stream for this input source.
00101    * Notice that ACEXML_InputSource assumes the ownership
00102    * of <stream>
00103    */
00104   virtual void setCharStream (ACEXML_CharStream *charStream);
00105 
00106   /**
00107    * Set the character encoding, if known.
00108    */
00109   virtual void setEncoding (const ACEXML_Char *encoding);
00110 
00111   /**
00112    * Set the public identifier for this input source.
00113    */
00114   virtual void setPublicId (const ACEXML_Char *publicId);
00115 
00116   /**
00117    * Set the public identifier for this input source.
00118    */
00119   virtual void setSystemId (const ACEXML_Char *systemId);
00120 
00121 private:
00122   ACEXML_CharStream *charStream_;
00123   ACEXML_Char *encoding_;
00124   ACEXML_Char *publicId_;
00125   ACEXML_Char *systemId_;
00126 };
00127 
00128 
00129 #include /**/ "ace/post.h"
00130 
00131 #endif /* _ACEXML_INPUTSOURCE_H_ */

Generated on Thu Nov 9 11:45:37 2006 for ACEXML by doxygen 1.3.6