blob: e4bf0c088f682c820292694cbfa4338c1bf09fac [file] [log] [blame]
kumarashishg826308d2023-06-23 13:21:22 +00001// Copyright 2016 The PDFium Authors
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -07002// 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
kumarashishg826308d2023-06-23 13:21:22 +000010#include <stdint.h>
11
12#include "core/fxcrt/bytestring.h"
Haibo Huang49cc9302020-04-27 16:14:24 -070013#include "third_party/base/span.h"
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070014
15class CPDF_SimpleParser {
16 public:
Haibo Huang49cc9302020-04-27 16:14:24 -070017 explicit CPDF_SimpleParser(pdfium::span<const uint8_t> input);
18 ~CPDF_SimpleParser();
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070019
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070020 ByteStringView GetWord();
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070021
Haibo Huang49cc9302020-04-27 16:14:24 -070022 void SetCurPos(uint32_t pos) { cur_pos_ = pos; }
23 uint32_t GetCurPos() const { return cur_pos_; }
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070024
25 private:
Haibo Huang49cc9302020-04-27 16:14:24 -070026 const pdfium::span<const uint8_t> data_;
27 uint32_t cur_pos_ = 0;
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070028};
29
30#endif // CORE_FPDFAPI_PARSER_CPDF_SIMPLE_PARSER_H_