summaryrefslogtreecommitdiff
path: root/xfa/fde/css/cfde_csssyntaxparser.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-06-26 15:28:15 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-06-30 18:51:27 +0000
commitf3024c3b1fbbfe442f93da3459ea79e817d5b8fe (patch)
tree86652e7b9fc74c60bb966883d02ea14ca0d2995b /xfa/fde/css/cfde_csssyntaxparser.h
parentd24236a926deeb8b9589c330c27dbd300b7f8c9d (diff)
downloadpdfium-f3024c3b1fbbfe442f93da3459ea79e817d5b8fe.tar.xz
Split CFDE_CSSTextBuf in two.
For the external buffer use case, use a CFDE_CSSExtTextBuf instead. With the split, both text buffer implementations are simpler now. As a result, it becomes obvious where it never fails. Adjust callers accordingly. Change-Id: I7b53d36593172487b8c939e6a55af2437ea4ee5a Reviewed-on: https://pdfium-review.googlesource.com/6932 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fde/css/cfde_csssyntaxparser.h')
-rw-r--r--xfa/fde/css/cfde_csssyntaxparser.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/xfa/fde/css/cfde_csssyntaxparser.h b/xfa/fde/css/cfde_csssyntaxparser.h
index a5e79d50e5..c17d84aef1 100644
--- a/xfa/fde/css/cfde_csssyntaxparser.h
+++ b/xfa/fde/css/cfde_csssyntaxparser.h
@@ -9,6 +9,8 @@
#include <stack>
+#include "core/fxcrt/fx_string.h"
+#include "xfa/fde/css/cfde_cssexttextbuf.h"
#include "xfa/fde/css/cfde_csstextbuf.h"
#define FDE_CSSSYNTAXCHECK_AllowCharset 1
@@ -37,18 +39,17 @@ enum class FDE_CSSSyntaxStatus : uint8_t {
class CFDE_CSSSyntaxParser {
public:
- CFDE_CSSSyntaxParser();
+ CFDE_CSSSyntaxParser(const wchar_t* pBuffer, int32_t iBufferSize);
+ CFDE_CSSSyntaxParser(const wchar_t* pBuffer,
+ int32_t iBufferSize,
+ int32_t iTextDatSize,
+ bool bOnlyDeclaration);
~CFDE_CSSSyntaxParser();
- bool Init(const wchar_t* pBuffer,
- int32_t iBufferSize,
- int32_t iTextDatSize = 32,
- bool bOnlyDeclaration = false);
FDE_CSSSyntaxStatus DoSyntaxParse();
CFX_WideStringC GetCurrentString() const;
protected:
- void Reset(bool bOnlyDeclaration);
void SwitchMode(FDE_CSSSyntaxMode eMode);
int32_t SwitchToComment();
@@ -63,7 +64,7 @@ class CFDE_CSSSyntaxParser {
void DisableImport() { m_dwCheck = 0; }
CFDE_CSSTextBuf m_TextData;
- CFDE_CSSTextBuf m_TextPlane;
+ CFDE_CSSExtTextBuf m_TextPlane;
int32_t m_iTextDataLen;
uint32_t m_dwCheck;
FDE_CSSSyntaxMode m_eMode;