1 // Copyright 2016 PDFium Authors. All rights reserved. 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 10 #include "core/fxcrt/fx_string.h" 11 #include "core/fxcrt/fx_system.h" 12 #include "third_party/base/span.h" 13 14 class CPDF_SimpleParser { 15 public: 16 explicit CPDF_SimpleParser(pdfium::span<const uint8_t> input); 17 ~CPDF_SimpleParser(); 18 19 ByteStringView GetWord(); 20 SetCurPos(uint32_t pos)21 void SetCurPos(uint32_t pos) { cur_pos_ = pos; } GetCurPos()22 uint32_t GetCurPos() const { return cur_pos_; } 23 24 private: 25 const pdfium::span<const uint8_t> data_; 26 uint32_t cur_pos_ = 0; 27 }; 28 29 #endif // CORE_FPDFAPI_PARSER_CPDF_SIMPLE_PARSER_H_ 30