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/include/fpdfapi/cpdf_stream.h" | 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" |
8 | 8 |
9 #include "core/include/fpdfapi/cpdf_dictionary.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" |
10 #include "core/include/fpdfapi/cpdf_stream_acc.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h" |
11 #include "core/include/fpdfapi/fpdf_parser_decode.h" | 11 #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h" |
12 | 12 |
13 CPDF_Stream::CPDF_Stream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict) | 13 CPDF_Stream::CPDF_Stream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict) |
14 : m_pDict(pDict), | 14 : m_pDict(pDict), |
15 m_dwSize(size), | 15 m_dwSize(size), |
16 m_GenNum(kMemoryBasedGenNum), | 16 m_GenNum(kMemoryBasedGenNum), |
17 m_pDataBuf(pData) {} | 17 m_pDataBuf(pData) {} |
18 | 18 |
19 CPDF_Stream::~CPDF_Stream() { | 19 CPDF_Stream::~CPDF_Stream() { |
20 if (IsMemoryBased()) | 20 if (IsMemoryBased()) |
21 FX_Free(m_pDataBuf); | 21 FX_Free(m_pDataBuf); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 if (m_pDict) | 128 if (m_pDict) |
129 m_pDict->SetAtInteger("Length", m_dwSize); | 129 m_pDict->SetAtInteger("Length", m_dwSize); |
130 } | 130 } |
131 | 131 |
132 CFX_WideString CPDF_Stream::GetUnicodeText() const { | 132 CFX_WideString CPDF_Stream::GetUnicodeText() const { |
133 CPDF_StreamAcc stream; | 133 CPDF_StreamAcc stream; |
134 stream.LoadAllData(this, FALSE); | 134 stream.LoadAllData(this, FALSE); |
135 return PDF_DecodeText(stream.GetData(), stream.GetSize()); | 135 return PDF_DecodeText(stream.GetData(), stream.GetSize()); |
136 } | 136 } |
137 | 137 |
OLD | NEW |