kumarashishg | 826308d | 2023-06-23 13:21:22 +0000 | [diff] [blame] | 1 | // Copyright 2016 The PDFium Authors |
Philip P. Moltmann | 4d3acf4 | 2017-03-20 11:05:52 -0700 | [diff] [blame] | 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_FPDFAPI_PARSER_CPDF_SIMPLE_PARSER_H_ |
| 8 | #define CORE_FPDFAPI_PARSER_CPDF_SIMPLE_PARSER_H_ |
| 9 | |
kumarashishg | 826308d | 2023-06-23 13:21:22 +0000 | [diff] [blame] | 10 | #include <stdint.h> |
| 11 | |
| 12 | #include "core/fxcrt/bytestring.h" |
Haibo Huang | 49cc930 | 2020-04-27 16:14:24 -0700 | [diff] [blame] | 13 | #include "third_party/base/span.h" |
Philip P. Moltmann | 4d3acf4 | 2017-03-20 11:05:52 -0700 | [diff] [blame] | 14 | |
| 15 | class CPDF_SimpleParser { |
| 16 | public: |
Haibo Huang | 49cc930 | 2020-04-27 16:14:24 -0700 | [diff] [blame] | 17 | explicit CPDF_SimpleParser(pdfium::span<const uint8_t> input); |
| 18 | ~CPDF_SimpleParser(); |
Philip P. Moltmann | 4d3acf4 | 2017-03-20 11:05:52 -0700 | [diff] [blame] | 19 | |
Philip P. Moltmann | d904c1e | 2018-03-19 09:26:45 -0700 | [diff] [blame] | 20 | ByteStringView GetWord(); |
Philip P. Moltmann | 4d3acf4 | 2017-03-20 11:05:52 -0700 | [diff] [blame] | 21 | |
Haibo Huang | 49cc930 | 2020-04-27 16:14:24 -0700 | [diff] [blame] | 22 | void SetCurPos(uint32_t pos) { cur_pos_ = pos; } |
| 23 | uint32_t GetCurPos() const { return cur_pos_; } |
Philip P. Moltmann | 4d3acf4 | 2017-03-20 11:05:52 -0700 | [diff] [blame] | 24 | |
| 25 | private: |
Haibo Huang | 49cc930 | 2020-04-27 16:14:24 -0700 | [diff] [blame] | 26 | const pdfium::span<const uint8_t> data_; |
| 27 | uint32_t cur_pos_ = 0; |
Philip P. Moltmann | 4d3acf4 | 2017-03-20 11:05:52 -0700 | [diff] [blame] | 28 | }; |
| 29 | |
| 30 | #endif // CORE_FPDFAPI_PARSER_CPDF_SIMPLE_PARSER_H_ |