summaryrefslogtreecommitdiff
path: root/xfa/src/fgas/xml/fgas_sax.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-03-09 13:49:00 -0500
committerDan Sinclair <dsinclair@chromium.org>2016-03-09 13:49:00 -0500
commit9332e0c2fced598a632e3bbe905b6f63b1f5b06b (patch)
treea8957a09cb34ecd28afcd6ebbed309d9c60e4644 /xfa/src/fgas/xml/fgas_sax.h
parent8388037a5c58d60043b11c03a8efe78c54c65a4b (diff)
downloadpdfium-9332e0c2fced598a632e3bbe905b6f63b1f5b06b.tar.xz
Cleanup the xfa/src/fgas directory.
This CL moves the code from xfa/src/fgas/src up one level. It then takes the headers in xfa/src/fgas/include and moves them to their correct folder. The src/ and include/ directories are then removed. In some cases, when moving from include/ there was another header with the same name. Those headers were either folded together, or the content of the conflicting folder moved to an anonymous namespace in the cpp file as they were not used anywhere else. Files with duplicate names as core/src/crt were renamed to be fgas_ instead of fx_. (e.g. fgas_system.h, fgas_memory.h, fgas_stream.h) R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1776303002 .
Diffstat (limited to 'xfa/src/fgas/xml/fgas_sax.h')
-rw-r--r--xfa/src/fgas/xml/fgas_sax.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/xfa/src/fgas/xml/fgas_sax.h b/xfa/src/fgas/xml/fgas_sax.h
new file mode 100644
index 0000000000..50762d4401
--- /dev/null
+++ b/xfa/src/fgas/xml/fgas_sax.h
@@ -0,0 +1,68 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef XFA_SRC_FGAS_XML_FGAS_SAX_H_
+#define XFA_SRC_FGAS_XML_FGAS_SAX_H_
+
+#include "core/include/fxcrt/fx_basic.h"
+
+#define FX_SAXPARSEMODE_NotConvert_amp 0x0001
+#define FX_SAXPARSEMODE_NotConvert_lt 0x0002
+#define FX_SAXPARSEMODE_NotConvert_gt 0x0004
+#define FX_SAXPARSEMODE_NotConvert_apos 0x0008
+#define FX_SAXPARSEMODE_NotConvert_quot 0x0010
+#define FX_SAXPARSEMODE_NotConvert_sharp 0x0020
+#define FX_SAXPARSEMODE_NotSkipSpace 0x0100
+
+enum FX_SAXNODE {
+ FX_SAXNODE_Unknown = 0,
+ FX_SAXNODE_Instruction,
+ FX_SAXNODE_Declaration,
+ FX_SAXNODE_Comment,
+ FX_SAXNODE_Tag,
+ FX_SAXNODE_Text,
+ FX_SAXNODE_CharData,
+};
+
+class IFX_SAXReaderHandler {
+ public:
+ virtual ~IFX_SAXReaderHandler() {}
+ virtual void* OnTagEnter(const CFX_ByteStringC& bsTagName,
+ FX_SAXNODE eType,
+ FX_DWORD dwStartPos) = 0;
+ virtual void OnTagAttribute(void* pTag,
+ const CFX_ByteStringC& bsAttri,
+ const CFX_ByteStringC& bsValue) = 0;
+ virtual void OnTagBreak(void* pTag) = 0;
+ virtual void OnTagData(void* pTag,
+ FX_SAXNODE eType,
+ const CFX_ByteStringC& bsData,
+ FX_DWORD dwStartPos) = 0;
+ virtual void OnTagClose(void* pTag, FX_DWORD dwEndPos) = 0;
+ virtual void OnTagEnd(void* pTag,
+ const CFX_ByteStringC& bsTagName,
+ FX_DWORD dwEndPos) = 0;
+ virtual void OnTargetData(void* pTag,
+ FX_SAXNODE eType,
+ const CFX_ByteStringC& bsData,
+ FX_DWORD dwStartPos) = 0;
+};
+
+class IFX_SAXReader {
+ public:
+ virtual ~IFX_SAXReader() {}
+ virtual void Release() = 0;
+ virtual int32_t StartParse(IFX_FileRead* pFile,
+ FX_DWORD dwStart = 0,
+ FX_DWORD dwLen = -1,
+ FX_DWORD dwParseMode = 0) = 0;
+ virtual int32_t ContinueParse(IFX_Pause* pPause = NULL) = 0;
+ virtual void SkipCurrentNode() = 0;
+ virtual void SetHandler(IFX_SAXReaderHandler* pHandler) = 0;
+};
+IFX_SAXReader* FX_SAXReader_Create();
+
+#endif // XFA_SRC_FGAS_XML_FGAS_SAX_H_