| OLD | NEW |
| 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 "xfa/src/fgas/crt/fgas_stream.h" | 7 #include "xfa/fgas/crt/fgas_stream.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "xfa/src/fgas/crt/fgas_system.h" | 11 #include "xfa/fgas/crt/fgas_codepage.h" |
| 12 #include "xfa/src/fgas/crt/fgas_codepage.h" | 12 #include "xfa/fgas/crt/fgas_system.h" |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 class CFX_StreamImp { | 16 class CFX_StreamImp { |
| 17 public: | 17 public: |
| 18 virtual void Release() { delete this; } | 18 virtual void Release() { delete this; } |
| 19 virtual FX_DWORD GetAccessModes() const { return m_dwAccess; } | 19 virtual FX_DWORD GetAccessModes() const { return m_dwAccess; } |
| 20 virtual int32_t GetLength() const = 0; | 20 virtual int32_t GetLength() const = 0; |
| 21 virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0; | 21 virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0; |
| 22 virtual int32_t GetPosition() = 0; | 22 virtual int32_t GetPosition() = 0; |
| (...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1617 return m_pStream->WriteData((const uint8_t*)pData, (int32_t)size) == | 1617 return m_pStream->WriteData((const uint8_t*)pData, (int32_t)size) == |
| 1618 (int32_t)size; | 1618 (int32_t)size; |
| 1619 } | 1619 } |
| 1620 FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, | 1620 FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, |
| 1621 FX_FILESIZE offset, | 1621 FX_FILESIZE offset, |
| 1622 size_t size) { | 1622 size_t size) { |
| 1623 m_pStream->Seek(FX_STREAMSEEK_Begin, offset); | 1623 m_pStream->Seek(FX_STREAMSEEK_Begin, offset); |
| 1624 int32_t iLen = m_pStream->WriteData((uint8_t*)pData, (int32_t)size); | 1624 int32_t iLen = m_pStream->WriteData((uint8_t*)pData, (int32_t)size); |
| 1625 return iLen == (int32_t)size; | 1625 return iLen == (int32_t)size; |
| 1626 } | 1626 } |
| OLD | NEW |