summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_psengine.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-03-28 18:28:45 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-28 18:28:45 +0000
commite3c204392a01870ecc9e8f3b2aa06b2b45306b5a (patch)
tree07a082760b5575f58458ecba1fe14384c3160cc0 /core/fpdfapi/page/cpdf_psengine.cpp
parent7aba472e80b073fb699c702a0971f31282737bb3 (diff)
downloadpdfium-e3c204392a01870ecc9e8f3b2aa06b2b45306b5a.tar.xz
Use ByteStringView in parsers
This CL converts the CPDF_SimpleParser to accept a ByteStringView. Several of the callers of SimpleParser are also updated to use a ByteStringView instead of <char*,size>. Change-Id: Ic2df3a06f92e77b53745a0419b44368142f9d8e6 Reviewed-on: https://pdfium-review.googlesource.com/29351 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_psengine.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_psengine.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/fpdfapi/page/cpdf_psengine.cpp b/core/fpdfapi/page/cpdf_psengine.cpp
index 7ce3a604a1..adfd45e877 100644
--- a/core/fpdfapi/page/cpdf_psengine.cpp
+++ b/core/fpdfapi/page/cpdf_psengine.cpp
@@ -190,10 +190,9 @@ int CPDF_PSEngine::PopInt() {
return static_cast<int>(Pop());
}
-bool CPDF_PSEngine::Parse(const char* str, int size) {
- CPDF_SimpleParser parser(reinterpret_cast<const uint8_t*>(str), size);
- ByteStringView word = parser.GetWord();
- return word == "{" ? m_MainProc.Parse(&parser, 0) : false;
+bool CPDF_PSEngine::Parse(const ByteStringView& view) {
+ CPDF_SimpleParser parser(view);
+ return parser.GetWord() == "{" && m_MainProc.Parse(&parser, 0);
}
bool CPDF_PSEngine::DoOperator(PDF_PSOP op) {