[8f4e59]: corelib / SAXHandlers.h  Maximize  Restore  History

Download this file

159 lines (129 with data), 5.0 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// SAXHandlers.h : header file
//
#pragma once
#include "xml_import.h"
#include "MyString.h"
#include "ItemData.h"
// Local variables
enum {PASSWORDSAFE = 0, PW_ENTRY, PW_GROUP, PW_TITLE, PW_USERNAME, PW_PASSWORD, PW_URL,
PW_AUTOTYPE, PW_NOTES, PW_CTIME, PW_ATIME, PW_LTIME, PW_PMTIME, PW_RMTIME,
PW_HISTORY, PW_STATUS, PW_MAX, PW_NUM, PW_HISTORY_ENTRY,
PW_CHANGED, PW_OLDPASSWORD, PW_DATE, PW_TIME};
struct pw_entry {
CMyString group;
CMyString title;
CMyString username;
CMyString password;
CMyString url;
CMyString autotype;
CMyString ctime;
CMyString atime;
CMyString ltime;
CMyString pmtime;
CMyString rmtime;
CMyString changed;
CMyString pwhistory;
CMyString notes;
};
// -----------------------------------------------------------------------
class PWSSAXErrorHandler: public ISAXErrorHandler
{
public:
// Local variables and functions
CString m_strValidationResult;
BOOL bErrorsFound;
// Standard functions
PWSSAXErrorHandler();
virtual ~PWSSAXErrorHandler();
virtual HRESULT STDMETHODCALLTYPE error (
struct ISAXLocator * pLocator,
unsigned short * pwchErrorMessage,
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 (
struct ISAXLocator * pLocator,
unsigned short * pwchErrorMessage,
HRESULT hrErrorCode );
virtual HRESULT STDMETHODCALLTYPE ignorableWarning (
struct ISAXLocator * pLocator,
unsigned short * pwchErrorMessage,
HRESULT hrErrorCode );
private:
// REQUIRED variable
ULONG m_refCnt;
};
// -----------------------------------------------------------------------
class PWSSAXContentHandler: public ISAXContentHandler
{
public:
// Local variables & function
CString m_strImportErrors;
int m_numEntries;
TCHAR m_delimiter;
void SetVariables(void* core, const bool &bValidation,
const CString &ImportedPrefix, const TCHAR &delimiter);
// Standard functions
PWSSAXContentHandler();
virtual ~PWSSAXContentHandler();
// 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] */ wchar_t __RPC_FAR *pwchPrefix,
/* [in] */ int cchPrefix,
/* [in] */ wchar_t __RPC_FAR *pwchUri,
/* [in] */ int cchUri);
virtual HRESULT STDMETHODCALLTYPE endPrefixMapping(
/* [in] */ wchar_t __RPC_FAR *pwchPrefix,
/* [in] */ int cchPrefix);
virtual HRESULT STDMETHODCALLTYPE startElement(
/* [in] */ wchar_t __RPC_FAR *pwchNamespaceUri,
/* [in] */ int cchNamespaceUri,
/* [in] */ wchar_t __RPC_FAR *pwchLocalName,
/* [in] */ int cchLocalName,
/* [in] */ wchar_t __RPC_FAR *pwchRawName,
/* [in] */ int cchRawName,
/* [in] */ ISAXAttributes __RPC_FAR *pAttributes);
virtual HRESULT STDMETHODCALLTYPE endElement(
/* [in] */ wchar_t __RPC_FAR *pwchNamespaceUri,
/* [in] */ int cchNamespaceUri,
/* [in] */ wchar_t __RPC_FAR *pwchLocalName,
/* [in] */ int cchLocalName,
/* [in] */ wchar_t __RPC_FAR *pwchRawName,
/* [in] */ int cchRawName);
virtual HRESULT STDMETHODCALLTYPE characters(
/* [in] */ wchar_t __RPC_FAR *pwchChars,
/* [in] */ int cchChars);
virtual HRESULT STDMETHODCALLTYPE ignorableWhitespace(
/* [in] */ wchar_t __RPC_FAR *pwchChars,
/* [in] */ int cchChars);
virtual HRESULT STDMETHODCALLTYPE processingInstruction(
/* [in] */ wchar_t __RPC_FAR *pwchTarget,
/* [in] */ int cchTarget,
/* [in] */ wchar_t __RPC_FAR *pwchData,
/* [in] */ int cchData);
virtual HRESULT STDMETHODCALLTYPE skippedEntity(
/* [in] */ wchar_t __RPC_FAR *pwchName,
/* [in] */ int cchName);
private:
// Local variables
pw_entry *cur_entry;
CItemData m_tempitem;
CMyString m_strElemContent;
CString m_ImportedPrefix;
void* m_core;
int m_whichtime, m_ipwh;
bool m_bValidation;
// REQUIRED variable
ULONG m_refCnt;
};

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks