Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp

Issue 1857713003: Rename GetCStr and GetPtr to match CFX_ByteString (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h" 7 #include "core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 } 914 }
915 915
916 std::vector<SearchTagRecord> patterns(ntags); 916 std::vector<SearchTagRecord> patterns(ntags);
917 uint32_t start = 0; 917 uint32_t start = 0;
918 uint32_t itag = 0; 918 uint32_t itag = 0;
919 uint32_t max_len = 0; 919 uint32_t max_len = 0;
920 for (int i = 0; i <= tags.GetLength(); ++i) { 920 for (int i = 0; i <= tags.GetLength(); ++i) {
921 if (tags[i] == 0) { 921 if (tags[i] == 0) {
922 uint32_t len = i - start; 922 uint32_t len = i - start;
923 max_len = std::max(len, max_len); 923 max_len = std::max(len, max_len);
924 patterns[itag].m_pTag = tags.GetCStr() + start; 924 patterns[itag].m_pTag = tags.c_str() + start;
925 patterns[itag].m_Len = len; 925 patterns[itag].m_Len = len;
926 patterns[itag].m_Offset = 0; 926 patterns[itag].m_Offset = 0;
927 start = i + 1; 927 start = i + 1;
928 ++itag; 928 ++itag;
929 } 929 }
930 } 930 }
931 931
932 const FX_FILESIZE pos_limit = m_Pos + limit; 932 const FX_FILESIZE pos_limit = m_Pos + limit;
933 for (FX_FILESIZE pos = m_Pos; !limit || pos < pos_limit; ++pos) { 933 for (FX_FILESIZE pos = m_Pos; !limit || pos < pos_limit; ++pos) {
934 uint8_t byte; 934 uint8_t byte;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 if (limit && m_Pos == limit) 981 if (limit && m_Pos == limit)
982 return -1; 982 return -1;
983 } 983 }
984 return -1; 984 return -1;
985 } 985 }
986 986
987 void CPDF_SyntaxParser::SetEncrypt( 987 void CPDF_SyntaxParser::SetEncrypt(
988 std::unique_ptr<IPDF_CryptoHandler> pCryptoHandler) { 988 std::unique_ptr<IPDF_CryptoHandler> pCryptoHandler) {
989 m_pCryptoHandler = std::move(pCryptoHandler); 989 m_pCryptoHandler = std::move(pCryptoHandler);
990 } 990 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698