OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |