| // Copyright 2017 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 CORE_FXCRT_CSS_CFX_CSSSYNTAXPARSER_H_ |
| #define CORE_FXCRT_CSS_CFX_CSSSYNTAXPARSER_H_ |
| #include "core/fxcrt/css/cfx_cssinputtextbuf.h" |
| #include "core/fxcrt/css/cfx_cssoutputtextbuf.h" |
| #include "core/fxcrt/fx_string.h" |
| class CFX_CSSSyntaxParser { |
| enum class Status : uint8_t { |
| explicit CFX_CSSSyntaxParser(WideStringView str); |
| void SetParseOnlyDeclarations(); |
| WideStringView GetCurrentString() const; |
| enum class Mode : uint8_t { |
| void SaveMode(Mode eMode); |
| bool m_bHasError = false; |
| Mode m_eMode = Mode::kRuleSet; |
| CFX_CSSOutputTextBuf m_Output; |
| CFX_CSSInputTextBuf m_Input; |
| std::stack<Mode> m_ModeStack; |
| #endif // CORE_FXCRT_CSS_CFX_CSSSYNTAXPARSER_H_ |