summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-30 10:43:35 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-30 15:52:51 +0000
commit8e5038f8a27b6275633e1015e7d0a480a6e8ae51 (patch)
tree92c4b235d5ba3d4db52780dca705336a7e85f8e4 /xfa
parent213f01205a77b293727cf77a30d7e912079def26 (diff)
downloadpdfium-8e5038f8a27b6275633e1015e7d0a480a6e8ae51.tar.xz
Rename fgas_stream to ifgas_stream
This Cl renames the the fgas_stream files to match the internal ifgas_stream class. The majority of the code in ifgas_stream.cpp is moved into the anonymouse namespace. Change-Id: I0518103d61df077782d9ab26d0ac87485417f379 Reviewed-on: https://pdfium-review.googlesource.com/3370 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fde/css/cfde_csstextbuf.h2
-rw-r--r--xfa/fde/css/fde_css.h2
-rw-r--r--xfa/fde/xml/fde_xml_imp.h2
-rw-r--r--xfa/fde/xml/fde_xml_imp_unittest.cpp2
-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.h2
-rw-r--r--xfa/fxfa/parser/cxfa_widetextread.h2
-rw-r--r--xfa/fxfa/parser/xfa_utils.h2
9 files changed, 67 insertions, 67 deletions
diff --git a/xfa/fde/css/cfde_csstextbuf.h b/xfa/fde/css/cfde_csstextbuf.h
index 9ade44be8a..52c76210ce 100644
--- a/xfa/fde/css/cfde_csstextbuf.h
+++ b/xfa/fde/css/cfde_csstextbuf.h
@@ -10,7 +10,7 @@
#include "core/fxcrt/cfx_retain_ptr.h"
#include "core/fxcrt/fx_memory.h"
#include "core/fxcrt/fx_system.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
class CFDE_CSSTextBuf {
public:
diff --git a/xfa/fde/css/fde_css.h b/xfa/fde/css/fde_css.h
index 58a6778732..ae4f36c93d 100644
--- a/xfa/fde/css/fde_css.h
+++ b/xfa/fde/css/fde_css.h
@@ -8,7 +8,7 @@
#define XFA_FDE_CSS_FDE_CSS_H_
#include "core/fxge/fx_dib.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
#include "xfa/fgas/font/cfgas_fontmgr.h"
enum FDE_CSSVALUETYPE {
diff --git a/xfa/fde/xml/fde_xml_imp.h b/xfa/fde/xml/fde_xml_imp.h
index ad2ccc467c..09cdcbacdf 100644
--- a/xfa/fde/xml/fde_xml_imp.h
+++ b/xfa/fde/xml/fde_xml_imp.h
@@ -14,7 +14,7 @@
#include "core/fxcrt/fx_basic.h"
#include "core/fxcrt/fx_system.h"
#include "xfa/fde/xml/fde_xml.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
class CFDE_BlockBuffer;
class CFDE_XMLInstruction;
diff --git a/xfa/fde/xml/fde_xml_imp_unittest.cpp b/xfa/fde/xml/fde_xml_imp_unittest.cpp
index 6191025fd2..3bd46ab77c 100644
--- a/xfa/fde/xml/fde_xml_imp_unittest.cpp
+++ b/xfa/fde/xml/fde_xml_imp_unittest.cpp
@@ -7,7 +7,7 @@
#include <memory>
#include "testing/gtest/include/gtest/gtest.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
TEST(CFDE_XMLSyntaxParser, CData) {
const wchar_t* input =
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
diff --git a/xfa/fxfa/parser/cxfa_widetextread.h b/xfa/fxfa/parser/cxfa_widetextread.h
index 3850660fbd..e6abac5adb 100644
--- a/xfa/fxfa/parser/cxfa_widetextread.h
+++ b/xfa/fxfa/parser/cxfa_widetextread.h
@@ -8,7 +8,7 @@
#define XFA_FXFA_PARSER_CXFA_WIDETEXTREAD_H_
#include "core/fxcrt/cfx_retain_ptr.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
class CXFA_WideTextRead : public IFGAS_Stream {
public:
diff --git a/xfa/fxfa/parser/xfa_utils.h b/xfa/fxfa/parser/xfa_utils.h
index c3111795da..b428a89b4e 100644
--- a/xfa/fxfa/parser/xfa_utils.h
+++ b/xfa/fxfa/parser/xfa_utils.h
@@ -8,7 +8,7 @@
#define XFA_FXFA_PARSER_XFA_UTILS_H_
#include "xfa/fde/xml/fde_xml.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
#include "xfa/fxfa/fxfa_basic.h"
class CFDE_XMLElement;