diff options
Diffstat (limited to 'xfa/fgas')
-rw-r--r-- | xfa/fgas/crt/ifgas_stream.cpp (renamed from xfa/fgas/crt/fgas_stream.cpp) | 113 | ||||
-rw-r--r-- | xfa/fgas/crt/ifgas_stream.h (renamed from xfa/fgas/crt/fgas_stream.h) | 7 | ||||
-rw-r--r-- | xfa/fgas/font/cfgas_fontmgr.h | 2 |
3 files changed, 61 insertions, 61 deletions
diff --git a/xfa/fgas/crt/fgas_stream.cpp b/xfa/fgas/crt/ifgas_stream.cpp index 02096d4966..eef19a59ff 100644 --- a/xfa/fgas/crt/fgas_stream.cpp +++ b/xfa/fgas/crt/ifgas_stream.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "xfa/fgas/crt/fgas_stream.h" +#include "xfa/fgas/crt/ifgas_stream.h" #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || \ _FX_OS_ == _FX_WIN64_ @@ -321,50 +321,6 @@ bool FileSetSize(FXSYS_FILE* file, int32_t size) { #endif } -} // namespace - -// static -CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateStream( - const CFX_RetainPtr<IFX_SeekableReadStream>& pFileRead, - uint32_t dwAccess) { - auto pSR = pdfium::MakeRetain<CFGAS_Stream>(); - if (!pSR->LoadFileRead(pFileRead, dwAccess)) - return nullptr; - - if (dwAccess & FX_STREAMACCESS_Text) - return pdfium::MakeRetain<CFGAS_TextStream>(pSR); - - return pSR; -} - -// static -CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateStream( - const CFX_RetainPtr<IFX_SeekableWriteStream>& pFileWrite, - uint32_t dwAccess) { - auto pSR = pdfium::MakeRetain<CFGAS_Stream>(); - if (!pSR->LoadFileWrite(pFileWrite, dwAccess)) - return nullptr; - - if (dwAccess & FX_STREAMACCESS_Text) - return pdfium::MakeRetain<CFGAS_TextStream>(pSR); - - return pSR; -} - -// static -CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateStream(uint8_t* pData, - int32_t length, - uint32_t dwAccess) { - auto pSR = pdfium::MakeRetain<CFGAS_Stream>(); - if (!pSR->LoadBuffer(pData, length, dwAccess)) - return nullptr; - - if (dwAccess & FX_STREAMACCESS_Text) - return pdfium::MakeRetain<CFGAS_TextStream>(pSR); - - return pSR; -} - IFGAS_StreamImp::IFGAS_StreamImp() : m_dwAccess(0) {} CFGAS_FileStreamImp::CFGAS_FileStreamImp() : m_hFile(nullptr), m_iLength(0) {} @@ -898,13 +854,6 @@ int32_t CFGAS_BufferStreamImp::WriteString(const wchar_t* pStr, return iLen; } -// static -CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateTextStream( - const CFX_RetainPtr<IFGAS_Stream>& pBaseStream) { - ASSERT(pBaseStream); - return pdfium::MakeRetain<CFGAS_TextStream>(pBaseStream); -} - CFGAS_TextStream::CFGAS_TextStream(const CFX_RetainPtr<IFGAS_Stream>& pStream) : m_wCodePage(FX_CODEPAGE_DefANSI), m_wBOMLength(0), @@ -1453,10 +1402,6 @@ CFX_RetainPtr<IFGAS_Stream> CFGAS_Stream::CreateSharedStream(uint32_t dwAccess, return pShared; } -CFX_RetainPtr<IFX_SeekableReadStream> IFGAS_Stream::MakeSeekableReadStream() { - return CFGAS_FileRead::Create(CFX_RetainPtr<IFGAS_Stream>(this)); -} - CFX_RetainPtr<CFGAS_FileRead> CFGAS_FileRead::Create( const CFX_RetainPtr<IFGAS_Stream>& pStream) { return pdfium::MakeRetain<CFGAS_FileRead>(pStream); @@ -1478,3 +1423,59 @@ bool CFGAS_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) { int32_t iLen = m_pStream->ReadData((uint8_t*)buffer, (int32_t)size); return iLen == (int32_t)size; } + +} // namespace + +// static +CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateStream( + const CFX_RetainPtr<IFX_SeekableReadStream>& pFileRead, + uint32_t dwAccess) { + auto pSR = pdfium::MakeRetain<CFGAS_Stream>(); + if (!pSR->LoadFileRead(pFileRead, dwAccess)) + return nullptr; + + if (dwAccess & FX_STREAMACCESS_Text) + return pdfium::MakeRetain<CFGAS_TextStream>(pSR); + + return pSR; +} + +// static +CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateStream( + const CFX_RetainPtr<IFX_SeekableWriteStream>& pFileWrite, + uint32_t dwAccess) { + auto pSR = pdfium::MakeRetain<CFGAS_Stream>(); + if (!pSR->LoadFileWrite(pFileWrite, dwAccess)) + return nullptr; + + if (dwAccess & FX_STREAMACCESS_Text) + return pdfium::MakeRetain<CFGAS_TextStream>(pSR); + + return pSR; +} + +// static +CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateStream(uint8_t* pData, + int32_t length, + uint32_t dwAccess) { + auto pSR = pdfium::MakeRetain<CFGAS_Stream>(); + if (!pSR->LoadBuffer(pData, length, dwAccess)) + return nullptr; + + if (dwAccess & FX_STREAMACCESS_Text) + return pdfium::MakeRetain<CFGAS_TextStream>(pSR); + + return pSR; +} + +// static +CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateTextStream( + const CFX_RetainPtr<IFGAS_Stream>& pBaseStream) { + ASSERT(pBaseStream); + return pdfium::MakeRetain<CFGAS_TextStream>(pBaseStream); +} + +// static +CFX_RetainPtr<IFX_SeekableReadStream> IFGAS_Stream::MakeSeekableReadStream() { + return CFGAS_FileRead::Create(CFX_RetainPtr<IFGAS_Stream>(this)); +} diff --git a/xfa/fgas/crt/fgas_stream.h b/xfa/fgas/crt/ifgas_stream.h index fdfc08205a..3ffead96dd 100644 --- a/xfa/fgas/crt/fgas_stream.h +++ b/xfa/fgas/crt/ifgas_stream.h @@ -4,8 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#ifndef XFA_FGAS_CRT_FGAS_STREAM_H_ -#define XFA_FGAS_CRT_FGAS_STREAM_H_ +#ifndef XFA_FGAS_CRT_IFGAS_STREAM_H_ +#define XFA_FGAS_CRT_IFGAS_STREAM_H_ #include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_stream.h" @@ -63,5 +63,4 @@ class IFGAS_Stream : public CFX_Retainable { CFX_RetainPtr<IFX_SeekableReadStream> MakeSeekableReadStream(); }; - -#endif // XFA_FGAS_CRT_FGAS_STREAM_H_ +#endif // XFA_FGAS_CRT_IFGAS_STREAM_H_ diff --git a/xfa/fgas/font/cfgas_fontmgr.h b/xfa/fgas/font/cfgas_fontmgr.h index 5918a23143..dc1dfff394 100644 --- a/xfa/fgas/font/cfgas_fontmgr.h +++ b/xfa/fgas/font/cfgas_fontmgr.h @@ -19,7 +19,7 @@ #include "core/fxge/fx_freetype.h" #include "core/fxge/ifx_systemfontinfo.h" #include "third_party/freetype/include/freetype/fttypes.h" -#include "xfa/fgas/crt/fgas_stream.h" +#include "xfa/fgas/crt/ifgas_stream.h" #define FX_FONTSTYLE_Normal 0x00 #define FX_FONTSTYLE_FixedPitch 0x01 |