xref: /aosp_15_r20/external/pdfium/core/fxcrt/css/cfx_cssvaluelistparser.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2017 The PDFium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #ifndef CORE_FXCRT_CSS_CFX_CSSVALUELISTPARSER_H_
8 #define CORE_FXCRT_CSS_CFX_CSSVALUELISTPARSER_H_
9 
10 #include <stdint.h>
11 
12 #include "core/fxcrt/css/cfx_cssvalue.h"
13 
14 class CFX_CSSValueListParser {
15  public:
16   CFX_CSSValueListParser(const wchar_t* psz, size_t nLen, wchar_t separator);
17 
18   bool NextValue(CFX_CSSValue::PrimitiveType* eType,
19                  const wchar_t** pStart,
20                  size_t* nLength);
UseCommaSeparator()21   void UseCommaSeparator() { m_Separator = ','; }
22 
23  private:
24   size_t SkipToChar(wchar_t wch);
25   size_t SkipToCharMatchingParens(wchar_t wch);
26 
27   wchar_t m_Separator;
28   const wchar_t* m_pCur;
29   const wchar_t* m_pEnd;
30 };
31 
32 #endif  // CORE_FXCRT_CSS_CFX_CSSVALUELISTPARSER_H_
33