Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[d8ace1]: src / core / XML / MSXML / MFileSAX2Handlers.h Maximize Restore History

Download this file

MFileSAX2Handlers.h    138 lines (108 with data), 4.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
* Copyright (c) 2003-2013 Rony Shapiro <ronys@users.sourceforge.net>.
* All rights reserved. Use of the code is allowed under the
* Artistic License 2.0 terms, as specified in the LICENSE file
* distributed with this code, or available from
* http://www.opensource.org/licenses/artistic-license-2.0.php
*/
#ifndef __MFILESAX2HANDLERS_H
#define __MFILESAX2HANDLERS_H
#include "../XMLFileValidation.h"
#include "../XMLFileHandlers.h"
#include "MFileValidator.h"
#include "../../StringX.h"
#include "../../UnknownField.h"
class PWScore;
// MSXML includes
#include <msxml6.h>
// -----------------------------------------------------------------------
class MFileSAX2ErrorHandler: public ISAXErrorHandler
{
public:
// Local variables and functions
stringT m_strValidationResult;
BOOL bErrorsFound;
// Standard functions
MFileSAX2ErrorHandler();
virtual ~MFileSAX2ErrorHandler();
virtual HRESULT STDMETHODCALLTYPE error(
/* [in] */ struct ISAXLocator * pLocator,
/* [in] */ const wchar_t * pwchErrorMessage,
/* [in] */ HRESULT hrErrorCode);
// This must be correctly implemented, if your handler must be a COM Object
// the current implementation is NOT thread-safe
long __stdcall QueryInterface(const struct _GUID &,void ** );
unsigned long __stdcall AddRef(void);
unsigned long __stdcall Release(void);
virtual HRESULT STDMETHODCALLTYPE fatalError(
/* [in] */ struct ISAXLocator * pLocator,
/* [in] */ const wchar_t * pwchErrorMessage,
/* [in] */ HRESULT hrErrorCode);
virtual HRESULT STDMETHODCALLTYPE ignorableWarning(
/* [in] */ struct ISAXLocator * pLocator,
/* [in] */ const wchar_t * pwchErrorMessage,
/* [in] */ HRESULT hrErrorCode);
private:
// REQUIRED variable
ULONG m_refCnt;
};
// -----------------------------------------------------------------------
class MFileSAX2ContentHandler: public ISAXContentHandler, public XMLFileHandlers
{
public:
// Standard functions
MFileSAX2ContentHandler();
virtual ~MFileSAX2ContentHandler();
// This must be correctly implemented, if your handler must be a COM Object
// the current implementation is NOT thread-safe
long __stdcall QueryInterface(const struct _GUID &,void ** );
unsigned long __stdcall AddRef(void);
unsigned long __stdcall Release(void);
virtual HRESULT STDMETHODCALLTYPE putDocumentLocator(
/* [in] */ ISAXLocator __RPC_FAR *pLocator);
virtual HRESULT STDMETHODCALLTYPE startDocument(void);
virtual HRESULT STDMETHODCALLTYPE endDocument(void);
virtual HRESULT STDMETHODCALLTYPE startPrefixMapping(
/* [in] */ const wchar_t __RPC_FAR *pwchPrefix,
/* [in] */ int cchPrefix,
/* [in] */ const wchar_t __RPC_FAR *pwchUri,
/* [in] */ int cchUri);
virtual HRESULT STDMETHODCALLTYPE endPrefixMapping(
/* [in] */ const wchar_t __RPC_FAR *pwchPrefix,
/* [in] */ int cchPrefix);
virtual HRESULT STDMETHODCALLTYPE startElement(
/* [in] */ const wchar_t __RPC_FAR *pwchNamespaceUri,
/* [in] */ int cchNamespaceUri,
/* [in] */ const wchar_t __RPC_FAR *pwchLocalName,
/* [in] */ int cchLocalName,
/* [in] */ const wchar_t __RPC_FAR *pwchRawName,
/* [in] */ int cchRawName,
/* [in] */ ISAXAttributes __RPC_FAR *pAttributes);
virtual HRESULT STDMETHODCALLTYPE endElement(
/* [in] */ const wchar_t __RPC_FAR *pwchNamespaceUri,
/* [in] */ int cchNamespaceUri,
/* [in] */ const wchar_t __RPC_FAR *pwchLocalName,
/* [in] */ int cchLocalName,
/* [in] */ const wchar_t __RPC_FAR *pwchRawName,
/* [in] */ int cchRawName);
virtual HRESULT STDMETHODCALLTYPE characters(
/* [in] */ const wchar_t __RPC_FAR *pwchChars,
/* [in] */ int cchChars);
virtual HRESULT STDMETHODCALLTYPE ignorableWhitespace(
/* [in] */ const wchar_t __RPC_FAR *pwchChars,
/* [in] */ int cchChars);
virtual HRESULT STDMETHODCALLTYPE processingInstruction(
/* [in] */ const wchar_t __RPC_FAR *pwchTarget,
/* [in] */ int cchTarget,
/* [in] */ const wchar_t __RPC_FAR *pwchData,
/* [in] */ int cchData);
virtual HRESULT STDMETHODCALLTYPE skippedEntity(
/* [in] */ const wchar_t __RPC_FAR *pwchName,
/* [in] */ int cchName);
private:
// Local variables
MFileValidator *m_pValidator;
// REQUIRED variable
ULONG m_refCnt;
};
#endif /* __MFILESAX2HANDLERS_H */