OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: SAX/C++: First interface draft

[ Lists Home | Date Index | Thread Index ]
  • From: Michael Fuller <msf@mds.rmit.edu.au>
  • To: James Clark <jjc@jclark.com>
  • Date: Mon, 6 Dec 1999 18:29:01 +1100

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@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS