[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: SAX/C++: First interface draft

  • From: Michael Fuller <msf@m...>
  • To: James Clark <jjc@j...>
  • Date: Mon, 6 Dec 1999 18:29:01 +1100

wistream
On Fri, Dec 03, 1999 at 11:48:47AM +0700, James Clark wrote:
> Here's another draft, with this change and a few other minor changes;
[...]
> - solve the UTF-8/UTF-16 problem by having two namespaces:

As I've suggested elsewhere, this can also be (partially) addressed
by providing both a CharacterStream and a ByteStream. That would change
the InputSource definition to:

 class InputSource
 {
 public:
   virtual SAXString getPublicId () const = 0;
   virtual void setPublicId (SAXString publicId) = 0;

   virtual SAXString getSystemId () const = 0;
   virtual void setSystemId (SAXString systemId) = 0;

   virtual SAXString getEncoding () const = 0;
   virtual void setEncoding(SAXString encoding) = 0;
   
   virtual std::istream * getByteStream () const = 0;
   virtual void setByteStream (std::istream * in) = 0;

   // Issue: is wistream the best C++ cchoice for a Unicode "character" stream,
   // given that sizeof(wchar_t) need not be 2 (eg, under // Sun/Solaris CC)?
   virtual std::wistream * getCharacterStream () const = 0;
   virtual void setCharacterStream (std::wistream * in) = 0;

 private:
   void operator delete (void *);
 };


> Discussion points:
>
> - Would it be better to typedef SAXString to the Standard C++ string
> class (ie std::basic_string<SAXChar>)?

Also:
    The Java definition explicitly indicates what exceptions may be thrown
through out the interface. Should C++ exception specificiers be used to
mirror those semantics?  If that's the case, we probably also need to add
embedded exceptions back into the SAXException class, a la:

	virtual std::exception& getException() const = 0;
	virtual SAXString toString() const = 0;

General query: should there be heavier use of const and "&" amongst
the various function's parameter declarations and return values?

Michael
____________________________________________
http://www.mds.rmit.edu.au/~msf/
Multimedia Databases Group, RMIT, Australia.

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.