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

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

Issue 2334323005: Rename dictionary set and get methods (Closed)
Patch Set: Created 4 years, 3 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 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 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/fpdf_parser_utility.h" 7 #include "core/fpdfapi/fpdf_parser/fpdf_parser_utility.h"
8 8
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 if (!pFile->ReadBlock(buf, offset, kBufSize)) 75 if (!pFile->ReadBlock(buf, offset, kBufSize))
76 return -1; 76 return -1;
77 77
78 if (memcmp(buf, "%PDF", 4) == 0) 78 if (memcmp(buf, "%PDF", 4) == 0)
79 return offset; 79 return offset;
80 } 80 }
81 return -1; 81 return -1;
82 } 82 }
83 83
84 int32_t GetDirectInteger(CPDF_Dictionary* pDict, const CFX_ByteString& key) { 84 int32_t GetDirectInteger(CPDF_Dictionary* pDict, const CFX_ByteString& key) {
85 CPDF_Number* pObj = ToNumber(pDict->GetObjectBy(key)); 85 CPDF_Number* pObj = ToNumber(pDict->GetObjectFor(key));
86 return pObj ? pObj->GetInteger() : 0; 86 return pObj ? pObj->GetInteger() : 0;
87 } 87 }
88 88
89 CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& bstr) { 89 CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& bstr) {
90 if (bstr.Find('#') == -1) 90 if (bstr.Find('#') == -1)
91 return CFX_ByteString(bstr); 91 return CFX_ByteString(bstr);
92 92
93 int size = bstr.GetLength(); 93 int size = bstr.GetLength();
94 CFX_ByteString result; 94 CFX_ByteString result;
95 FX_CHAR* pDestStart = result.GetBuffer(size); 95 FX_CHAR* pDestStart = result.GetBuffer(size);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 buf.AppendBlock(acc.GetData(), acc.GetSize()); 212 buf.AppendBlock(acc.GetData(), acc.GetSize());
213 buf << "\r\nendstream"; 213 buf << "\r\nendstream";
214 break; 214 break;
215 } 215 }
216 default: 216 default:
217 ASSERT(FALSE); 217 ASSERT(FALSE);
218 break; 218 break;
219 } 219 }
220 return buf; 220 return buf;
221 } 221 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp ('k') | core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698