Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

rtSaxCppParserIF.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2006 Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
00022  *
00023  *****************************************************************************/
00024 
00025 #ifndef __RTSAXCPPPARSERIF_H_
00026 #define __RTSAXCPPPARSERIF_H_
00027 
00030 #include <string.h>
00031 #include <stdlib.h>
00032 
00033 #include "rtxsrc/rtxErrCodes.h"
00034 #include "rtxsrc/rtxCppInputStreamIF.h"
00035 #include "rtxmlsrc/osrtxml.h"
00036 #include "rtxmlsrc/rtSaxDefs.h"
00037 
00038 
00039 class EXTERNXML OSXMLErrorInfo {
00040  public:
00041    virtual void resetErrorInfo () = 0;
00042    virtual void setErrorInfo (int status, const char* file = 0, int line = 0) = 0;
00043    virtual int  getErrorInfo (int* status, const char** file, int* line) = 0;
00044 };
00045 
00046 class EXTERNXML OSXMLErrorHandler
00047 {
00048  public:
00049 
00064    virtual void warning() = 0;
00065 
00082    virtual void error() = 0;
00083 
00098    virtual void fatalError() = 0;
00099    
00107    virtual void resetErrors() = 0;
00109 };
00110 
00115 class EXTERNXML OSXMLContentHandler
00116 {
00117  public:
00134    virtual int characters
00135    (
00136        const OSUTF8CHAR* const chars,
00137        unsigned int         length
00138    ) = 0;
00139 
00152    virtual int endElement
00153    (
00154       const OSUTF8CHAR* const uri, 
00155       const OSUTF8CHAR* const localname, 
00156       const OSUTF8CHAR* const qname
00157    ) = 0;
00158 
00176    virtual int startElement
00177    (
00178       const   OSUTF8CHAR* const  uri,
00179       const   OSUTF8CHAR* const  localname,
00180       const   OSUTF8CHAR* const  qname,
00181       const   OSUTF8CHAR* const* attrs
00182    ) = 0;
00183 
00185 };
00186 
00187 class EXTERNXML OSXMLBase {
00188 protected:
00189    OSXMLBase () {}
00190 
00191    virtual ~OSXMLBase () {}
00192 public:
00193    virtual void release () = 0;
00194 };
00195 
00196 #define DECLARE_XMLBASEIMP \
00197 public: void release () { delete this; }
00198 
00199 class EXTERNXML OSXMLReader : public OSXMLBase
00200 {
00201  public:
00202 
00203    virtual int parse () = 0;
00220    virtual int parse
00221    (
00222       OSInputStreamIF& source
00223    ) = 0;
00224 
00231    virtual int parse
00232    (
00233       const char* const pBuffer,
00234       size_t            bufSize
00235    ) = 0;
00236 
00251    virtual int parse
00252    (
00253        const char* const systemId
00254    ) = 0;
00255 };
00256 
00264 class EXTERNXML OSXMLDefaultHandlerIF : 
00265    public OSXMLContentHandler, public OSXMLErrorInfo
00266 {
00267  public:
00268    virtual ~OSXMLDefaultHandlerIF () {}
00269 
00270    virtual int startElement 
00271       (const OSUTF8CHAR* const uri, 
00272        const OSUTF8CHAR* const localname, 
00273        const OSUTF8CHAR* const qname, 
00274        const OSUTF8CHAR* const* attrs) = 0;
00275 
00276    virtual int characters 
00277       (const OSUTF8CHAR* const chars, unsigned int length) = 0;
00278 
00279    virtual int endElement
00280       (const OSUTF8CHAR* const uri,
00281        const OSUTF8CHAR* const localname,
00282        const OSUTF8CHAR* const qname) = 0;
00283 
00284    virtual void startDocument() = 0;
00285    virtual void endDocument () = 0;
00286 
00287    virtual int finalize () = 0;
00288 } ;
00289 
00290 class EXTERNXML OSXMLParserCtxtIF {
00291  public:
00292    virtual ~OSXMLParserCtxtIF () {}
00293    virtual OSInputStreamIF* createInputStream () = 0;
00294    virtual OSInputStreamIF* createFileInputStream 
00295       (const char* const filename) = 0;
00296    virtual OSInputStreamIF* createMemoryInputStream 
00297       (OSOCTET* pMemBuf, size_t bufSize) = 0;
00298    virtual OSCTXT* getContext () = 0;
00299    virtual const OSUTF8CHAR* parseQName (const OSUTF8CHAR* const qname) = 0;
00300 };
00301 
00302 #ifdef __cplusplus
00303 extern "C" {
00304 #endif
00305 
00313 OSXMLReader* rtSaxCppCreateXmlReader (OSXMLParserCtxtIF* pContext, 
00314                                       OSXMLDefaultHandlerIF* pSaxHandler);
00315 
00326 void rtSaxCppLockXmlLibrary ();
00327 
00333 void rtSaxCppUnlockXmlLibrary ();
00334 
00335 #ifdef __cplusplus
00336 }
00337 #endif
00338 
00339 #endif /* __RTSAXCPPPARSERIF_H_ */

This file was last modified on 8 Jan 2007.
XBinder, Version 1.1.9