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

Side by Side Diff: core/fpdfapi/parser/cpdf_stream.cpp

Issue 2517513003: Add unit test for CXFA_FileRead. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « core/fpdfapi/parser/cpdf_stream.h ('k') | core/fpdfapi/parser/cpdf_stream_acc.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/parser/cpdf_stream.h" 7 #include "core/fpdfapi/parser/cpdf_stream.h"
8 8
9 #include "core/fpdfapi/parser/cpdf_dictionary.h" 9 #include "core/fpdfapi/parser/cpdf_dictionary.h"
10 #include "core/fpdfapi/parser/cpdf_stream_acc.h" 10 #include "core/fpdfapi/parser/cpdf_stream_acc.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 uint32_t size) const { 106 uint32_t size) const {
107 if (m_bMemoryBased && m_pFile) 107 if (m_bMemoryBased && m_pFile)
108 return m_pFile->ReadBlock(buf, offset, size); 108 return m_pFile->ReadBlock(buf, offset, size);
109 109
110 if (m_pDataBuf) 110 if (m_pDataBuf)
111 FXSYS_memcpy(buf, m_pDataBuf.get() + offset, size); 111 FXSYS_memcpy(buf, m_pDataBuf.get() + offset, size);
112 112
113 return true; 113 return true;
114 } 114 }
115 115
116 bool CPDF_Stream::HasFilter() const {
117 return m_pDict && m_pDict->KeyExist("Filter");
118 }
119
116 CFX_WideString CPDF_Stream::GetUnicodeText() const { 120 CFX_WideString CPDF_Stream::GetUnicodeText() const {
117 CPDF_StreamAcc stream; 121 CPDF_StreamAcc stream;
118 stream.LoadAllData(this, false); 122 stream.LoadAllData(this, false);
119 return PDF_DecodeText(stream.GetData(), stream.GetSize()); 123 return PDF_DecodeText(stream.GetData(), stream.GetSize());
120 } 124 }
OLDNEW
« no previous file with comments | « core/fpdfapi/parser/cpdf_stream.h ('k') | core/fpdfapi/parser/cpdf_stream_acc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698